Skip to content
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

bahncard 100 support? #14

Open
grssnbchr opened this issue Feb 13, 2025 · 3 comments
Open

bahncard 100 support? #14

grssnbchr opened this issue Feb 13, 2025 · 3 comments

Comments

@grssnbchr
Copy link

I guess this is the list of valid loyalty cards that are supported for journeys requests. Is Bahncard 100 not supported?

- bahncard-2nd-50

@grssnbchr grssnbchr changed the title bahncard-100 support? bahncard 100 support? Feb 13, 2025
@traines-source
Copy link
Member

The JS API of db-vendo-client itself should already support BC100, because there you can just use the discount option (haven't verified though). The mapping from the REST API strings to these objects is currently taken from db-rest, which does not contain BC100 yet. But thinking about it, since we are in the process of switching db-rest to db-vendo-client as a backend, it does probably make sense to move this to db-vendo-client itself, in order to avoid having weird circular dependencies. Doing that we can also add BC100 (and the other new/changed loyalty cards that the DB API provides).

@traines-source
Copy link
Member

Said and done, I've now moved the db-specific REST param parsing to db-vendo-client and have updated the loyaltyCards, which means that now bahncard-2nd-100, bahncard-1st-100, nl-40, at-klimaticket etc should work. Also, multi-traveller support now works via REST, by passing either multiple ages or multiple loyaltyCards (or both, in corresponding order), e.g.:
/journeys/?from=8000096&to=8700023&loyaltyCard=&loyaltyCard=bahncard-2nd-50&transfers=0
For one traveller without and one with BC50.
I haven't tested very thoroughly whether all the international cards are correctly applied, so lmk if you notice anything :)

Btw, in the DB APIs, there's also this intriguing separate option deutschlandTicketVorhanden, but it doesn't seem to to anything price-wise (and is not used in the DB UI AFAICT).

@grssnbchr
Copy link
Author

wow, that was fast :-) will do testing ASAP and provide you with some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants