Skip to content

Add availableUntil to rental vehicles in the GTFS GraphQL API - #6643

Merged
optionsome merged 3 commits into
opentripplanner:dev-2.xfrom
raumobil:feat/rental-avaibility-information
May 13, 2025
Merged

optionsome merged 3 commits into
opentripplanner:dev-2.xfrom
raumobil:feat/rental-avaibility-information

Conversation

@tobsesHub

Copy link
Copy Markdown
Contributor

Summary

This PR adds availability information to the rental vehicle model and GraphQL API by using the available_until field of the vehicle_status.json in GBFS.

Issue

#6547

The PR handles the first two steps in this commend: #6547 (comment)

This field can be used to better inform the user about the availability of the vehicle.
Also this field can later be used, to consider it the routing as described in the linked issue.

It does not consider the new more complex GBFS extension(vehicle_availability.json), linked in the issue, because the GBFS model does not exist in the library yet.

Unit tests

  • considers the available_until field in the GraphQLIntegrationTest

@tobsesHub
tobsesHub requested a review from a team as a code owner May 8, 2025 09:38
@codecov

codecov Bot commented May 8, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.25%. Comparing base (2cc021e) to head (9f4d334).
Report is 44 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...ental/datasources/GbfsFreeVehicleStatusMapper.java 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6643      +/-   ##
=============================================
+ Coverage      71.17%   71.25%   +0.07%     
- Complexity     18455    18464       +9     
=============================================
  Files           2027     2028       +1     
  Lines          76287    76272      -15     
  Branches        7804     7799       -5     
=============================================
+ Hits           54298    54346      +48     
+ Misses         19225    19170      -55     
+ Partials        2764     2756       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tobsesHub
tobsesHub force-pushed the feat/rental-avaibility-information branch from 7707256 to 0798a95 Compare May 8, 2025 09:54
@tobsesHub tobsesHub changed the title add rental availability information to GraphQL API add rental availability information to GTFS GraphQL API May 8, 2025

@leonardehrenfried leonardehrenfried left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small request.

@tobsesHub
tobsesHub force-pushed the feat/rental-avaibility-information branch from 0798a95 to fb580c0 Compare May 9, 2025 08:53
type RentalVehicle implements Node & PlaceInterface {
"If true, vehicle is currently available for renting."
allowPickupNow: Boolean
"The date and time when any rental of the vehicle must be completed."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wording is from the GBFS specification, but for me it's a bit vague if this means that the vehicle should be rented or returned before this time. The spec elaborates it in more words. Perhaps we could just say "The vehicle should be returned before this deadline."?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I replaced the description with your suggestion.

@tobsesHub
tobsesHub force-pushed the feat/rental-avaibility-information branch from fb580c0 to 9f4d334 Compare May 9, 2025 15:02
@leonardehrenfried leonardehrenfried changed the title add rental availability information to GTFS GraphQL API Add rental availability information to GTFS GraphQL API May 12, 2025
@leonardehrenfried leonardehrenfried changed the title Add rental availability information to GTFS GraphQL API Add rental availability to GTFS GraphQL API May 12, 2025
@optionsome
optionsome self-requested a review May 13, 2025 08:45
@optionsome optionsome changed the title Add rental availability to GTFS GraphQL API Add availableUntil to rental vehicles in the GTFS GraphQL API May 13, 2025
@optionsome optionsome added the !New Feature A functional feature targeting the end user. label May 13, 2025
@optionsome optionsome added this to the 2.8 (next release) milestone May 13, 2025
@optionsome
optionsome merged commit 683cb1d into opentripplanner:dev-2.x May 13, 2025
t2gran pushed a commit that referenced this pull request May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!New Feature A functional feature targeting the end user.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants