-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add support for age-based tariffs in DB profile #264
Conversation
Thanks for this excellent PR!
Would you mind to determine and use the lowest
What do you think about changing the API to Would you like to be mentioned as a contributor? If you do, there are several supported formats. |
With the current test setup, unfortunately it is expected that some integration tests fail, but given that they store response fixtures given a hash of the request, the There is another problem though: In order to have unchanging requests (so that the test fixtures can be used), all requests need to be made for a fixed point in time. This point in time currently applies to the integration tests of all profiles, so
TLDR: Updating all integration tests' fixtures because a single profile changed its request signature is a major hassle. I'm not happy with this setup, but so far haven't managed to do something about it. |
In 1ab526d, I have changed the integration tests to individually define their |
It's definitely handier; I'd also say that it fits in
Sure, thanks! |
How would you like to be mentioned? |
The supported age groups are now: - 'B' (baby, infant) - 'K' (kind, child) - 'Y' (young) - 'E' (Erwachsener, adult) - 'S' (Senior)
759dab4
to
2f62e71
Compare
FYI: I have done some minor squashing & renaming of your commits, and checked in new integration test fixtures for the DB profile. |
|
2f62e71
to
119d291
Compare
Nothing left to do! |
The supported age groups would be:
B
(baby, infant)K
(kind, child)Y
(young)E
(Erwachsener, adult)S
(Senior)(all taken from a decompiled DB Navigator)
Note: The age groups
Y
andS
are fairly new, so in order for them to work, the version inbase.json
needed to be updated to a newer one otherwise HAFAS responds with anPARSE
error (onlyext
seems to matter but I updated the others as well).I don't know if and how the version update affects other methods, but at first glance everything seems to work fine.
Would also resolve a problem mentioned in #235
Intended Usage
If no
ageGroup
is passed it defaults to adult to maintain compatibility to prior versions.