mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-10-22 20:56:32 +03:00
fix ticket parsing
This commit is contained in:
parent
a1ab95c249
commit
bdbf4f3761
1 changed files with 4 additions and 2 deletions
|
@ -26,7 +26,9 @@ const parseTickets = (ctx, j) => {
|
|||
.flatMap(p => [
|
||||
p.einfacheFahrt?.standard?.reisePosition,
|
||||
p.einfacheFahrt?.upsellEntgelt?.einfacheFahrt?.reisePosition,
|
||||
].filter(p => p)
|
||||
p.einfacheFahrt?.upsellAngebote?.map(a => a.upsellEntgelt?.einfacheFahrt?.reisePosition),
|
||||
].flatMap(p => p)
|
||||
.filter(p => p)
|
||||
.map(p => {
|
||||
p.reisePosition.teilpreis = Boolean(p.teilpreisInformationen?.length);
|
||||
return p.reisePosition;
|
||||
|
@ -44,7 +46,7 @@ const parseTickets = (ctx, j) => {
|
|||
amount: Math.round(s.preis?.betrag * 100),
|
||||
currency: s.preis?.waehrung,
|
||||
},
|
||||
firstClass: s.klasse == 'KLASSE_1' || s.premium || Boolean(s.nutzungsInformationen?.find(i => i.klasse == 'KLASSE_1')),
|
||||
firstClass: s.klasse == 'KLASSE_1' || Boolean(s.nutzungsInformationen?.find(i => i.klasse == 'KLASSE_1')),
|
||||
partialFare: s.teilpreis,
|
||||
};
|
||||
if (s.teilpreis) {
|
||||
|
|
Loading…
Add table
Reference in a new issue