@golemio/pid 3.9.4-dev.1714786001 → 3.9.4-dev.1732067049
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/00_clear_test_data.sql +2 -1
- package/db/example/21_ropid_departures_presets_ropidgtfs_stops.sql +6 -0
- package/db/migrations/postgresql/20250312125125-create-presets-ropidgtfs-stops-table.js +53 -0
- package/db/migrations/postgresql/sqls/20250312125125-create-presets-ropidgtfs-stops-table-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20250312125125-create-presets-ropidgtfs-stops-table-up.sql +7 -0
- package/dist/helpers/DateTimeUtils.d.ts +17 -0
- package/dist/helpers/DateTimeUtils.js +18 -10
- package/dist/helpers/DateTimeUtils.js.map +1 -1
- package/dist/helpers/GtfsStopParser.d.ts +6 -0
- package/dist/helpers/GtfsStopParser.js +44 -0
- package/dist/helpers/GtfsStopParser.js.map +1 -0
- package/dist/integration-engine/jis/repositories/RopidDeparturesPresetsRopidGTFSStopsRepository.d.ts +13 -0
- package/dist/integration-engine/jis/repositories/RopidDeparturesPresetsRopidGTFSStopsRepository.js +39 -0
- package/dist/integration-engine/jis/repositories/RopidDeparturesPresetsRopidGTFSStopsRepository.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/DeparturePresetsRepository.d.ts +2 -0
- package/dist/integration-engine/ropid-gtfs/data-access/DeparturePresetsRepository.js +15 -6
- package/dist/integration-engine/ropid-gtfs/data-access/DeparturePresetsRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.d.ts +8 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +39 -5
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +6 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +2 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +2 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v3/V3DeparturesPresetController.d.ts +8 -0
- package/dist/output-gateway/pid/controllers/v3/V3DeparturesPresetController.js +44 -0
- package/dist/output-gateway/pid/controllers/v3/V3DeparturesPresetController.js.map +1 -0
- package/dist/output-gateway/pid/data-access/RopidDeparturesPresetRepository.d.ts +14 -0
- package/dist/output-gateway/pid/data-access/RopidDeparturesPresetRepository.js +82 -0
- package/dist/output-gateway/pid/data-access/RopidDeparturesPresetRepository.js.map +1 -0
- package/dist/output-gateway/pid/data-access/RopidDeparturesPresetsRopidGTFSStopsRepository.d.ts +13 -0
- package/dist/output-gateway/pid/data-access/RopidDeparturesPresetsRopidGTFSStopsRepository.js +39 -0
- package/dist/output-gateway/pid/data-access/RopidDeparturesPresetsRopidGTFSStopsRepository.js.map +1 -0
- package/dist/output-gateway/pid/domain/DeparturesPresetInterfaces.d.ts +6 -0
- package/dist/output-gateway/pid/domain/DeparturesPresetInterfaces.js +3 -0
- package/dist/output-gateway/pid/domain/DeparturesPresetInterfaces.js.map +1 -0
- package/dist/output-gateway/pid/ioc/Di.js +12 -0
- package/dist/output-gateway/pid/ioc/Di.js.map +1 -1
- package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +6 -0
- package/dist/output-gateway/pid/ioc/OgPidToken.js +6 -0
- package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -1
- package/dist/output-gateway/pid/routers/v3/V3PIDRouter.d.ts +1 -0
- package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js +4 -0
- package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/RopidDeparturesPresetFacade.d.ts +9 -0
- package/dist/output-gateway/pid/service/facade/RopidDeparturesPresetFacade.js +37 -0
- package/dist/output-gateway/pid/service/facade/RopidDeparturesPresetFacade.js.map +1 -0
- package/dist/output-gateway/pid/service/transformations/RopidDeparturesPresetTransformation.d.ts +7 -0
- package/dist/output-gateway/pid/service/transformations/RopidDeparturesPresetTransformation.js +30 -0
- package/dist/output-gateway/pid/service/transformations/RopidDeparturesPresetTransformation.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +2 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.d.ts +8 -2
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js +4 -3
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.d.ts +1 -3
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js +4 -30
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js.map +1 -1
- package/dist/schema-definitions/jis/models/RopidDeparturesPresetsRopidGTFSStopsModel.d.ts +12 -0
- package/dist/schema-definitions/jis/models/RopidDeparturesPresetsRopidGTFSStopsModel.js +41 -0
- package/dist/schema-definitions/jis/models/RopidDeparturesPresetsRopidGTFSStopsModel.js.map +1 -0
- package/dist/schema-definitions/jis/models/interfaces/IPresetsGtfsStops.d.ts +4 -0
- package/dist/schema-definitions/jis/models/interfaces/IPresetsGtfsStops.js +3 -0
- package/dist/schema-definitions/jis/models/interfaces/IPresetsGtfsStops.js.map +1 -0
- package/dist/schema-definitions/jis/models/interfaces/IPresetsRopidGTFSStops.d.ts +7 -0
- package/dist/schema-definitions/jis/models/interfaces/IPresetsRopidGTFSStops.js +3 -0
- package/dist/schema-definitions/jis/models/interfaces/IPresetsRopidGTFSStops.js.map +1 -0
- package/dist/schema-definitions/ropid-departures-presets/models/RopidDeparturesPresetsModel.d.ts +19 -0
- package/dist/schema-definitions/ropid-departures-presets/models/RopidDeparturesPresetsModel.js +64 -0
- package/dist/schema-definitions/ropid-departures-presets/models/RopidDeparturesPresetsModel.js.map +1 -0
- package/dist/schema-definitions/ropid-departures-presets/models/interfaces/IRopidDeparturesPresets.d.ts +9 -0
- package/dist/schema-definitions/ropid-departures-presets/models/interfaces/IRopidDeparturesPresets.js +3 -0
- package/dist/schema-definitions/ropid-departures-presets/models/interfaces/IRopidDeparturesPresets.js.map +1 -0
- package/docs/openapi-output.yaml +39 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RopidDeparturesPresetsModel } from "../../../schema-definitions/ropid-departures-presets/models/RopidDeparturesPresetsModel";
|
|
2
|
+
import { ILogger } from "@golemio/core/dist/helpers";
|
|
3
|
+
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
4
|
+
import { AbstractBasicRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository";
|
|
5
|
+
import { ModelStatic } from "@golemio/core/dist/shared/sequelize";
|
|
6
|
+
import { RopidDeparturesPresetsRopidGTFSStopsRepository } from "./RopidDeparturesPresetsRopidGTFSStopsRepository";
|
|
7
|
+
export declare class RopidDeparturesPresetRepository extends AbstractBasicRepository {
|
|
8
|
+
schema: string;
|
|
9
|
+
tableName: string;
|
|
10
|
+
sequelizeModel: ModelStatic<RopidDeparturesPresetsModel>;
|
|
11
|
+
private gtfsStopRepository;
|
|
12
|
+
constructor(connector: IDatabaseConnector, logger: ILogger, presetStopRepository: RopidDeparturesPresetsRopidGTFSStopsRepository);
|
|
13
|
+
getAllWithStops(): Promise<RopidDeparturesPresetsModel[]>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RopidDeparturesPresetRepository = void 0;
|
|
16
|
+
const const_1 = require("../../../schema-definitions/const");
|
|
17
|
+
const RopidDeparturesPresetsModel_1 = require("../../../schema-definitions/ropid-departures-presets/models/RopidDeparturesPresetsModel");
|
|
18
|
+
const AbstractBasicRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository");
|
|
19
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
20
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
21
|
+
const OgPidToken_1 = require("../ioc/OgPidToken");
|
|
22
|
+
const RopidDeparturesPresetsRopidGTFSStopsRepository_1 = require("./RopidDeparturesPresetsRopidGTFSStopsRepository");
|
|
23
|
+
const GTFSStopModel_1 = require("../../ropid-gtfs/models/GTFSStopModel");
|
|
24
|
+
let RopidDeparturesPresetRepository = exports.RopidDeparturesPresetRepository = class RopidDeparturesPresetRepository extends AbstractBasicRepository_1.AbstractBasicRepository {
|
|
25
|
+
constructor(connector, logger, presetStopRepository) {
|
|
26
|
+
super(connector, logger);
|
|
27
|
+
this.schema = const_1.PG_SCHEMA;
|
|
28
|
+
this.tableName = RopidDeparturesPresetsModel_1.RopidDeparturesPresetsModel.tableName;
|
|
29
|
+
this.sequelizeModel = connector
|
|
30
|
+
.getConnection()
|
|
31
|
+
.define(this.tableName, RopidDeparturesPresetsModel_1.RopidDeparturesPresetsModel.attributeModel, { schema: this.schema });
|
|
32
|
+
this.gtfsStopRepository = new GTFSStopModel_1.GTFSStopModel();
|
|
33
|
+
// associations
|
|
34
|
+
this.sequelizeModel.belongsToMany(this.gtfsStopRepository.sequelizeModel, {
|
|
35
|
+
through: presetStopRepository.sequelizeModel,
|
|
36
|
+
foreignKey: "preset_id",
|
|
37
|
+
otherKey: "stop_id",
|
|
38
|
+
as: "stops",
|
|
39
|
+
});
|
|
40
|
+
this.gtfsStopRepository.sequelizeModel.belongsToMany(this.sequelizeModel, {
|
|
41
|
+
through: presetStopRepository.sequelizeModel,
|
|
42
|
+
foreignKey: "stop_id",
|
|
43
|
+
otherKey: "preset_id",
|
|
44
|
+
});
|
|
45
|
+
presetStopRepository.sequelizeModel.belongsTo(this.sequelizeModel, {
|
|
46
|
+
targetKey: "id",
|
|
47
|
+
foreignKey: "preset_id",
|
|
48
|
+
});
|
|
49
|
+
presetStopRepository.sequelizeModel.belongsTo(this.gtfsStopRepository.sequelizeModel, {
|
|
50
|
+
targetKey: "stop_id",
|
|
51
|
+
foreignKey: "stop_id",
|
|
52
|
+
});
|
|
53
|
+
this.sequelizeModel.hasMany(presetStopRepository.sequelizeModel, {
|
|
54
|
+
sourceKey: "id",
|
|
55
|
+
foreignKey: "preset_id",
|
|
56
|
+
});
|
|
57
|
+
this.gtfsStopRepository.sequelizeModel.hasMany(presetStopRepository.sequelizeModel, {
|
|
58
|
+
sourceKey: "stop_id",
|
|
59
|
+
foreignKey: "stop_id",
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async getAllWithStops() {
|
|
63
|
+
return await this.sequelizeModel.findAll({
|
|
64
|
+
include: {
|
|
65
|
+
model: this.gtfsStopRepository.sequelizeModel,
|
|
66
|
+
as: "stops",
|
|
67
|
+
attributes: ["stop_id"],
|
|
68
|
+
through: { attributes: [] },
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
attributes: ["route_name", "note", "is_testing"],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.RopidDeparturesPresetRepository = RopidDeparturesPresetRepository = __decorate([
|
|
76
|
+
(0, tsyringe_1.injectable)(),
|
|
77
|
+
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
78
|
+
__param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
79
|
+
__param(2, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.RopidDeparturesPresetsRopidGTFSStopsRepository)),
|
|
80
|
+
__metadata("design:paramtypes", [Object, Object, RopidDeparturesPresetsRopidGTFSStopsRepository_1.RopidDeparturesPresetsRopidGTFSStopsRepository])
|
|
81
|
+
], RopidDeparturesPresetRepository);
|
|
82
|
+
//# sourceMappingURL=RopidDeparturesPresetRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RopidDeparturesPresetRepository.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/data-access/RopidDeparturesPresetRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,yIAA+G;AAG/G,kIAA+H;AAC/H,wEAAqE;AAErE,iEAAwE;AACxE,kDAA+C;AAC/C,qHAAkH;AAClH,yEAAoE;AAG7D,IAAM,+BAA+B,6CAArC,MAAM,+BAAgC,SAAQ,iDAAuB;IAMxE,YACyC,SAA6B,EACxC,MAAe,EAEzC,oBAAoE;QAEpE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAXtB,WAAM,GAAG,iBAAS,CAAC;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SAAS;SACxB,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,eAAe;QACjB,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;YACrC,OAAO,EAAE;gBACL,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,cAAc;gBAC7C,EAAE,EAAE,OAAO;gBACX,UAAU,EAAE,CAAC,SAAS,CAAC;gBACvB,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;gBAC3B,QAAQ,EAAE,IAAI;aACjB;YACD,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC;SACnD,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;0CA5DY,+BAA+B;IAD3C,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IACnC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,8CAA8C,CAAC,CAAA;qDAC5C,+FAA8C;GAV/D,+BAA+B,CA4D3C"}
|
package/dist/output-gateway/pid/data-access/RopidDeparturesPresetsRopidGTFSStopsRepository.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RopidDeparturesPresetsRopidGTFSStopsModel } from "../../../schema-definitions/jis/models/RopidDeparturesPresetsRopidGTFSStopsModel";
|
|
2
|
+
import { ILogger } from "@golemio/core/dist/helpers";
|
|
3
|
+
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
4
|
+
import { AbstractValidatableRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository";
|
|
5
|
+
import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator";
|
|
6
|
+
import { ModelStatic } from "@golemio/core/dist/shared/sequelize";
|
|
7
|
+
export declare class RopidDeparturesPresetsRopidGTFSStopsRepository extends AbstractValidatableRepository {
|
|
8
|
+
validator: JSONSchemaValidator;
|
|
9
|
+
schema: string;
|
|
10
|
+
tableName: string;
|
|
11
|
+
sequelizeModel: ModelStatic<RopidDeparturesPresetsRopidGTFSStopsModel>;
|
|
12
|
+
constructor(connector: IDatabaseConnector, logger: ILogger);
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RopidDeparturesPresetsRopidGTFSStopsRepository = void 0;
|
|
16
|
+
const const_1 = require("../../../schema-definitions/const");
|
|
17
|
+
const RopidDeparturesPresetsRopidGTFSStopsModel_1 = require("../../../schema-definitions/jis/models/RopidDeparturesPresetsRopidGTFSStopsModel");
|
|
18
|
+
const AbstractValidatableRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository");
|
|
19
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
20
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
21
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
22
|
+
let RopidDeparturesPresetsRopidGTFSStopsRepository = exports.RopidDeparturesPresetsRopidGTFSStopsRepository = class RopidDeparturesPresetsRopidGTFSStopsRepository extends AbstractValidatableRepository_1.AbstractValidatableRepository {
|
|
23
|
+
constructor(connector, logger) {
|
|
24
|
+
super(connector, logger);
|
|
25
|
+
this.schema = const_1.PG_SCHEMA;
|
|
26
|
+
this.tableName = RopidDeparturesPresetsRopidGTFSStopsModel_1.RopidDeparturesPresetsRopidGTFSStopsModel.tableName;
|
|
27
|
+
this.validator = new golemio_validator_1.JSONSchemaValidator("RopidDeparturesPresetsRopidGTFSStopsRepository", RopidDeparturesPresetsRopidGTFSStopsModel_1.RopidDeparturesPresetsRopidGTFSStopsModel.jsonSchema);
|
|
28
|
+
this.sequelizeModel = connector
|
|
29
|
+
.getConnection()
|
|
30
|
+
.define(this.tableName, RopidDeparturesPresetsRopidGTFSStopsModel_1.RopidDeparturesPresetsRopidGTFSStopsModel.attributeModel, { schema: this.schema });
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.RopidDeparturesPresetsRopidGTFSStopsRepository = RopidDeparturesPresetsRopidGTFSStopsRepository = __decorate([
|
|
34
|
+
(0, tsyringe_1.injectable)(),
|
|
35
|
+
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
36
|
+
__param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
37
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
38
|
+
], RopidDeparturesPresetsRopidGTFSStopsRepository);
|
|
39
|
+
//# sourceMappingURL=RopidDeparturesPresetsRopidGTFSStopsRepository.js.map
|
package/dist/output-gateway/pid/data-access/RopidDeparturesPresetsRopidGTFSStopsRepository.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RopidDeparturesPresetsRopidGTFSStopsRepository.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/data-access/RopidDeparturesPresetsRopidGTFSStopsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,gJAAsH;AAGtH,8IAA2I;AAC3I,wEAAqE;AACrE,mFAAkF;AAElF,iEAAwE;AAGjE,IAAM,8CAA8C,4DAApD,MAAM,8CAA+C,SAAQ,6DAA6B;IAM7F,YAAiD,SAA6B,EAA4B,MAAe;QACrH,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALtB,WAAM,GAAG,iBAAS,CAAC;QACnB,cAAS,GAAG,qFAAyC,CAAC,SAAS,CAAC;QAKnE,IAAI,CAAC,SAAS,GAAG,IAAI,uCAAmB,CACpC,gDAAgD,EAChD,qFAAyC,CAAC,UAAU,CACvD,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,SAAS;aAC1B,aAAa,EAAE;aACf,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,qFAAyC,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACnH,CAAC;CACJ,CAAA;yDAhBY,8CAA8C;IAD1D,IAAA,qBAAU,GAAE;IAOI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IAAiC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GANhG,8CAA8C,CAgB1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeparturesPresetInterfaces.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/domain/DeparturesPresetInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -19,6 +19,12 @@ const JISInfotextOverviewTransformation_1 = require("../service/transformations/
|
|
|
19
19
|
const JISInfotextTransferTransformation_1 = require("../service/transformations/JISInfotextTransferTransformation");
|
|
20
20
|
const TransferDepartureTransformation_1 = require("../service/transformations/TransferDepartureTransformation");
|
|
21
21
|
const OgPidToken_1 = require("./OgPidToken");
|
|
22
|
+
const RopidDeparturesPresetFacade_1 = require("../service/facade/RopidDeparturesPresetFacade");
|
|
23
|
+
const V3DeparturesPresetController_1 = require("../controllers/v3/V3DeparturesPresetController");
|
|
24
|
+
const RopidDeparturesPresetRepository_1 = require("../data-access/RopidDeparturesPresetRepository");
|
|
25
|
+
const RopidDeparturesPresetsRopidGTFSStopsRepository_1 = require("../data-access/RopidDeparturesPresetsRopidGTFSStopsRepository");
|
|
26
|
+
const RopidDeparturesPresetTransformation_1 = require("../service/transformations/RopidDeparturesPresetTransformation");
|
|
27
|
+
const GtfsStopParser_1 = require("../../../helpers/GtfsStopParser");
|
|
22
28
|
const ogPidContainer = ioc_1.OutputGatewayContainer.createChildContainer();
|
|
23
29
|
exports.OgPidContainer = ogPidContainer;
|
|
24
30
|
//#region Repositories
|
|
@@ -29,22 +35,28 @@ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextRepository,
|
|
|
29
35
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.DeparturesRepository, data_access_1.DeparturesRepository);
|
|
30
36
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RunTripsRedisRepository, RunTripsRedisRepository_1.RunTripsRedisRepository);
|
|
31
37
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.PublicVehiclePositionsRepository, PublicVehiclePositionsRepository_1.PublicVehiclePositionsRepository);
|
|
38
|
+
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetRepository, RopidDeparturesPresetRepository_1.RopidDeparturesPresetRepository);
|
|
39
|
+
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetsRopidGTFSStopsRepository, RopidDeparturesPresetsRopidGTFSStopsRepository_1.RopidDeparturesPresetsRopidGTFSStopsRepository);
|
|
32
40
|
//#endregion
|
|
33
41
|
//#region Transformations
|
|
34
42
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextDepartureTransformation, JISInfotextDepartureTransformation_1.JISInfotextDepartureTransformation);
|
|
35
43
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextTransferTransformation, JISInfotextTransferTransformation_1.JISInfotextTransferTransformation);
|
|
36
44
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextOverviewTransformation, JISInfotextOverviewTransformation_1.JISInfotextOverviewTransformation);
|
|
37
45
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.TransferDepartureTransformation, TransferDepartureTransformation_1.TransferDepartureTransformation);
|
|
46
|
+
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetTransformation, RopidDeparturesPresetTransformation_1.RopidDeparturesPresetTransformation);
|
|
38
47
|
//#endregion
|
|
39
48
|
//#region Facade
|
|
40
49
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.StopFacade, StopFacade_1.StopFacade);
|
|
41
50
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.InfotextFacade, InfotextFacade_1.InfotextFacade);
|
|
42
51
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.TransferFacade, TransferFacade_1.TransferFacade);
|
|
52
|
+
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetFacade, RopidDeparturesPresetFacade_1.RopidDeparturesPresetFacade);
|
|
43
53
|
//#endregion
|
|
44
54
|
//#region Controllers
|
|
45
55
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V3TransferBoardsController, V3TransferBoardsController_1.V3TransferBoardsController);
|
|
46
56
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V3InfotextsController, V3InfotextsController_1.V3InfotextsController);
|
|
57
|
+
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V3RopidDeparturesPresetController, V3DeparturesPresetController_1.V3RopidDeparturesPresetController);
|
|
47
58
|
//#endregion
|
|
48
59
|
//#region Helpers
|
|
49
60
|
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextStopSuppressionFilter, JISInfotextStopSuppressionFilter_1.JISInfotextStopSuppressionFilter);
|
|
61
|
+
ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.GtfsStopParser, GtfsStopParser_1.GtfsStopParser);
|
|
50
62
|
//# sourceMappingURL=Di.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,sHAAiH;AACjH,gGAA2F;AAC3F,wGAAmG;AACnG,+DAA+E;AAE/E,mFAAgF;AAChF,6FAA0F;AAC1F,gDAAsD;AACtD,gFAA6E;AAC7E,4GAAyG;AACzG,kGAA+F;AAC/F,qEAAkE;AAClE,6DAA0D;AAC1D,qEAAkE;AAClE,sHAAmH;AACnH,oHAAiH;AACjH,oHAAiH;AACjH,gHAA6G;AAC7G,6CAA0C;
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,sHAAiH;AACjH,gGAA2F;AAC3F,wGAAmG;AACnG,+DAA+E;AAE/E,mFAAgF;AAChF,6FAA0F;AAC1F,gDAAsD;AACtD,gFAA6E;AAC7E,4GAAyG;AACzG,kGAA+F;AAC/F,qEAAkE;AAClE,6DAA0D;AAC1D,qEAAkE;AAClE,sHAAmH;AACnH,oHAAiH;AACjH,oHAAiH;AACjH,gHAA6G;AAC7G,6CAA0C;AAC1C,+FAA4F;AAC5F,iGAAmG;AACnG,oGAAiG;AACjG,kIAA+H;AAC/H,wHAAqH;AACrH,oEAAyD;AAEzD,MAAM,cAAc,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AA2C/D,wCAAc;AAzCzC,sBAAsB;AACtB,cAAc,CAAC,iBAAiB,CAAC,uBA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ACpE,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,cAAc,EAAE,+BAAc,CAAC,CAAC;AAC5E,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,cAAc,EAAE,+BAAc,CAAC,CAAC;AAC5E,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,2BAA2B,EAAE,yDAA2B,CAAC,CAAC;AACtG,YAAY;AAEZ,qBAAqB;AACrB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,0BAA0B,EAAE,uDAA0B,CAAC,CAAC;AACpG,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,qBAAqB,EAAE,6CAAqB,CAAC,CAAC;AAC1F,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,iCAAiC,EAAE,gEAAiC,CAAC,CAAC;AAClH,YAAY;AAEZ,iBAAiB;AACjB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,gCAAgC,EAAE,mEAAgC,CAAC,CAAC;AAChH,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,cAAc,EAAE,+BAAc,CAAC,CAAC"}
|
|
@@ -5,14 +5,20 @@ export declare const OgPidToken: {
|
|
|
5
5
|
DeparturesRepository: symbol;
|
|
6
6
|
RunTripsRedisRepository: symbol;
|
|
7
7
|
PublicVehiclePositionsRepository: symbol;
|
|
8
|
+
RopidDeparturesPresetRepository: symbol;
|
|
9
|
+
RopidDeparturesPresetsRopidGTFSStopsRepository: symbol;
|
|
8
10
|
JISInfotextDepartureTransformation: symbol;
|
|
9
11
|
JISInfotextTransferTransformation: symbol;
|
|
10
12
|
JISInfotextOverviewTransformation: symbol;
|
|
11
13
|
TransferDepartureTransformation: symbol;
|
|
14
|
+
RopidDeparturesPresetTransformation: symbol;
|
|
12
15
|
StopFacade: symbol;
|
|
13
16
|
InfotextFacade: symbol;
|
|
14
17
|
TransferFacade: symbol;
|
|
18
|
+
RopidDeparturesPresetFacade: symbol;
|
|
15
19
|
V3TransferBoardsController: symbol;
|
|
16
20
|
V3InfotextsController: symbol;
|
|
21
|
+
V3RopidDeparturesPresetController: symbol;
|
|
17
22
|
JISInfotextStopSuppressionFilter: symbol;
|
|
23
|
+
GtfsStopParser: symbol;
|
|
18
24
|
};
|
|
@@ -9,24 +9,30 @@ exports.OgPidToken = {
|
|
|
9
9
|
DeparturesRepository: Symbol(),
|
|
10
10
|
RunTripsRedisRepository: Symbol(),
|
|
11
11
|
PublicVehiclePositionsRepository: Symbol(),
|
|
12
|
+
RopidDeparturesPresetRepository: Symbol(),
|
|
13
|
+
RopidDeparturesPresetsRopidGTFSStopsRepository: Symbol(),
|
|
12
14
|
//#endregion
|
|
13
15
|
//#region Transformations
|
|
14
16
|
JISInfotextDepartureTransformation: Symbol(),
|
|
15
17
|
JISInfotextTransferTransformation: Symbol(),
|
|
16
18
|
JISInfotextOverviewTransformation: Symbol(),
|
|
17
19
|
TransferDepartureTransformation: Symbol(),
|
|
20
|
+
RopidDeparturesPresetTransformation: Symbol(),
|
|
18
21
|
//#endregion
|
|
19
22
|
//#region Facade
|
|
20
23
|
StopFacade: Symbol(),
|
|
21
24
|
InfotextFacade: Symbol(),
|
|
22
25
|
TransferFacade: Symbol(),
|
|
26
|
+
RopidDeparturesPresetFacade: Symbol(),
|
|
23
27
|
//#endregion
|
|
24
28
|
//#region Controllers
|
|
25
29
|
V3TransferBoardsController: Symbol(),
|
|
26
30
|
V3InfotextsController: Symbol(),
|
|
31
|
+
V3RopidDeparturesPresetController: Symbol(),
|
|
27
32
|
//#endregion
|
|
28
33
|
//#region Helpers
|
|
29
34
|
JISInfotextStopSuppressionFilter: Symbol(),
|
|
35
|
+
GtfsStopParser: Symbol(),
|
|
30
36
|
//#endregion
|
|
31
37
|
};
|
|
32
38
|
//# sourceMappingURL=OgPidToken.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OgPidToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/OgPidToken.ts"],"names":[],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M,EAAE;IAC3C,+BAA+B,EAAE,MAAM,EAAE;IACzC,mCAAmC,EAAE,MAAM,EAAE;IAC7C,YAAY;IAEZ,gBAAgB;IAChB,UAAU,EAAE,MAAM,EAAE;IACpB,cAAc,EAAE,MAAM,EAAE;IACxB,cAAc,EAAE,MAAM,EAAE;IACxB,2BAA2B,EAAE,MAAM,EAAE;IACrC,YAAY;IAEZ,qBAAqB;IACrB,0BAA0B,EAAE,MAAM,EAAE;IACpC,qBAAqB,EAAE,MAAM,EAAE;IAC/B,iCAAiC,EAAE,MAAM,EAAE;IAC3C,YAAY;IAEZ,iBAAiB;IACjB,gCAAgC,EAAE,MAAM,EAAE;IAC1C,cAAc,EAAE,MAAM,EAAE;IACxB,YAAY;CACf,CAAC"}
|
|
@@ -4,6 +4,7 @@ export declare class V3PIDRouter extends AbstractRouter {
|
|
|
4
4
|
private readonly cacheHeaderMiddleware;
|
|
5
5
|
private readonly transferBoardsController;
|
|
6
6
|
private readonly infotextsController;
|
|
7
|
+
private readonly ropidDeparturesPresetController;
|
|
7
8
|
constructor();
|
|
8
9
|
protected initRoutes: () => void;
|
|
9
10
|
private registerInfotextsRoutes;
|
|
@@ -29,10 +29,14 @@ class V3PIDRouter extends AbstractRouter_1.AbstractRouter {
|
|
|
29
29
|
this.router.get("/infotexts", Validation_1.checkErrors,
|
|
30
30
|
// max-age 10 seconds, stale-while-revalidate 10 seconds
|
|
31
31
|
this.cacheHeaderMiddleware.getMiddleware(10, 10), this.infotextsController.getJisInfotexts);
|
|
32
|
+
this.router.get("/departurepresets", Validation_1.checkErrors,
|
|
33
|
+
// max-age 10 seconds, stale-while-revalidate 10 seconds
|
|
34
|
+
this.cacheHeaderMiddleware.getMiddleware(10, 10), this.ropidDeparturesPresetController.getDeparturesPresets);
|
|
32
35
|
};
|
|
33
36
|
this.cacheHeaderMiddleware = Di_1.OgPidContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
34
37
|
this.transferBoardsController = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.V3TransferBoardsController);
|
|
35
38
|
this.infotextsController = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.V3InfotextsController);
|
|
39
|
+
this.ropidDeparturesPresetController = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.V3RopidDeparturesPresetController);
|
|
36
40
|
this.initRoutes();
|
|
37
41
|
}
|
|
38
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V3PIDRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/routers/v3/V3PIDRouter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"V3PIDRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/routers/v3/V3PIDRouter.ts"],"names":[],"mappings":";;;AAGA,+EAA8E;AAC9E,qCAAgD;AAChD,qDAAoD;AACpD,yDAAoD;AACpD,sFAAmF;AAEnF,6EAA2E;AAC3E,+DAAuE;AACvE,+DAA2D;AAC3D,mFAAoE;AACpE,6CAAmD;AAEnD,MAAa,WAAY,SAAQ,+BAAc;IAO3C;QACI,KAAK,CAAC,wBAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAPlB,WAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QAiBxB,eAAU,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACnC,CAAC,CAAC;QAEM,4BAAuB,GAAG,GAAG,EAAE;YACnC,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,iBAAiB,EACjB;gBACI,IAAA,yBAAK,EAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,kBAAU,EAAE,GAAG,EAAE,kBAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;gBACnF,IAAA,yBAAK,EAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG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;AAED,MAAM,WAAW,GAAmB,IAAI,WAAW,EAAE,CAAC;AAC7C,kCAAW"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RopidDeparturesPresetRepository } from "../../data-access/RopidDeparturesPresetRepository";
|
|
2
|
+
import { RopidDeparturesPresetTransformation } from "../transformations/RopidDeparturesPresetTransformation";
|
|
3
|
+
import { IDeparturesPresetOutputDto } from "../../domain/DeparturesPresetInterfaces";
|
|
4
|
+
export declare class RopidDeparturesPresetFacade {
|
|
5
|
+
private ropidDeparturesPresetRepository;
|
|
6
|
+
private ropidDeparturesPresetTransformation;
|
|
7
|
+
constructor(ropidDeparturesPresetRepository: RopidDeparturesPresetRepository, ropidDeparturesPresetTransformation: RopidDeparturesPresetTransformation);
|
|
8
|
+
getRopidDeparturesPreset(): Promise<IDeparturesPresetOutputDto[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RopidDeparturesPresetFacade = void 0;
|
|
16
|
+
const RopidDeparturesPresetRepository_1 = require("../../data-access/RopidDeparturesPresetRepository");
|
|
17
|
+
const OgPidToken_1 = require("../../ioc/OgPidToken");
|
|
18
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
19
|
+
const RopidDeparturesPresetTransformation_1 = require("../transformations/RopidDeparturesPresetTransformation");
|
|
20
|
+
let RopidDeparturesPresetFacade = exports.RopidDeparturesPresetFacade = class RopidDeparturesPresetFacade {
|
|
21
|
+
constructor(ropidDeparturesPresetRepository, ropidDeparturesPresetTransformation) {
|
|
22
|
+
this.ropidDeparturesPresetRepository = ropidDeparturesPresetRepository;
|
|
23
|
+
this.ropidDeparturesPresetTransformation = ropidDeparturesPresetTransformation;
|
|
24
|
+
}
|
|
25
|
+
async getRopidDeparturesPreset() {
|
|
26
|
+
const presets = await this.ropidDeparturesPresetRepository.getAllWithStops();
|
|
27
|
+
return this.ropidDeparturesPresetTransformation.transformArray(presets);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.RopidDeparturesPresetFacade = RopidDeparturesPresetFacade = __decorate([
|
|
31
|
+
(0, tsyringe_1.injectable)(),
|
|
32
|
+
__param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.RopidDeparturesPresetRepository)),
|
|
33
|
+
__param(1, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.RopidDeparturesPresetTransformation)),
|
|
34
|
+
__metadata("design:paramtypes", [RopidDeparturesPresetRepository_1.RopidDeparturesPresetRepository,
|
|
35
|
+
RopidDeparturesPresetTransformation_1.RopidDeparturesPresetTransformation])
|
|
36
|
+
], RopidDeparturesPresetFacade);
|
|
37
|
+
//# sourceMappingURL=RopidDeparturesPresetFacade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RopidDeparturesPresetFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/RopidDeparturesPresetFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uGAAsG;AACtG,qDAAoD;AACpD,iEAAwE;AACxE,gHAA6G;AAItG,IAAM,2BAA2B,yCAAjC,MAAM,2BAA2B;IACpC,YAEY,+BAAgE,EAEhE,mCAAwE;QAFxE,oCAA+B,GAA/B,+BAA+B,CAAiC;QAEhE,wCAAmC,GAAnC,mCAAmC,CAAqC;IACjF,CAAC;IAEJ,KAAK,CAAC,wBAAwB;QAC1B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,+BAA+B,CAAC,eAAe,EAAE,CAAC;QAE7E,OAAO,IAAI,CAAC,mCAAmC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5E,CAAC;CACJ,CAAA;sCAbY,2BAA2B;IADvC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,+BAA+B,CAAC,CAAA;IAElD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,mCAAmC,CAAC,CAAA;qCADd,iEAA+B;QAE3B,yEAAmC;GAL3E,2BAA2B,CAavC"}
|
package/dist/output-gateway/pid/service/transformations/RopidDeparturesPresetTransformation.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
2
|
+
import { IDeparturesPresetOutputDto } from "../../domain/DeparturesPresetInterfaces";
|
|
3
|
+
import { RopidDeparturesPresetsModel } from "../../../../schema-definitions/ropid-departures-presets/models/RopidDeparturesPresetsModel";
|
|
4
|
+
export declare class RopidDeparturesPresetTransformation extends AbstractTransformation<RopidDeparturesPresetsModel, IDeparturesPresetOutputDto> {
|
|
5
|
+
name: string;
|
|
6
|
+
protected transformInternal: (preset: RopidDeparturesPresetsModel) => IDeparturesPresetOutputDto;
|
|
7
|
+
}
|
package/dist/output-gateway/pid/service/transformations/RopidDeparturesPresetTransformation.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.RopidDeparturesPresetTransformation = void 0;
|
|
10
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
11
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
12
|
+
let RopidDeparturesPresetTransformation = exports.RopidDeparturesPresetTransformation = class RopidDeparturesPresetTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.name = "RopidDeparturesPresetTransformation";
|
|
16
|
+
this.transformInternal = (preset) => {
|
|
17
|
+
const stops = preset.stops ?? [];
|
|
18
|
+
return {
|
|
19
|
+
note: preset.note,
|
|
20
|
+
route_name: preset.route_name,
|
|
21
|
+
is_testing: preset.is_testing,
|
|
22
|
+
stops: stops.map(({ stop_id }) => stop_id),
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.RopidDeparturesPresetTransformation = RopidDeparturesPresetTransformation = __decorate([
|
|
28
|
+
(0, tsyringe_1.injectable)()
|
|
29
|
+
], RopidDeparturesPresetTransformation);
|
|
30
|
+
//# sourceMappingURL=RopidDeparturesPresetTransformation.js.map
|
package/dist/output-gateway/pid/service/transformations/RopidDeparturesPresetTransformation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RopidDeparturesPresetTransformation.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/transformations/RopidDeparturesPresetTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6GAA0G;AAC1G,iEAAgE;AAKzD,IAAM,mCAAmC,iDAAzC,MAAM,mCAAoC,SAAQ,+CAGxD;IAHM;;QAII,SAAI,GAAG,qCAAqC,CAAC;QAE1C,sBAAiB,GAAG,CAAC,MAAmC,EAA8B,EAAE;YAC9F,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;YACjC,OAAO;gBACH,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC;aAC7C,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;8CAfY,mCAAmC;IAD/C,IAAA,qBAAU,GAAE;GACA,mCAAmC,CAe/C"}
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js
CHANGED
|
@@ -33,7 +33,8 @@ let StopTimesTripScopeHandler = exports.StopTimesTripScopeHandler = class StopTi
|
|
|
33
33
|
throw new golemio_errors_1.GeneralError("delay_computation_cache_not_found", this.constructor.name, undefined, 500);
|
|
34
34
|
}
|
|
35
35
|
const filteredStopTimes = this.filterNoStopWaypoints(delayComputationCache.stop_times);
|
|
36
|
-
const
|
|
36
|
+
const vpAndFilteredStopTimes = filteredStopTimes.map((stopTime) => ({ stopTime, vehiclePosition }));
|
|
37
|
+
const stopTimes = this.tripStopTimesTransformation.transformArray(vpAndFilteredStopTimes);
|
|
37
38
|
const stopTimesWithDelay = await this.stopTimeRepository.getPublicStopTimeCache(vehiclePosition.vehicle_id, vehiclePosition.gtfs_trip_id);
|
|
38
39
|
if (stopTimesWithDelay.length > 0) {
|
|
39
40
|
let prevStopArrivalTime = null;
|
|
@@ -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;AAGpI,+DAAsF;AAEtF,6EAAwE;AACxE,2DAA2D;AAC3D,iEAAwE;AACxE,yFAAsF;AAG/E,IAAM,yBAAyB,uCAA/B,MAAM,yBAA0B,SAAQ,mEAAgC;IAG3E,YAC8D,0BAAuD,EACzD,kBAAuC;QAE/F,KAAK,EAAE,CAAC;QAHkD,+BAA0B,GAA1B,0BAA0B,CAA6B;QACzD,uBAAkB,GAAlB,kBAAkB,CAAqB;QAG/F,IAAI,CAAC,2BAA2B,GAAG,IAAI,yEAAmC,EAAE,CAAC;IACjF,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,MAA8B,EAAE,eAAmC;QACnF,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,wBAAwB,CACxF,eAAe,CAAC,YAAY,CAC/B,CAAC;QAEF,IAAI,CAAC,qBAAqB,EAAE;YACxB,MAAM,IAAI,6BAAY,CAAC,mCAAmC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;SACtG;QAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;QACvF,MAAM,SAAS,GAAG,IAAI,CAAC,2BAA2B,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"StopTimesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.ts"],"names":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C,CAAC,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;iBACjH;aACJ;SACJ;QAED,MAAM,CAAC,UAAU,GAAG,IAAA,mCAA6B,EAAC,SAAS,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,qBAAqB,CAAC,SAAsB;QAChD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAmB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACpF,CAAC;IAEO,sBAAsB,CAC1B,SAAmB,EACnB,WAAqB,EACrB,WAAqB,EACrB,aAAuB;QAEvB,MAAM,WAAW,GAA2E;YACxF,cAAc,EAAE,SAAS;YACzB,gBAAgB,EAAE,WAAW;SAChC,CAAC;QACF,IAAI,SAAS,GAAG,WAAW,IAAI,aAAa,GAAG,WAAW,IAAI,WAAW,GAAG,WAAW,EAAE;YACrF,WAAW,CAAC,gBAAgB,GAAG,IAAI,CAAC;SACvC;QACD,IAAI,aAAa,GAAG,SAAS,IAAI,WAAW,GAAG,SAAS,EAAE;YACtD,WAAW,CAAC,cAAc,GAAG,IAAI,CAAC;SACrC;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ,CAAA;oCAhGY,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,CAgGrC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { IStopTime } from "../../../../../schema-definitions/ropid-gtfs/redis/interfaces/IDelayComputationDto";
|
|
2
|
+
import { IPublicApiCacheDto } from "../../../../../schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto";
|
|
2
3
|
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
3
4
|
import { IGeoJSONFeature } from "@golemio/core/dist/output-gateway";
|
|
4
|
-
|
|
5
|
+
type TransformIn = {
|
|
6
|
+
stopTime: IStopTime;
|
|
7
|
+
vehiclePosition: IPublicApiCacheDto;
|
|
8
|
+
};
|
|
9
|
+
export declare class PublicVPTripStopTimesTransformation extends AbstractTransformation<TransformIn, IGeoJSONFeature> {
|
|
5
10
|
name: string;
|
|
6
|
-
protected transformInternal: ({
|
|
11
|
+
protected transformInternal: ({ stopTime, vehiclePosition }: TransformIn) => IGeoJSONFeature;
|
|
7
12
|
private isStopWheelchairAccessible;
|
|
8
13
|
}
|
|
14
|
+
export {};
|
|
@@ -9,15 +9,16 @@ class PublicVPTripStopTimesTransformation extends AbstractTransformation_1.Abstr
|
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.name = "TripStopTimesTransformation";
|
|
12
|
-
this.transformInternal = ({
|
|
12
|
+
this.transformInternal = ({ stopTime, vehiclePosition }) => {
|
|
13
|
+
const { stop } = stopTime;
|
|
13
14
|
const properties = {
|
|
14
15
|
stop_name: stop.stop_name,
|
|
15
16
|
stop_sequence: stopTime.stop_sequence,
|
|
16
17
|
zone_id: stop.zone_id,
|
|
17
18
|
is_wheelchair_accessible: this.isStopWheelchairAccessible(stop),
|
|
18
19
|
shape_dist_traveled: stopTime.shape_dist_traveled,
|
|
19
|
-
arrival_time: DateTimeUtils_1.DateTimeUtils.formatStopTime(DateTimeUtils_1.DateTimeUtils.
|
|
20
|
-
departure_time: DateTimeUtils_1.DateTimeUtils.formatStopTime(DateTimeUtils_1.DateTimeUtils.
|
|
20
|
+
arrival_time: DateTimeUtils_1.DateTimeUtils.formatStopTime(DateTimeUtils_1.DateTimeUtils.getStopDateTimeForTripOrigin(stopTime.arrival_time_seconds, vehiclePosition.detailed_info.origin_timestamp)),
|
|
21
|
+
departure_time: DateTimeUtils_1.DateTimeUtils.formatStopTime(DateTimeUtils_1.DateTimeUtils.getStopDateTimeForTripOrigin(stopTime.departure_time_seconds, vehiclePosition.detailed_info.origin_timestamp)),
|
|
21
22
|
realtime_arrival_time: null,
|
|
22
23
|
realtime_departure_time: null,
|
|
23
24
|
lng: stop.stop_lon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicVPTripStopTimesTransformation.js","sourceRoot":"","sources":["../../../../../../src/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.ts"],"names":[],"mappings":";;;AAAA,kFAA6E;AAC7E,wEAAuD;
|
|
1
|
+
{"version":3,"file":"PublicVPTripStopTimesTransformation.js","sourceRoot":"","sources":["../../../../../../src/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.ts"],"names":[],"mappings":";;;AAAA,kFAA6E;AAC7E,wEAAuD;AAIvD,6GAA0G;AAC1G,sEAAyF;AAOzF,MAAa,mCAAoC,SAAQ,+CAAoD;IAA7G;;QACW,SAAI,GAAG,6BAA6B,CAAC;QAElC,sBAAiB,GAAG,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAe,EAAE,EAAE;YACzE,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;YAC1B,MAAM,UAAU,GAA6E;gBACzF,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,aAAa,EAAE,QAAQ,CAAC,aAAa;gBACrC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,wBAAwB,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC;gBAC/D,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB;gBACjD,YAAY,EAAE,6BAAa,CAAC,cAAc,CACtC,6BAAa,CAAC,4BAA4B,CACtC,QAAQ,CAAC,oBAAoB,EAC7B,eAAe,CAAC,aAAa,CAAC,gBAAgB,CACjD,CACJ;gBACD,cAAc,EAAE,6BAAa,CAAC,cAAc,CACxC,6BAAa,CAAC,4BAA4B,CACtC,QAAQ,CAAC,sBAAsB,EAC/B,eAAe,CAAC,aAAa,CAAC,gBAAgB,CACjD,CACJ;gBACD,qBAAqB,EAAE,IAAI;gBAC3B,uBAAuB,EAAE,IAAI;gBAC7B,GAAG,EAAE,IAAI,CAAC,QAAQ;gBAClB,GAAG,EAAE,IAAI,CAAC,QAAQ;aACrB,CAAC;YAEF,OAAO,IAAA,oCAAmB,EAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAC/D,CAAC,CAAC;QAEM,+BAA0B,GAAG,CAAC,EAAE,mBAAmB,EAAS,EAAkB,EAAE;YACpF,IAAI,mBAAmB,KAAK,IAAI,IAAI,mBAAmB,KAAK,mDAA8B,CAAC,aAAa,EAAE;gBACtG,OAAO,IAAI,CAAC;aACf;YAED,OAAO,mBAAmB,KAAK,mDAA8B,CAAC,iBAAiB,CAAC;QACpF,CAAC,CAAC;IACN,CAAC;CAAA;AAvCD,kFAuCC"}
|
|
@@ -4,6 +4,7 @@ import { GetAllOptions, IGTFSStopGetAllOutput } from "./GTFSStopModelInterfaces"
|
|
|
4
4
|
export declare class GTFSStopModel extends SequelizeModel {
|
|
5
5
|
private readonly outputAttributes;
|
|
6
6
|
private cisStopsModel;
|
|
7
|
+
private gtfsStopParser;
|
|
7
8
|
constructor();
|
|
8
9
|
Associate: () => void;
|
|
9
10
|
/**
|
|
@@ -18,9 +19,6 @@ export declare class GTFSStopModel extends SequelizeModel {
|
|
|
18
19
|
* Retrieve specific gtfs stop
|
|
19
20
|
*/
|
|
20
21
|
GetOne: (id: string) => Promise<IGeoJSONFeature | null>;
|
|
21
|
-
private isValidInteger;
|
|
22
|
-
private validateAswId;
|
|
23
|
-
private prepareAswWhereOptions;
|
|
24
22
|
private prepareCisStops;
|
|
25
23
|
private prepareFindOptionsForMetro;
|
|
26
24
|
}
|
|
@@ -14,7 +14,8 @@ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
|
14
14
|
const models_1 = require("@golemio/core/dist/output-gateway/models");
|
|
15
15
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
16
16
|
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
17
|
-
const
|
|
17
|
+
const OgPidToken_1 = require("../../pid/ioc/OgPidToken");
|
|
18
|
+
const Di_1 = require("../../pid/ioc/Di");
|
|
18
19
|
class GTFSStopModel extends models_1.SequelizeModel {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(ropid_gtfs_1.RopidGTFS.stops.name, ropid_gtfs_1.RopidGTFS.stops.pgTableName, StopDto_1.StopDto.attributeModel, {
|
|
@@ -73,6 +74,7 @@ class GTFSStopModel extends models_1.SequelizeModel {
|
|
|
73
74
|
return stops;
|
|
74
75
|
};
|
|
75
76
|
const connector = ioc_1.OutputGatewayContainer.resolve(CoreToken_1.CoreToken.PostgresConnector);
|
|
77
|
+
this.gtfsStopParser = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.GtfsStopParser);
|
|
76
78
|
this.outputAttributes = Object.keys(StopDto_1.StopDto.attributeModel);
|
|
77
79
|
const notUsedColumns = [
|
|
78
80
|
"stop_code",
|
|
@@ -99,7 +101,7 @@ class GTFSStopModel extends models_1.SequelizeModel {
|
|
|
99
101
|
let where = {};
|
|
100
102
|
let allGtfsIds = [];
|
|
101
103
|
if (options.aswIds && options.aswIds.length > 0) {
|
|
102
|
-
where[sequelize_1.default.Op.or] = this.prepareAswWhereOptions(options.aswIds);
|
|
104
|
+
where[sequelize_1.default.Op.or] = this.gtfsStopParser.prepareAswWhereOptions(options.aswIds);
|
|
103
105
|
}
|
|
104
106
|
if (options.cisIds && options.cisIds.length > 0) {
|
|
105
107
|
let stops;
|
|
@@ -182,34 +184,6 @@ class GTFSStopModel extends models_1.SequelizeModel {
|
|
|
182
184
|
}
|
|
183
185
|
return options.returnRaw ? data : (0, Geo_1.buildGeojsonFeatureCollection)(data, "stop_lon", "stop_lat", true);
|
|
184
186
|
}
|
|
185
|
-
isValidInteger(value) {
|
|
186
|
-
if (value === null)
|
|
187
|
-
return true;
|
|
188
|
-
return value >= const_2.PG_INT_MIN && value <= const_2.PG_INT_MAX;
|
|
189
|
-
}
|
|
190
|
-
validateAswId(aswId, nodeId, stopId) {
|
|
191
|
-
const nodeIdNum = Number(nodeId);
|
|
192
|
-
const stopIdNum = stopId ? Number(stopId) : null;
|
|
193
|
-
if (!this.isValidInteger(nodeIdNum) || !this.isValidInteger(stopIdNum)) {
|
|
194
|
-
throw new golemio_errors_1.GeneralError(`Invalid ASW ID: ${aswId}`, this.constructor.name, `Invalid ASW ID: ${aswId}`, 400);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
prepareAswWhereOptions(aswIds) {
|
|
198
|
-
let aswWhereOptions = [];
|
|
199
|
-
for (const aswId of aswIds) {
|
|
200
|
-
let aswIdLike = aswId.replaceAll("_", "/");
|
|
201
|
-
if (aswIdLike.slice(-1) === "/") {
|
|
202
|
-
aswIdLike = aswIdLike.slice(0, -1);
|
|
203
|
-
}
|
|
204
|
-
const [nodeId, stopId] = aswIdLike.split("/");
|
|
205
|
-
if (!nodeId) {
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
this.validateAswId(aswId, nodeId, stopId);
|
|
209
|
-
aswWhereOptions.push(sequelize_1.default.and(sequelize_1.default.where(sequelize_1.default.col("asw_node_id"), "=", nodeId), stopId && sequelize_1.default.where(sequelize_1.default.col("asw_stop_id"), "=", stopId)));
|
|
210
|
-
}
|
|
211
|
-
return aswWhereOptions;
|
|
212
|
-
}
|
|
213
187
|
prepareFindOptionsForMetro(innerWhere) {
|
|
214
188
|
// Select metro and train stops within a node
|
|
215
189
|
// matching the previous where criteria
|