mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
remove hafas-client dep
This commit is contained in:
parent
5bb4e66c9a
commit
30d84352ae
2 changed files with 13 additions and 6 deletions
|
@ -1,4 +1,12 @@
|
|||
import {data as c} from 'hafas-client/p/db/loyalty-cards.js'; // TODO remove hafas-client dep?
|
||||
const c = {
|
||||
NONE: Symbol('no loyalty card'),
|
||||
BAHNCARD: Symbol('Bahncard'),
|
||||
VORTEILSCARD: Symbol('VorteilsCard'),
|
||||
HALBTAXABO: Symbol('HalbtaxAbo'),
|
||||
VOORDEELURENABO: Symbol('Voordeelurenabo'),
|
||||
SHCARD: Symbol('SH-Card'),
|
||||
GENERALABONNEMENT: Symbol('General-Abonnement'),
|
||||
};
|
||||
|
||||
// see https://gist.github.com/juliuste/202bb04f450a79f8fa12a2ec3abcd72d
|
||||
const formatLoyaltyCard = (data) => {
|
||||
|
@ -9,26 +17,26 @@ const formatLoyaltyCard = (data) => {
|
|||
};
|
||||
}
|
||||
const cls = data.class === 1 ? 'KLASSE_1' : 'KLASSE_2';
|
||||
if (data.type === c.BAHNCARD) {
|
||||
if (data.type.toString() === c.BAHNCARD.toString()) {
|
||||
return {
|
||||
art: 'BAHNCARD' + data.discount,
|
||||
klasse: cls,
|
||||
};
|
||||
}
|
||||
if (data.type === c.VORTEILSCARD) {
|
||||
if (data.type.toString() === c.VORTEILSCARD.toString()) {
|
||||
return {
|
||||
art: 'A-VORTEILSCARD',
|
||||
klasse: 'KLASSENLOS',
|
||||
};
|
||||
}
|
||||
if (data.type === c.HALBTAXABO) {
|
||||
if (data.type.toString() === c.HALBTAXABO.toString()) {
|
||||
return {
|
||||
art: 'CH-HALBTAXABO_OHNE_RAILPLUS',
|
||||
klasse: 'KLASSENLOS',
|
||||
};
|
||||
}
|
||||
// TODO Rest
|
||||
if (data.type === c.GENERALABONNEMENT) {
|
||||
if (data.type.toString() === c.GENERALABONNEMENT.toString()) {
|
||||
return {
|
||||
art: 'CH-GENERAL-ABONNEMENT',
|
||||
klasse: cls,
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
"cross-fetch": "^4.0.0",
|
||||
"google-polyline": "^1.0.3",
|
||||
"gps-distance": "0.0.4",
|
||||
"hafas-client": "^6.3.2",
|
||||
"https-proxy-agent": "^7.0.0",
|
||||
"lodash": "^4.17.5",
|
||||
"luxon": "^3.1.1",
|
||||
|
|
Loading…
Add table
Reference in a new issue