feat: modify /plan-journey so it returns bus polylines, /getAllRoutes & /getAllRideRoutes to return processed data - #47
Draft
jumpy-cat wants to merge 53 commits into
Draft
feat: modify /plan-journey so it returns bus polylines, /getAllRoutes & /getAllRideRoutes to return processed data#47jumpy-cat wants to merge 53 commits into
jumpy-cat wants to merge 53 commits into
Conversation
Replace the any returned by processJourneys with an actual type that models the two variant nature of the processed legs. Did a similar thing with the journey leg type in `McRaptorAlgorithm.ts`. Both changes should have no semantic difference but behavior and performance should ideally both be checked.
These wrappers add zod-based input validation, type-safety, and reflection capabilities. To be used in the future for generating openapi definitions.
Also reordered the definitions so that the main api is together and closer to the top + fixed a bug where req & res bodies were mixed up.
Logic was ported from the frontend, which shall be changed to rely on the result from the backend.
…t and response schemas
Make sure the passed schemas can accept strings as input as that is what express gives as `path` and `query`. Update module docs.
The previous approach of supporting many status codes and having a 2XX entry in the generated OpenAPI spec doesn't work well with swagger_parser. Switch to using only the 200 status code and having an entry for 200 instead.
jumpy-cat
force-pushed
the
nav/plan-journey-bus-polylines
branch
from
July 25, 2026 14:20
56bf050 to
032b194
Compare
test: add tests for makeBusRouteLines; refactor: switch from tuple to object in zod schema
jumpy-cat
force-pushed
the
nav/plan-journey-bus-polylines
branch
from
July 25, 2026 21:44
032b194 to
e5f4055
Compare
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.
Description
Move the majority of bus route line processing into the backend so that more information in available during journey planning. (WIP) Modify plan journey so that its bus legs contain polyline info. (WIP) refactor all changed routes to use
documented.Type of Change
feat)fix)Related Issues
Backend Side of mbusdev/bluebus-flutter#98
Changes Made
/getpatternsare now checked against zod schemas before being processed intoBusRouteLines similar to those used in the frontend (but missing a few fields)Testing Done
Flutter:
Screenshots / Demo (if UI or notification change)
Checklist
[type](scope): short descriptionmainand is our current working update branch (e.g.maizebus2.1)print()/debugPrint()/console.log()left in production code