-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
This issue tracks Phase 3 (the final phase) of the GTFS Frequencies implementation.
With Phase 1 (Storage/DB) and Phase 2 #582 (Core Logic & Helpers) already merged, this phase focuses entirely on wiring the frequency data into the API Handlers and Response Models.
Implementation
Part 1: Models & Core Handlers
stop_time_schedule.go: ImplementScheduleFrequencystruct and update slices.trip_details_handler.go: PopulateFrequency,TripStatusForTripDetails.Frequency, andSchedule.Frequency.trips_helper.go(BuildTripSchedule): PopulateSchedule.Frequency.arrivals_and_departure_for_stop.go: PopulateFrequencyand adjust predicted times based on headways forexact_times=0.trip_for_vehicle_handler.go: Populate frequency for the vehicle's active trip.
Part 2: Batch Queries & Schedule Handlers
schedule_for_stop_handler.go: BuildScheduleFrequenciesusing the new struct. Expand stop times forexact_times=1.schedule_for_route_handler.go: Include frequency data per-trip-direction group.trips_for_route_handler.go: Populate*int64headway field using batch query to avoid N+1.trips_for_location_handler.go: Populate using batch query and update time-window filtering logic for active frequency windows.
Testing Requirements
- Create
createTestApiWithFrequencyData(t)fixture helper. - Add subtests for
trip_details_handler_test.go. - Add subtests for
trips_for_route_handler_test.go&trips_for_location_handler_test.go. - Add subtests for
schedule_for_stop_handler_test.go. - Add subtests for
arrivals_and_departure_for_stop_test.go. - Verify standard regression suite passes perfectly with normal (non-frequency) data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels