Repository navigation
Conversation
Interrail now reads Renfe's long-distance trains from train-api next to SNCF's. Renfe stations SNCF also serves take SNCF's id, and Barcelona Sants and Spain's main stations are interchange hubs, so Paris to Madrid comes out as a TGV to Barcelona and an AVE on. A Renfe train books on renfe.com, a city name like Madrid finds its main station, and the reservation-fee estimate leaves out journeys with a Renfe train. Without train-api, Interrail shows SNCF's trains alone, as before.
This branch has not been deployed
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.
Before: Interrail only knows SNCF's trains, so Paris → Madrid finds nothing: SNCF stops at Barcelona.
After: Interrail also reads Renfe's long-distance trains, so Paris → Madrid comes out as a TGV to Barcelona, a change, then an AVE to Madrid. Typing "Madrid", "Sevilla" or "Valencia" finds the city's main station, a Renfe train books on renfe.com, and Spanish stations show on the map.
Stacked on #97 (which is on #83): merge those first.
How
<base>/renfe/interrail/all.json), fetched next to SNCF's. There is no bundled snapshot of it: without train-api, or when its file is entirely in the past, Interrail shows SNCF's trains alone, as today. The MAX passes never ask for it.src/data/operators.tsdescribes Renfe. Its stations SNCF also serves take SNCF's id, by name with accents, case and punctuation aside (Barcelona Sants, Perpignan, Marseille St Charles…) or by a short mapping (Lyon Part Dieu, Nîmes, Valence TGV). A train both feeds carry is kept once.setNetworkHubsinconnections.ts), so the MAX searches and their caches are unchanged.operator; Renfe trains book on renfe.com (the direct-train button says "Book on Renfe", and a connection's step list links each train to its own site).docs/user-flows.mdandllms.txtare updated.Before merging
Renfe's file is published today with every pair of stops of every regional train (3.4 million trains), too big for a browser. offware-apps/train-api#13 keeps those trains between the long-distance stations only; merge it before this one.
Checks
tsc,npm test(244 passed, includingtests/spain.test.ts: joining stations, dropping duplicates, Paris → Madrid via Barcelona, no fee estimate, SNCF-only fallback, city names),npm run build,npm run verifyandnpm run test:e2e(25/25). The e2e gates run without train-api, so they cover the SNCF-only path. I also opened the built app against a local train-api serving SNCF's Interrail file and a Renfe sample:?card=interrail&mode=od&from=paris&to=madridresolved Madrid, showed Paris → Barcelona Sants → Madrid with a 2 h 58 change, and the booking steps linked SNCF Connect for the TGV and renfe.com for the AVE.