feat(Departures): show in-seat transfers - #3462
Open
thecristen wants to merge 8 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Asana Ticket: Follow up on "🛜 🐞 Daily Schedules sometimes doesn't show school trips "
I might.. probably will split this out into a couple smaller PRs. I mostly made this branch for testing on dev-green, but I welcome initial feedback too.
This leverages the upcoming addition to transfers to the V3 API from this PR:
/transfersendpoint api#1074Implementation
next_trip_id. This indicates a trip you can transfer to.Warning
This new data entity/relationship seemed to reveal a bug in our current JSON API-parsing code. I think it's because our trips have transfers which have trips... anyway it was recursing and performing terribly. So I had to change it! I did use AI to rewrite the
JsonApimodule.Schedules.Repo.schedule_for_trip/1andPredictions.Repo.all/1to detect the presence of a populatednext_trip_idand fetch and append even more schedules/predictions from that. Is this too magical/heavy-handed?Note
This output results in longer lists of schedules/predictions which might now cover more than one trip. This complicates ordering/grouping on
stop_sequence, because new trips will have a new sequence ofstop_sequencevalues.%Dotcom.ScheduleFinder.TripHeading{}to hold the route/headsign for later rendering.I'm not super sure what happens during an active trip, during the transfer. Curious to find out!
Screenshots
As far as the UI is concerned, it looks almost the same as this PR!
How to test
(copied from the other PR)
In transfers.txt we can see the trips which come into play, so we can look up those trips and find departures pages to test. I've been enjoying these:
http://localhost:4001/departures?route_id=57&direction_id=1&stop_id=917
http://localhost:4001/departures?route_id=741&direction_id=0&stop_id=place-crtst
http://localhost:4001/departures?route_id=Boat-F10&direction_id=0&stop_id=Boat-Aquarium
http://localhost:4001/departures?route_id=37&direction_id=1&stop_id=11839