@transportme/load-ptv-gtfs 1.4.28 → 1.4.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,6 +112,8 @@ export default class GTFSTrip {
112
112
  getStopData() {
113
113
  return this.#stopData
114
114
  }
115
+
116
+ getRunID() { return null }
115
117
  }
116
118
 
117
119
  /**
@@ -140,7 +142,7 @@ export class SmartrakTrip extends GTFSTrip {
140
142
  return {
141
143
  ...super.getTripData(),
142
144
  depotID: this.getDepotID(),
143
- runID: this.getTripID()
145
+ runID: this.getRunID()
144
146
  }
145
147
  }
146
148
 
@@ -148,6 +150,14 @@ export class SmartrakTrip extends GTFSTrip {
148
150
  return parseInt(this.#depotID)
149
151
  }
150
152
 
153
+ getRunID() {
154
+ const tripIDParts = this.getTripID().split('-')
155
+ const routeNumber = tripIDParts[1]
156
+ const routeVariant = tripIDParts[2]
157
+ const rosterType = this.getCalendarName().split('-')[0].replace(/\d+/, '')
158
+ const tripRunID = tripIDParts[5]
159
+ return `${this.getDepotID()}-${routeNumber}-${routeVariant}-${rosterType}-${tripRunID}`
160
+ }
151
161
  }
152
162
 
153
163
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/load-ptv-gtfs",
3
- "version": "1.4.28",
3
+ "version": "1.4.30",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "scripts": {