From 7c68f962c1f0a2c6fae807b92f7cf556aefd2a37 Mon Sep 17 00:00:00 2001 From: Pieterjan Van Saet Date: Fri, 22 Jul 2022 00:24:47 +0200 Subject: [PATCH] =?UTF-8?q?parse{Stopover,JourneyLeg,=20Trip}:=20expose=20?= =?UTF-8?q?{arrival,departure}PrognosisType=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see #266 Co-authored-by: Jannis R --- lib/default-profile.js | 2 + package.json | 2 +- parse/journey-leg.js | 2 + parse/prognosis-type.js | 11 ++ parse/stopover.js | 2 + test/e2e/lib/validators.js | 10 ++ test/fixtures/bvg-journey.js | 30 ++++-- test/fixtures/bvg-radar.js | 128 +++++++++++++++++------ test/fixtures/bvg-trip-with-occupancy.js | 58 +++++++++- test/fixtures/db-journey-2.js | 64 +++++++++--- test/fixtures/db-journey-polyline.js | 2 + test/fixtures/db-journey.js | 2 + test/fixtures/oebb-trip.js | 30 +++++- test/fixtures/rejseplanen-trip.js | 24 +++++ test/fixtures/rsag-journey.js | 2 + test/fixtures/sbb-journeys.js | 20 ++++ test/fixtures/vbb-journeys.js | 12 +++ test/fixtures/vbb-on-demand-trip.js | 2 + 18 files changed, 346 insertions(+), 57 deletions(-) create mode 100644 parse/prognosis-type.js diff --git a/lib/default-profile.js b/lib/default-profile.js index 36d0c10b..09a6e62d 100644 --- a/lib/default-profile.js +++ b/lib/default-profile.js @@ -18,6 +18,7 @@ const parsePlatform = require('../parse/platform') const parseProductsBitmask = require('../parse/products-bitmask') const parseIcon = require('../parse/icon') const parseWhen = require('../parse/when') +const parsePrognosisType = require('../parse/prognosis-type') const parseDeparture = require('../parse/departure') const parseArrival = require('../parse/arrival') const parseTrip = require('../parse/trip') @@ -73,6 +74,7 @@ const defaultProfile = { parseProductsBitmask, parseIcon, parseWhen, + parsePrognosisType, parseDeparture, parseArrival, parseTrip, diff --git a/package.json b/package.json index 9c96181c..1bf23eca 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "is-coordinates": "^2.0.2", "is-roughly-equal": "^0.1.0", "replayer": "^2.2.3", - "tap": "^15.0.9", + "tap": "^15.2.3", "validate-fptf": "^3.0.0" }, "scripts": { diff --git a/parse/journey-leg.js b/parse/journey-leg.js index 1d16e60c..f5a5903d 100644 --- a/parse/journey-leg.js +++ b/parse/journey-leg.js @@ -125,11 +125,13 @@ const parseJourneyLeg = (ctx, pt, date) => { // pt = raw leg res.arrivalPlatform = arrPl.platform res.plannedArrivalPlatform = arrPl.plannedPlatform if (arrPl.prognosedPlatform) res.prognosedArrivalPlatform = arrPl.prognosedPlatform + res.arrivalPrognosisType = profile.parsePrognosisType(ctx, pt.arr.aProgType) || null const depPl = profile.parsePlatform(ctx, pt.dep.dPlatfS || (pt.dep.dPltfS !== undefined ? pt.dep.dPltfS.txt : null), pt.dep.dPlatfR || (pt.dep.dPltfR !== undefined ? pt.dep.dPltfR.txt : null), pt.dep.dCncl) res.departurePlatform = depPl.platform res.plannedDeparturePlatform = depPl.plannedPlatform if (depPl.prognosedPlatform) res.prognosedDeparturePlatform = depPl.prognosedPlatform + res.departurePrognosisType = profile.parsePrognosisType(ctx, pt.dep.dProgType) || null if (opt.stopovers && pt.jny.stopL) { const stopL = pt.jny.stopL diff --git a/parse/prognosis-type.js b/parse/prognosis-type.js new file mode 100644 index 00000000..6b74fffd --- /dev/null +++ b/parse/prognosis-type.js @@ -0,0 +1,11 @@ +'use strict' + +const parsePrognosisType = (_, progType) => { + return { + 'PROGNOSED': 'prognosed', + 'CALCULATED': 'calculated', + // todo: are there more? + }[progType] || null +} + +module.exports = parsePrognosisType diff --git a/parse/stopover.js b/parse/stopover.js index b651fc31..1268c5c2 100644 --- a/parse/stopover.js +++ b/parse/stopover.js @@ -16,11 +16,13 @@ const parseStopover = (ctx, st, date) => { // st = raw stopover plannedArrival: arr.plannedWhen, arrivalDelay: arr.delay, arrivalPlatform: arrPl.platform, + arrivalPrognosisType: profile.parsePrognosisType(ctx, st.aProgType), plannedArrivalPlatform: arrPl.plannedPlatform, departure: dep.when, plannedDeparture: dep.plannedWhen, departureDelay: dep.delay, departurePlatform: depPl.platform, + departurePrognosisType: profile.parsePrognosisType(ctx, st.dProgType), plannedDeparturePlatform: depPl.plannedPlatform } diff --git a/test/e2e/lib/validators.js b/test/e2e/lib/validators.js index 163b0f4b..95d44970 100644 --- a/test/e2e/lib/validators.js +++ b/test/e2e/lib/validators.js @@ -175,6 +175,11 @@ const createValidateStopover = (cfg) => { val.date(val, s.plannedArrival, name + '.plannedArrival') assertValidWhen(s.plannedArrival, cfg.when, name + '.plannedArrival') } + if (is(s.departurePrognosisType)) { + const msg = name + '.departurePrognosisType must ' + a.strictEqual(typeof s.departurePrognosisType, 'string', msg + 'be a string') + a.ok(s.departurePrognosisType, msg + 'not be empty') + } if (is(s.plannedDeparture)) { val.date(val, s.plannedDeparture, name + '.plannedDeparture') assertValidWhen(s.plannedDeparture, cfg.when, name + '.plannedDeparture') @@ -209,6 +214,11 @@ const createValidateStopover = (cfg) => { a.strictEqual(typeof s.plannedArrivalPlatform, 'string', msg + 'be a string') a.ok(s.plannedArrivalPlatform, msg + 'not be empty') } + if (is(s.arrivalPrognosisType)) { + const msg = name + '.arrivalPrognosisType must ' + a.strictEqual(typeof s.arrivalPrognosisType, 'string', msg + 'be a string') + a.ok(s.arrivalPrognosisType, msg + 'not be empty') + } if (is(s.departurePlatform)) { const msg = name + '.departurePlatform must ' a.strictEqual(typeof s.departurePlatform, 'string', msg + 'be a string') diff --git a/test/fixtures/bvg-journey.js b/test/fixtures/bvg-journey.js index 2a7e777b..f11ea778 100644 --- a/test/fixtures/bvg-journey.js +++ b/test/fixtures/bvg-journey.js @@ -84,9 +84,11 @@ module.exports = { arrival: '2019-08-18T14:29:00+02:00', plannedArrival: '2019-08-18T14:29:00+02:00', arrivalDelay: 0, + arrivalPrognosisType: 'prognosed', departure: '2019-08-18T14:16:00+02:00', plannedDeparture: '2019-08-18T14:16:00+02:00', departureDelay: 0, + departurePrognosisType: 'prognosed', reachable: true, polyline: { type: 'FeatureCollection', @@ -741,11 +743,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-18T14:16:00+02:00', plannedDeparture: '2019-08-18T14:16:00+02:00', departureDelay: 0, departurePlatform: '1', - plannedDeparturePlatform: '1' + plannedDeparturePlatform: '1', + departurePrognosisType: 'prognosed', }, { stop: { @@ -773,11 +777,13 @@ module.exports = { arrivalDelay: 0, arrivalPlatform: '11', plannedArrivalPlatform: '11', + arrivalPrognosisType: 'prognosed', departure: '2019-08-18T14:18:00+02:00', plannedDeparture: '2019-08-18T14:18:00+02:00', departureDelay: 0, departurePlatform: '11', - plannedDeparturePlatform: '11' + plannedDeparturePlatform: '11', + departurePrognosisType: 'prognosed', }, { stop: { @@ -805,11 +811,13 @@ module.exports = { arrivalDelay: 0, arrivalPlatform: '1', plannedArrivalPlatform: '1', + arrivalPrognosisType: 'prognosed', departure: '2019-08-18T14:20:00+02:00', plannedDeparture: '2019-08-18T14:20:00+02:00', departureDelay: 0, departurePlatform: '1', - plannedDeparturePlatform: '1' + plannedDeparturePlatform: '1', + departurePrognosisType: 'prognosed', }, { stop: { @@ -837,11 +845,13 @@ module.exports = { arrivalDelay: 0, arrivalPlatform: '11', plannedArrivalPlatform: '11', + arrivalPrognosisType: 'prognosed', departure: '2019-08-18T14:22:00+02:00', plannedDeparture: '2019-08-18T14:22:00+02:00', departureDelay: 0, departurePlatform: '11', - plannedDeparturePlatform: '11' + plannedDeparturePlatform: '11', + departurePrognosisType: 'prognosed', }, { stop: { @@ -869,11 +879,13 @@ module.exports = { arrivalDelay: 0, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2019-08-18T14:24:00+02:00', plannedDeparture: '2019-08-18T14:24:00+02:00', departureDelay: 0, departurePlatform: '2', - plannedDeparturePlatform: '2' + plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', }, { stop: { @@ -901,11 +913,13 @@ module.exports = { arrivalDelay: 0, arrivalPlatform: '1', plannedArrivalPlatform: '1', + arrivalPrognosisType: 'prognosed', departure: '2019-08-18T14:27:00+02:00', plannedDeparture: '2019-08-18T14:27:00+02:00', departureDelay: 0, departurePlatform: '1', - plannedDeparturePlatform: '1' + plannedDeparturePlatform: '1', + departurePrognosisType: 'prognosed', }, { stop: { @@ -933,11 +947,13 @@ module.exports = { arrivalDelay: 0, arrivalPlatform: '1', plannedArrivalPlatform: '1', + arrivalPrognosisType: 'prognosed', departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }], remarks: [ { diff --git a/test/fixtures/bvg-radar.js b/test/fixtures/bvg-radar.js index 9bd8995c..df18015f 100644 --- a/test/fixtures/bvg-radar.js +++ b/test/fixtures/bvg-radar.js @@ -50,11 +50,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:26:00+02:00', plannedDeparture: '2019-08-19T20:26:00+02:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -82,11 +84,13 @@ module.exports = [ arrivalDelay: 60, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:30:00+02:00', plannedDeparture: '2019-08-19T20:29:00+02:00', departureDelay: 60, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -114,11 +118,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:34:00+02:00', plannedDeparture: '2019-08-19T20:31:00+02:00', departureDelay: 180, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -146,11 +152,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ @@ -426,11 +434,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T19:57:00+02:00', plannedDeparture: '2019-08-19T19:57:00+02:00', departureDelay: 0, departurePlatform: '13', - plannedDeparturePlatform: '13' + plannedDeparturePlatform: '13', + departurePrognosisType: null, }, { stop: { @@ -458,11 +468,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: '4', plannedArrivalPlatform: '4', + arrivalPrognosisType: null, departure: '2019-08-19T20:33:00+02:00', plannedDeparture: '2019-08-19T20:33:00+02:00', departureDelay: 0, departurePlatform: '4', - plannedDeparturePlatform: '4' + plannedDeparturePlatform: '4', + departurePrognosisType: null, }, { stop: { @@ -490,11 +502,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: '4', plannedArrivalPlatform: '4', + arrivalPrognosisType: null, departure: '2019-08-19T20:35:00+02:00', plannedDeparture: '2019-08-19T20:35:00+02:00', departureDelay: 0, departurePlatform: '4', - plannedDeparturePlatform: '4' + plannedDeparturePlatform: '4', + departurePrognosisType: null, }, { stop: { @@ -522,11 +536,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ @@ -802,11 +818,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:17:00+02:00', plannedDeparture: '2019-08-19T20:17:00+02:00', departureDelay: 0, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -834,11 +852,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:33:00+02:00', plannedDeparture: '2019-08-19T20:33:00+02:00', departureDelay: 0, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -866,11 +886,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:35:00+02:00', plannedDeparture: '2019-08-19T20:35:00+02:00', departureDelay: 0, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -898,11 +920,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ @@ -1178,11 +1202,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:08:00+02:00', plannedDeparture: '2019-08-19T20:08:00+02:00', departureDelay: 0, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1210,11 +1236,13 @@ module.exports = [ arrivalDelay: -60, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:31:00+02:00', plannedDeparture: '2019-08-19T20:32:00+02:00', departureDelay: -60, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1242,11 +1270,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1274,11 +1304,13 @@ module.exports = [ arrivalDelay: 0, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ @@ -1554,11 +1586,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:04:00+02:00', plannedDeparture: '2019-08-19T20:04:00+02:00', departureDelay: 0, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1586,11 +1620,13 @@ module.exports = [ arrivalDelay: 60, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:32:00+02:00', plannedDeparture: '2019-08-19T20:31:00+02:00', departureDelay: 60, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1618,11 +1654,13 @@ module.exports = [ arrivalDelay: 60, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:34:00+02:00', plannedDeparture: '2019-08-19T20:33:00+02:00', departureDelay: 60, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1650,11 +1688,13 @@ module.exports = [ arrivalDelay: 60, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ @@ -1930,11 +1970,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:25:00+02:00', plannedDeparture: '2019-08-19T20:25:00+02:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1962,11 +2004,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:33:00+02:00', plannedDeparture: '2019-08-19T20:30:00+02:00', departureDelay: 180, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1994,11 +2038,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:36:00+02:00', plannedDeparture: '2019-08-19T20:33:00+02:00', departureDelay: 180, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -2026,11 +2072,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ @@ -2306,11 +2354,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T19:39:00+02:00', plannedDeparture: '2019-08-19T19:39:00+02:00', departureDelay: 0, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -2338,11 +2388,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:33:00+02:00', plannedDeparture: '2019-08-19T20:30:00+02:00', departureDelay: 180, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -2370,11 +2422,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:35:00+02:00', plannedDeparture: '2019-08-19T20:32:00+02:00', departureDelay: 180, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -2402,11 +2456,13 @@ module.exports = [ arrivalDelay: 180, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ @@ -2682,11 +2738,13 @@ module.exports = [ arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T19:59:00+02:00', plannedDeparture: '2019-08-19T19:59:00+02:00', departureDelay: 0, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -2714,11 +2772,13 @@ module.exports = [ arrivalDelay: 120, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:32:00+02:00', plannedDeparture: '2019-08-19T20:30:00+02:00', departureDelay: 120, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -2746,11 +2806,13 @@ module.exports = [ arrivalDelay: 60, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2019-08-19T20:34:00+02:00', plannedDeparture: '2019-08-19T20:33:00+02:00', departureDelay: 60, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -2778,11 +2840,13 @@ module.exports = [ arrivalDelay: 60, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], frames: [ diff --git a/test/fixtures/bvg-trip-with-occupancy.js b/test/fixtures/bvg-trip-with-occupancy.js index 6e48bd44..43dad72b 100644 --- a/test/fixtures/bvg-trip-with-occupancy.js +++ b/test/fixtures/bvg-trip-with-occupancy.js @@ -71,6 +71,7 @@ module.exports = { departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: 'prognosed', destination: { type: 'stop', @@ -97,6 +98,7 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: 'prognosed', polyline: { type: 'FeatureCollection', @@ -1019,11 +1021,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:18:00+01:00', plannedDeparture: '2021-11-01T07:18:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: 'prognosed', remarks: [ { type: 'hint', @@ -1059,11 +1063,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:20:00+01:00', plannedDeparture: '2021-11-01T07:20:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1093,11 +1099,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:21:00+01:00', plannedDeparture: '2021-11-01T07:21:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [ { type: 'hint', @@ -1133,11 +1141,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:22:00+01:00', plannedDeparture: '2021-11-01T07:22:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1167,11 +1177,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:24:00+01:00', plannedDeparture: '2021-11-01T07:24:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1201,11 +1213,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:26:00+01:00', plannedDeparture: '2021-11-01T07:26:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1235,11 +1249,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:27:00+01:00', plannedDeparture: '2021-11-01T07:27:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1269,11 +1285,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:28:00+01:00', plannedDeparture: '2021-11-01T07:28:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1303,11 +1321,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:31:00+01:00', plannedDeparture: '2021-11-01T07:31:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [ { type: 'hint', @@ -1343,11 +1363,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:33:00+01:00', plannedDeparture: '2021-11-01T07:33:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'medium' }, @@ -1377,11 +1399,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:35:00+01:00', plannedDeparture: '2021-11-01T07:35:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1411,11 +1435,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:36:00+01:00', plannedDeparture: '2021-11-01T07:36:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1445,11 +1471,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:38:00+01:00', plannedDeparture: '2021-11-01T07:38:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1479,11 +1507,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:39:00+01:00', plannedDeparture: '2021-11-01T07:39:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1513,11 +1543,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:41:00+01:00', plannedDeparture: '2021-11-01T07:41:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [ { type: 'hint', @@ -1553,11 +1585,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:44:00+01:00', plannedDeparture: '2021-11-01T07:44:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1587,11 +1621,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:45:00+01:00', plannedDeparture: '2021-11-01T07:45:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1621,11 +1657,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:47:00+01:00', plannedDeparture: '2021-11-01T07:47:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1655,11 +1693,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:47:00+01:00', plannedDeparture: '2021-11-01T07:47:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1689,11 +1729,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:48:00+01:00', plannedDeparture: '2021-11-01T07:48:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1723,11 +1765,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:49:00+01:00', plannedDeparture: '2021-11-01T07:49:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1757,11 +1801,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:50:00+01:00', plannedDeparture: '2021-11-01T07:50:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1791,11 +1837,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:51:00+01:00', plannedDeparture: '2021-11-01T07:51:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1825,11 +1873,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:52:00+01:00', plannedDeparture: '2021-11-01T07:52:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1859,11 +1909,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:53:00+01:00', plannedDeparture: '2021-11-01T07:53:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1893,11 +1945,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-11-01T07:55:00+01:00', plannedDeparture: '2021-11-01T07:55:00+01:00', departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [], occupancy: 'low' }, @@ -1927,11 +1981,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: 'prognosed', departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], } diff --git a/test/fixtures/db-journey-2.js b/test/fixtures/db-journey-2.js index 1fb2c1d1..2bfdeee9 100644 --- a/test/fixtures/db-journey-2.js +++ b/test/fixtures/db-journey-2.js @@ -53,9 +53,11 @@ module.exports = { departure: '2020-11-16T10:04:00+01:00', plannedDeparture: '2020-11-16T10:04:00+01:00', departureDelay: null, + departurePrognosisType: null, arrival: '2020-11-16T10:05:00+01:00', plannedArrival: '2020-11-16T10:05:00+01:00', arrivalDelay: null, + arrivalPrognosisType: null, reachable: true, tripId: '1|9612|1|80|16112020', line: { @@ -109,11 +111,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:04:00+01:00', plannedDeparture: '2020-11-16T10:04:00+01:00', departureDelay: null, departurePlatform: '2', - plannedDeparturePlatform: '2' + plannedDeparturePlatform: '2', + departurePrognosisType: null, }, { stop: { @@ -144,11 +148,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], remarks: [ @@ -354,9 +360,11 @@ module.exports = { departure: '2020-11-16T10:15:00+01:00', plannedDeparture: '2020-11-16T10:15:00+01:00', departureDelay: null, + departurePrognosisType: null, arrival: '2020-11-16T10:33:00+01:00', plannedArrival: '2020-11-16T10:33:00+01:00', arrivalDelay: null, + arrivalPrognosisType: null, reachable: true, tripId: '1|24525|9|80|16112020', line: { @@ -428,11 +436,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:15:00+01:00', plannedDeparture: '2020-11-16T10:15:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -486,11 +496,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:16:00+01:00', plannedDeparture: '2020-11-16T10:16:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -544,11 +556,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:18:00+01:00', plannedDeparture: '2020-11-16T10:18:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -602,11 +616,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:20:00+01:00', plannedDeparture: '2020-11-16T10:20:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -637,11 +653,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:21:00+01:00', plannedDeparture: '2020-11-16T10:21:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -672,11 +690,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:22:00+01:00', plannedDeparture: '2020-11-16T10:22:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -707,11 +727,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:24:00+01:00', plannedDeparture: '2020-11-16T10:24:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -765,11 +787,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:26:00+01:00', plannedDeparture: '2020-11-16T10:26:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -823,11 +847,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:27:00+01:00', plannedDeparture: '2020-11-16T10:27:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -881,11 +907,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:29:00+01:00', plannedDeparture: '2020-11-16T10:29:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -939,11 +967,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:30:00+01:00', plannedDeparture: '2020-11-16T10:30:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -974,11 +1004,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-11-16T10:31:00+01:00', plannedDeparture: '2020-11-16T10:31:00+01:00', departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, }, { stop: { @@ -1032,11 +1064,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, - plannedDeparturePlatform: null + plannedDeparturePlatform: null, + departurePrognosisType: null, } ], cycle: {min: 600, max: 600, nr: 13} diff --git a/test/fixtures/db-journey-polyline.js b/test/fixtures/db-journey-polyline.js index 20b655fe..7b162eda 100644 --- a/test/fixtures/db-journey-polyline.js +++ b/test/fixtures/db-journey-polyline.js @@ -76,9 +76,11 @@ module.exports = { arrival: '2020-07-27T12:34:00+02:00', plannedArrival: '2020-07-27T12:34:00+02:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', departure: '2020-07-27T10:38:00+02:00', plannedDeparture: '2020-07-27T10:38:00+02:00', departureDelay: null, + departurePrognosisType: 'prognosed', reachable: true, polyline: { type: 'FeatureCollection', diff --git a/test/fixtures/db-journey.js b/test/fixtures/db-journey.js index c6621c62..13284cf9 100644 --- a/test/fixtures/db-journey.js +++ b/test/fixtures/db-journey.js @@ -157,9 +157,11 @@ module.exports = { arrival: '2020-04-11T09:01:00+02:00', plannedArrival: '2020-04-11T09:01:00+02:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', departure: '2020-04-11T05:20:00+02:00', plannedDeparture: '2020-04-11T05:20:00+02:00', departureDelay: null, + departurePrognosisType: 'prognosed', reachable: true, tripId: '1|301001|0|80|11042020', line: { diff --git a/test/fixtures/oebb-trip.js b/test/fixtures/oebb-trip.js index d9d1c4f4..caa63186 100644 --- a/test/fixtures/oebb-trip.js +++ b/test/fixtures/oebb-trip.js @@ -104,9 +104,11 @@ module.exports = { arrival: '2020-06-11T19:48:00+02:00', plannedArrival: '2020-06-11T19:48:00+02:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T16:33:00+02:00', plannedDeparture: '2020-06-11T16:33:00+02:00', departureDelay: null, + departurePrognosisType: 'prognosed', reachable: true, line: { type: 'line', @@ -133,11 +135,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2020-06-11T16:33:00+02:00', plannedDeparture: '2020-06-11T16:33:00+02:00', departureDelay: null, departurePlatform: '2', - plannedDeparturePlatform: '2' + plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', }, { stop: { @@ -168,11 +172,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '8A-C', plannedArrivalPlatform: '8A-B', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T16:55:00+02:00', plannedDeparture: '2020-06-11T16:55:00+02:00', departureDelay: null, departurePlatform: '8A-C', plannedDeparturePlatform: '8A-B', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -207,11 +213,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '5', plannedArrivalPlatform: '5', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T17:02:00+02:00', plannedDeparture: '2020-06-11T17:02:00+02:00', departureDelay: null, departurePlatform: '5', plannedDeparturePlatform: '5', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -246,11 +254,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '3', plannedArrivalPlatform: '3', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T17:16:00+02:00', plannedDeparture: '2020-06-11T17:16:00+02:00', departureDelay: null, departurePlatform: '3', plannedDeparturePlatform: '3', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -285,11 +295,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '5', plannedArrivalPlatform: '5', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T17:30:00+02:00', plannedDeparture: '2020-06-11T17:30:00+02:00', departureDelay: null, departurePlatform: '5', plannedDeparturePlatform: '5', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -324,11 +336,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T18:02:00+02:00', plannedDeparture: '2020-06-11T18:02:00+02:00', departureDelay: null, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -363,11 +377,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '1A-G', plannedArrivalPlatform: '1A-F', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T18:17:00+02:00', plannedDeparture: '2020-06-11T18:17:00+02:00', departureDelay: null, departurePlatform: '1A-G', plannedDeparturePlatform: '1A-F', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -402,11 +418,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '6A-F', plannedArrivalPlatform: '6A-F', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T18:32:00+02:00', plannedDeparture: '2020-06-11T18:32:00+02:00', departureDelay: null, departurePlatform: '6A-F', plannedDeparturePlatform: '6A-F', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -441,11 +459,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T18:46:00+02:00', plannedDeparture: '2020-06-11T18:46:00+02:00', departureDelay: null, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -480,11 +500,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '3', plannedArrivalPlatform: '3', + arrivalPrognosisType: null, departure: '2020-06-11T19:00:00+02:00', plannedDeparture: '2020-06-11T19:00:00+02:00', departureDelay: null, departurePlatform: '3', plannedDeparturePlatform: '3', + departurePrognosisType: null, remarks: [ öbbWestbahnTickets, corona, @@ -519,11 +541,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T19:06:00+02:00', plannedDeparture: '2020-06-11T19:06:00+02:00', departureDelay: null, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -558,11 +582,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2020-06-11T19:31:00+02:00', plannedDeparture: '2020-06-11T19:31:00+02:00', departureDelay: null, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', remarks: [ öbbWestbahnTickets, corona, @@ -575,11 +601,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '6A-C', plannedArrivalPlatform: '4A-C', + arrivalPrognosisType: 'prognosed', departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, remarks: [ öbbWestbahnTickets, corona, diff --git a/test/fixtures/rejseplanen-trip.js b/test/fixtures/rejseplanen-trip.js index 55d9dbb1..233330ff 100644 --- a/test/fixtures/rejseplanen-trip.js +++ b/test/fixtures/rejseplanen-trip.js @@ -46,6 +46,7 @@ module.exports = { departureDelay: null, departurePlatform: '3', plannedDeparturePlatform: '4', + departurePrognosisType: 'prognosed', destination: { type: 'stop', @@ -70,6 +71,7 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '5', plannedArrivalPlatform: '5', + arrivalPrognosisType: 'prognosed', remarks: [ { type: 'hint', code: 'RE', text: 'Reservierung empfohlen' }, @@ -101,11 +103,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, departure: '2021-10-12T16:06:00+02:00', plannedDeparture: '2021-10-12T16:06:00+02:00', departureDelay: null, departurePlatform: '3', plannedDeparturePlatform: '4', + departurePrognosisType: 'prognosed', remarks: [ { type: 'status', @@ -138,11 +142,13 @@ module.exports = { arrivalDelay: 60, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T16:12:00+02:00', plannedDeparture: '2021-10-12T16:10:00+02:00', departureDelay: 120, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', }, { stop: { @@ -168,11 +174,13 @@ module.exports = { arrivalDelay: 60, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T16:17:00+02:00', plannedDeparture: '2021-10-12T16:14:00+02:00', departureDelay: 180, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', }, { stop: { @@ -198,11 +206,13 @@ module.exports = { arrivalDelay: 60, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T16:24:00+02:00', plannedDeparture: '2021-10-12T16:22:00+02:00', departureDelay: 120, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', }, { stop: { @@ -228,11 +238,13 @@ module.exports = { arrivalDelay: 60, arrivalPlatform: '3', plannedArrivalPlatform: '3', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T16:29:00+02:00', plannedDeparture: '2021-10-12T16:28:00+02:00', departureDelay: 60, departurePlatform: '3', plannedDeparturePlatform: '3', + departurePrognosisType: 'prognosed', }, { stop: { @@ -258,11 +270,13 @@ module.exports = { arrivalDelay: 180, arrivalPlatform: '1', plannedArrivalPlatform: '1', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T16:37:00+02:00', plannedDeparture: '2021-10-12T16:34:00+02:00', departureDelay: 180, departurePlatform: '1', plannedDeparturePlatform: '1', + departurePrognosisType: 'prognosed', }, { stop: { @@ -288,11 +302,13 @@ module.exports = { arrivalDelay: 120, arrivalPlatform: '3', plannedArrivalPlatform: '3', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T16:46:00+02:00', plannedDeparture: '2021-10-12T16:45:00+02:00', departureDelay: 60, departurePlatform: '3', plannedDeparturePlatform: '3', + departurePrognosisType: 'prognosed', }, { stop: { @@ -318,11 +334,13 @@ module.exports = { arrivalDelay: 120, arrivalPlatform: '3', plannedArrivalPlatform: '3', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T17:01:00+02:00', plannedDeparture: '2021-10-12T17:01:00+02:00', departureDelay: null, departurePlatform: '3', plannedDeparturePlatform: '3', + departurePrognosisType: 'prognosed', }, { stop: { @@ -348,11 +366,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '2', plannedArrivalPlatform: '2', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T17:10:00+02:00', plannedDeparture: '2021-10-12T17:10:00+02:00', departureDelay: null, departurePlatform: '2', plannedDeparturePlatform: '2', + departurePrognosisType: 'prognosed', }, { stop: { @@ -378,11 +398,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '1', plannedArrivalPlatform: '1', + arrivalPrognosisType: 'prognosed', departure: '2021-10-12T17:18:00+02:00', plannedDeparture: '2021-10-12T17:18:00+02:00', departureDelay: null, departurePlatform: '1', plannedDeparturePlatform: '1', + departurePrognosisType: 'prognosed', }, { stop: { @@ -408,11 +430,13 @@ module.exports = { arrivalDelay: null, arrivalPlatform: '5', plannedArrivalPlatform: '5', + arrivalPrognosisType: 'prognosed', departure: null, plannedDeparture: null, departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, }, ], } diff --git a/test/fixtures/rsag-journey.js b/test/fixtures/rsag-journey.js index fca9935b..d11c3d7f 100644 --- a/test/fixtures/rsag-journey.js +++ b/test/fixtures/rsag-journey.js @@ -57,6 +57,7 @@ module.exports = { departureDelay: 0, departurePlatform: '1', plannedDeparturePlatform: '1', + departurePrognosisType: 'prognosed', destination: { type: 'stop', @@ -86,6 +87,7 @@ module.exports = { arrivalDelay: 0, arrivalPlatform: '4', plannedArrivalPlatform: '4', + arrivalPrognosisType: 'prognosed', cycle: {min: 3600, max: 3600, nr: 3}, }, diff --git a/test/fixtures/sbb-journeys.js b/test/fixtures/sbb-journeys.js index b6b17fa9..a2940c65 100644 --- a/test/fixtures/sbb-journeys.js +++ b/test/fixtures/sbb-journeys.js @@ -128,9 +128,11 @@ module.exports = [{ departure: '2020-12-14T10:03:00+01:00', plannedDeparture: '2020-12-14T10:03:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T11:10:00+01:00', plannedArrival: '2020-12-14T11:10:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|33571|3|95|14122020', line: { @@ -161,9 +163,11 @@ module.exports = [{ departure: '2020-12-14T11:16:00+01:00', plannedDeparture: '2020-12-14T11:16:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T11:52:00+01:00', plannedArrival: '2020-12-14T11:52:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|155150|2|95|14122020', line: { @@ -194,9 +198,11 @@ module.exports = [{ departure: '2020-12-14T11:57:00+01:00', plannedDeparture: '2020-12-14T11:57:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T12:27:00+01:00', plannedArrival: '2020-12-14T12:27:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|70708|0|95|14122020', line: { @@ -235,9 +241,11 @@ module.exports = [{ departure: '2020-12-14T10:28:00+01:00', plannedDeparture: '2020-12-14T10:28:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T11:26:00+01:00', plannedArrival: '2020-12-14T11:26:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|5522|0|95|14122020', line: { @@ -357,9 +365,11 @@ module.exports = [{ departure: '2020-12-14T11:34:00+01:00', plannedDeparture: '2020-12-14T11:34:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T12:40:00+01:00', plannedArrival: '2020-12-14T12:40:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|201862|0|95|14122020', line: { @@ -398,9 +408,11 @@ module.exports = [{ departure: '2020-12-14T10:58:00+01:00', plannedDeparture: '2020-12-14T10:58:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T11:56:00+01:00', plannedArrival: '2020-12-14T11:56:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|259027|0|95|14122020', line: { @@ -520,9 +532,11 @@ module.exports = [{ departure: '2020-12-14T12:04:00+01:00', plannedDeparture: '2020-12-14T12:04:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T13:16:00+01:00', plannedArrival: '2020-12-14T13:16:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|73704|0|95|14122020', line: { @@ -561,9 +575,11 @@ module.exports = [{ departure: '2020-12-14T11:03:00+01:00', plannedDeparture: '2020-12-14T11:03:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T12:10:00+01:00', plannedArrival: '2020-12-14T12:10:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|33571|4|95|14122020', line: { @@ -594,9 +610,11 @@ module.exports = [{ departure: '2020-12-14T12:16:00+01:00', plannedDeparture: '2020-12-14T12:16:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T12:52:00+01:00', plannedArrival: '2020-12-14T12:52:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|156563|0|95|14122020', line: { @@ -627,9 +645,11 @@ module.exports = [{ departure: '2020-12-14T12:57:00+01:00', plannedDeparture: '2020-12-14T12:57:00+01:00', departureDelay: null, + departurePrognosisType: 'prognosed', arrival: '2020-12-14T13:27:00+01:00', plannedArrival: '2020-12-14T13:27:00+01:00', arrivalDelay: null, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|70657|2|95|14122020', line: { diff --git a/test/fixtures/vbb-journeys.js b/test/fixtures/vbb-journeys.js index f61767de..607e67e7 100644 --- a/test/fixtures/vbb-journeys.js +++ b/test/fixtures/vbb-journeys.js @@ -46,9 +46,11 @@ module.exports = [{ departure: '2020-12-07T14:08:00+01:00', plannedDeparture: '2020-12-07T14:08:00+01:00', departureDelay: 0, + departurePrognosisType: 'prognosed', arrival: '2020-12-07T14:16:00+01:00', plannedArrival: '2020-12-07T14:16:00+01:00', arrivalDelay: 0, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|35066|1|86|7122020', line: { @@ -122,9 +124,11 @@ module.exports = [{ departure: '2020-12-07T14:20:00+01:00', plannedDeparture: '2020-12-07T14:20:00+01:00', departureDelay: 0, + departurePrognosisType: 'calculated', arrival: '2020-12-07T14:25:00+01:00', plannedArrival: '2020-12-07T14:25:00+01:00', arrivalDelay: 0, + arrivalPrognosisType: 'calculated', reachable: true, tripId: '1|66441|25|86|7122020', line: { @@ -198,9 +202,11 @@ module.exports = [{ departure: '2020-12-07T14:34:00+01:00', plannedDeparture: '2020-12-07T13:52:00+01:00', departureDelay: 2520, + departurePrognosisType: 'prognosed', arrival: '2020-12-07T14:58:00+01:00', plannedArrival: '2020-12-07T14:17:00+01:00', arrivalDelay: 2460, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|43248|0|86|7122020', line: { @@ -340,9 +346,11 @@ module.exports = [{ departure: '2020-12-07T14:12:00+01:00', plannedDeparture: '2020-12-07T14:12:00+01:00', departureDelay: 0, + departurePrognosisType: 'prognosed', arrival: '2020-12-07T14:21:00+01:00', plannedArrival: '2020-12-07T14:21:00+01:00', arrivalDelay: 0, + arrivalPrognosisType: 'prognosed', reachable: true, tripId: '1|35069|1|86|7122020', line: { @@ -417,8 +425,10 @@ module.exports = [{ plannedDeparture: '2020-12-07T14:25:00+01:00', departureDelay: null, arrival: null, + departurePrognosisType: null, plannedArrival: '2020-12-07T14:30:00+01:00', arrivalDelay: null, + arrivalPrognosisType: null, reachable: false, tripId: '1|66451|1|86|7122020', line: { @@ -493,9 +503,11 @@ module.exports = [{ departure: '2020-12-07T14:39:00+01:00', plannedDeparture: '2020-12-07T14:39:00+01:00', departureDelay: null, + departurePrognosisType: null, arrival: '2020-12-07T15:07:00+01:00', plannedArrival: '2020-12-07T15:07:00+01:00', arrivalDelay: null, + arrivalPrognosisType: null, reachable: true, tripId: '1|1961|0|86|7122020', line: { diff --git a/test/fixtures/vbb-on-demand-trip.js b/test/fixtures/vbb-on-demand-trip.js index ad4499b3..7c249a8d 100644 --- a/test/fixtures/vbb-on-demand-trip.js +++ b/test/fixtures/vbb-on-demand-trip.js @@ -33,6 +33,7 @@ module.exports = { departureDelay: null, departurePlatform: null, plannedDeparturePlatform: null, + departurePrognosisType: null, destination: {}, arrival: null, @@ -40,4 +41,5 @@ module.exports = { arrivalDelay: null, arrivalPlatform: null, plannedArrivalPlatform: null, + arrivalPrognosisType: null, }