mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-10-23 05:06:31 +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 => [
|
.flatMap(p => [
|
||||||
p.einfacheFahrt?.standard?.reisePosition,
|
p.einfacheFahrt?.standard?.reisePosition,
|
||||||
p.einfacheFahrt?.upsellEntgelt?.einfacheFahrt?.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 => {
|
.map(p => {
|
||||||
p.reisePosition.teilpreis = Boolean(p.teilpreisInformationen?.length);
|
p.reisePosition.teilpreis = Boolean(p.teilpreisInformationen?.length);
|
||||||
return p.reisePosition;
|
return p.reisePosition;
|
||||||
|
@ -44,7 +46,7 @@ const parseTickets = (ctx, j) => {
|
||||||
amount: Math.round(s.preis?.betrag * 100),
|
amount: Math.round(s.preis?.betrag * 100),
|
||||||
currency: s.preis?.waehrung,
|
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,
|
partialFare: s.teilpreis,
|
||||||
};
|
};
|
||||||
if (s.teilpreis) {
|
if (s.teilpreis) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue