-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rental system to GraphQL API #5909
Add rental system to GraphQL API #5909
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5909 +/- ##
=============================================
+ Coverage 69.45% 69.51% +0.05%
- Complexity 17070 17104 +34
=============================================
Files 1937 1938 +1
Lines 73692 73743 +51
Branches 7540 7547 +7
=============================================
+ Hits 51184 51263 +79
+ Misses 19880 19841 -39
- Partials 2628 2639 +11 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure if we should have the network filtering in the map layer or just do it in UI. The problem is that even though we might not want to show some networks in our UI, some other people might. On the other hand, setting this filter on a request level is not really feasible with the map layers. There is an option that we expose filtered and unfiltered versions of the map layer but there is some push towards unifying the map layers and this would be slightly away from it by adding yet another map layer that is only used by us.
...java/org/opentripplanner/ext/vectortiles/layers/vehiclerental/VehicleRentalLayerBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/inspector/vector/LayerParameters.java
Outdated
Show resolved
Hide resolved
...in/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsGeofencingZoneMapper.java
Outdated
Show resolved
Hide resolved
src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls
Outdated
Show resolved
Hide resolved
src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls
Outdated
Show resolved
Hide resolved
...in/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsGeofencingZoneMapper.java
Outdated
Show resolved
Hide resolved
@@ -61,6 +62,11 @@ public DataFetcher<RentalVehicleType> vehicleType() { | |||
return environment -> getSource(environment).vehicleType; | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to expose core model classes directly in the API. Can you please add an Impl (=mapper) class just like RentalVehicleImpl
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a mapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to see tests and the mapper class.
…ources/GbfsGeofencingZoneMapper.java Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
@@ -1746,6 +1748,8 @@ type RentalVehicle implements Node & PlaceInterface { | |||
rentalUris: VehicleRentalUris | |||
"ID of the vehicle in the format of network:id" | |||
vehicleId: String | |||
"The vehicle rental system information." | |||
vehicleRentalSystem: VehicleRentalSystem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to discuss in the developer meeting what to do with the naming of this field/type and if it's already too late to create a type for this.
This is now ready for review. |
@@ -1183,6 +1183,8 @@ type QueryType { | |||
nearest places related to bicycling. | |||
""" | |||
filterByModes: [Mode], | |||
"Only include vehicle rental networks that match one of the given network names." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the term "network name" is confusing here. Is it the network id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While updating it, I noticed we could also make the list items non null so I did it in the same commit 87bda74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bit of documentation.
I've approved this now to get rid of my old review but I'll wait for @vpaturet 's review before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good
Summary
Added an option for hiding networks from maplayers so that unnecessary data doesn't always need to be returned from otp. (For example, in cases where one only wants to show the vehicles of a network and never the stations.)Unit tests