@golemio/pid 5.10.0 → 5.10.1-dev.2503887487
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/migrations/postgresql/20260504000000-add-off-track-to-future-stop-times.js +53 -0
- package/db/migrations/postgresql/sqls/20260504000000-add-off-track-to-future-stop-times-down.sql +92 -0
- package/db/migrations/postgresql/sqls/20260504000000-add-off-track-to-future-stop-times-up.sql +97 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsPresetsRepository.d.ts +10 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsPresetsRepository.js +16 -6
- package/dist/integration-engine/jis/repositories/JISInfotextsPresetsRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +3 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +15 -2
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.d.ts +6 -15
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js +12 -20
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map +1 -1
- package/dist/integration-engine/jis/services/JISInfotextsDataService.d.ts +2 -5
- package/dist/integration-engine/jis/services/JISInfotextsDataService.js +2 -5
- package/dist/integration-engine/jis/services/JISInfotextsDataService.js.map +1 -1
- package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js +2 -2
- package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +5 -2
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +7 -5
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +1 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RemapPresetsToGtfsStopsTask.d.ts +9 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RemapPresetsToGtfsStopsTask.js +38 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RemapPresetsToGtfsStopsTask.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +1 -0
- 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/helpers/BasePositionsManager.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/BasePositionsManager.js.map +1 -1
- package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.js +2 -2
- package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.js.map +1 -1
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotext.d.ts +1 -3
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextPreset.d.ts +3 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextPreset.js +3 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextPreset.js.map +1 -0
- package/dist/schema-definitions/jis/datasources/interfaces/index.d.ts +1 -0
- package/dist/schema-definitions/jis/datasources/interfaces/index.js +1 -0
- package/dist/schema-definitions/jis/datasources/interfaces/index.js.map +1 -1
- package/dist/schema-definitions/jis/models/JISInfotextsModel.d.ts +2 -0
- package/dist/schema-definitions/jis/models/JISInfotextsModel.js.map +1 -1
- package/docs/asyncapi.yaml +16 -5
- package/docs/implementation_documentation.md +21 -0
- package/docs/openapi-input.yaml +14 -3
- package/package.json +6 -6
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* We receive the dbmigrate dependency from dbmigrate initially.
|
|
12
|
+
* This enables us to not have to rely on NODE_PATH.
|
|
13
|
+
*/
|
|
14
|
+
exports.setup = function(options, seedLink) {
|
|
15
|
+
dbm = options.dbmigrate;
|
|
16
|
+
type = dbm.dataType;
|
|
17
|
+
seed = seedLink;
|
|
18
|
+
Promise = options.Promise;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.up = function(db) {
|
|
22
|
+
var filePath = path.join(__dirname, 'sqls', '20260504000000-add-off-track-to-future-stop-times-up.sql');
|
|
23
|
+
return new Promise( function( resolve, reject ) {
|
|
24
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
25
|
+
if (err) return reject(err);
|
|
26
|
+
console.log('received data: ' + data);
|
|
27
|
+
|
|
28
|
+
resolve(data);
|
|
29
|
+
});
|
|
30
|
+
})
|
|
31
|
+
.then(function(data) {
|
|
32
|
+
return db.runSql(data);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.down = function(db) {
|
|
37
|
+
var filePath = path.join(__dirname, 'sqls', '20260504000000-add-off-track-to-future-stop-times-down.sql');
|
|
38
|
+
return new Promise( function( resolve, reject ) {
|
|
39
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
40
|
+
if (err) return reject(err);
|
|
41
|
+
console.log('received data: ' + data);
|
|
42
|
+
|
|
43
|
+
resolve(data);
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
.then(function(data) {
|
|
47
|
+
return db.runSql(data);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports._meta = {
|
|
52
|
+
"version": 1
|
|
53
|
+
};
|
package/db/migrations/postgresql/sqls/20260504000000-add-off-track-to-future-stop-times-down.sql
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
CREATE OR REPLACE VIEW v_public_vehiclepositions_future_stop_times AS
|
|
2
|
+
WITH RECURSIVE stop_times AS (
|
|
3
|
+
SELECT
|
|
4
|
+
rst.trip_id,
|
|
5
|
+
vt.id AS trips_id,
|
|
6
|
+
vt.provider_source_type,
|
|
7
|
+
coalesce(vp.delay, 0) AS delay,
|
|
8
|
+
coalesce(vp.last_stop_sequence, 1) AS initial_stop_sequence,
|
|
9
|
+
vp.state_position,
|
|
10
|
+
rst.stop_id,
|
|
11
|
+
rst.stop_sequence,
|
|
12
|
+
rst.computed_dwell_time_seconds,
|
|
13
|
+
rst.arrival_time,
|
|
14
|
+
rst.departure_time,
|
|
15
|
+
CASE WHEN vp.last_stop_sequence IS NULL THEN
|
|
16
|
+
coalesce(vp.delay, 0)
|
|
17
|
+
ELSE
|
|
18
|
+
coalesce(vp.delay_stop_arrival, 0)
|
|
19
|
+
END AS arrival_delay_seconds,
|
|
20
|
+
CASE WHEN vp.last_stop_sequence IS NULL THEN
|
|
21
|
+
predict_delay_seconds(vp.delay, rst.computed_dwell_time_seconds, vt.provider_source_type)
|
|
22
|
+
WHEN vp.state_position::text = 'at_stop'::text THEN
|
|
23
|
+
CASE WHEN vt.provider_source_type::text = '1'::text THEN
|
|
24
|
+
greatest(0, vp.delay)
|
|
25
|
+
ELSE
|
|
26
|
+
vp.delay
|
|
27
|
+
END
|
|
28
|
+
ELSE
|
|
29
|
+
vp.delay_stop_departure
|
|
30
|
+
END AS departure_delay_seconds
|
|
31
|
+
FROM
|
|
32
|
+
ropidgtfs_stop_times rst
|
|
33
|
+
JOIN vehiclepositions_trips vt ON vt.gtfs_trip_id::text = rst.trip_id::text
|
|
34
|
+
JOIN vehiclepositions_positions vp ON vp.id = vt.last_position_id
|
|
35
|
+
AND (vp.valid_to IS NULL
|
|
36
|
+
OR vp.valid_to >= now())
|
|
37
|
+
AND (vp.state_position::text = ANY (ARRAY['on_track'::character varying::text,
|
|
38
|
+
'at_stop'::character varying::text,
|
|
39
|
+
'before_track'::character varying::text,
|
|
40
|
+
'before_track_delayed'::character varying::text]))
|
|
41
|
+
WHERE
|
|
42
|
+
vt.gtfs_trip_id IS NOT NULL
|
|
43
|
+
AND rst.stop_sequence = coalesce(vp.last_stop_sequence, 1)
|
|
44
|
+
UNION ALL
|
|
45
|
+
SELECT
|
|
46
|
+
rst.trip_id,
|
|
47
|
+
previous_row.trips_id,
|
|
48
|
+
previous_row.provider_source_type,
|
|
49
|
+
previous_row.delay,
|
|
50
|
+
previous_row.initial_stop_sequence,
|
|
51
|
+
previous_row.state_position,
|
|
52
|
+
rst.stop_id,
|
|
53
|
+
rst.stop_sequence,
|
|
54
|
+
rst.computed_dwell_time_seconds,
|
|
55
|
+
rst.arrival_time,
|
|
56
|
+
rst.departure_time,
|
|
57
|
+
CASE WHEN (rst.stop_sequence - previous_row.initial_stop_sequence) = 1
|
|
58
|
+
AND previous_row.state_position::text <> 'at_stop'::text THEN
|
|
59
|
+
CASE WHEN (rst.arrival_time::interval +(interval '1 second' * previous_row.delay) < previous_row.departure_time::interval +(interval '1 second' *(previous_row.departure_delay_seconds))) THEN
|
|
60
|
+
NULL
|
|
61
|
+
ELSE
|
|
62
|
+
previous_row.delay
|
|
63
|
+
END
|
|
64
|
+
ELSE
|
|
65
|
+
previous_row.departure_delay_seconds
|
|
66
|
+
END AS arrival_delay_seconds,
|
|
67
|
+
predict_delay_seconds(
|
|
68
|
+
CASE WHEN (rst.stop_sequence - previous_row.initial_stop_sequence) = 1
|
|
69
|
+
AND previous_row.state_position::text <> 'at_stop'::text THEN
|
|
70
|
+
previous_row.delay
|
|
71
|
+
ELSE
|
|
72
|
+
previous_row.departure_delay_seconds
|
|
73
|
+
END, rst.computed_dwell_time_seconds, previous_row.provider_source_type) AS departure_delay_seconds
|
|
74
|
+
FROM
|
|
75
|
+
stop_times previous_row
|
|
76
|
+
JOIN ropidgtfs_stop_times rst ON rst.trip_id::text = previous_row.trip_id::text
|
|
77
|
+
AND rst.stop_sequence =(previous_row.stop_sequence + 1))
|
|
78
|
+
SELECT
|
|
79
|
+
stop_times.trips_id AS rt_trip_id,
|
|
80
|
+
stop_times.stop_sequence,
|
|
81
|
+
stop_times.arrival_delay_seconds AS stop_arr_delay,
|
|
82
|
+
CASE WHEN (stop_times.arrival_time::interval +(interval '1 second' * coalesce(stop_times.arrival_delay_seconds, 0))) >(stop_times.departure_time::interval +(interval '1 second' * coalesce(stop_times.departure_delay_seconds, 0))) THEN
|
|
83
|
+
NULL
|
|
84
|
+
ELSE
|
|
85
|
+
stop_times.departure_delay_seconds
|
|
86
|
+
END AS stop_dep_delay,
|
|
87
|
+
stop_times.stop_id
|
|
88
|
+
FROM
|
|
89
|
+
stop_times
|
|
90
|
+
ORDER BY
|
|
91
|
+
stop_times.trip_id,
|
|
92
|
+
stop_times.stop_sequence;
|
package/db/migrations/postgresql/sqls/20260504000000-add-off-track-to-future-stop-times-up.sql
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
CREATE OR REPLACE VIEW v_public_vehiclepositions_future_stop_times AS
|
|
2
|
+
WITH RECURSIVE stop_times AS (
|
|
3
|
+
SELECT
|
|
4
|
+
rst.trip_id,
|
|
5
|
+
vt.id AS trips_id,
|
|
6
|
+
vt.provider_source_type,
|
|
7
|
+
coalesce(vp.delay, 0) AS delay,
|
|
8
|
+
coalesce(vp.last_stop_sequence, 1) AS initial_stop_sequence,
|
|
9
|
+
vp.state_position,
|
|
10
|
+
rst.stop_id,
|
|
11
|
+
rst.stop_sequence,
|
|
12
|
+
rst.computed_dwell_time_seconds,
|
|
13
|
+
rst.arrival_time,
|
|
14
|
+
rst.departure_time,
|
|
15
|
+
CASE WHEN vp.state_position::text = 'off_track'::text THEN
|
|
16
|
+
coalesce(vp.delay, 0)
|
|
17
|
+
WHEN vp.last_stop_sequence IS NULL THEN
|
|
18
|
+
coalesce(vp.delay, 0)
|
|
19
|
+
ELSE
|
|
20
|
+
coalesce(vp.delay_stop_arrival, 0)
|
|
21
|
+
END AS arrival_delay_seconds,
|
|
22
|
+
CASE WHEN vp.state_position::text = 'off_track'::text THEN
|
|
23
|
+
predict_delay_seconds(vp.delay, rst.computed_dwell_time_seconds, vt.provider_source_type)
|
|
24
|
+
WHEN vp.last_stop_sequence IS NULL THEN
|
|
25
|
+
predict_delay_seconds(vp.delay, rst.computed_dwell_time_seconds, vt.provider_source_type)
|
|
26
|
+
WHEN vp.state_position::text = 'at_stop'::text THEN
|
|
27
|
+
CASE WHEN vt.provider_source_type::text = '1'::text THEN
|
|
28
|
+
greatest(0, vp.delay)
|
|
29
|
+
ELSE
|
|
30
|
+
vp.delay
|
|
31
|
+
END
|
|
32
|
+
ELSE
|
|
33
|
+
vp.delay_stop_departure
|
|
34
|
+
END AS departure_delay_seconds
|
|
35
|
+
FROM
|
|
36
|
+
ropidgtfs_stop_times rst
|
|
37
|
+
JOIN vehiclepositions_trips vt ON vt.gtfs_trip_id::text = rst.trip_id::text
|
|
38
|
+
JOIN vehiclepositions_positions vp ON vp.id = vt.last_position_id
|
|
39
|
+
AND (vp.valid_to IS NULL
|
|
40
|
+
OR vp.valid_to >= now())
|
|
41
|
+
AND (vp.state_position::text = ANY (ARRAY['on_track'::character varying::text,
|
|
42
|
+
'at_stop'::character varying::text,
|
|
43
|
+
'before_track'::character varying::text,
|
|
44
|
+
'before_track_delayed'::character varying::text,
|
|
45
|
+
'off_track'::character varying::text]))
|
|
46
|
+
WHERE
|
|
47
|
+
vt.gtfs_trip_id IS NOT NULL
|
|
48
|
+
AND rst.stop_sequence = coalesce(vp.last_stop_sequence, 1)
|
|
49
|
+
UNION ALL
|
|
50
|
+
SELECT
|
|
51
|
+
rst.trip_id,
|
|
52
|
+
previous_row.trips_id,
|
|
53
|
+
previous_row.provider_source_type,
|
|
54
|
+
previous_row.delay,
|
|
55
|
+
previous_row.initial_stop_sequence,
|
|
56
|
+
previous_row.state_position,
|
|
57
|
+
rst.stop_id,
|
|
58
|
+
rst.stop_sequence,
|
|
59
|
+
rst.computed_dwell_time_seconds,
|
|
60
|
+
rst.arrival_time,
|
|
61
|
+
rst.departure_time,
|
|
62
|
+
CASE WHEN (rst.stop_sequence - previous_row.initial_stop_sequence) = 1
|
|
63
|
+
AND previous_row.state_position::text <> 'at_stop'::text THEN
|
|
64
|
+
CASE WHEN (rst.arrival_time::interval +(interval '1 second' * previous_row.delay) < previous_row.departure_time::interval +(interval '1 second' *(previous_row.departure_delay_seconds))) THEN
|
|
65
|
+
NULL
|
|
66
|
+
ELSE
|
|
67
|
+
previous_row.delay
|
|
68
|
+
END
|
|
69
|
+
ELSE
|
|
70
|
+
previous_row.departure_delay_seconds
|
|
71
|
+
END AS arrival_delay_seconds,
|
|
72
|
+
predict_delay_seconds(
|
|
73
|
+
CASE WHEN (rst.stop_sequence - previous_row.initial_stop_sequence) = 1
|
|
74
|
+
AND previous_row.state_position::text <> 'at_stop'::text THEN
|
|
75
|
+
previous_row.delay
|
|
76
|
+
ELSE
|
|
77
|
+
previous_row.departure_delay_seconds
|
|
78
|
+
END, rst.computed_dwell_time_seconds, previous_row.provider_source_type) AS departure_delay_seconds
|
|
79
|
+
FROM
|
|
80
|
+
stop_times previous_row
|
|
81
|
+
JOIN ropidgtfs_stop_times rst ON rst.trip_id::text = previous_row.trip_id::text
|
|
82
|
+
AND rst.stop_sequence =(previous_row.stop_sequence + 1))
|
|
83
|
+
SELECT
|
|
84
|
+
stop_times.trips_id AS rt_trip_id,
|
|
85
|
+
stop_times.stop_sequence,
|
|
86
|
+
stop_times.arrival_delay_seconds AS stop_arr_delay,
|
|
87
|
+
CASE WHEN (stop_times.arrival_time::interval +(interval '1 second' * coalesce(stop_times.arrival_delay_seconds, 0))) >(stop_times.departure_time::interval +(interval '1 second' * coalesce(stop_times.departure_delay_seconds, 0))) THEN
|
|
88
|
+
NULL
|
|
89
|
+
ELSE
|
|
90
|
+
stop_times.departure_delay_seconds
|
|
91
|
+
END AS stop_dep_delay,
|
|
92
|
+
stop_times.stop_id
|
|
93
|
+
FROM
|
|
94
|
+
stop_times
|
|
95
|
+
ORDER BY
|
|
96
|
+
stop_times.trip_id,
|
|
97
|
+
stop_times.stop_sequence;
|
|
@@ -9,13 +9,22 @@ type RepositoryOptions = {
|
|
|
9
9
|
transaction?: Transaction;
|
|
10
10
|
};
|
|
11
11
|
export declare class JISInfotextsPresetsRepository extends AbstractValidatableRepository {
|
|
12
|
-
private logger;
|
|
13
12
|
validator: JSONSchemaValidator;
|
|
14
13
|
schema: string;
|
|
15
14
|
tableName: string;
|
|
16
15
|
private sequelizeModel;
|
|
17
16
|
constructor(connector: IDatabaseConnector, logger: ILogger);
|
|
17
|
+
/**
|
|
18
|
+
* Inserts new rows or updates existing ones. On conflict, all columns except `created_at` are overwritten —
|
|
19
|
+
* `created_at` is intentionally preserved to track when a row was first seen, while `updated_at` advances
|
|
20
|
+
* each cycle so stale-record cleanup can identify entries missing from the latest feed.
|
|
21
|
+
*/
|
|
18
22
|
upsertAll(data: IJISInfotextsPresets[], options?: RepositoryOptions): ReturnType<ModelStatic<JISInfotextsPresetsModel>["bulkCreate"]>;
|
|
23
|
+
/**
|
|
24
|
+
* Removes rows that were not touched during the current refresh cycle — any row whose `updated_at`
|
|
25
|
+
* predates `dateTime` was absent from the latest feed and is considered stale.
|
|
26
|
+
* Call this after `upsertAll` with the timestamp captured at the start of the save to clean up vanished entries.
|
|
27
|
+
*/
|
|
19
28
|
deleteAllLastUpdatedBefore(dateTime: Date, options?: RepositoryOptions): Promise<number>;
|
|
20
29
|
deleteAll(options?: RepositoryOptions): Promise<number>;
|
|
21
30
|
private getUpdateAttributes;
|
|
@@ -17,7 +17,6 @@ const const_1 = require("../../../schema-definitions/const");
|
|
|
17
17
|
const JISInfotextsPresetsModel_1 = require("../../../schema-definitions/jis/models/JISInfotextsPresetsModel");
|
|
18
18
|
const AbstractValidatableRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository");
|
|
19
19
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
20
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
21
20
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
22
21
|
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
23
22
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
@@ -25,7 +24,6 @@ const RepositoryUtils_1 = require("../../shared/RepositoryUtils");
|
|
|
25
24
|
let JISInfotextsPresetsRepository = class JISInfotextsPresetsRepository extends AbstractValidatableRepository_1.AbstractValidatableRepository {
|
|
26
25
|
constructor(connector, logger) {
|
|
27
26
|
super(connector, logger);
|
|
28
|
-
this.logger = logger;
|
|
29
27
|
this.schema = const_1.PG_SCHEMA;
|
|
30
28
|
this.tableName = JISInfotextsPresetsModel_1.JISInfotextsPresetsModel.tableName;
|
|
31
29
|
this.validator = new golemio_validator_1.JSONSchemaValidator("JISInfotextsPresetsRepository", JISInfotextsPresetsModel_1.JISInfotextsPresetsModel.jsonSchema);
|
|
@@ -33,6 +31,11 @@ let JISInfotextsPresetsRepository = class JISInfotextsPresetsRepository extends
|
|
|
33
31
|
.getConnection()
|
|
34
32
|
.define(this.tableName, JISInfotextsPresetsModel_1.JISInfotextsPresetsModel.attributeModel, { schema: this.schema });
|
|
35
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Inserts new rows or updates existing ones. On conflict, all columns except `created_at` are overwritten —
|
|
36
|
+
* `created_at` is intentionally preserved to track when a row was first seen, while `updated_at` advances
|
|
37
|
+
* each cycle so stale-record cleanup can identify entries missing from the latest feed.
|
|
38
|
+
*/
|
|
36
39
|
async upsertAll(data, options) {
|
|
37
40
|
try {
|
|
38
41
|
return await this.sequelizeModel.bulkCreate(data, {
|
|
@@ -41,9 +44,14 @@ let JISInfotextsPresetsRepository = class JISInfotextsPresetsRepository extends
|
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
catch (err) {
|
|
44
|
-
RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "upsertAll");
|
|
47
|
+
throw RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "upsertAll");
|
|
45
48
|
}
|
|
46
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Removes rows that were not touched during the current refresh cycle — any row whose `updated_at`
|
|
52
|
+
* predates `dateTime` was absent from the latest feed and is considered stale.
|
|
53
|
+
* Call this after `upsertAll` with the timestamp captured at the start of the save to clean up vanished entries.
|
|
54
|
+
*/
|
|
47
55
|
async deleteAllLastUpdatedBefore(dateTime, options) {
|
|
48
56
|
try {
|
|
49
57
|
return await this.sequelizeModel.destroy({
|
|
@@ -54,7 +62,7 @@ let JISInfotextsPresetsRepository = class JISInfotextsPresetsRepository extends
|
|
|
54
62
|
});
|
|
55
63
|
}
|
|
56
64
|
catch (err) {
|
|
57
|
-
throw
|
|
65
|
+
throw RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "deleteAllLastUpdatedBefore");
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
async deleteAll(options) {
|
|
@@ -62,11 +70,13 @@ let JISInfotextsPresetsRepository = class JISInfotextsPresetsRepository extends
|
|
|
62
70
|
return await this.sequelizeModel.destroy({ where: {}, transaction: options?.transaction });
|
|
63
71
|
}
|
|
64
72
|
catch (err) {
|
|
65
|
-
throw
|
|
73
|
+
throw RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "deleteAll");
|
|
66
74
|
}
|
|
67
75
|
}
|
|
76
|
+
// created_at is excluded so that re-upserting an existing row doesn't overwrite
|
|
77
|
+
// when it was first seen — only updated_at should advance on subsequent refreshes.
|
|
68
78
|
getUpdateAttributes() {
|
|
69
|
-
return Object.keys(JISInfotextsPresetsModel_1.JISInfotextsPresetsModel.attributeModel).filter((attribute) =>
|
|
79
|
+
return Object.keys(JISInfotextsPresetsModel_1.JISInfotextsPresetsModel.attributeModel).filter((attribute) => attribute !== "created_at");
|
|
70
80
|
}
|
|
71
81
|
};
|
|
72
82
|
exports.JISInfotextsPresetsRepository = JISInfotextsPresetsRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextsPresetsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsPresetsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,8GAAoF;AAIpF,8IAA2I;AAC3I,wEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"JISInfotextsPresetsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsPresetsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,8GAAoF;AAIpF,8IAA2I;AAC3I,wEAAqE;AACrE,mFAAkF;AAClF,mEAAmF;AACnF,iEAAwE;AACxE,kEAA6D;AAOtD,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,6DAA6B;IAO5E,YAAiD,SAA6B,EAA4B,MAAe;QACrH,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QANtB,WAAM,GAAG,iBAAS,CAAC;QACnB,cAAS,GAAG,mDAAwB,CAAC,SAAS,CAAC;QAMlD,IAAI,CAAC,SAAS,GAAG,IAAI,uCAAmB,CAAC,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AAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;QAC/F,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,iCAAe,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACrF,CAAC;IACL,CAAC;IAED,gFAAgF;IAChF,mFAAmF;IAC3E,mBAAmB;QACvB,OAAO,MAAM,CAAC,IAAI,CAAC,mDAAwB,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC;IAClH,CAAC;CACJ,CAAA;AAjEY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,qBAAU,GAAE;IAQI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IAAiC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GAPhG,6BAA6B,CAiEzC"}
|
|
@@ -6,6 +6,7 @@ import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postg
|
|
|
6
6
|
import { AbstractValidatableRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository";
|
|
7
7
|
import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator";
|
|
8
8
|
import { Transaction } from "@golemio/core/dist/shared/sequelize";
|
|
9
|
+
import { JISInfotextsPresetsRepository } from "./JISInfotextsPresetsRepository";
|
|
9
10
|
import { JISInfotextsRopidGTFSStopsRepository } from "./JISInfotextsRopidGTFSStopsRepository";
|
|
10
11
|
type RepositoryOptions = {
|
|
11
12
|
transaction?: Transaction;
|
|
@@ -13,12 +14,13 @@ type RepositoryOptions = {
|
|
|
13
14
|
export declare class JISInfotextsRepository extends AbstractValidatableRepository {
|
|
14
15
|
private logger;
|
|
15
16
|
private infotextStopRepository;
|
|
17
|
+
private infotextPresetsRepository;
|
|
16
18
|
private gtfsStopRepository;
|
|
17
19
|
validator: JSONSchemaValidator;
|
|
18
20
|
schema: string;
|
|
19
21
|
tableName: string;
|
|
20
22
|
private sequelizeModel;
|
|
21
|
-
constructor(connector: IDatabaseConnector, logger: ILogger, infotextStopRepository: JISInfotextsRopidGTFSStopsRepository, gtfsStopRepository: RopidGTFSStopsModel);
|
|
23
|
+
constructor(connector: IDatabaseConnector, logger: ILogger, infotextStopRepository: JISInfotextsRopidGTFSStopsRepository, infotextPresetsRepository: JISInfotextsPresetsRepository, gtfsStopRepository: RopidGTFSStopsModel);
|
|
22
24
|
/**
|
|
23
25
|
* Refresh all data from VYMI and delete old data
|
|
24
26
|
*
|
|
@@ -24,12 +24,14 @@ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
|
24
24
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
25
25
|
const RepositoryUtils_1 = require("../../shared/RepositoryUtils");
|
|
26
26
|
const JISContainerToken_1 = require("../ioc/JISContainerToken");
|
|
27
|
+
const JISInfotextsPresetsRepository_1 = require("./JISInfotextsPresetsRepository");
|
|
27
28
|
const JISInfotextsRopidGTFSStopsRepository_1 = require("./JISInfotextsRopidGTFSStopsRepository");
|
|
28
29
|
let JISInfotextsRepository = class JISInfotextsRepository extends AbstractValidatableRepository_1.AbstractValidatableRepository {
|
|
29
|
-
constructor(connector, logger, infotextStopRepository, gtfsStopRepository) {
|
|
30
|
+
constructor(connector, logger, infotextStopRepository, infotextPresetsRepository, gtfsStopRepository) {
|
|
30
31
|
super(connector, logger);
|
|
31
32
|
this.logger = logger;
|
|
32
33
|
this.infotextStopRepository = infotextStopRepository;
|
|
34
|
+
this.infotextPresetsRepository = infotextPresetsRepository;
|
|
33
35
|
this.gtfsStopRepository = gtfsStopRepository;
|
|
34
36
|
this.schema = const_1.PG_SCHEMA;
|
|
35
37
|
this.tableName = JISInfotextsModel_1.JISInfotextsModel.tableName;
|
|
@@ -64,6 +66,15 @@ let JISInfotextsRepository = class JISInfotextsRepository extends AbstractValida
|
|
|
64
66
|
sourceKey: "stop_id",
|
|
65
67
|
foreignKey: "stop_id",
|
|
66
68
|
});
|
|
69
|
+
this.sequelizeModel.hasMany(this.infotextPresetsRepository["sequelizeModel"], {
|
|
70
|
+
sourceKey: "id",
|
|
71
|
+
foreignKey: "infotext_id",
|
|
72
|
+
as: "presets",
|
|
73
|
+
});
|
|
74
|
+
this.infotextPresetsRepository["sequelizeModel"].belongsTo(this.sequelizeModel, {
|
|
75
|
+
targetKey: "id",
|
|
76
|
+
foreignKey: "infotext_id",
|
|
77
|
+
});
|
|
67
78
|
}
|
|
68
79
|
/**
|
|
69
80
|
* Refresh all data from VYMI and delete old data
|
|
@@ -146,8 +157,10 @@ exports.JISInfotextsRepository = JISInfotextsRepository = __decorate([
|
|
|
146
157
|
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
147
158
|
__param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
148
159
|
__param(2, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsRopidGTFSStopsRepository)),
|
|
149
|
-
__param(3, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.
|
|
160
|
+
__param(3, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsPresetsRepository)),
|
|
161
|
+
__param(4, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.RopidGTFSStopsRepository)),
|
|
150
162
|
__metadata("design:paramtypes", [Object, Object, JISInfotextsRopidGTFSStopsRepository_1.JISInfotextsRopidGTFSStopsRepository,
|
|
163
|
+
JISInfotextsPresetsRepository_1.JISInfotextsPresetsRepository,
|
|
151
164
|
ropid_gtfs_1.RopidGTFSStopsModel])
|
|
152
165
|
], JISInfotextsRepository);
|
|
153
166
|
//# sourceMappingURL=JISInfotextsRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAqD;AACrD,6DAAuC;AACvC,gGAAsE;AAItE,8IAA2I;AAC3I,wEAAqE;AACrE,6EAAwE;AACxE,mFAAkF;AAClF,mEAAmF;AACnF,iEAAwE;AACxE,kEAA6D;AAC7D,gEAA6D;AAC7D,iGAA8F;AAOvF,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,6DAA6B;IAOrE,YACyC,SAA6B,EACxC,MAAuB,EAEjD,sBAAoE,EAEpE,kBAA+C;QAE/C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"JISInfotextsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAqD;AACrD,6DAAuC;AACvC,gGAAsE;AAItE,8IAA2I;AAC3I,wEAAqE;AACrE,6EAAwE;AACxE,mFAAkF;AAClF,mEAAmF;AACnF,iEAAwE;AACxE,kEAA6D;AAC7D,gEAA6D;AAC7D,mFAAgF;AAChF,iGAA8F;AAOvF,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,6DAA6B;IAOrE,YACyC,SAA6B,EACxC,MAAuB,EAEjD,sBAAoE,EAEpE,yBAAgE,EAEhE,kBAA+C;QAE/C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QARS,WAAM,GAAN,MAAM,CAAS;QAEzC,2BAAsB,GAAtB,sBAAsB,CAAsC;QAE5D,8BAAyB,GAAzB,yBAAyB,CAA+B;QAExD,uBAAkB,GAAlB,kBAAkB,CAAqB;QAb5C,WAAM,GAAG,iBAAS,CAAC;QACnB,cAAS,GAAG,qCAAiB,CAAC,SAAS,CAAC;QAe3C,IAAI,CAAC,SAAS,GA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class JISInfotextsRopidGTFSStopsRepository extends AbstractValidatableRepository {
|
|
12
|
-
private logger;
|
|
13
12
|
validator: JSONSchemaValidator;
|
|
14
13
|
schema: string;
|
|
15
14
|
tableName: string;
|
|
16
15
|
private sequelizeModel;
|
|
17
16
|
constructor(connector: IDatabaseConnector, logger: ILogger);
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param options Options for the operation
|
|
23
|
-
* @returns The number of deleted items
|
|
18
|
+
* Removes rows that were not touched during the current refresh cycle — any row whose `updated_at`
|
|
19
|
+
* predates `dateTime` was absent from the latest feed and is considered stale.
|
|
20
|
+
* Call this after `upsertAll` with the timestamp captured at the start of the save to clean up vanished entries.
|
|
24
21
|
*/
|
|
25
22
|
deleteAllLastUpdatedBefore(dateTime: Date, options?: RepositoryOptions): Promise<number>;
|
|
26
23
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @param options Options for the operation
|
|
31
|
-
* @returns The upserted items
|
|
24
|
+
* Inserts new rows or updates existing ones. On conflict, all columns except `created_at` are overwritten —
|
|
25
|
+
* `created_at` is intentionally preserved to track when a row was first seen, while `updated_at` advances
|
|
26
|
+
* each cycle so stale-record cleanup can identify entries missing from the latest feed.
|
|
32
27
|
*/
|
|
33
28
|
upsertAll(data: IJISInfotextsRopidGTFSStops[], options?: RepositoryOptions): ReturnType<ModelStatic<JISInfotextsRopidGTFSStopsModel>["bulkCreate"]>;
|
|
34
29
|
private getUpdateAttributes;
|
|
35
|
-
/**
|
|
36
|
-
* @param options
|
|
37
|
-
* @returns The number of deleted items
|
|
38
|
-
*/
|
|
39
30
|
deleteAll(options?: RepositoryOptions): Promise<number>;
|
|
40
31
|
}
|
|
41
32
|
export {};
|
|
@@ -17,7 +17,6 @@ const const_1 = require("../../../schema-definitions/const");
|
|
|
17
17
|
const JISInfotextsRopidGTFSStopsModel_1 = require("../../../schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel");
|
|
18
18
|
const AbstractValidatableRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository");
|
|
19
19
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
20
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
21
20
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
22
21
|
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
23
22
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
@@ -25,7 +24,6 @@ const RepositoryUtils_1 = require("../../shared/RepositoryUtils");
|
|
|
25
24
|
let JISInfotextsRopidGTFSStopsRepository = class JISInfotextsRopidGTFSStopsRepository extends AbstractValidatableRepository_1.AbstractValidatableRepository {
|
|
26
25
|
constructor(connector, logger) {
|
|
27
26
|
super(connector, logger);
|
|
28
|
-
this.logger = logger;
|
|
29
27
|
this.schema = const_1.PG_SCHEMA;
|
|
30
28
|
this.tableName = JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.tableName;
|
|
31
29
|
this.validator = new golemio_validator_1.JSONSchemaValidator("JISInfotextsRopidGTFSStopsRepository", JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.jsonSchema);
|
|
@@ -34,11 +32,9 @@ let JISInfotextsRopidGTFSStopsRepository = class JISInfotextsRopidGTFSStopsRepos
|
|
|
34
32
|
.define(this.tableName, JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.attributeModel, { schema: this.schema });
|
|
35
33
|
}
|
|
36
34
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param options Options for the operation
|
|
41
|
-
* @returns The number of deleted items
|
|
35
|
+
* Removes rows that were not touched during the current refresh cycle — any row whose `updated_at`
|
|
36
|
+
* predates `dateTime` was absent from the latest feed and is considered stale.
|
|
37
|
+
* Call this after `upsertAll` with the timestamp captured at the start of the save to clean up vanished entries.
|
|
42
38
|
*/
|
|
43
39
|
async deleteAllLastUpdatedBefore(dateTime, options) {
|
|
44
40
|
try {
|
|
@@ -50,15 +46,13 @@ let JISInfotextsRopidGTFSStopsRepository = class JISInfotextsRopidGTFSStopsRepos
|
|
|
50
46
|
});
|
|
51
47
|
}
|
|
52
48
|
catch (err) {
|
|
53
|
-
throw
|
|
49
|
+
throw RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "deleteAllLastUpdatedBefore");
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
52
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @param options Options for the operation
|
|
61
|
-
* @returns The upserted items
|
|
53
|
+
* Inserts new rows or updates existing ones. On conflict, all columns except `created_at` are overwritten —
|
|
54
|
+
* `created_at` is intentionally preserved to track when a row was first seen, while `updated_at` advances
|
|
55
|
+
* each cycle so stale-record cleanup can identify entries missing from the latest feed.
|
|
62
56
|
*/
|
|
63
57
|
async upsertAll(data, options) {
|
|
64
58
|
try {
|
|
@@ -68,22 +62,20 @@ let JISInfotextsRopidGTFSStopsRepository = class JISInfotextsRopidGTFSStopsRepos
|
|
|
68
62
|
});
|
|
69
63
|
}
|
|
70
64
|
catch (err) {
|
|
71
|
-
RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "upsertAll");
|
|
65
|
+
throw RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "upsertAll");
|
|
72
66
|
}
|
|
73
67
|
}
|
|
68
|
+
// created_at is excluded so that re-upserting an existing row doesn't overwrite
|
|
69
|
+
// when it was first seen — only updated_at should advance on subsequent refreshes.
|
|
74
70
|
getUpdateAttributes() {
|
|
75
|
-
return Object.keys(JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.attributeModel).filter((attribute) =>
|
|
71
|
+
return Object.keys(JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.attributeModel).filter((attribute) => attribute !== "created_at");
|
|
76
72
|
}
|
|
77
|
-
/**
|
|
78
|
-
* @param options
|
|
79
|
-
* @returns The number of deleted items
|
|
80
|
-
*/
|
|
81
73
|
async deleteAll(options) {
|
|
82
74
|
try {
|
|
83
75
|
return await this.sequelizeModel.destroy({ where: {}, transaction: options?.transaction });
|
|
84
76
|
}
|
|
85
77
|
catch (err) {
|
|
86
|
-
throw
|
|
78
|
+
throw RepositoryUtils_1.RepositoryUtils.mapSequelizeError(err, this.constructor.name, "deleteAll");
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
81
|
};
|
package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextsRopidGTFSStopsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,4HAAkG;AAIlG,8IAA2I;AAC3I,wEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"JISInfotextsRopidGTFSStopsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,4HAAkG;AAIlG,8IAA2I;AAC3I,wEAAqE;AACrE,mFAAkF;AAClF,mEAAmF;AACnF,iEAAwE;AACxE,kEAA6D;AAOtD,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,6DAA6B;IAOnF,YAAiD,SAA6B,EAA4B,MAAe;QACrH,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QANtB,WAAM,GAAG,iBAAS,CAAC;QACnB,cAAS,GAAG,iEAA+B,CAAC,SAAS,CAAC;QAMzD,IAAI,CAAC,SAA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+B,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC;IACzH,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,OAA2B;QAC9C,IAAI,CAAC;YACD,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;QAC/F,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,iCAAe,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACrF,CAAC;IACL,CAAC;CACJ,CAAA;AApEY,oFAAoC;+CAApC,oCAAoC;IADhD,IAAA,qBAAU,GAAE;IAQI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IAAiC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GAPhG,oCAAoC,CAoEhD"}
|
|
@@ -12,11 +12,8 @@ export declare class JISInfotextsDataService {
|
|
|
12
12
|
private logger;
|
|
13
13
|
constructor(infotextsRepository: JISInfotextsRepository, infotextsRopidGTFSStopsRepository: JISInfotextsRopidGTFSStopsRepository, infotextsPresetsRepository: JISInfotextsPresetsRepository, databaseConnector: IDatabaseConnector, logger: ILogger);
|
|
14
14
|
/**
|
|
15
|
-
* Insert or update all given infotexts and
|
|
16
|
-
* `created_at` shall be overwritten.
|
|
17
|
-
*
|
|
18
|
-
* @param infotexts The infotexts data to be upserted
|
|
19
|
-
* @param infotextsRopidGTFSStops The infotextsRopidGTFSStops data to be upserted
|
|
15
|
+
* Insert or update all given infotexts, their stop links and preset links. In case of an update, all attributes except for
|
|
16
|
+
* `created_at` shall be overwritten. Rows absent from this refresh cycle are deleted as stale.
|
|
20
17
|
*/
|
|
21
18
|
refreshData(infotexts: IJISInfotext[], infotextsRopidGTFSStops: IJISInfotextsRopidGTFSStops[], infotextsPresets: IJISInfotextsPresets[]): Promise<void>;
|
|
22
19
|
}
|
|
@@ -30,11 +30,8 @@ let JISInfotextsDataService = class JISInfotextsDataService {
|
|
|
30
30
|
// do nothing
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* Insert or update all given infotexts and
|
|
34
|
-
* `created_at` shall be overwritten.
|
|
35
|
-
*
|
|
36
|
-
* @param infotexts The infotexts data to be upserted
|
|
37
|
-
* @param infotextsRopidGTFSStops The infotextsRopidGTFSStops data to be upserted
|
|
33
|
+
* Insert or update all given infotexts, their stop links and preset links. In case of an update, all attributes except for
|
|
34
|
+
* `created_at` shall be overwritten. Rows absent from this refresh cycle are deleted as stale.
|
|
38
35
|
*/
|
|
39
36
|
async refreshData(infotexts, infotextsRopidGTFSStops, infotextsPresets) {
|
|
40
37
|
const connection = this.databaseConnector.getConnection();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextsDataService.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/services/JISInfotextsDataService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAkE;AAClE,iGAAmG;AACnG,mFAAqF;AACrF,+GAAiH;AAIjH,wEAAqE;AACrE,6EAAwE;AACxE,iEAAwE;AAGjE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAChC,YAEY,mBAA2C,EAE3C,iCAAuE,EAEvE,0BAAyD,EACpB,iBAAqC,EAChD,MAAe;QANzC,wBAAmB,GAAnB,mBAAmB,CAAwB;QAE3C,sCAAiC,GAAjC,iCAAiC,CAAsC;QAEvE,+BAA0B,GAA1B,0BAA0B,CAA+B;QACpB,sBAAiB,GAAjB,iBAAiB,CAAoB;QAChD,WAAM,GAAN,MAAM,CAAS;QAEjD,aAAa;IACjB,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"JISInfotextsDataService.js","sourceRoot":"","sources":["../../../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D,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,6BAA6B,CAAC,CAAA;IAEvD,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IACnC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;qCANI,+CAAsB;QAER,2EAAoC;QAE3C,6DAA6B;GAP5D,uBAAuB,CAuDnC"}
|
|
@@ -31,9 +31,9 @@ let JISInfotextsTransformation = class JISInfotextsTransformation extends Abstra
|
|
|
31
31
|
infotext_id: data.id,
|
|
32
32
|
stop_id: id,
|
|
33
33
|
})) ?? [];
|
|
34
|
-
const infotextsPresets = data.informed_entity?.presets?.map(({
|
|
34
|
+
const infotextsPresets = data.informed_entity?.presets?.map(({ route_name }) => ({
|
|
35
35
|
infotext_id: data.id,
|
|
36
|
-
route_name
|
|
36
|
+
route_name,
|
|
37
37
|
})) ?? [];
|
|
38
38
|
return {
|
|
39
39
|
infotext,
|