@golemio/pid 2.12.10 → 2.12.11-dev.1273352315
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.
- package/db/example/12_metro_line_A_gtfs_trips.sql +1 -2
- package/db/example/15_vehicle_descriptors.sql +3 -3
- package/db/example/redis/publicDepartureBoardsMock.json +13 -0
- package/db/example/redis/publicVehiclePositionsMock.json +24 -0
- package/db/migrations/postgresql/20240418133218-detailed-stop-times.js +53 -0
- package/db/migrations/postgresql/20240424122841-delay-at-past-stops-release-part-1.js +53 -0
- package/db/migrations/postgresql/sqls/20240418133218-detailed-stop-times-down.sql +263 -0
- package/db/migrations/postgresql/sqls/20240418133218-detailed-stop-times-up.sql +174 -0
- package/db/migrations/postgresql/sqls/20240424122841-delay-at-past-stops-release-part-1-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20240424122841-delay-at-past-stops-release-part-1-up.sql +98 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js +4 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.d.ts +4 -3
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +8 -6
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.d.ts +14 -0
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js +82 -0
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.d.ts +10 -2
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js +81 -10
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.d.ts +12 -0
- package/dist/{schema-definitions/vehicle-positions/models/views/interfaces/IStopTimeDelayPredictionDto.js → integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.js} +1 -1
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/interfaces/TripModelInterfaces.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +10 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +4 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +4 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.d.ts +7 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js +36 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.d.ts +2 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +9 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.js +5 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +4 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.d.ts +21 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js +102 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.d.ts +3 -2
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +9 -7
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.d.ts +4 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.js +3 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.d.ts +5 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.js +31 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.d.ts +1 -0
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js +30 -12
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.d.ts +1 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js +5 -21
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.d.ts +0 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +4 -21
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js +6 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.d.ts +4 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js +39 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +3 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.d.ts +3 -6
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +8 -19
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +2 -1
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.d.ts +8 -0
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js +65 -0
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js.map +1 -0
- package/dist/output-gateway/public/controllers/v1/interfaces/PublicParamsInterfaces.d.ts +10 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.d.ts +11 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +72 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -0
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.d.ts +1 -0
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +22 -2
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.d.ts +9 -0
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.js +3 -0
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.js.map +1 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.d.ts +34 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.js +3 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.js.map +1 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.d.ts +4 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.js +3 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.js.map +1 -0
- package/dist/output-gateway/public/domain/repository/IVehiclePositionsRepository.d.ts +1 -0
- package/dist/output-gateway/public/ioc/Di.js +8 -0
- package/dist/output-gateway/public/ioc/Di.js.map +1 -1
- package/dist/output-gateway/public/ioc/OgModuleToken.d.ts +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js.map +1 -1
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.d.ts +10 -0
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js +28 -0
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/v1/{PublicRouter.d.ts → PublicVehiclePositionsRouter.d.ts} +3 -3
- package/dist/output-gateway/public/routers/v1/{PublicRouter.js → PublicVehiclePositionsRouter.js} +8 -8
- package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.d.ts +5 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.js +42 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.js.map +1 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.d.ts +17 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js +117 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.d.ts +1 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +5 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.d.ts +34 -0
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js +54 -0
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map +1 -0
- package/dist/output-gateway/shared/DepartureCalculator.d.ts +10 -0
- package/dist/output-gateway/shared/DepartureCalculator.js +26 -0
- package/dist/output-gateway/shared/DepartureCalculator.js.map +1 -0
- package/dist/output-gateway/shared/RopidRouterUtils.d.ts +2 -1
- package/dist/output-gateway/shared/RopidRouterUtils.js +4 -3
- package/dist/output-gateway/shared/RopidRouterUtils.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.js +5 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IDelayComputationDto.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.d.ts +12 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js +3 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.js +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.d.ts +4 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js +69 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js.map +1 -0
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.d.ts +3 -0
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js +12 -0
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.d.ts +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.js +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts +3 -0
- package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicStopTimeCacheDto.d.ts +3 -0
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js +26 -1
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js.map +1 -1
- package/docs/implementation_documentation.md +26 -0
- package/docs/openapi-output.yaml +234 -0
- package/package.json +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/StopTimeDelayPredictionRepository.d.ts +0 -7
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/StopTimeDelayPredictionRepository.js +0 -19
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/StopTimeDelayPredictionRepository.js.map +0 -1
- package/dist/output-gateway/public/routers/v1/PublicRouter.js.map +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/StopTimeDelayPredictionModel.d.ts +0 -13
- package/dist/schema-definitions/vehicle-positions/models/views/StopTimeDelayPredictionModel.js +0 -41
- package/dist/schema-definitions/vehicle-positions/models/views/StopTimeDelayPredictionModel.js.map +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IStopTimeDelayPredictionDto.d.ts +0 -9
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IStopTimeDelayPredictionDto.js.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DepartureBoardFacade = void 0;
|
|
13
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
14
|
+
const PublicDepartureTransformation_1 = require("../transformations/PublicDepartureTransformation");
|
|
15
|
+
const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
|
|
16
|
+
class DepartureBoardFacade {
|
|
17
|
+
constructor(departureRepository, tripRepository, descriptorRepository) {
|
|
18
|
+
this.departureRepository = departureRepository;
|
|
19
|
+
this.tripRepository = tripRepository;
|
|
20
|
+
this.descriptorRepository = descriptorRepository;
|
|
21
|
+
this.transformation = new PublicDepartureTransformation_1.PublicDepartureTransformation();
|
|
22
|
+
}
|
|
23
|
+
getAll(stopIds, limit, routeShortNames, minutesAfter) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
let output = [];
|
|
26
|
+
const sortedStopGroups = this.sortStopGroupsByPriority(stopIds);
|
|
27
|
+
for (const stopGroup of sortedStopGroups) {
|
|
28
|
+
let outputGroup = [];
|
|
29
|
+
const spanDepartures = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.getPublicDepartureCache`);
|
|
30
|
+
const departures = yield this.departureRepository.getPublicGtfsDepartureCache(stopGroup.stopIds, minutesAfter);
|
|
31
|
+
spanDepartures === null || spanDepartures === void 0 ? void 0 : spanDepartures.end();
|
|
32
|
+
const spanVehicles = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.getAllVehicleIdsAndDupl`);
|
|
33
|
+
try {
|
|
34
|
+
for (const departure of departures) {
|
|
35
|
+
const vehicleIds = yield this.tripRepository.getAllVehicleIdsForTrip(departure.trip_id);
|
|
36
|
+
const duplicatedDepartures = yield this.duplicateDeparturesWithDifferentVehicleIds(departure, vehicleIds);
|
|
37
|
+
outputGroup = outputGroup.concat(duplicatedDepartures);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
throw new golemio_errors_1.GeneralError("Error while retrieving cached data", this.constructor.name, err, 500);
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
spanVehicles === null || spanVehicles === void 0 ? void 0 : spanVehicles.end();
|
|
48
|
+
}
|
|
49
|
+
const spanManipulate = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.manipulateDepartures`);
|
|
50
|
+
try {
|
|
51
|
+
if (routeShortNames) {
|
|
52
|
+
outputGroup = outputGroup.filter((departure) => routeShortNames.includes(departure.route.short_name));
|
|
53
|
+
}
|
|
54
|
+
outputGroup = this.sortDeparturesByPredictedTimestamp(outputGroup);
|
|
55
|
+
// minutesBefore is set to 0 because we want to display departures that are already happening
|
|
56
|
+
// this may change in the future
|
|
57
|
+
outputGroup = this.removeDeparturesOutsideTimeRange(outputGroup, 0, minutesAfter).slice(0, limit);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
throw new golemio_errors_1.GeneralError("Error while manipulating departures", this.constructor.name, err, 500);
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
spanManipulate === null || spanManipulate === void 0 ? void 0 : spanManipulate.end();
|
|
64
|
+
}
|
|
65
|
+
output.push(outputGroup);
|
|
66
|
+
}
|
|
67
|
+
return output;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
duplicateDeparturesWithDifferentVehicleIds(departure, vehicleIds) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
let outputGroup = [];
|
|
73
|
+
// If there are no vehicleIds, we still want to display the departure
|
|
74
|
+
// but without any RT/vehicle information
|
|
75
|
+
if (vehicleIds.length === 0) {
|
|
76
|
+
outputGroup.push(this.transformation.transformElement({
|
|
77
|
+
departure,
|
|
78
|
+
vehicleId: null,
|
|
79
|
+
vehiclePosition: null,
|
|
80
|
+
vehicleDescriptor: null,
|
|
81
|
+
}));
|
|
82
|
+
return outputGroup;
|
|
83
|
+
}
|
|
84
|
+
// Otherwise, we want to duplicate the departure for each vehicleId
|
|
85
|
+
// (multiple vehicles can be on the same trip at the same time)
|
|
86
|
+
for (const vehicleId of vehicleIds) {
|
|
87
|
+
const vehiclePosition = yield this.tripRepository.getDetailedVehiclePosition(vehicleId);
|
|
88
|
+
const vehicleDescriptor = (vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.detailed_info.registration_number)
|
|
89
|
+
? yield this.descriptorRepository.getOneByRegNumber(departure.route_type, vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.detailed_info.registration_number)
|
|
90
|
+
: null;
|
|
91
|
+
outputGroup.push(this.transformation.transformElement({
|
|
92
|
+
departure,
|
|
93
|
+
vehicleId,
|
|
94
|
+
vehiclePosition,
|
|
95
|
+
vehicleDescriptor,
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
return outputGroup;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
removeDeparturesOutsideTimeRange(departureGroup, minutesBefore, minutesAfter) {
|
|
102
|
+
const now = new Date();
|
|
103
|
+
const timeRangeStart = new Date(now.getTime() - minutesBefore * 60 * 1000);
|
|
104
|
+
const timeRangeEnd = new Date(now.getTime() + minutesAfter * 60 * 1000);
|
|
105
|
+
departureGroup = departureGroup.filter((departure) => new Date(departure.departure.timestamp_predicted) >= timeRangeStart &&
|
|
106
|
+
new Date(departure.departure.timestamp_predicted) <= timeRangeEnd);
|
|
107
|
+
return departureGroup;
|
|
108
|
+
}
|
|
109
|
+
sortStopGroupsByPriority(stopIds) {
|
|
110
|
+
return Array.from(stopIds).sort((a, b) => a.priority - b.priority);
|
|
111
|
+
}
|
|
112
|
+
sortDeparturesByPredictedTimestamp(departureGroup) {
|
|
113
|
+
return departureGroup.sort((a, b) => new Date(a.departure.timestamp_predicted).getTime() - new Date(b.departure.timestamp_predicted).getTime());
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.DepartureBoardFacade = DepartureBoardFacade;
|
|
117
|
+
//# sourceMappingURL=DepartureBoardFacade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DepartureBoardFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/DepartureBoardFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,6EAA8F;AAC9F,oGAAiG;AACjG,+FAA6F;AAE7F,MAAa,oBAAoB;IAG7B,YACqB,mBAA6C,EAC7C,cAA2C,EAC3C,oBAAuD;QAFvD,wBAAmB,GAAnB,mBAAmB,CAA0B;QAC7C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AC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,YAAY,CACxE,CAAC;QAEF,OAAO,cAAc,CAAC;IAC1B,CAAC;IAEO,wBAAwB,CAAC,OAA0C;QACvE,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;IAEO,kCAAkC,CAAC,cAA4C;QACnF,OAAO,cAAc,CAAC,IAAI,CACtB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,EAAE,CACtH,CAAC;IACN,CAAC;CACJ;AA1ID,oDA0IC"}
|
|
@@ -9,4 +9,5 @@ export declare class StopTimesTripScopeHandler extends AbstractTripScopeHandler
|
|
|
9
9
|
private tripStopTimesTransformation;
|
|
10
10
|
constructor(delayComputationRepository: IDelayComputationRepository, stopTimeRepository: IStopTimeRepository);
|
|
11
11
|
handle(output: IPublicApiDetailedTrip, vehiclePosition: IPublicApiCacheDto): Promise<IPublicApiDetailedTrip>;
|
|
12
|
+
private filterNoStopWaypoints;
|
|
12
13
|
}
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js
CHANGED
|
@@ -42,7 +42,8 @@ let StopTimesTripScopeHandler = exports.StopTimesTripScopeHandler = class StopTi
|
|
|
42
42
|
if (!delayComputationCache) {
|
|
43
43
|
throw new golemio_errors_1.GeneralError("delay_computation_cache_not_found", this.constructor.name, undefined, 500);
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const filteredStopTimes = this.filterNoStopWaypoints(delayComputationCache.stop_times);
|
|
46
|
+
const stopTimes = this.tripStopTimesTransformation.transformArray(filteredStopTimes);
|
|
46
47
|
const stopTimesWithDelay = yield this.stopTimeRepository.getPublicStopTimeCache(vehiclePosition.vehicle_id);
|
|
47
48
|
if (stopTimesWithDelay.length > 0) {
|
|
48
49
|
for (const stopTimeWithDelay of stopTimesWithDelay) {
|
|
@@ -68,6 +69,9 @@ let StopTimesTripScopeHandler = exports.StopTimesTripScopeHandler = class StopTi
|
|
|
68
69
|
return output;
|
|
69
70
|
});
|
|
70
71
|
}
|
|
72
|
+
filterNoStopWaypoints(stopTimes) {
|
|
73
|
+
return stopTimes.filter((stopTime) => !stopTime.is_no_stop_waypoint);
|
|
74
|
+
}
|
|
71
75
|
};
|
|
72
76
|
exports.StopTimesTripScopeHandler = StopTimesTripScopeHandler = __decorate([
|
|
73
77
|
(0, tsyringe_1.injectable)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StopTimesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,iEAA6D;AAC7D,6HAAoI;AAEpI,+DAAsF;AAEtF,6EAAwE;AACxE,2DAA2D;AAC3D,iEAAwE;AACxE,yEAAsE;
|
|
1
|
+
{"version":3,"file":"StopTimesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,iEAA6D;AAC7D,6HAAoI;AAEpI,+DAAsF;AAEtF,6EAAwE;AACxE,2DAA2D;AAC3D,iEAAwE;AACxE,yEAAsE;AAI/D,IAAM,yBAAyB,uCAA/B,MAAM,yBAA0B,SAAQ,mDAAwB;IAGnE,YAC8D,0BAAuD,EACzD,kBAAuC;QAE/F,KAAK,EAAE,CAAC;QAHkD,+BAA0B,GAA1B,0BAA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iB,CAAC,SAAS,KAAK,IAAI;4BAChC,CAAC,CAAC,IAAI;4BACN,CAAC,CAAC,gBAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC;iCAC9D,IAAI,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,SAAS,EAAE,CAAC;iCAC9C,QAAQ,CAAC,UAAU,CAAC,CAAC;wBAEpC,QAAQ,CAAC,UAAU,CAAC,qBAAqB,GAAG,aAAa,CAAC;wBAC1D,QAAQ,CAAC,UAAU,CAAC,uBAAuB,GAAG,eAAe,CAAC;qBACjE;iBACJ;aACJ;YAED,MAAM,CAAC,UAAU,GAAG,IAAA,mCAA6B,EAAC,SAAS,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC;QAClB,CAAC;KAAA;IAEO,qBAAqB,CAAC,SAAsB;QAChD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAmB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACpF,CAAC;CACJ,CAAA;oCA5DY,yBAAyB;IADrC,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,0BAA0B,CAAC,CAAA;IAChD,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,wBAAwB,CAAC,CAAA;;GAL1C,yBAAyB,CA4DrC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IPublicDepartureTransformInputDto } from "../../domain/IPublicDepartureTransformInputDto";
|
|
2
|
+
import { IPublicApiDeparture } from "../../domain/PublicApiDepartureInterfaces";
|
|
3
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
4
|
+
export declare class PublicDepartureTransformation extends AbstractTransformation<IPublicDepartureTransformInputDto, IPublicApiDeparture> {
|
|
5
|
+
name: string;
|
|
6
|
+
protected transformInternal: (inputDto: IPublicDepartureTransformInputDto) => {
|
|
7
|
+
departure: {
|
|
8
|
+
timestamp_scheduled: string;
|
|
9
|
+
timestamp_predicted: string;
|
|
10
|
+
delay_seconds: number | null;
|
|
11
|
+
minutes: number;
|
|
12
|
+
};
|
|
13
|
+
stop: {
|
|
14
|
+
id: string;
|
|
15
|
+
sequence: number;
|
|
16
|
+
platform_code: string | null;
|
|
17
|
+
};
|
|
18
|
+
route: {
|
|
19
|
+
type: string;
|
|
20
|
+
short_name: string;
|
|
21
|
+
};
|
|
22
|
+
trip: {
|
|
23
|
+
id: string;
|
|
24
|
+
headsign: string;
|
|
25
|
+
is_canceled: boolean;
|
|
26
|
+
};
|
|
27
|
+
vehicle: {
|
|
28
|
+
id: string | null;
|
|
29
|
+
is_wheelchair_accessible: boolean | null;
|
|
30
|
+
is_air_conditioned: boolean | null;
|
|
31
|
+
has_charger: boolean | null;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicDepartureTransformation = void 0;
|
|
4
|
+
const RouteTypeEnums_1 = require("../../../../helpers/RouteTypeEnums");
|
|
5
|
+
const DepartureCalculator_1 = require("../../../shared/DepartureCalculator");
|
|
6
|
+
const RopidRouterUtils_1 = require("../../../shared/RopidRouterUtils");
|
|
7
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
8
|
+
const const_1 = require("../../../../const");
|
|
9
|
+
class PublicDepartureTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.name = "PublicDepartureTransformation";
|
|
13
|
+
this.transformInternal = (inputDto) => {
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
const { departure, vehicleId, vehiclePosition, vehicleDescriptor } = inputDto;
|
|
16
|
+
const delayInSeconds = (_a = vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.delay) !== null && _a !== void 0 ? _a : null;
|
|
17
|
+
const departureTime = new Date(departure.departure_datetime);
|
|
18
|
+
const arrivalTime = departure.arrival_datetime ? new Date(departure.arrival_datetime) : null;
|
|
19
|
+
const predictedDepartureTime = DepartureCalculator_1.DepartureCalculator.getPredictedDepartureTime(departureTime, arrivalTime, delayInSeconds);
|
|
20
|
+
return {
|
|
21
|
+
departure: {
|
|
22
|
+
timestamp_scheduled: (_b = RopidRouterUtils_1.RopidRouterUtils.formatTimestamp(departureTime)) !== null && _b !== void 0 ? _b : departure.departure_datetime,
|
|
23
|
+
timestamp_predicted: (_c = RopidRouterUtils_1.RopidRouterUtils.formatTimestamp(predictedDepartureTime)) !== null && _c !== void 0 ? _c : departure.departure_datetime,
|
|
24
|
+
delay_seconds: delayInSeconds,
|
|
25
|
+
minutes: DepartureCalculator_1.DepartureCalculator.getDepartureMinutes(predictedDepartureTime),
|
|
26
|
+
},
|
|
27
|
+
stop: {
|
|
28
|
+
id: departure.stop_id,
|
|
29
|
+
sequence: departure.stop_sequence,
|
|
30
|
+
// NOTE platform_code is always null for trains
|
|
31
|
+
// fill from realtime data (CIS stop platform code) if needed in the future
|
|
32
|
+
platform_code: departure.platform_code,
|
|
33
|
+
},
|
|
34
|
+
route: {
|
|
35
|
+
type: RouteTypeEnums_1.GTFSRouteTypeEnum[departure.route_type].toLowerCase(),
|
|
36
|
+
short_name: departure.route_short_name,
|
|
37
|
+
},
|
|
38
|
+
trip: {
|
|
39
|
+
id: departure.trip_id,
|
|
40
|
+
headsign: departure.trip_headsign,
|
|
41
|
+
is_canceled: (vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.state_position) === const_1.StatePositionEnum.CANCELED,
|
|
42
|
+
},
|
|
43
|
+
vehicle: {
|
|
44
|
+
id: vehicleId,
|
|
45
|
+
is_wheelchair_accessible: (_d = vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.detailed_info.is_wheelchair_accessible) !== null && _d !== void 0 ? _d : null,
|
|
46
|
+
is_air_conditioned: (_e = vehicleDescriptor === null || vehicleDescriptor === void 0 ? void 0 : vehicleDescriptor.is_air_conditioned) !== null && _e !== void 0 ? _e : null,
|
|
47
|
+
has_charger: (_f = vehicleDescriptor === null || vehicleDescriptor === void 0 ? void 0 : vehicleDescriptor.has_usb_chargers) !== null && _f !== void 0 ? _f : null,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.PublicDepartureTransformation = PublicDepartureTransformation;
|
|
54
|
+
//# sourceMappingURL=PublicDepartureTransformation.js.map
|
package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicDepartureTransformation.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/transformations/PublicDepartureTransformation.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAG5D,6EAAqE;AACrE,uEAA+D;AAC/D,6GAA0G;AAC1G,6CAA8C;AAE9C,MAAa,6BAA8B,SAAQ,+CAGlD;IAHD;;QAIW,SAAI,GAAG,+BAA+B,CAAC;QAEpC,sBAAiB,GAAG,CAAC,QAA2C,EAAE,EAAE;;YAC1E,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,GAAG,QAAQ,CAAC;YAE9E,MAAM,cAAc,GAAG,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,mCAAI,IAAI,CAAC;YACtD,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;YAC7D,MAAM,WAAW,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC7F,MAAM,sBAAsB,GAAG,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C3D;aACJ,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA;AA7CD,sEA6CC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class DepartureCalculator {
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the predicted departure time based on the scheduled departure time, arrival time and delay.
|
|
4
|
+
**/
|
|
5
|
+
static getPredictedDepartureTime: (departureTime: Date, arrivalTime: Date | null, delayInSeconds: number | null) => Date;
|
|
6
|
+
/**
|
|
7
|
+
* Calculates the number of minutes until the predicted departure time.
|
|
8
|
+
**/
|
|
9
|
+
static getDepartureMinutes: (predictedDepartureTime: Date) => number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DepartureCalculator = void 0;
|
|
4
|
+
class DepartureCalculator {
|
|
5
|
+
}
|
|
6
|
+
exports.DepartureCalculator = DepartureCalculator;
|
|
7
|
+
/**
|
|
8
|
+
* Calculates the predicted departure time based on the scheduled departure time, arrival time and delay.
|
|
9
|
+
**/
|
|
10
|
+
DepartureCalculator.getPredictedDepartureTime = (departureTime, arrivalTime, delayInSeconds) => {
|
|
11
|
+
let delayInSecondsWithDefault = delayInSeconds !== null && delayInSeconds !== void 0 ? delayInSeconds : 0;
|
|
12
|
+
let adjustedDepartureTime = new Date(departureTime.getTime() + delayInSecondsWithDefault * 1000);
|
|
13
|
+
if (arrivalTime && delayInSecondsWithDefault > 0) {
|
|
14
|
+
const dwellInSeconds = (departureTime.getTime() - arrivalTime.getTime()) / 1000;
|
|
15
|
+
const minDwellInSeconds = Math.min(delayInSecondsWithDefault, dwellInSeconds);
|
|
16
|
+
adjustedDepartureTime.setTime(adjustedDepartureTime.getTime() - minDwellInSeconds * 1000);
|
|
17
|
+
}
|
|
18
|
+
return adjustedDepartureTime;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Calculates the number of minutes until the predicted departure time.
|
|
22
|
+
**/
|
|
23
|
+
DepartureCalculator.getDepartureMinutes = (predictedDepartureTime) => {
|
|
24
|
+
return Math.round((predictedDepartureTime.getTime() - new Date().getTime()) / (60 * 1000));
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=DepartureCalculator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DepartureCalculator.js","sourceRoot":"","sources":["../../../src/output-gateway/shared/DepartureCalculator.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;;AAAhC,kDA4BC;AA3BG;;IAEI;AACU,6CAAyB,GAAG,CACtC,aAAmB,EACnB,WAAwB,EACxB,cAA6B,EACzB,EAAE;IACN,IAAI,yBAAyB,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,CAAC;IACpD,IAAI,qBAAqB,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,yBAAyB,GAAG,IAAI,CAAC,CAAC;IAEjG,IAAI,WAAW,IAAI,yBAAyB,GAAG,CAAC,EAAE;QAC9C,MAAM,cAAc,GAAG,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;QAChF,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,cAAc,CAAC,CAAC;QAE9E,qBAAqB,CAAC,OAAO,CAAC,qBAAqB,CAAC,OAAO,EAAE,GAAG,iBAAiB,GAAG,IAAI,CAAC,CAAC;KAC7F;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC,CAAC;AAEF;;IAEI;AACU,uCAAmB,GAAG,CAAC,sBAA4B,EAAU,EAAE;IACzE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ClassConstructor } from "@golemio/core/dist/shared/class-transformer";
|
|
2
2
|
import { ParsedQs } from "qs";
|
|
3
3
|
export declare class RopidRouterUtils {
|
|
4
|
+
static TIMEZONE: string;
|
|
4
5
|
/**
|
|
5
6
|
* Convert plain object to DTO class instance
|
|
6
7
|
*/
|
|
@@ -8,7 +9,7 @@ export declare class RopidRouterUtils {
|
|
|
8
9
|
/**
|
|
9
10
|
* Format to ISO 8601 (without milliseconds)
|
|
10
11
|
*/
|
|
11
|
-
static formatTimestamp: (dateObject: Date | null, preferredTimezone
|
|
12
|
+
static formatTimestamp: (dateObject: Date | null, preferredTimezone?: string) => string | null;
|
|
12
13
|
/**
|
|
13
14
|
* Validate and return timezone (it is possible to use _ symbol instead of URL encoded / symbol)
|
|
14
15
|
*/
|
|
@@ -4,13 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RopidRouterUtils = void 0;
|
|
7
|
-
const config_1 = require("@golemio/core/dist/output-gateway/config");
|
|
8
7
|
const Logger_1 = require("@golemio/core/dist/output-gateway/Logger");
|
|
9
|
-
const
|
|
8
|
+
const config_1 = require("@golemio/core/dist/output-gateway/config");
|
|
10
9
|
const class_transformer_1 = require("@golemio/core/dist/shared/class-transformer");
|
|
10
|
+
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
11
11
|
class RopidRouterUtils {
|
|
12
12
|
}
|
|
13
13
|
exports.RopidRouterUtils = RopidRouterUtils;
|
|
14
|
+
RopidRouterUtils.TIMEZONE = "Europe/Prague";
|
|
14
15
|
/**
|
|
15
16
|
* Convert plain object to DTO class instance
|
|
16
17
|
*/
|
|
@@ -20,7 +21,7 @@ RopidRouterUtils.mapObjectToDTOInstance = (dto, data) => {
|
|
|
20
21
|
/**
|
|
21
22
|
* Format to ISO 8601 (without milliseconds)
|
|
22
23
|
*/
|
|
23
|
-
RopidRouterUtils.formatTimestamp = (dateObject, preferredTimezone) => {
|
|
24
|
+
RopidRouterUtils.formatTimestamp = (dateObject, preferredTimezone = RopidRouterUtils.TIMEZONE) => {
|
|
24
25
|
if (!dateObject)
|
|
25
26
|
return null;
|
|
26
27
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidRouterUtils.js","sourceRoot":"","sources":["../../../src/output-gateway/shared/RopidRouterUtils.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"RopidRouterUtils.js","sourceRoot":"","sources":["../../../src/output-gateway/shared/RopidRouterUtils.ts"],"names":[],"mappings":";;;;;;AAAA,qEAA+D;AAC/D,qEAAkE;AAClE,mFAAgG;AAChG,gGAA+D;AAG/D,MAAa,gBAAgB;;AAA7B,4CA0CC;AAzCiB,yBAAQ,GAAG,eAAe,CAAC;AAEzC;;GAEG;AACW,uCAAsB,GAAG,CAAI,GAAwB,EAAE,IAAS,EAAE,EAAE;IAC9E,OAAO,IAAA,mCAAe,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF;;GAEG;AACW,gCAAe,GAAG,CAAC,UAAuB,EAAE,iBAAiB,GAAG,gBAAgB,CAAC,QAAQ,EAAiB,EAAE;IACtH,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,IAAI;QACA,MAAM,QAAQ,GAAG,IAAA,yBAAM,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,CAAC;QAEnE,IAAI,QAAQ,KAAK,cAAc,EAAE;YAC7B,YAAG,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;YACpE,OAAO,IAAI,CAAC;SACf;QAED,OAAO,QAAQ,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACV,YAAG,CAAC,KAAK,CAAC,wDAAwD,EAAE,GAAG,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC;KACf;AACL,CAAC,CAAC;AAEF;;GAEG;AACW,qCAAoB,GAAG,CAAC,iBAAmC,EAAU,EAAE;IACjF,MAAM,QAAQ,GACV,OAAO,iBAAiB,KAAK,QAAQ;QACjC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;QACtC,CAAC,CAAC,eAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC;IAElD,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PUBLIC_DEPARTURE_NAMESPACE_PREFIX = "gtfsPublicDepartureCache";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/schema-definitions/ropid-gtfs/redis/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,iCAAiC,GAAG,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GTFSRouteTypeEnum } from "../../../../helpers/RouteTypeEnums";
|
|
2
|
+
export interface IPublicGtfsDepartureCacheDto {
|
|
3
|
+
stop_id: string;
|
|
4
|
+
departure_datetime: string;
|
|
5
|
+
arrival_datetime: string | null;
|
|
6
|
+
route_short_name: string;
|
|
7
|
+
route_type: GTFSRouteTypeEnum;
|
|
8
|
+
trip_id: string;
|
|
9
|
+
stop_sequence: number;
|
|
10
|
+
platform_code: string | null;
|
|
11
|
+
trip_headsign: string;
|
|
12
|
+
}
|
package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPublicGtfsDepartureCacheDto.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayComputationDtoSchema.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.ts"],"names":[],"mappings":";;;AAGA,MAAM,yBAAyB,GAAyC;IACpE,OAAO,EAAE,yCAAyC;IAClD,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,UAAU,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAChC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAClC,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACvC,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE;oBAChF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC3B,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAClC,oBAAoB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBACzC,sBAAsB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAC3C,IAAI,EAAE;wBACF,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAC5B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAC7B,O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,EAAE,IAAI,EAAE,CAAC,EAAE;oBACtF,sBAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAC7C;gBACD,QAAQ,EAAE;oBACN,OAAO;oBACP,SAAS;oBACT,SAAS;oBACT,aAAa;oBACb,yBAAyB;oBACzB,oBAAoB;oBACpB,oBAAoB;oBACpB,qBAAqB;oBACrB,wBAAwB;iBAC3B;aACJ;SACJ;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACxB,MAAM,EAAE;wBACJ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;wBAC/C,QAAQ,EAAE,CAAC;wBACX,QAAQ,EAAE,CAAC;qBACd;iBACJ;gBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;aAC/B;SACJ;KACJ;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,QAAQ,CAAC;CACxE,CAAC;AAEoC,8DAAyB"}
|
|
1
|
+
{"version":3,"file":"DelayComputationDtoSchema.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.ts"],"names":[],"mappings":";;;AAGA,MAAM,yBAAyB,GAAyC;IACpE,OAAO,EAAE,yCAAyC;IAClD,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,UAAU,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,YAAY,EAAE,EAAE,IAAI,EAAE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BACJ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;wBAC/C,QAAQ,EAAE,CAAC;wBACX,QAAQ,EAAE,CAAC;qBACd;iBACJ;gBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;aAC/B;SACJ;KACJ;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,QAAQ,CAAC;CACxE,CAAC;AAEoC,8DAAyB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
|
|
2
|
+
import { IPublicGtfsDepartureCacheDto } from "../interfaces/IPublicGtfsDepartureCacheDto";
|
|
3
|
+
declare const publicGtfsDepartureDtoSchema: JSONSchemaType<IPublicGtfsDepartureCacheDto[]>;
|
|
4
|
+
export { publicGtfsDepartureDtoSchema as PublicGtfsDepartureDtoSchema };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicGtfsDepartureDtoSchema = void 0;
|
|
4
|
+
const publicGtfsDepartureDtoSchema = {
|
|
5
|
+
$schema: "http://json-schema.org/draft-04/schema#",
|
|
6
|
+
title: "PublicGtfsDepartureDto",
|
|
7
|
+
type: "array",
|
|
8
|
+
items: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
stop_id: {
|
|
12
|
+
type: "string",
|
|
13
|
+
},
|
|
14
|
+
departure_datetime: {
|
|
15
|
+
type: "string",
|
|
16
|
+
},
|
|
17
|
+
arrival_datetime: {
|
|
18
|
+
oneOf: [
|
|
19
|
+
{
|
|
20
|
+
type: "string",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "null",
|
|
24
|
+
nullable: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
route_short_name: {
|
|
29
|
+
type: "string",
|
|
30
|
+
},
|
|
31
|
+
route_type: {
|
|
32
|
+
type: "number",
|
|
33
|
+
},
|
|
34
|
+
trip_id: {
|
|
35
|
+
type: "string",
|
|
36
|
+
},
|
|
37
|
+
stop_sequence: {
|
|
38
|
+
type: "number",
|
|
39
|
+
},
|
|
40
|
+
platform_code: {
|
|
41
|
+
oneOf: [
|
|
42
|
+
{
|
|
43
|
+
type: "string",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "null",
|
|
47
|
+
nullable: true,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
trip_headsign: {
|
|
52
|
+
type: "string",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: [
|
|
56
|
+
"stop_id",
|
|
57
|
+
"departure_datetime",
|
|
58
|
+
"arrival_datetime",
|
|
59
|
+
"route_short_name",
|
|
60
|
+
"route_type",
|
|
61
|
+
"trip_id",
|
|
62
|
+
"stop_sequence",
|
|
63
|
+
"platform_code",
|
|
64
|
+
"trip_headsign",
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
exports.PublicGtfsDepartureDtoSchema = publicGtfsDepartureDtoSchema;
|
|
69
|
+
//# sourceMappingURL=PublicGtfsDepartureDtoSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicGtfsDepartureDtoSchema.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.ts"],"names":[],"mappings":";;;AAGA,MAAM,4BAA4B,GAAmD;IACjF,OAAO,EAAE,yCAAyC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;aACjB;YACD,kBAAkB,EAAE;gBAChB,IAAI,EAAE,QAAQ;aACjB;YACD,gBAAgB,EAAE;gBACd,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,QAAQ;qBACjB;oBACD;wBACI,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,IAAI;qBACjB;iBACJ;aACJ;YACD,gBAAgB,EAAE;gBACd,IAAI,EAAE,QAAQ;aACjB;YACD,UAAU,EAAE;gBACR,IAAI,EAAE,QAAQ;aACjB;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;aACjB;YACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;aACjB;YACD,aAAa,EAAE;gBACX,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,QAAQ;qBACjB;oBACD;wBACI,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,IAAI;qBACjB;iBACJ;aACJ;YACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;aACjB;SACJ;QACD,QAAQ,EAAE;YACN,SAAS;YACT,oBAAoB;YACpB,kBAAkB;YAClB,kBAAkB;YAClB,YAAY;YACZ,SAAS;YACT,eAAe;YACf,eAAe;YACf,eAAe;SAClB;KACJ;CACJ,CAAC;AACuC,oEAA4B"}
|
|
@@ -16,5 +16,8 @@ export declare class PublicStopTimeModel extends Model<PublicStopTimeModel> impl
|
|
|
16
16
|
provider_source_type: ProviderSourceTypeEnum;
|
|
17
17
|
cis_trip_number: number | null;
|
|
18
18
|
vehicle_registration_number: number | null;
|
|
19
|
+
cis_stop_platform_code: string | null;
|
|
20
|
+
platform_code: string | null;
|
|
21
|
+
stop_id: string;
|
|
19
22
|
static attributeModel: ModelAttributes<PublicStopTimeModel>;
|
|
20
23
|
}
|
|
@@ -57,5 +57,17 @@ PublicStopTimeModel.attributeModel = {
|
|
|
57
57
|
type: sequelize_1.DataTypes.INTEGER,
|
|
58
58
|
allowNull: true,
|
|
59
59
|
},
|
|
60
|
+
cis_stop_platform_code: {
|
|
61
|
+
type: sequelize_1.DataTypes.STRING,
|
|
62
|
+
allowNull: true,
|
|
63
|
+
},
|
|
64
|
+
platform_code: {
|
|
65
|
+
type: sequelize_1.DataTypes.STRING,
|
|
66
|
+
allowNull: true,
|
|
67
|
+
},
|
|
68
|
+
stop_id: {
|
|
69
|
+
type: sequelize_1.DataTypes.STRING,
|
|
70
|
+
allowNull: false,
|
|
71
|
+
},
|
|
60
72
|
};
|
|
61
73
|
//# sourceMappingURL=PublicStopTimeModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicStopTimeModel.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.ts"],"names":[],"mappings":";;;AAAA,mEAAwF;AAKxF,MAAa,mBAAoB,SAAQ,iBAA0B;;AAAnE,
|
|
1
|
+
{"version":3,"file":"PublicStopTimeModel.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.ts"],"names":[],"mappings":";;;AAAA,mEAAwF;AAKxF,MAAa,mBAAoB,SAAQ,iBAA0B;;AAAnE,kDAmFC;AAlFiB,6BAAS,GAAG,+CAA+C,CAAC;AAkB5D,kCAAc,GAAyC;IACjE,UAAU,EAAE;QACR,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,IAAI;KACnB;IACD,YAAY,EAAE;QACV,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;KACnB;IACD,aAAa,EAAE;QACX,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,IAAI;KACnB;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI;KAClB;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI;KAClB;IACD,eAAe,EAAE;QACb,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI;KAClB;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,IAAI;KAClB;IACD,UAAU,EAAE;QACR,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI;KAClB;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI;KAClB;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QACzB,SAAS,EAAE,KAAK;KACnB;IACD,eAAe,EAAE;QACb,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI;KAClB;IACD,2BAA2B,EAAE;QACzB,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,IAAI;KAClB;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,IAAI;KAClB;IACD,aAAa,EAAE;QACX,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,IAAI;KAClB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;KACnB;CACJ,CAAC"}
|
|
@@ -16,6 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./TripWithLastPositionModel"), exports);
|
|
18
18
|
__exportStar(require("./ProcessedPositionModel"), exports);
|
|
19
|
-
__exportStar(require("./StopTimeDelayPredictionModel"), exports);
|
|
20
19
|
__exportStar(require("./PublicStopTimeModel"), exports);
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/views/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,2DAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/views/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,2DAAyC;AACzC,wDAAsC"}
|
package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts
CHANGED
|
@@ -13,4 +13,7 @@ export interface IPublicStopTimeDto {
|
|
|
13
13
|
provider_source_type: ProviderSourceTypeEnum;
|
|
14
14
|
cis_trip_number: number | null;
|
|
15
15
|
vehicle_registration_number: number | null;
|
|
16
|
+
cis_stop_platform_code: string | null;
|
|
17
|
+
platform_code: string | null;
|
|
18
|
+
stop_id: string;
|
|
16
19
|
}
|
package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js
CHANGED
|
@@ -33,8 +33,33 @@ const publicStopTimeCacheDtoSchema = {
|
|
|
33
33
|
},
|
|
34
34
|
],
|
|
35
35
|
},
|
|
36
|
+
cis_stop_platform_code: {
|
|
37
|
+
oneOf: [
|
|
38
|
+
{
|
|
39
|
+
type: "string",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "null",
|
|
43
|
+
nullable: true,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
platform_code: {
|
|
48
|
+
oneOf: [
|
|
49
|
+
{
|
|
50
|
+
type: "string",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "null",
|
|
54
|
+
nullable: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
stop_id: {
|
|
59
|
+
type: "string",
|
|
60
|
+
},
|
|
36
61
|
},
|
|
37
|
-
required: ["sequence", "arr_delay", "dep_delay"],
|
|
62
|
+
required: ["sequence", "arr_delay", "dep_delay", "cis_stop_platform_code", "platform_code", "stop_id"],
|
|
38
63
|
},
|
|
39
64
|
};
|
|
40
65
|
exports.PublicStopTimeCacheDtoSchema = publicStopTimeCacheDtoSchema;
|