Skip to content

Commit 2a968e1

Browse files
committed
upgrade to db-hafas 1.0.1 & db-station 1.8
1 parent 8d04f1f commit 2a968e1

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

Diff for: Routing/RoutePart.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ class RoutePart {
66
this.direction = route.direction;
77
this.start = route.start;
88
this.end = route.end;
9-
this.product = new VehicleProduct(route.product);
10-
this.fromEvaId = route.from.id;
11-
this.toEvaId = route.to.id;
12-
this.arrivingPlatformNumber = route.to.platform;
13-
this.departingPlatformNumber = route.from.platform;
9+
this.product = new VehicleProduct(route.line);
10+
this.fromEvaId = route.origin.id;
11+
this.toEvaId = route.destination.id;
12+
this.arrivingPlatformNumber = route.arrivalPlatform;
13+
this.departingPlatformNumber = route.departurePlatform;
1414
}
1515
}
1616

Diff for: Routing/RoutingService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class RoutingService {
99

1010
routes(from, to) {
1111
const self = this
12-
return hafas.routes(from, to)
12+
return hafas.journeys(from + "", to + "")
1313
.then(result => result.map(element => self.relationships.resolve(new Route(element))))
1414
}
1515
}

Diff for: Routing/VehicleProduct.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class VehicleProduct {
22
constructor(payload) {
3+
console.log(payload)
34
this.name = payload.name;
4-
this.number = payload.nr;
55
this.class = payload.class;
66
this.productCode = payload.productCode;
7-
this.productName = payload.productName;
7+
this.productName = payload.product;
88
}
99
}
1010

Diff for: Station/StationIdMappingService.js

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ class StationIdMappingService {
77
this.stationMapPromise = new Promise((resolve) => {
88
let stationMap = {evaId: {}, ds100: {}, stationNumber: {}}
99
stations.full().on('data', (station) => {
10+
station.additionalIds.forEach(id => {
11+
stationMap.evaId[id] = {stationNumber: station.nr, ds100: station.ds100}
12+
})
1013
stationMap.evaId[station.id] = {stationNumber: station.nr, ds100: station.ds100}
1114
stationMap.ds100[station.ds100] = {stationNumber: station.nr, evaId: station.id}
1215
stationMap.stationNumber[station.nr] = {ds100: station.ds100, evaId: station.id}

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "index.js",
66
"dependencies": {
77
"csv-parse": "^1.2.0",
8-
"db-hafas": "^0.3.0",
9-
"db-stations": "^1.0.1",
8+
"db-hafas": "^1.0.1",
9+
"db-stations": "^1.8.0",
1010
"express": "^4.15.2",
1111
"express-graphql": "^0.6.6",
1212
"graphiql": "^0.11.2",

0 commit comments

Comments
 (0)