Skip to content

Add support for booking_rules.txt to gtfs-schedule module#36

Merged
sargunv merged 4 commits intomainfrom
copilot/add-booking-rules-support
Oct 24, 2025
Merged

Add support for booking_rules.txt to gtfs-schedule module#36
sargunv merged 4 commits intomainfrom
copilot/add-booking-rules-support

Conversation

Copy link
Contributor

Copilot AI commented Oct 23, 2025

  • Create BookingRule.kt file with the data class and enum types
  • Create BookingRuleTest.kt with unit tests
  • Update common.kt to replace BookingRule placeholder type
  • Add booking_rules.txt to ProducerTest TODO list (no sample data available)
  • Run tests and verify everything works
  • Run linter and fix any issues
  • Fix prior_notice_duration fields to use WholeMinutes
  • Resolve merge conflicts with main branch
Original prompt

Please add support for booking_rules.txt to the gtfs-schedule module. Use gtfs.org/documentation/schedule/reference#booking_rulestxt as a reference. Follow all existing patterns, especially the data types used and the tests. Remember to uncomment the relevant lines in producertest when you've added the model, or add it to the list at the bottom if none are available.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

🤖 Generated with [GitHub Copilot](https://copilot.github.com)

Co-Authored-By: GitHub Copilot <noreply@github.com>

Co-authored-by: sargunv <1320357+sargunv@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for booking_rules.txt to gtfs-schedule module Add support for booking_rules.txt to gtfs-schedule module Oct 23, 2025
Copilot AI requested a review from sargunv October 23, 2025 06:00
Copy link
Owner

@sargunv sargunv left a comment

Choose a reason for hiding this comment

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

@copilot handle my comment, and resolve merge conflicts with main.

Comment on lines 25 to 29
/** Minimum number of minutes before travel to make the request. */
@SerialName("prior_notice_duration_min") public val priorNoticeDurationMin: WholeSeconds? = null,

/** Maximum number of minutes before travel to make the request. */
@SerialName("prior_notice_duration_max") public val priorNoticeDurationMax: WholeSeconds? = null,
Copy link
Owner

Choose a reason for hiding this comment

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

These should be WholeMinutes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in bb28fc8. Changed WholeSeconds to WholeMinutes for prior_notice_duration_min and prior_notice_duration_max fields.

@sargunv sargunv marked this pull request as ready for review October 23, 2025 22:11
Copy link
Contributor Author

Copilot AI commented Oct 23, 2025

@copilot handle my comment, and resolve merge conflicts with main.

Merge conflicts resolved in f0916b8. Merged main branch which added Shape, LocationGroup, LocationGroupStop, Transfer, and Frequency models. The TODO list in ProducerTest now includes both booking_rules.txt and frequencies.txt.

Copilot AI requested a review from sargunv October 23, 2025 22:28
@sargunv sargunv merged commit 3a7531e into main Oct 24, 2025
2 of 3 checks passed
@sargunv sargunv deleted the copilot/add-booking-rules-support branch October 24, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants