Changes to the StopTimes method used by the graphql APIs - #3576
Conversation
…l as some changes to the transmodel api
abyrd
left a comment
There was a problem hiding this comment.
Looks good. I am only requesting some changes to the PR description for future reference. The title and description should be changed to clarify what exactly the expression "StopTimes call" refers to. It appears from code that it refers to the legacy and Transmodel GraphQL APIs. The description says it builds on #3571 which is true, but it also builds on #3575. Knowing this helps isolate the commits unique to this PR for review, and it can be useful to state the commit hash where they diverge. We can complete and merge this during today's meeting.
|
|
||
| // Realtime patterns may have been cancelled and replaced. Do not include the patterns that | ||
| // have been replaced | ||
| Collection<TripPattern> replacedPatterns = realTimePatterns |
There was a problem hiding this comment.
Can be replaced with built-in method realtimePatterns.removeIf(tp -> tp.getOriginalTripPattern() != null)
There was a problem hiding this comment.
I missed a detail during the discussion. Gard looked into this: "it is not so easy to replace the removal logic with removeIf. It doesn’t remove the patterns that have an original pattern reference, but all the patterns that are referred to as original patterns by other patterns."
abyrd
left a comment
There was a problem hiding this comment.
Discussed in detail during the call, and I reviewed core logic in StopTimesHelper around line 260.
Summary
This builds on top of #3571 and #3575. It changes the retrieval of StopTimes via both GraphQL APIs in the following ways:
The main use case for this is generating "departure boards": lists of all planned or realtime-created vehicle departures on any pattern passing through a given stop, optionally with information about planned vehicle departures that have been cancelled or changed.
Issue
#3119
Unit tests
No new unit tests. Functionality has been tested manually by creating test Siri messages.
Documentation
Added javadoc to StopTimesHelper and expanded documentation for the Transmodel api.
Changelog
Changelog added