@golemio/pid 3.14.0 → 3.14.1-dev.1815030855
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/20250509095900-get-departures-planned-start.js +53 -0
- package/db/migrations/postgresql/sqls/20250509095900-get-departures-planned-start-down.sql +189 -0
- package/db/migrations/postgresql/sqls/20250509095900-get-departures-planned-start-up.sql +200 -0
- package/dist/helpers/RedisJsonParser.d.ts +21 -0
- package/dist/helpers/RedisJsonParser.js +57 -0
- package/dist/helpers/RedisJsonParser.js.map +1 -0
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +0 -1
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.d.ts +2 -0
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js +48 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +10 -7
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/interfaces/VPInterfaces.d.ts +3 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js +2 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js +2 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js.map +1 -1
- package/dist/output-gateway/pid/index.d.ts +1 -0
- package/dist/output-gateway/pid/index.js.map +1 -1
- package/dist/output-gateway/pid/models/helpers/SkipHelper.js +6 -2
- package/dist/output-gateway/pid/models/helpers/SkipHelper.js.map +1 -1
- package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.d.ts +1 -1
- package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js +10 -14
- package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js.map +1 -1
- package/dist/output-gateway/public/domain/repository/IDelayComputationRepository.d.ts +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
- package/package.json +3 -3
|
@@ -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', '20250509095900-get-departures-planned-start-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', '20250509095900-get-departures-planned-start-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
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
drop function get_departures;
|
|
2
|
+
create function get_departures (
|
|
3
|
+
stopsIds varchar,
|
|
4
|
+
mode int,
|
|
5
|
+
dateDepartureBetweenStart timestamptz,
|
|
6
|
+
dateDepartureBetweenEnd timestamptz,
|
|
7
|
+
isNegativeMinutesBefore int,
|
|
8
|
+
dateCanceledDepartureBetweenStart timestamptz,
|
|
9
|
+
dateCanceledDepartureBetweenEnd timestamptz,
|
|
10
|
+
airconditioninfoenabled int
|
|
11
|
+
)
|
|
12
|
+
returns table (
|
|
13
|
+
departure_datetime_real timestamptz,
|
|
14
|
+
arrival_datetime_real timestamptz,
|
|
15
|
+
stop_sequence int2,
|
|
16
|
+
stop_headsign varchar(70),
|
|
17
|
+
arrival_datetime timestamptz,
|
|
18
|
+
departure_datetime timestamptz,
|
|
19
|
+
stop_id varchar(25),
|
|
20
|
+
platform_code varchar(10),
|
|
21
|
+
wheelchair_boarding int2,
|
|
22
|
+
min_stop_sequence int2,
|
|
23
|
+
max_stop_sequence int2,
|
|
24
|
+
trip_id varchar(50),
|
|
25
|
+
trip_headsign varchar(100),
|
|
26
|
+
trip_short_name varchar(30),
|
|
27
|
+
wheelchair_accessible int2,
|
|
28
|
+
route_short_name varchar(50),
|
|
29
|
+
route_type int2,
|
|
30
|
+
route_id varchar(20),
|
|
31
|
+
is_night bpchar(1),
|
|
32
|
+
is_regional bpchar(1),
|
|
33
|
+
is_substitute_transport bpchar(1),
|
|
34
|
+
next_stop_id varchar(30),
|
|
35
|
+
delay_seconds int4,
|
|
36
|
+
real_wheelchair_accessible bool,
|
|
37
|
+
is_canceled bool,
|
|
38
|
+
"trip.gtfs_trip_short_name" varchar(255),
|
|
39
|
+
"trip.gtfs_date" date,
|
|
40
|
+
"trip.internal_route_name" varchar(50),
|
|
41
|
+
"trip.internal_run_number" int4,
|
|
42
|
+
"trip.start_timestamp" timestamptz,
|
|
43
|
+
"trip.last_position.last_stop_id" varchar(255),
|
|
44
|
+
"trip.last_position.last_stop_sequence" int4,
|
|
45
|
+
"trip.last_position.last_stop_name" varchar(255),
|
|
46
|
+
"trip.last_position.this_stop_sequence" int4,
|
|
47
|
+
"trip.cis_stop_platform_code" varchar(15),
|
|
48
|
+
"trip.vehicle_descriptor.is_air_conditioned" bool,
|
|
49
|
+
delay_minutes int4,
|
|
50
|
+
is_delay_available bool,
|
|
51
|
+
run_number int4
|
|
52
|
+
|
|
53
|
+
)
|
|
54
|
+
language SQL
|
|
55
|
+
set search_path from current
|
|
56
|
+
as $$
|
|
57
|
+
select
|
|
58
|
+
departure_boards_detailed."computed.departure_datetime_real",
|
|
59
|
+
departure_boards_detailed."computed.arrival_datetime_real",
|
|
60
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence",
|
|
61
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_headsign",
|
|
62
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.arrival_datetime",
|
|
63
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.departure_datetime",
|
|
64
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_id",
|
|
65
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.platform_code",
|
|
66
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.wheelchair_boarding",
|
|
67
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.min_stop_sequence",
|
|
68
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.max_stop_sequence",
|
|
69
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.trip_id",
|
|
70
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.trip_headsign",
|
|
71
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.trip_short_name",
|
|
72
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.wheelchair_accessible",
|
|
73
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.route_short_name",
|
|
74
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.route_type",
|
|
75
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.route_id",
|
|
76
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.is_night",
|
|
77
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.is_regional",
|
|
78
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.is_substitute_transport",
|
|
79
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.next_stop_id",
|
|
80
|
+
departure_boards_detailed."delay_seconds",
|
|
81
|
+
departure_boards_detailed."real_wheelchair_accessible",
|
|
82
|
+
departure_boards_detailed."is_canceled",
|
|
83
|
+
departure_boards_detailed."trip.gtfs_trip_short_name",
|
|
84
|
+
departure_boards_detailed."trip.gtfs_date",
|
|
85
|
+
departure_boards_detailed."trip.internal_route_name",
|
|
86
|
+
departure_boards_detailed."trip.internal_run_number",
|
|
87
|
+
departure_boards_detailed."trip.start_timestamp",
|
|
88
|
+
departure_boards_detailed."trip.last_position.last_stop_id",
|
|
89
|
+
departure_boards_detailed."trip.last_position.last_stop_sequence",
|
|
90
|
+
departure_boards_detailed."trip.last_position.last_stop_name",
|
|
91
|
+
departure_boards_detailed."trip.last_position.this_stop_sequence",
|
|
92
|
+
departure_boards_detailed.cis_stop_platform_code as "trip.cis_stop_platform_code",
|
|
93
|
+
case when airconditioninfoenabled = 1 then departure_boards_detailed."trip.vehicle_descriptor.is_air_conditioned" else NULL end,
|
|
94
|
+
TRUNC(departure_boards_detailed."trip.last_position.delay"::DECIMAL / 60, 0)::int as "delay_minutes",
|
|
95
|
+
case when departure_boards_detailed."trip.last_position.delay" is null then false else true end as "is_delay_available",
|
|
96
|
+
departure_boards_detailed."run.run_number"
|
|
97
|
+
|
|
98
|
+
from (
|
|
99
|
+
select
|
|
100
|
+
("departure_datetime"
|
|
101
|
+
+ MAKE_INTERVAL(secs => (case when "trip.last_position.delay" is null then 0 else "trip.last_position.delay" end))
|
|
102
|
+
- case when (MAKE_INTERVAL(secs => (case when "trip.last_position.delay" is null then 0 else "trip.last_position.delay" end)) > MAKE_INTERVAL())
|
|
103
|
+
then least (
|
|
104
|
+
MAKE_INTERVAL(secs => (case when "trip.last_position.delay" is null then 0 else "trip.last_position.delay" end)),
|
|
105
|
+
("departure_datetime" - "arrival_datetime")::interval
|
|
106
|
+
)
|
|
107
|
+
else MAKE_INTERVAL()
|
|
108
|
+
end
|
|
109
|
+
) "computed.departure_datetime_real",
|
|
110
|
+
"arrival_datetime" + MAKE_INTERVAL(secs => (
|
|
111
|
+
CASE WHEN "trip.last_position.delay" IS NULL THEN 0 ELSE "trip.last_position.delay" end
|
|
112
|
+
)) "computed.arrival_datetime_real",
|
|
113
|
+
"ropidgtfs_precomputed_departures"."stop_sequence" as "ropidgtfs_precomputed_departures.stop_sequence",
|
|
114
|
+
"ropidgtfs_precomputed_departures"."stop_headsign" as "ropidgtfs_precomputed_departures.stop_headsign",
|
|
115
|
+
"ropidgtfs_precomputed_departures"."pickup_type" as "ropidgtfs_precomputed_departures.pickup_type",
|
|
116
|
+
"ropidgtfs_precomputed_departures"."drop_off_type" as "ropidgtfs_precomputed_departures.drop_off_type",
|
|
117
|
+
"ropidgtfs_precomputed_departures"."arrival_time" as "ropidgtfs_precomputed_departures.arrival_time",
|
|
118
|
+
"ropidgtfs_precomputed_departures"."arrival_datetime" as "ropidgtfs_precomputed_departures.arrival_datetime",
|
|
119
|
+
"ropidgtfs_precomputed_departures"."departure_time" as "ropidgtfs_precomputed_departures.departure_time",
|
|
120
|
+
"ropidgtfs_precomputed_departures"."departure_datetime" as "ropidgtfs_precomputed_departures.departure_datetime",
|
|
121
|
+
"ropidgtfs_precomputed_departures"."stop_id" as "ropidgtfs_precomputed_departures.stop_id",
|
|
122
|
+
"ropidgtfs_precomputed_departures"."stop_name" as "ropidgtfs_precomputed_departures.stop_name",
|
|
123
|
+
"ropidgtfs_precomputed_departures"."platform_code" as "ropidgtfs_precomputed_departures.platform_code",
|
|
124
|
+
"ropidgtfs_precomputed_departures"."wheelchair_boarding" as "ropidgtfs_precomputed_departures.wheelchair_boarding",
|
|
125
|
+
"ropidgtfs_precomputed_departures"."min_stop_sequence" as "ropidgtfs_precomputed_departures.min_stop_sequence",
|
|
126
|
+
"ropidgtfs_precomputed_departures"."max_stop_sequence" as "ropidgtfs_precomputed_departures.max_stop_sequence",
|
|
127
|
+
"ropidgtfs_precomputed_departures"."trip_id" as "ropidgtfs_precomputed_departures.trip_id",
|
|
128
|
+
"ropidgtfs_precomputed_departures"."trip_headsign" as "ropidgtfs_precomputed_departures.trip_headsign",
|
|
129
|
+
"ropidgtfs_precomputed_departures"."trip_short_name" as "ropidgtfs_precomputed_departures.trip_short_name",
|
|
130
|
+
"ropidgtfs_precomputed_departures"."wheelchair_accessible" as "ropidgtfs_precomputed_departures.wheelchair_accessible",
|
|
131
|
+
"ropidgtfs_precomputed_departures"."service_id" as "ropidgtfs_precomputed_departures.service_id",
|
|
132
|
+
"ropidgtfs_precomputed_departures"."date" as "ropidgtfs_precomputed_departures.date",
|
|
133
|
+
"ropidgtfs_precomputed_departures"."route_short_name" as "ropidgtfs_precomputed_departures.route_short_name",
|
|
134
|
+
"ropidgtfs_precomputed_departures"."route_type" as "ropidgtfs_precomputed_departures.route_type",
|
|
135
|
+
"ropidgtfs_precomputed_departures"."route_id" as "ropidgtfs_precomputed_departures.route_id",
|
|
136
|
+
"ropidgtfs_precomputed_departures"."is_night" as "ropidgtfs_precomputed_departures.is_night",
|
|
137
|
+
"ropidgtfs_precomputed_departures"."is_regional" as "ropidgtfs_precomputed_departures.is_regional",
|
|
138
|
+
"ropidgtfs_precomputed_departures"."is_substitute_transport" as "ropidgtfs_precomputed_departures.is_substitute_transport",
|
|
139
|
+
"ropidgtfs_precomputed_departures"."next_stop_sequence" as "ropidgtfs_precomputed_departures.next_stop_sequence",
|
|
140
|
+
"ropidgtfs_precomputed_departures"."next_stop_id" as "ropidgtfs_precomputed_departures.next_stop_id",
|
|
141
|
+
"ropidgtfs_precomputed_departures"."last_stop_sequence" as "ropidgtfs_precomputed_departures.last_stop_sequence",
|
|
142
|
+
"ropidgtfs_precomputed_departures"."last_stop_id" as "ropidgtfs_precomputed_departures.last_stop_id",
|
|
143
|
+
x.*,
|
|
144
|
+
cis_stop.cis_stop_platform_code as "cis_stop_platform_code",
|
|
145
|
+
run.run_number as "run.run_number"
|
|
146
|
+
from
|
|
147
|
+
"ropidgtfs_precomputed_departures" as "ropidgtfs_precomputed_departures"
|
|
148
|
+
left join "ropidgtfs_run_numbers" as run on
|
|
149
|
+
"ropidgtfs_precomputed_departures"."trip_id" = run.trip_id
|
|
150
|
+
and "ropidgtfs_precomputed_departures"."service_id" = run.service_id
|
|
151
|
+
left outer join v_vehiclepositions_trip_position_vehicle_info as x on
|
|
152
|
+
"ropidgtfs_precomputed_departures"."trip_id" = x."trip.gtfs_trip_id"
|
|
153
|
+
left join vehiclepositions_cis_stops as cis_stop on
|
|
154
|
+
cis_stop.rt_trip_id = x."trip.id"
|
|
155
|
+
and cis_stop.cis_stop_group_id = "ropidgtfs_precomputed_departures"."cis_stop_group_id"
|
|
156
|
+
) departure_boards_detailed
|
|
157
|
+
where
|
|
158
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_id" = ANY(STRING_TO_ARRAY(stopsIds,','))
|
|
159
|
+
and (
|
|
160
|
+
(
|
|
161
|
+
(
|
|
162
|
+
(mode = 1 and departure_boards_detailed."computed.arrival_datetime_real" between dateDepartureBetweenStart and dateDepartureBetweenEnd)
|
|
163
|
+
or (mode != 1 and departure_boards_detailed."computed.departure_datetime_real" between dateDepartureBetweenStart and dateDepartureBetweenEnd)
|
|
164
|
+
)
|
|
165
|
+
and
|
|
166
|
+
(
|
|
167
|
+
0 = isNegativeMinutesBefore
|
|
168
|
+
or ( -- pro záporné minutes before
|
|
169
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence" >= departure_boards_detailed."trip.last_position.last_stop_sequence"
|
|
170
|
+
or departure_boards_detailed."trip.last_position.last_stop_sequence" IS null
|
|
171
|
+
)
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
)
|
|
175
|
+
or (
|
|
176
|
+
departure_boards_detailed."trip.is_canceled" = true
|
|
177
|
+
and
|
|
178
|
+
(
|
|
179
|
+
(mode = 1 and departure_boards_detailed."computed.arrival_datetime_real" between dateCanceledDepartureBetweenStart and dateCanceledDepartureBetweenEnd)
|
|
180
|
+
or (mode != 1 and departure_boards_detailed."computed.departure_datetime_real" between dateCanceledDepartureBetweenStart and dateCanceledDepartureBetweenEnd)
|
|
181
|
+
)
|
|
182
|
+
)
|
|
183
|
+
) and
|
|
184
|
+
(
|
|
185
|
+
(mode = 1 and (departure_boards_detailed."ropidgtfs_precomputed_departures.pickup_type" != '1' and departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence" != departure_boards_detailed."ropidgtfs_precomputed_departures.max_stop_sequence")) -- mode default/departures
|
|
186
|
+
or (mode=2 and (departure_boards_detailed."ropidgtfs_precomputed_departures.drop_off_type" != '1' and departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence" != departure_boards_detailed."ropidgtfs_precomputed_departures.min_stop_sequence")) -- mode arrivals
|
|
187
|
+
or (mode=3 and (departure_boards_detailed."ropidgtfs_precomputed_departures.pickup_type" != '1')) -- mode mixed
|
|
188
|
+
);
|
|
189
|
+
$$;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
drop function get_departures;
|
|
2
|
+
create function get_departures (
|
|
3
|
+
stopsIds varchar,
|
|
4
|
+
mode int,
|
|
5
|
+
dateDepartureBetweenStart timestamptz,
|
|
6
|
+
dateDepartureBetweenEnd timestamptz,
|
|
7
|
+
isNegativeMinutesBefore int,
|
|
8
|
+
dateCanceledDepartureBetweenStart timestamptz,
|
|
9
|
+
dateCanceledDepartureBetweenEnd timestamptz,
|
|
10
|
+
airconditioninfoenabled int
|
|
11
|
+
)
|
|
12
|
+
returns table (
|
|
13
|
+
departure_datetime_real timestamptz,
|
|
14
|
+
arrival_datetime_real timestamptz,
|
|
15
|
+
stop_sequence int2,
|
|
16
|
+
stop_headsign varchar(70),
|
|
17
|
+
arrival_datetime timestamptz,
|
|
18
|
+
departure_datetime timestamptz,
|
|
19
|
+
stop_id varchar(25),
|
|
20
|
+
platform_code varchar(10),
|
|
21
|
+
wheelchair_boarding int2,
|
|
22
|
+
min_stop_sequence int2,
|
|
23
|
+
max_stop_sequence int2,
|
|
24
|
+
trip_id varchar(50),
|
|
25
|
+
trip_headsign varchar(100),
|
|
26
|
+
trip_short_name varchar(30),
|
|
27
|
+
wheelchair_accessible int2,
|
|
28
|
+
route_short_name varchar(50),
|
|
29
|
+
route_type int2,
|
|
30
|
+
route_id varchar(20),
|
|
31
|
+
is_night bpchar(1),
|
|
32
|
+
is_regional bpchar(1),
|
|
33
|
+
is_substitute_transport bpchar(1),
|
|
34
|
+
next_stop_id varchar(30),
|
|
35
|
+
delay_seconds int4,
|
|
36
|
+
real_wheelchair_accessible bool,
|
|
37
|
+
is_canceled bool,
|
|
38
|
+
"trip.gtfs_trip_short_name" varchar(255),
|
|
39
|
+
"trip.gtfs_date" date,
|
|
40
|
+
"trip.internal_route_name" varchar(50),
|
|
41
|
+
"trip.internal_run_number" int4,
|
|
42
|
+
"trip.start_timestamp" timestamptz,
|
|
43
|
+
"trip.last_position.last_stop_id" varchar(255),
|
|
44
|
+
"trip.last_position.last_stop_sequence" int4,
|
|
45
|
+
"trip.last_position.last_stop_name" varchar(255),
|
|
46
|
+
"trip.last_position.this_stop_sequence" int4,
|
|
47
|
+
"trip.cis_stop_platform_code" varchar(15),
|
|
48
|
+
"trip.vehicle_descriptor.is_air_conditioned" bool,
|
|
49
|
+
delay_minutes int4,
|
|
50
|
+
is_delay_available bool,
|
|
51
|
+
run_number int4,
|
|
52
|
+
planned_start_timestamp timestamptz
|
|
53
|
+
|
|
54
|
+
)
|
|
55
|
+
language SQL
|
|
56
|
+
set search_path from current
|
|
57
|
+
as $$
|
|
58
|
+
select
|
|
59
|
+
departure_boards_detailed."computed.departure_datetime_real",
|
|
60
|
+
departure_boards_detailed."computed.arrival_datetime_real",
|
|
61
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence",
|
|
62
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_headsign",
|
|
63
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.arrival_datetime",
|
|
64
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.departure_datetime",
|
|
65
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_id",
|
|
66
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.platform_code",
|
|
67
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.wheelchair_boarding",
|
|
68
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.min_stop_sequence",
|
|
69
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.max_stop_sequence",
|
|
70
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.trip_id",
|
|
71
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.trip_headsign",
|
|
72
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.trip_short_name",
|
|
73
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.wheelchair_accessible",
|
|
74
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.route_short_name",
|
|
75
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.route_type",
|
|
76
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.route_id",
|
|
77
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.is_night",
|
|
78
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.is_regional",
|
|
79
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.is_substitute_transport",
|
|
80
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.next_stop_id",
|
|
81
|
+
departure_boards_detailed."delay_seconds",
|
|
82
|
+
departure_boards_detailed."real_wheelchair_accessible",
|
|
83
|
+
departure_boards_detailed."is_canceled",
|
|
84
|
+
departure_boards_detailed."trip.gtfs_trip_short_name",
|
|
85
|
+
departure_boards_detailed."trip.gtfs_date",
|
|
86
|
+
departure_boards_detailed."trip.internal_route_name",
|
|
87
|
+
departure_boards_detailed."trip.internal_run_number",
|
|
88
|
+
departure_boards_detailed."trip.start_timestamp",
|
|
89
|
+
departure_boards_detailed."trip.last_position.last_stop_id",
|
|
90
|
+
departure_boards_detailed."trip.last_position.last_stop_sequence",
|
|
91
|
+
departure_boards_detailed."trip.last_position.last_stop_name",
|
|
92
|
+
departure_boards_detailed."trip.last_position.this_stop_sequence",
|
|
93
|
+
departure_boards_detailed.cis_stop_platform_code as "trip.cis_stop_platform_code",
|
|
94
|
+
case when airconditioninfoenabled = 1 then departure_boards_detailed."trip.vehicle_descriptor.is_air_conditioned" else NULL end,
|
|
95
|
+
TRUNC(departure_boards_detailed."trip.last_position.delay"::DECIMAL / 60, 0)::int as "delay_minutes",
|
|
96
|
+
case when departure_boards_detailed."trip.last_position.delay" is null then false else true end as "is_delay_available",
|
|
97
|
+
departure_boards_detailed."run.run_number",
|
|
98
|
+
departure_boards_detailed.planned_start_timestamp
|
|
99
|
+
|
|
100
|
+
from (
|
|
101
|
+
select
|
|
102
|
+
("departure_datetime"
|
|
103
|
+
+ MAKE_INTERVAL(secs => (case when "trip.last_position.delay" is null then 0 else "trip.last_position.delay" end))
|
|
104
|
+
- case when (MAKE_INTERVAL(secs => (case when "trip.last_position.delay" is null then 0 else "trip.last_position.delay" end)) > MAKE_INTERVAL())
|
|
105
|
+
then least (
|
|
106
|
+
MAKE_INTERVAL(secs => (case when "trip.last_position.delay" is null then 0 else "trip.last_position.delay" end)),
|
|
107
|
+
("departure_datetime" - "arrival_datetime")::interval
|
|
108
|
+
)
|
|
109
|
+
else MAKE_INTERVAL()
|
|
110
|
+
end
|
|
111
|
+
) "computed.departure_datetime_real",
|
|
112
|
+
"arrival_datetime" + MAKE_INTERVAL(secs => (
|
|
113
|
+
CASE WHEN "trip.last_position.delay" IS NULL THEN 0 ELSE "trip.last_position.delay" end
|
|
114
|
+
)) "computed.arrival_datetime_real",
|
|
115
|
+
"ropidgtfs_precomputed_departures"."stop_sequence" as "ropidgtfs_precomputed_departures.stop_sequence",
|
|
116
|
+
"ropidgtfs_precomputed_departures"."stop_headsign" as "ropidgtfs_precomputed_departures.stop_headsign",
|
|
117
|
+
"ropidgtfs_precomputed_departures"."pickup_type" as "ropidgtfs_precomputed_departures.pickup_type",
|
|
118
|
+
"ropidgtfs_precomputed_departures"."drop_off_type" as "ropidgtfs_precomputed_departures.drop_off_type",
|
|
119
|
+
"ropidgtfs_precomputed_departures"."arrival_time" as "ropidgtfs_precomputed_departures.arrival_time",
|
|
120
|
+
"ropidgtfs_precomputed_departures"."arrival_datetime" as "ropidgtfs_precomputed_departures.arrival_datetime",
|
|
121
|
+
"ropidgtfs_precomputed_departures"."departure_time" as "ropidgtfs_precomputed_departures.departure_time",
|
|
122
|
+
"ropidgtfs_precomputed_departures"."departure_datetime" as "ropidgtfs_precomputed_departures.departure_datetime",
|
|
123
|
+
"ropidgtfs_precomputed_departures"."stop_id" as "ropidgtfs_precomputed_departures.stop_id",
|
|
124
|
+
"ropidgtfs_precomputed_departures"."stop_name" as "ropidgtfs_precomputed_departures.stop_name",
|
|
125
|
+
"ropidgtfs_precomputed_departures"."platform_code" as "ropidgtfs_precomputed_departures.platform_code",
|
|
126
|
+
"ropidgtfs_precomputed_departures"."wheelchair_boarding" as "ropidgtfs_precomputed_departures.wheelchair_boarding",
|
|
127
|
+
"ropidgtfs_precomputed_departures"."min_stop_sequence" as "ropidgtfs_precomputed_departures.min_stop_sequence",
|
|
128
|
+
"ropidgtfs_precomputed_departures"."max_stop_sequence" as "ropidgtfs_precomputed_departures.max_stop_sequence",
|
|
129
|
+
"ropidgtfs_precomputed_departures"."trip_id" as "ropidgtfs_precomputed_departures.trip_id",
|
|
130
|
+
"ropidgtfs_precomputed_departures"."trip_headsign" as "ropidgtfs_precomputed_departures.trip_headsign",
|
|
131
|
+
"ropidgtfs_precomputed_departures"."trip_short_name" as "ropidgtfs_precomputed_departures.trip_short_name",
|
|
132
|
+
"ropidgtfs_precomputed_departures"."wheelchair_accessible" as "ropidgtfs_precomputed_departures.wheelchair_accessible",
|
|
133
|
+
"ropidgtfs_precomputed_departures"."service_id" as "ropidgtfs_precomputed_departures.service_id",
|
|
134
|
+
"ropidgtfs_precomputed_departures"."date" as "ropidgtfs_precomputed_departures.date",
|
|
135
|
+
"ropidgtfs_precomputed_departures"."route_short_name" as "ropidgtfs_precomputed_departures.route_short_name",
|
|
136
|
+
"ropidgtfs_precomputed_departures"."route_type" as "ropidgtfs_precomputed_departures.route_type",
|
|
137
|
+
"ropidgtfs_precomputed_departures"."route_id" as "ropidgtfs_precomputed_departures.route_id",
|
|
138
|
+
"ropidgtfs_precomputed_departures"."is_night" as "ropidgtfs_precomputed_departures.is_night",
|
|
139
|
+
"ropidgtfs_precomputed_departures"."is_regional" as "ropidgtfs_precomputed_departures.is_regional",
|
|
140
|
+
"ropidgtfs_precomputed_departures"."is_substitute_transport" as "ropidgtfs_precomputed_departures.is_substitute_transport",
|
|
141
|
+
"ropidgtfs_precomputed_departures"."next_stop_sequence" as "ropidgtfs_precomputed_departures.next_stop_sequence",
|
|
142
|
+
"ropidgtfs_precomputed_departures"."next_stop_id" as "ropidgtfs_precomputed_departures.next_stop_id",
|
|
143
|
+
"ropidgtfs_precomputed_departures"."last_stop_sequence" as "ropidgtfs_precomputed_departures.last_stop_sequence",
|
|
144
|
+
"ropidgtfs_precomputed_departures"."last_stop_id" as "ropidgtfs_precomputed_departures.last_stop_id",
|
|
145
|
+
plan_start.planned_departure AS planned_start_timestamp,
|
|
146
|
+
x.*,
|
|
147
|
+
cis_stop.cis_stop_platform_code as "cis_stop_platform_code",
|
|
148
|
+
run.run_number as "run.run_number"
|
|
149
|
+
from
|
|
150
|
+
"ropidgtfs_precomputed_departures" as "ropidgtfs_precomputed_departures"
|
|
151
|
+
left join "ropidgtfs_run_numbers" as run on
|
|
152
|
+
"ropidgtfs_precomputed_departures"."trip_id" = run.trip_id
|
|
153
|
+
and "ropidgtfs_precomputed_departures"."service_id" = run.service_id
|
|
154
|
+
left outer join v_vehiclepositions_trip_position_vehicle_info as x on
|
|
155
|
+
"ropidgtfs_precomputed_departures"."trip_id" = x."trip.gtfs_trip_id"
|
|
156
|
+
left join lateral (
|
|
157
|
+
select pd.departure_datetime as planned_departure
|
|
158
|
+
from ropidgtfs_precomputed_departures pd
|
|
159
|
+
where pd.trip_id = "ropidgtfs_precomputed_departures".trip_id
|
|
160
|
+
and pd.date = "ropidgtfs_precomputed_departures".date
|
|
161
|
+
and pd.stop_sequence = 1
|
|
162
|
+
limit 1
|
|
163
|
+
) as plan_start on true
|
|
164
|
+
left join vehiclepositions_cis_stops as cis_stop on
|
|
165
|
+
cis_stop.rt_trip_id = x."trip.id"
|
|
166
|
+
and cis_stop.cis_stop_group_id = "ropidgtfs_precomputed_departures"."cis_stop_group_id"
|
|
167
|
+
) departure_boards_detailed
|
|
168
|
+
where
|
|
169
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_id" = ANY(STRING_TO_ARRAY(stopsIds,','))
|
|
170
|
+
and (
|
|
171
|
+
(
|
|
172
|
+
(
|
|
173
|
+
(mode = 1 and departure_boards_detailed."computed.arrival_datetime_real" between dateDepartureBetweenStart and dateDepartureBetweenEnd)
|
|
174
|
+
or (mode != 1 and departure_boards_detailed."computed.departure_datetime_real" between dateDepartureBetweenStart and dateDepartureBetweenEnd)
|
|
175
|
+
)
|
|
176
|
+
and
|
|
177
|
+
(
|
|
178
|
+
0 = isNegativeMinutesBefore
|
|
179
|
+
or ( -- pro záporné minutes before
|
|
180
|
+
departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence" >= departure_boards_detailed."trip.last_position.last_stop_sequence"
|
|
181
|
+
or departure_boards_detailed."trip.last_position.last_stop_sequence" IS null
|
|
182
|
+
)
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
)
|
|
186
|
+
or (
|
|
187
|
+
departure_boards_detailed."trip.is_canceled" = true
|
|
188
|
+
and
|
|
189
|
+
(
|
|
190
|
+
(mode = 1 and departure_boards_detailed."computed.arrival_datetime_real" between dateCanceledDepartureBetweenStart and dateCanceledDepartureBetweenEnd)
|
|
191
|
+
or (mode != 1 and departure_boards_detailed."computed.departure_datetime_real" between dateCanceledDepartureBetweenStart and dateCanceledDepartureBetweenEnd)
|
|
192
|
+
)
|
|
193
|
+
)
|
|
194
|
+
) and
|
|
195
|
+
(
|
|
196
|
+
(mode = 1 and (departure_boards_detailed."ropidgtfs_precomputed_departures.pickup_type" != '1' and departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence" != departure_boards_detailed."ropidgtfs_precomputed_departures.max_stop_sequence")) -- mode default/departures
|
|
197
|
+
or (mode=2 and (departure_boards_detailed."ropidgtfs_precomputed_departures.drop_off_type" != '1' and departure_boards_detailed."ropidgtfs_precomputed_departures.stop_sequence" != departure_boards_detailed."ropidgtfs_precomputed_departures.min_stop_sequence")) -- mode arrivals
|
|
198
|
+
or (mode=3 and (departure_boards_detailed."ropidgtfs_precomputed_departures.pickup_type" != '1')) -- mode mixed
|
|
199
|
+
);
|
|
200
|
+
$$;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class RedisJsonParser {
|
|
2
|
+
/**
|
|
3
|
+
* Parses a Redis JSON.GET response when multiple properties are requested.
|
|
4
|
+
* For multiple properties, the result is like: { "$.a": [valueA], "$.b": [valueB] }.
|
|
5
|
+
*
|
|
6
|
+
* @param json - The JSON string or object to parse.
|
|
7
|
+
* @param context - Additional context for error handling.
|
|
8
|
+
* @returns The parsed object with unwrapped values.
|
|
9
|
+
*/
|
|
10
|
+
static parse<T extends object>(json: string | object, context: string): T;
|
|
11
|
+
/**
|
|
12
|
+
* Parses a Redis JSON.GET response when a single property is requested.
|
|
13
|
+
* Result for one property is like: [ [ ...value... ] ].
|
|
14
|
+
*
|
|
15
|
+
* @param json - The JSON string or object to parse.
|
|
16
|
+
* @param context - Additional context for error handling.
|
|
17
|
+
* @param property - The property name to extract.
|
|
18
|
+
* @returns An object with the extracted property.
|
|
19
|
+
*/
|
|
20
|
+
static parseSingle<T extends object, K extends keyof T>(json: unknown, context: string, property: K): Pick<T, K>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisJsonParser = void 0;
|
|
4
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
5
|
+
class RedisJsonParser {
|
|
6
|
+
/**
|
|
7
|
+
* Parses a Redis JSON.GET response when multiple properties are requested.
|
|
8
|
+
* For multiple properties, the result is like: { "$.a": [valueA], "$.b": [valueB] }.
|
|
9
|
+
*
|
|
10
|
+
* @param json - The JSON string or object to parse.
|
|
11
|
+
* @param context - Additional context for error handling.
|
|
12
|
+
* @returns The parsed object with unwrapped values.
|
|
13
|
+
*/
|
|
14
|
+
static parse(json, context) {
|
|
15
|
+
let parsed;
|
|
16
|
+
try {
|
|
17
|
+
parsed = typeof json === "string" ? JSON.parse(json) : json;
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
throw new golemio_errors_1.GeneralError(`Failed to parse Redis JSON with more properties`, context, err);
|
|
21
|
+
}
|
|
22
|
+
const obj = {};
|
|
23
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
24
|
+
const newKey = key.startsWith("$.") ? key.slice(2) : key;
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
obj[newKey] = value.length === 1 ? value[0] : value;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
obj[newKey] = value;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parses a Redis JSON.GET response when a single property is requested.
|
|
36
|
+
* Result for one property is like: [ [ ...value... ] ].
|
|
37
|
+
*
|
|
38
|
+
* @param json - The JSON string or object to parse.
|
|
39
|
+
* @param context - Additional context for error handling.
|
|
40
|
+
* @param property - The property name to extract.
|
|
41
|
+
* @returns An object with the extracted property.
|
|
42
|
+
*/
|
|
43
|
+
static parseSingle(json, context, property) {
|
|
44
|
+
try {
|
|
45
|
+
const parsed = typeof json === "string" ? JSON.parse(json) : json;
|
|
46
|
+
const value = Array.isArray(parsed) && parsed.length === 1 ? parsed[0] : parsed;
|
|
47
|
+
return {
|
|
48
|
+
[property]: value,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
throw new golemio_errors_1.GeneralError(`Failed to parse Redis JSON with single property`, context, err);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.RedisJsonParser = RedisJsonParser;
|
|
57
|
+
//# sourceMappingURL=RedisJsonParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedisJsonParser.js","sourceRoot":"","sources":["../../src/helpers/RedisJsonParser.ts"],"names":[],"mappings":";;;AAAA,6EAA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IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAEhF,OAAO;gBACH,CAAC,QAAQ,CAAC,EAAE,KAAK;aACN,CAAC;SACnB;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,6BAAY,CAAC,iDAAiD,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;SAC3F;IACL,CAAC;CACJ;AAnDD,0CAmDC"}
|
|
@@ -20,7 +20,6 @@ class VehiclePositionsController extends controllers_1.BaseController {
|
|
|
20
20
|
const dataBatches = this.splitData(inputData);
|
|
21
21
|
for (const batch of dataBatches) {
|
|
22
22
|
await this.sendMessageToExchange("input." + this.queuePrefix + ".saveDataToDB", JSON.stringify(batch), {
|
|
23
|
-
persistent: true,
|
|
24
23
|
timestamp: new Date().getTime(),
|
|
25
24
|
});
|
|
26
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VehiclePositionsController.js","sourceRoot":"","sources":["../../../src/input-gateway/vehicle-positions/VehiclePositionsController.ts"],"names":[],"mappings":";;;AAAA,kFAA0D;AAG1D,wEAAqE;AACrE,8EAA8E;AAC9E,8DAA6E;AAC7E,6EAA8F;AAC9F,mFAAkF;AAElF,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,MAAa,0BAA2B,SAAQ,4BAAc;IAM1D;QACI,KAAK,CACD,oCAAgB,CAAC,IAAI,EACrB,IAAI,uCAAmB,CAAC,oCAAgB,CAAC,IAAI,GAAG,YAAY,EAAE,oCAAgB,CAAC,oBAAoB,CAAC,CACvG,CAAC;QAMN;;WAEG;QACI,gBAAW,GAAG,KAAK,EAAE,SAA2B,EAAiB,EAAE;YACtE,IAAI;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB;gBAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;gBAC9C,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE;oBAC7B,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;wBACnG,
|
|
1
|
+
{"version":3,"file":"VehiclePositionsController.js","sourceRoot":"","sources":["../../../src/input-gateway/vehicle-positions/VehiclePositionsController.ts"],"names":[],"mappings":";;;AAAA,kFAA0D;AAG1D,wEAAqE;AACrE,8EAA8E;AAC9E,8DAA6E;AAC7E,6EAA8F;AAC9F,mFAAkF;AAElF,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,MAAa,0BAA2B,SAAQ,4BAAc;IAM1D;QACI,KAAK,CACD,oCAAgB,CAAC,IAAI,EACrB,IAAI,uCAAmB,CAAC,oCAAgB,CAAC,IAAI,GAAG,YAAY,EAAE,oCAAgB,CAAC,oBAAoB,CAAC,CACvG,CAAC;QAMN;;WAEG;QACI,gBAAW,GAAG,KAAK,EAAE,SAA2B,EAAiB,EAAE;YACtE,IAAI;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB;gBAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;gBAC9C,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE;oBAC7B,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;wBACnG,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;qBAClC,CAAC,CAAC;iBACN;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;oBACrC,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,MAAM,IAAI,6BAAY,CAAC,oCAAoC,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;iBACrF;aACJ;QACL,CAAC,CAAC;QAEM,cAAS,GAAG,CAAC,IAAsB,EAAsB,EAAE;YAC/D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;gBAC7B,OAAO,CAAC,IAAI,CAAC,CAAC;aACjB;YAED,MAAM,MAAM,GAAuB,EAAE,CAAC;YACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,EAAE;gBAChF,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC;gBAClD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;aACvC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC;QArCE,MAAM,MAAM,GAAG,2BAAqB,CAAC,OAAO,CAAgB,qBAAS,CAAC,YAAY,CAAC,CAAC;QACpF,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,4CAA4C,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/G,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;CAmCJ;AAjDD,gEAiDC"}
|
package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { IProcessedPositions, IRedisKeyExpiration, ITripPositionsWithGTFS } from
|
|
|
2
2
|
import { RedisModel } from "@golemio/core/dist/integration-engine/models/RedisModel";
|
|
3
3
|
export declare class DelayComputationRedisRepository extends RedisModel {
|
|
4
4
|
static NAMESPACE_PREFIX: string;
|
|
5
|
+
private logger;
|
|
5
6
|
constructor();
|
|
6
7
|
expire(keys: string[], ttlInSeconds: number): Promise<void>;
|
|
7
8
|
expirePxat(tripIdsWithTtl: IRedisKeyExpiration[]): Promise<void>;
|
|
8
9
|
cacheTripDataBatch(trips: ITripPositionsWithGTFS[], positions: IProcessedPositions[]): Promise<void>;
|
|
10
|
+
getTripPropertiesBatch<T extends object>(tripIds: string[], properties: Array<keyof T>): Promise<Array<T | null>>;
|
|
9
11
|
calculateExpirationTtl(positions: IProcessedPositions[], tripId: string): number;
|
|
10
12
|
}
|
package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DelayComputationRedisRepository = void 0;
|
|
4
|
+
const RedisJsonParser_1 = require("../../../../helpers/RedisJsonParser");
|
|
5
|
+
const Di_1 = require("../../ioc/Di");
|
|
4
6
|
const DelayComputationDtoSchema_1 = require("../../../../schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema");
|
|
5
7
|
const const_1 = require("../../../../schema-definitions/vehicle-positions/redis/const");
|
|
8
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
6
9
|
const RedisModel_1 = require("@golemio/core/dist/integration-engine/models/RedisModel");
|
|
7
10
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
8
11
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
@@ -14,6 +17,7 @@ class DelayComputationRedisRepository extends RedisModel_1.RedisModel {
|
|
|
14
17
|
isKeyConstructedFromData: true,
|
|
15
18
|
prefix: DelayComputationRedisRepository.NAMESPACE_PREFIX,
|
|
16
19
|
}, new golemio_validator_1.JSONSchemaValidator("GTFSDelayComputationRedisRepositoryValidator", DelayComputationDtoSchema_1.DelayComputationDtoSchema));
|
|
20
|
+
this.logger = Di_1.RopidGtfsContainer.resolve(CoreToken_1.CoreToken.Logger);
|
|
17
21
|
}
|
|
18
22
|
async expire(keys, ttlInSeconds) {
|
|
19
23
|
const pipeline = this.connection.pipeline();
|
|
@@ -45,7 +49,9 @@ class DelayComputationRedisRepository extends RedisModel_1.RedisModel {
|
|
|
45
49
|
const pipeline = this.connection.pipeline();
|
|
46
50
|
for (const trip of trips) {
|
|
47
51
|
const expirationTtl = this.calculateExpirationTtl(positions, trip.id);
|
|
48
|
-
|
|
52
|
+
const redisKey = `${DelayComputationRedisRepository.NAMESPACE_PREFIX}:${trip.gtfs_trip_id}`;
|
|
53
|
+
pipeline.call("JSON.SET", redisKey, "$", JSON.stringify(trip.gtfsData));
|
|
54
|
+
pipeline.pexpireat(redisKey, expirationTtl);
|
|
49
55
|
}
|
|
50
56
|
try {
|
|
51
57
|
await pipeline.exec();
|
|
@@ -54,6 +60,47 @@ class DelayComputationRedisRepository extends RedisModel_1.RedisModel {
|
|
|
54
60
|
throw new golemio_errors_1.GeneralError("Error while setting caches in Redis with pipeline", this.constructor.name, err);
|
|
55
61
|
}
|
|
56
62
|
}
|
|
63
|
+
async getTripPropertiesBatch(tripIds, properties) {
|
|
64
|
+
if (tripIds.length === 0) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
const pipeline = this.connection.pipeline();
|
|
68
|
+
for (const tripId of tripIds) {
|
|
69
|
+
const redisKey = `${this.prefix}:${tripId}`;
|
|
70
|
+
const propertyPaths = [];
|
|
71
|
+
for (const prop of properties) {
|
|
72
|
+
propertyPaths.push(`$.${String(prop)}`);
|
|
73
|
+
}
|
|
74
|
+
pipeline.call("JSON.GET", redisKey, ...propertyPaths);
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const responses = await pipeline.exec();
|
|
78
|
+
if (!responses) {
|
|
79
|
+
return tripIds.map(() => null);
|
|
80
|
+
}
|
|
81
|
+
const result = [];
|
|
82
|
+
for (let index = 0; index < responses.length; index++) {
|
|
83
|
+
const [error, redisResult] = responses[index];
|
|
84
|
+
if (error) {
|
|
85
|
+
this.logger.warn({
|
|
86
|
+
error,
|
|
87
|
+
result: redisResult,
|
|
88
|
+
}, `${this.constructor.name}: Failed to fetch trip '${tripIds[index]}' from Redis`);
|
|
89
|
+
result.push(null);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (redisResult === null || redisResult === undefined) {
|
|
93
|
+
result.push(null);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
result.push(RedisJsonParser_1.RedisJsonParser.parse(redisResult, this.constructor.name));
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
throw new golemio_errors_1.GeneralError("Error while fetching trip properties batch from Redis", this.constructor.name, err);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
57
104
|
calculateExpirationTtl(positions, tripId) {
|
|
58
105
|
const now = new Date();
|
|
59
106
|
const expirationLimit = new Date(now.getTime() + 30 * 60 * 1000); // 30 minutes
|
package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayComputationRedisRepository.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DelayComputationRedisRepository.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.ts"],"names":[],"mappings":";;;AAAA,yEAA2D;AAC3D,qCAA2D;AAM3D,iIAAoG;AACpG,wFAA6F;AAE7F,wEAAqE;AACrE,wFAAqF;AACrF,6EAAwE;AACxE,mFAAkF;AAElF,MAAa,+BAAgC,SAAQ,uB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AC,uDAAuD,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC/G;IACL,CAAC;IAEM,sBAAsB,CAAC,SAAgC,EAAE,MAAc;QAC1E,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,eAAe,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,aAAa;QAE/E,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;QAEzE,IAAI,OAAO,GAAgB,IAAI,CAAC;QAEhC,IAAI,aAAa,EAAE;YACf,MAAM,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC;YACjD,MAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,cAAc,CAAC,CAAC;YACnF,OAAO,GAAG,YAAY,EAAE,QAAQ,IAAI,IAAI,CAAC;SAC5C;QAED,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IAClH,CAAC;;AArIL,0EAsIC;AArIiB,gDAAgB,GAAG,+CAAuC,CAAC"}
|
|
@@ -78,16 +78,19 @@ let DeparturePresetsFacade = exports.DeparturePresetsFacade = class DeparturePre
|
|
|
78
78
|
for (const preset of presets) {
|
|
79
79
|
const params = new URLSearchParams(preset.url_query_params);
|
|
80
80
|
const aswIds = params.getAll("aswIds");
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
const aswIdsWithBrackets = params.getAll("aswIds[]");
|
|
82
|
+
const whereOptions = this.gtfsStopParser.prepareAswWhereOptions([...new Set([...aswIds, ...aswIdsWithBrackets])]);
|
|
83
|
+
for (const whereOption of whereOptions) {
|
|
84
|
+
const stops = await this.ropidGTFSStopsModel.find({
|
|
85
|
+
where: whereOption,
|
|
85
86
|
});
|
|
86
|
-
if (
|
|
87
|
-
this.logger.warn(
|
|
87
|
+
if (stops.length === 0) {
|
|
88
|
+
this.logger.warn(whereOption, "cannot find gtfs stop with where options");
|
|
88
89
|
continue;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
+
for (const stop of stops) {
|
|
92
|
+
mappedPresetsWithGtfsStops.push({ preset_id: preset.id, stop_id: stop.stop_id });
|
|
93
|
+
}
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
return mappedPresetsWithGtfsStops;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeparturePresetsFacade.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yEAAoE;AACpE,wEAAoG;AAGpG,6FAA0F;AAC1F,iEAAwE;AACxE,wDAAiD;AACjD,gFAA6E;AAC7E,0FAAuF;AACvF,4EAAyE;AACzE,kHAA+G;AAC/G,gEAA6D;AAC7D,0IAAqI;AAGrI,oEAAyD;AAGlD,IAAM,sBAAsB,oCAA5B,MAAM,sBAAsB;IAC/B,YACyE,kBAA+C,EACvD,mBAAwC,EACpC,0BAAsD,EAE/G,8CAA8F,EAE9F,+BAAqE,EACrB,cAA8B,EAC/C,MAAe;QARe,uBAAkB,GAAlB,kBAAkB,CAA6B;QACvD,wBAAmB,GAAnB,mBAAmB,CAAqB;QACpC,+BAA0B,GAA1B,0BAA0B,CAA4B;QAE/G,mDAA8C,GAA9C,8CAA8C,CAAgD;QAE9F,oCAA+B,GAA/B,+BAA+B,CAAsC;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AO,GAAG,CAAC;aACtC,CAAC,CAAC;YAEH,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,6BAAW,CAAC,kBAAkB,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;YACzG,MAAM,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,6BAAW,CAAC,kBAAkB,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;YAE3G,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAEtE,MAAM,IAAI,CAAC,8CAA8C,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;SACrG;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACvB,MAAM,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,6BAAW,CAAC,kBAAkB,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;SAClH;IACL,CAAC;IAEO,KAAK,CAAC,qBAAqB;QAC/B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,CAAC;QAE/D,MAAM,0BAA0B,GAA4C,EAAE,CAAC;QAC/E,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAE5D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DeparturePresetsFacade.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yEAAoE;AACpE,wEAAoG;AAGpG,6FAA0F;AAC1F,iEAAwE;AACxE,wDAAiD;AACjD,gFAA6E;AAC7E,0FAAuF;AACvF,4EAAyE;AAC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IAAA,iBAAM,EAAC,2CAAoB,CAAC,oCAAoC,CAAC,CAAA;IAEjE,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,cAAc,CAAC,CAAA;IAC9C,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;qCAR2D,yDAA2B;QAClC,yCAAmB;QACR,uDAA0B;QAE/D,+FAA8C;QAE7D,2EAAoC;QACL,+BAAc;GATjF,sBAAsB,CAsFlC"}
|
|
@@ -53,6 +53,8 @@ export interface IShapeAnchorPoint {
|
|
|
53
53
|
export interface ISegmentShape extends IShape {
|
|
54
54
|
shape_at_stop: boolean;
|
|
55
55
|
}
|
|
56
|
+
export interface IComputationTripStopsAndAnchors extends Pick<IComputationTrip, "shapes_anchor_points" | "stop_times"> {
|
|
57
|
+
}
|
|
56
58
|
export interface IComputationTrip {
|
|
57
59
|
trip_id: string;
|
|
58
60
|
stop_times: IStopTime[];
|
|
@@ -64,7 +66,7 @@ export interface IRedisKeyExpiration {
|
|
|
64
66
|
expirationTtl: number;
|
|
65
67
|
}
|
|
66
68
|
export interface ITripPositionsWithOrWithoutGTFS {
|
|
67
|
-
gtfsData:
|
|
69
|
+
gtfsData: IComputationTripStopsAndAnchors | null;
|
|
68
70
|
id: string;
|
|
69
71
|
gtfs_trip_id: string;
|
|
70
72
|
gtfs_route_type: GTFSRouteTypeEnum;
|
|
@@ -88,9 +88,8 @@ class ProcessRegionalBusPositionsTask extends workers_1.AbstractTask {
|
|
|
88
88
|
let tripsPositionsWithGtfsData = [];
|
|
89
89
|
try {
|
|
90
90
|
const tripsPositionsToUpdate = await this.positionsRepository.getPositionsForUpdateDelay(tripIds);
|
|
91
|
-
gtfsComputationTrips =
|
|
92
|
-
|
|
93
|
-
tripsPositionsToUpdate.map((trip) => trip.gtfs_trip_id));
|
|
91
|
+
gtfsComputationTrips =
|
|
92
|
+
await this.delayComputationRedisRepository.getTripPropertiesBatch(tripsPositionsToUpdate.map((trip) => trip.gtfs_trip_id), ["shapes_anchor_points", "stop_times"]);
|
|
94
93
|
for (let i = 0; i < tripsPositionsToUpdate.length; i++) {
|
|
95
94
|
const trip = tripsPositionsToUpdate[i];
|
|
96
95
|
const gtfsData = gtfsComputationTrips[i];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessRegionalBusPositionsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.ts"],"names":[],"mappings":";;;AAAA,oFAAyE;AACzE,oEAAmF;AACnF,wCAA2D;AAC3D,oEAA8E;AAE9E,wEAAqE;AAErE,2FAAqF;AACrF,2EAA6E;AAC7E,6EAA8F;AAE9F,4EAAyE;AACzE,oEAAiE;AACjE,gFAA6E;
|
|
1
|
+
{"version":3,"file":"ProcessRegionalBusPositionsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.ts"],"names":[],"mappings":";;;AAAA,oFAAyE;AACzE,oEAAmF;AACnF,wCAA2D;AAC3D,oEAA8E;AAE9E,wEAAqE;AAErE,2FAAqF;AACrF,2EAA6E;AAC7E,6EAA8F;AAE9F,4EAAyE;AACzE,oEAAiE;AACjE,gFAA6E;AAW7E,mEAA0E;AAC1E,qEAAkE;AAElE,MAAa,+BAAgC,SAAQ,sBAA+B;IAahF,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAbP,cAAS,GAAG,6BAA6B,CAAC;QAC1C,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,+CAA2B,CAAC;QAoG7C,sCAAiC,GAAG,KAAK,EAC7C,IAAqC,EACG,EAAE;YAC1C,IAAI;gBACA,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACvG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MAAM,CAAC,IAAI,CAAC,eAAe,KAAK,wBAAwB,CAAC,CAAC;IACnE,CAAC;IAEO,kBAAkB,CAAC,SAA0C;QACjE,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,kBAAkB,IAAI,CAAC,CAAC,CAAC,CAAC;QACpG,IAAI,eAAe,KAAK,CAAC,EAAE;YACvB,MAAM,IAAI,6BAAY,CAAC,0CAA0C,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAC7F;QAED,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AAjOD,0EAiOC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropagateTrainDelayTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.ts"],"names":[],"mappings":";;;AACA,sDAA2D;AAC3D,gGAAqF;AAErF,wEAAqE;AAErE,mEAAuF;AACvF,mEAAyD;AAGzD,mFAAqF;AACrF,sFAAmF;AAEnF,MAAa,uBAAwB,SAAQ,uDAAqD;IAU9F,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAVP,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,0DAA8B,CAAC;QAiEhD,sBAAiB,GAAG,KAAK,EAC7B,aAAiC,EACjC,eAAuB,EACI,EAAE;YAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;gBAC5C,UAAU,EAAE,CAAC,cAAc,CAAC;gBAC5B,KAAK,EAAE;oBACH,aAAa,EAAE,aAAa;oBAC5B,eAAe,EAAE,EAAE,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,eAAe,EAAE;i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CAAC;gBACjF,MAAM,yBAAyB,GAC3B,mBAAmB,KAAK,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;gBAErF,MAAM,IAAI,CAAC,yBAAyB,CAAC;oBACjC,iBAAiB,EAAE,YAAY;oBAC/B,kBAAkB,EAAE,aAAa,IAAI,IAAI;oBACzC,sBAAsB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,eAAe;oBACjE,YAAY,EAAE,gBAAgB,CAAC,QAAQ,CAAC,cAAc;oBACtD,yBAAyB,EAAE,2BAA2B;oBACtD,gBAAgB,EAAE,eAAe;oBACjC,cAAc,EAAE,aAAc;oBAC9B,cAAc,EAAE,gBAAgB,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"PropagateTrainDelayTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.ts"],"names":[],"mappings":";;;AACA,sDAA2D;AAC3D,gGAAqF;AAErF,wEAAqE;AAErE,mEAAuF;AACvF,mEAAyD;AAGzD,mFAAqF;AACrF,sFAAmF;AAEnF,MAAa,uBAAwB,SAAQ,uDAAqD;IAU9F,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAVP,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,0DAA8B,CAAC;QAiEhD,sBAAiB,GAAG,KAAK,EAC7B,aAAiC,EACjC,eAAuB,EACI,EAAE;YAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;gBAC5C,UAAU,EAAE,CAAC,cAAc,CAAC;gBAC5B,KAAK,EAAE;oBACH,aAAa,EAAE,aAAa;oBAC5B,eAAe,EAAE,EAAE,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,eAAe,EA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AAO,CAAC;gBACjF,MAAM,yBAAyB,GAC3B,mBAAmB,KAAK,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;gBAErF,MAAM,IAAI,CAAC,yBAAyB,CAAC;oBACjC,iBAAiB,EAAE,YAAY;oBAC/B,kBAAkB,EAAE,aAAa,IAAI,IAAI;oBACzC,sBAAsB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,eAAe;oBACjE,YAAY,EAAE,gBAAgB,CAAC,QAAQ,CAAC,cAAc;oBACtD,yBAAyB,EAAE,2BAA2B;oBACtD,gBAAgB,EAAE,eAAe;oBACjC,cAAc,EAAE,aAAc;oBAC9B,cAAc,EAAE,gBAAgB,CAAC,QAAQ,CAAC,OAAO;oBACjD,aAAa,EAAE,cAAc;wBACzB,CAAC,CAAC;4BACI;gCACI,OAAO,EAAE,cAAc;gCACvB,yBAAyB,EAAE,yBAAyB;6BACvD;yBACJ;wBACH,CAAC,CAAC,EAAE;oBACR,gBAAgB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,QAAQ;iBACvD,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,SAAS,oDAAoD,YAAY,MAAM,GAAG,CAAC,OAAO,EAAE,CACvG,CAAC;aACL;SACJ;IACL,CAAC;CAkBJ;AApFD,0DAoFC"}
|
package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js
CHANGED
|
@@ -113,9 +113,8 @@ class UpdateDelayTask extends workers_1.AbstractTask {
|
|
|
113
113
|
let tripsPositionsWithGtfsData = [];
|
|
114
114
|
try {
|
|
115
115
|
const tripsPositionsToUpdate = await this.positionsRepository.getPositionsForUpdateDelay(tripIds);
|
|
116
|
-
gtfsComputationTrips =
|
|
117
|
-
|
|
118
|
-
tripsPositionsToUpdate.map((trip) => trip.gtfs_trip_id));
|
|
116
|
+
gtfsComputationTrips =
|
|
117
|
+
await this.delayComputationRedisRepository.getTripPropertiesBatch(tripsPositionsToUpdate.map((trip) => trip.gtfs_trip_id), ["shapes_anchor_points", "stop_times"]);
|
|
119
118
|
for (let i = 0; i < tripsPositionsToUpdate.length; i++) {
|
|
120
119
|
const trip = tripsPositionsToUpdate[i];
|
|
121
120
|
const gtfsData = gtfsComputationTrips[i];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateDelayTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.ts"],"names":[],"mappings":";;;AAAA,0EAA4D;AAC5D,4FAAiF;AACjF,oFAAyE;AACzE,oEAA8G;AAC9G,sDAA2D;AAC3D,gGAAqF;AACrF,wCAA2D;AAC3D,oEAA8E;AAE9E,wEAAqE;AAErE,2EAAwF;AACxF,2FAAqF;AACrF,2EAA6E;AAC7E,6EAA8F;AAE9F,4EAAyE;AACzE,oEAAiE;AACjE,gFAA6E;AAE7E,kEAA+D;AAC/D,gDAA6C;AAa7C,mEAA0E;AAC1E,qEAAkE;AAElE,MAAa,eAAgB,SAAQ,sBAA+B;IAehE,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAfP,cAAS,GAAG,aAAa,CAAC;QAC1B,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QACnC,WAAM,GAAG,+CAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"UpdateDelayTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.ts"],"names":[],"mappings":";;;AAAA,0EAA4D;AAC5D,4FAAiF;AACjF,oFAAyE;AACzE,oEAA8G;AAC9G,sDAA2D;AAC3D,gGAAqF;AACrF,wCAA2D;AAC3D,oEAA8E;AAE9E,wEAAqE;AAErE,2EAAwF;AACxF,2FAAqF;AACrF,2EAA6E;AAC7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AAG,OAAO,CAAC,MAAM,CAAC;YAC9B,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YAC3D,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEP,IAAI,0BAA0B,CAAC,MAAM,KAAK,CAAC,EAAE;YACzC,OAAO;SACV;QAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,oCAAoC,CAAC,0BAA0B,CAAC,CAAC;QAC9G,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,KAAK,wBAAwB,CAAC,CAAC;IACnE,CAAC;IAEO,kBAAkB,CAAC,SAA0C;QACjE,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,kBAAkB,IAAI,CAAC,CAAC,CAAC,CAAC;QACpG,IAAI,eAAe,KAAK,CAAC,EAAE;YACvB,MAAM,IAAI,6BAAY,CAAC,0CAA0C,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAC7F;QAED,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AAzVD,0CAyVC"}
|
|
@@ -41,6 +41,7 @@ export interface IPIDDeparture {
|
|
|
41
41
|
"trip.last_position.this_stop_sequence": number | null;
|
|
42
42
|
"trip.cis_stop_platform_code": string | null;
|
|
43
43
|
"trip.vehicle_descriptor.is_air_conditioned"?: boolean | null;
|
|
44
|
+
planned_start_timestamp: string | null;
|
|
44
45
|
}
|
|
45
46
|
export interface ITransferDeparture {
|
|
46
47
|
departure_datetime_real: Date | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,4CAA0B;AAC1B,2CAAyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,4CAA0B;AAC1B,2CAAyB;AAiHzB,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,yCAAuB,CAAA;AAC3B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,eAQX;AARD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,2CAAwB,CAAA;IACxB,0DAAuC,CAAA;IACvC,oDAAiC,CAAA;IACjC,mEAAgD,CAAA;IAChD,qEAAkD,CAAA;IAClD,8EAA2D,CAAA;AAC/D,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAED,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,mCAAkB,CAAA;IAClB,8BAA8B;AAClC,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB"}
|
|
@@ -32,13 +32,17 @@ class SkipHelper {
|
|
|
32
32
|
static isVehicleMissing(departure, runScheduleMap, untrackedTrips, nowDate = new Date()) {
|
|
33
33
|
// Not missing if essential trip data is missing or if delay information is available
|
|
34
34
|
if (!("trip.start_timestamp" in departure) ||
|
|
35
|
-
departure["trip.start_timestamp"] === null ||
|
|
36
35
|
departure.run_number === null ||
|
|
37
36
|
departure.route_id === null ||
|
|
38
37
|
departure.is_delay_available) {
|
|
39
38
|
return false;
|
|
40
39
|
}
|
|
41
|
-
|
|
40
|
+
// Use fallback to planned_start_timestamp if trip.start_timestamp is null
|
|
41
|
+
const rawStartTimestamp = departure["trip.start_timestamp"] ?? departure.planned_start_timestamp;
|
|
42
|
+
if (!rawStartTimestamp) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const startTimestamp = new Date(rawStartTimestamp);
|
|
42
46
|
const minutesToStart = (startTimestamp.getTime() - nowDate.getTime()) / 60000;
|
|
43
47
|
/// Not missing if departure is too far in the future (threshold varies for metro)
|
|
44
48
|
if (this.isOutsideStartThreshold(minutesToStart, departure.route_type)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkipHelper.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/models/helpers/SkipHelper.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAG5D,2CAAwC;AACxC,mCAKiB;AAEjB;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAE1C,MAAa,UAAU;IACnB;;;OAGG;IACI,MAAM,CAAC,oBAAoB,CAAC,SAAyB,EAAE,UAAkB;QAC5E,MAAM,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC;QAChD,IAAI,CAAC,aAAa,EAAE;YAChB,OAAO,KAAK,CAAC;SAChB;QAED,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,CAAC,UAAU,IAAI,UAAU,KAAK,UAAU,CAAC;IACrD,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,SAAyB;QAClD,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,gBAAgB,CAC1B,SAAyB,EACzB,cAAkD,EAClD,cAAkC,EAClC,OAAO,GAAG,IAAI,IAAI,EAAE;QAEpB,qFAAqF;QACrF,IACI,CAAC,CAAC,sBAAsB,IAAI,SAAS,CAAC;YACtC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"SkipHelper.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/models/helpers/SkipHelper.ts"],"names":[],"mappings":";;;AAAA,uEA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0CAAkC,CAAC,CAAC,CAAC,cAAc,IAAI,oCAA4B,CAAC;IAC3H,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAAC,cAAsB;QACpD,OAAO,cAAc,GAAG,oCAA4B,CAAC;IACzD,CAAC;IAEO,MAAM,CAAC,2BAA2B,CAAC,YAAkB,EAAE,cAAoB;QAC/E,MAAM,oBAAoB,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;QACzF,OAAO,oBAAoB,IAAI,kCAA0B,CAAC;IAC9D,CAAC;CACJ;AAxID,gCAwIC"}
|
|
@@ -6,5 +6,5 @@ export declare class DelayComputationRepository implements IDelayComputationRepo
|
|
|
6
6
|
private redisConnector;
|
|
7
7
|
private log;
|
|
8
8
|
constructor(redisConnector: IoRedisConnector, log: ILogger);
|
|
9
|
-
|
|
9
|
+
getDelayComputationCacheProperty<K extends keyof IDelayComputationDto>(gtfsTripId: string, property: K): Promise<Pick<IDelayComputationDto, K> | null>;
|
|
10
10
|
}
|
|
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.DelayComputationRepository = void 0;
|
|
16
|
+
const RedisJsonParser_1 = require("../../../../helpers/RedisJsonParser");
|
|
16
17
|
const const_1 = require("../../../../schema-definitions/vehicle-positions/redis/const");
|
|
17
18
|
const IoRedisConnector_1 = require("@golemio/core/dist/helpers/data-access/redis/IoRedisConnector");
|
|
18
19
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
@@ -24,27 +25,22 @@ let DelayComputationRepository = exports.DelayComputationRepository = class Dela
|
|
|
24
25
|
this.redisConnector = redisConnector;
|
|
25
26
|
this.log = log;
|
|
26
27
|
}
|
|
27
|
-
async
|
|
28
|
+
async getDelayComputationCacheProperty(gtfsTripId, property) {
|
|
28
29
|
if (!this.redisConnector.isConnected()) {
|
|
29
30
|
await this.redisConnector.connect();
|
|
30
31
|
}
|
|
32
|
+
const redisKey = `${const_1.GTFS_DELAY_COMPUTATION_NAMESPACE_PREFIX}:${gtfsTripId}`;
|
|
31
33
|
const connection = this.redisConnector.getConnection();
|
|
32
|
-
let delayComputationCache = null;
|
|
33
34
|
try {
|
|
34
|
-
|
|
35
|
+
const jsonResult = await connection.call("JSON.GET", redisKey, `$.${property}`);
|
|
36
|
+
if (!jsonResult) {
|
|
37
|
+
this.log.warn(`${this.constructor.name}: Property '${property}' not found in Redis key '${redisKey}'`);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return RedisJsonParser_1.RedisJsonParser.parseSingle(jsonResult, this.constructor.name, property);
|
|
35
41
|
}
|
|
36
42
|
catch (err) {
|
|
37
|
-
throw new golemio_errors_1.GeneralError(`${this.constructor.name}:
|
|
38
|
-
}
|
|
39
|
-
if (delayComputationCache === null) {
|
|
40
|
-
this.log.info(`${this.constructor.name}: Cannot find delay computation cache`);
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
try {
|
|
44
|
-
return JSON.parse(delayComputationCache);
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Cannot parse delay computation cache: ${err.message}`, this.constructor.name, err);
|
|
43
|
+
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Failed to fetch '${property}' from delay computation cache`, this.constructor.name, err);
|
|
48
44
|
}
|
|
49
45
|
}
|
|
50
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayComputationRepository.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/data-access/redis/DelayComputationRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DelayComputationRepository.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/data-access/redis/DelayComputationRepository.ts"],"names":[],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qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,cAAc,CAAC,CAAA;IACrC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;qCADsC,mCAAgB;GAF1E,0BAA0B,CAgCtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IDelayComputationDto } from "../../../../schema-definitions/ropid-gtfs/redis/interfaces/IDelayComputationDto";
|
|
2
2
|
export interface IDelayComputationRepository {
|
|
3
|
-
|
|
3
|
+
getDelayComputationCacheProperty<K extends keyof IDelayComputationDto>(gtfsTripId: string, property: K): Promise<Pick<IDelayComputationDto, K> | null>;
|
|
4
4
|
}
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js
CHANGED
|
@@ -28,7 +28,7 @@ let ShapesTripScopeHandler = exports.ShapesTripScopeHandler = class ShapesTripSc
|
|
|
28
28
|
this.shapeModel = models_1.models.GTFSShapesModel;
|
|
29
29
|
}
|
|
30
30
|
async handle(output, vehiclePosition) {
|
|
31
|
-
const delayComputationCache = await this.delayComputationRepository.
|
|
31
|
+
const delayComputationCache = await this.delayComputationRepository.getDelayComputationCacheProperty(vehiclePosition.gtfs_trip_id, "shapes");
|
|
32
32
|
if (!delayComputationCache) {
|
|
33
33
|
throw new golemio_errors_1.GeneralError("delay_computation_cache_not_found", this.constructor.name, undefined, 500);
|
|
34
34
|
}
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,iEAA6D;AAC7D,uHAA8H;AAC9H,6DAA+C;AAG/C,+DAAsF;AACtF,6EAAwE;AACxE,iEAAwE;AACxE,yFAAsF;AAG/E,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,mEAAgC;IAIxE,YAC8D,0BAAuD;QAEjH,KAAK,EAAE,CAAC;QAFkD,+BAA0B,GAA1B,0BAA0B,CAA6B;QAGjH,IAAI,CAAC,wBAAwB,GAAG,IAAI,mEAAgC,EAAE,CAAC;QACvE,IAAI,CAAC,UAAU,GAAG,eAAM,CAAC,eAAe,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,MAA8B,EAAE,eAAmC;QACnF,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"ShapesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,iEAA6D;AAC7D,uHAA8H;AAC9H,6DAA+C;AAG/C,+DAAsF;AACtF,6EAAwE;AACxE,iEAAwE;AACxE,yFAAsF;AAG/E,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,mEAAgC;IAIxE,YAC8D,0BAAuD;QAEjH,KAAK,EAAE,CAAC;QAFkD,+BAA0B,GAA1B,0BAA0B,CAA6B;QAGjH,IAAI,CAAC,wBAAwB,GAAG,IAAI,mEAAgC,EAAE,CAAC;QACvE,IAAI,CAAC,UAAU,GAAG,eAAM,CAAC,eAAe,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,MAA8B,EAAE,eAAmC;QACnF,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,gCAAgC,CAChG,eAAe,CAAC,YAAY,EAC5B,QAAQ,CACX,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,CAAC,MAAM,GAAG,IAAA,mCAA6B,EACzC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,cAAc,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CACjH,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;iCA5BY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,0BAA0B,CAAC,CAAA;;GAL5C,sBAAsB,CA4BlC"}
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js
CHANGED
|
@@ -28,7 +28,7 @@ let StopTimesTripScopeHandler = exports.StopTimesTripScopeHandler = class StopTi
|
|
|
28
28
|
this.tripStopTimesTransformation = new PublicVPTripStopTimesTransformation_1.PublicVPTripStopTimesTransformation();
|
|
29
29
|
}
|
|
30
30
|
async handle(output, vehiclePosition) {
|
|
31
|
-
const delayComputationCache = await this.delayComputationRepository.
|
|
31
|
+
const delayComputationCache = await this.delayComputationRepository.getDelayComputationCacheProperty(vehiclePosition.gtfs_trip_id, "stop_times");
|
|
32
32
|
if (!delayComputationCache) {
|
|
33
33
|
throw new golemio_errors_1.GeneralError("delay_computation_cache_not_found", this.constructor.name, undefined, 500);
|
|
34
34
|
}
|
|
@@ -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,
|
|
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,gCAAgC,CAChG,eAAe,CAAC,YAAY,EAC5B,YAAY,CACf,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,sBAAsB,GA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,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,CAiGrC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/pid",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.1-dev.1815030855",
|
|
4
4
|
"description": "Golemio PID Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@golemio/core": ">=1.16.0-rc.1551191551"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@golemio/ovapi-gtfs-realtime-bindings": "1.2.
|
|
79
|
+
"@golemio/ovapi-gtfs-realtime-bindings": "1.2.4-dev.1288219308",
|
|
80
80
|
"@turf/turf": "^6.5.0",
|
|
81
81
|
"cheap-ruler": "^3.0.2",
|
|
82
82
|
"csv-parser": "^3.0.0",
|
|
@@ -84,4 +84,4 @@
|
|
|
84
84
|
"html-entities": "^2.3.3",
|
|
85
85
|
"pg-copy-streams": "^5.1.1"
|
|
86
86
|
}
|
|
87
|
-
}
|
|
87
|
+
}
|