diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-01-19 20:14:41 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-01-19 20:14:41 +0100 |
commit | 1ca70b38ed92aaf1a52418ee91bd2d194a556baf (patch) | |
tree | 478278ee0a2d4aac048fad67f60eddf697c51c40 /lib/Travel/Routing/DE | |
parent | a7f027fe14d59ca57f49286586d546ea4c132836 (diff) |
Add support for up to two stopovers
Diffstat (limited to 'lib/Travel/Routing/DE')
-rw-r--r-- | lib/Travel/Routing/DE/DBRIS.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Travel/Routing/DE/DBRIS.pm b/lib/Travel/Routing/DE/DBRIS.pm index 63f6d35..6f57dcf 100644 --- a/lib/Travel/Routing/DE/DBRIS.pm +++ b/lib/Travel/Routing/DE/DBRIS.pm @@ -86,6 +86,14 @@ sub new { deutschlandTicketVorhanden => \0 }; + for my $via ( @{ $conf{via} } ) { + my $via_stop = { id => $via->{stop}->id }; + if ( $via->{duration} ) { + $via_stop->{aufenthaltsdauer} = 0 + $via->{duration}; + } + push( @{ $req->{zwischenhalte} }, $via_stop ); + } + if ( @{ $conf{discounts} // [] } ) { $req->{reisende}[0]{ermaessigungen} = []; } @@ -346,6 +354,13 @@ the requested itinerary. A Travel::Status::DE::DBRIS::Location(3pm) instance describing the destination of the requested itinerary. +=item B<via> => I<arrayref> + +An arrayref containing up to two hashrefs that describe stopovers which must +be part of the requested itinerary. Each hashref consists of two keys: +B<stop> (Travel::Status::DE::DBRIS::Location(3pm) object, mandatory) and +B<duration> (stopover duration in minutes, optional, default: 0). + =item B<cache> => I<cache> A Cache::File(3pm) instance used for caching bahn.de requests. |