Skip to content

Enhancement: Use /api/v1/trains/checkin with transitous stop ids #3345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
networkException opened this issue Apr 12, 2025 · 1 comment
Open
Labels

Comments

@networkException
Copy link

networkException commented Apr 12, 2025

Describe the problem

When implementing support for checking in using the api it is not possible to use transitous stop ids, as the start and destination station fields need to be a träwelling internal id or an ibnr.

While this could be solved by adding an endpoint to query träwelling's data model for transitous station identifiers, this only works with träwelling having fetched the stations previously. Ideally the checkin api would fetch the transitous trip first, discovering all stopover stations in the process.

@HerrLevin
Copy link
Member

I've removed this from the original migration parent issue because this is not directly needed to fulfil the direct functionality.

While we could accept the motis/transitous endpoint ID, we've decided in the past that we don't want to work with external identifiers in our api. In the long run we wanted to possibly integrate multiple API sources, which would only make this more difficult. The IBNR is a remaining legacy of old processes and internal workings of Träwelling and the (slow) refactoring of the ui.

As a workaroud you could still query the autocomplete endpoint of Träwelling with the exact name of your station. That way you'll directly get a Träwelling ID.

We could still implement this but with the following suggestion:

  • (maybe) no extra endpoint. Motis has no direct endpoint for fetching station data. We'll always need to fetch the motis departure endpoint and iterate over every single departure for fetching the data

We'll look into it, how/what we're going to do with it, once we're over the transitous migration.

@HerrLevin HerrLevin changed the title Cannot use /api/v1/trains/checkin with transitous stop ids Enhancement: Use /api/v1/trains/checkin with transitous stop ids Apr 12, 2025
networkException added a commit to networkException/travelynx that referenced this issue Apr 18, 2025
This patch adds support for checkins using MOTIS backends
using the Travel::Status::MOTIS module.

With this travelynx supports the two services currently
exposed by the module, RNV for local transit in Mannheim,
Germany and surrounding cities and transitous for worldwide
crowdsourced tranit feeds.

This implementation supports realtime predictions,
cancellations and polylines as well as custom route colors
if available.

As MOTIS doesn't expose names of indivial trips currently,
displaying transports is mostly limited to route names.

MOTIS uses strings for stop ids, based on the used GTFS
source feeds. As travelynx's data model currently assumes
interger station ids, this patch adds a mapping table
to the database.

This patch assumes support for MOTIS in db-fakedisplay.

Note that while träwelling has migrated to tranitous fully
sync remains unsupported for now.

See Traewelling/traewelling#3345
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants