@golemio/pid 4.0.3 → 4.0.4-dev.2001605097

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.
Files changed (198) hide show
  1. package/README.md +1 -1
  2. package/db/example/redis/gtfsStopsCacheMock.json +8 -0
  3. package/db/example/redis/jisCacheMock.json +31 -0
  4. package/db/migrations/postgresql/20250716143052-add-stop-name-to-combined-stop-times.js +53 -0
  5. package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-down.sql +47 -0
  6. package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-up.sql +47 -0
  7. package/dist/helpers/GtfsStopParser.d.ts +2 -0
  8. package/dist/helpers/GtfsStopParser.js +11 -8
  9. package/dist/helpers/GtfsStopParser.js.map +1 -1
  10. package/dist/helpers/jis/JISInfotextSeverityLevelPriority.d.ts +6 -0
  11. package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js +11 -0
  12. package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js.map +1 -0
  13. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +0 -1
  14. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
  15. package/dist/integration-engine/jis/ioc/Di.js +10 -0
  16. package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
  17. package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +4 -0
  18. package/dist/integration-engine/jis/ioc/JISContainerToken.js +5 -0
  19. package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
  20. package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.d.ts +9 -0
  21. package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js +86 -0
  22. package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js.map +1 -0
  23. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +6 -1
  24. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +50 -2
  25. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
  26. package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.d.ts +7 -0
  27. package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js +37 -0
  28. package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js.map +1 -0
  29. package/dist/integration-engine/jis/workers/JISWorker.js +1 -0
  30. package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
  31. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.d.ts +13 -0
  32. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js +47 -0
  33. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js.map +1 -0
  34. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +1 -2
  35. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +5 -4
  36. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
  37. package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.d.ts +18 -0
  38. package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js +44 -0
  39. package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js.map +1 -0
  40. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.d.ts +5 -1
  41. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +24 -0
  42. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
  43. package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
  44. package/dist/integration-engine/ropid-gtfs/index.d.ts +1 -0
  45. package/dist/integration-engine/ropid-gtfs/index.js +1 -0
  46. package/dist/integration-engine/ropid-gtfs/index.js.map +1 -1
  47. package/dist/integration-engine/ropid-gtfs/ioc/Di.js +8 -0
  48. package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
  49. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +3 -0
  50. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +3 -0
  51. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
  52. package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js +1 -1
  53. package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js.map +1 -1
  54. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +1 -0
  55. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
  56. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +8 -5
  57. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
  58. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.d.ts +12 -0
  59. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js +44 -0
  60. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js.map +1 -0
  61. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.d.ts +12 -0
  62. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js +87 -0
  63. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js.map +1 -0
  64. package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.d.ts +1 -0
  65. package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.js +1 -0
  66. package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.js.map +1 -1
  67. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +1 -0
  68. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
  69. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/interfaces/TripRepositoryInterfaces.d.ts +2 -1
  70. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.d.ts +3 -1
  71. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +124 -109
  72. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
  73. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.d.ts +3 -1
  74. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +100 -85
  75. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js.map +1 -1
  76. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
  77. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +1 -0
  78. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
  79. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js +2 -0
  80. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js.map +1 -1
  81. package/dist/output-gateway/index.js +1 -0
  82. package/dist/output-gateway/index.js.map +1 -1
  83. package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.d.ts +17 -0
  84. package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js +113 -0
  85. package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js.map +1 -0
  86. package/dist/output-gateway/jis/ioc/Di.js +2 -2
  87. package/dist/output-gateway/jis/ioc/Di.js.map +1 -1
  88. package/dist/output-gateway/jis/ioc/OgJisToken.d.ts +2 -0
  89. package/dist/output-gateway/jis/ioc/OgJisToken.js +2 -0
  90. package/dist/output-gateway/jis/ioc/OgJisToken.js.map +1 -1
  91. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
  92. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.d.ts +17 -0
  93. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js +155 -0
  94. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js.map +1 -0
  95. package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.d.ts +14 -0
  96. package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js +3 -0
  97. package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js.map +1 -0
  98. package/dist/output-gateway/pid/domain/InfotextInterfaces.d.ts +5 -0
  99. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.d.ts +4 -1
  100. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js +7 -1
  101. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js.map +1 -1
  102. package/dist/output-gateway/pid/helpers/TransferBoardFilter.d.ts +5 -0
  103. package/dist/output-gateway/pid/helpers/TransferBoardFilter.js +33 -0
  104. package/dist/output-gateway/pid/helpers/TransferBoardFilter.js.map +1 -0
  105. package/dist/output-gateway/pid/helpers/TransferBoardSorter.d.ts +6 -0
  106. package/dist/output-gateway/pid/helpers/TransferBoardSorter.js +61 -0
  107. package/dist/output-gateway/pid/helpers/TransferBoardSorter.js.map +1 -0
  108. package/dist/output-gateway/pid/index.d.ts +50 -0
  109. package/dist/output-gateway/pid/index.js.map +1 -1
  110. package/dist/output-gateway/pid/ioc/Di.js +64 -6
  111. package/dist/output-gateway/pid/ioc/Di.js.map +1 -1
  112. package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +12 -0
  113. package/dist/output-gateway/pid/ioc/OgPidToken.js +12 -0
  114. package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -1
  115. package/dist/output-gateway/pid/routers/index.d.ts +1 -0
  116. package/dist/output-gateway/pid/routers/index.js +3 -1
  117. package/dist/output-gateway/pid/routers/index.js.map +1 -1
  118. package/dist/output-gateway/pid/routers/v4/V4PIDRouter.d.ts +16 -0
  119. package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js +67 -0
  120. package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js.map +1 -0
  121. package/dist/output-gateway/pid/service/facade/InfotextFacade.d.ts +7 -2
  122. package/dist/output-gateway/pid/service/facade/InfotextFacade.js +29 -4
  123. package/dist/output-gateway/pid/service/facade/InfotextFacade.js.map +1 -1
  124. package/dist/output-gateway/pid/service/facade/StopFacade.d.ts +12 -3
  125. package/dist/output-gateway/pid/service/facade/StopFacade.js +43 -7
  126. package/dist/output-gateway/pid/service/facade/StopFacade.js.map +1 -1
  127. package/dist/output-gateway/pid/service/facade/TransferFacade.d.ts +17 -10
  128. package/dist/output-gateway/pid/service/facade/TransferFacade.js +161 -16
  129. package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
  130. package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.d.ts +7 -1
  131. package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js +9 -0
  132. package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js.map +1 -1
  133. package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.d.ts +13 -0
  134. package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js +31 -0
  135. package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js.map +1 -0
  136. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.d.ts +27 -0
  137. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js +77 -0
  138. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js.map +1 -0
  139. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.d.ts +1 -1
  140. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +7 -4
  141. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -1
  142. package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.d.ts +1 -0
  143. package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js +21 -0
  144. package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js.map +1 -1
  145. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.d.ts +2 -1
  146. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +14 -15
  147. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
  148. package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.d.ts +1 -1
  149. package/dist/output-gateway/public/ioc/Di.js +1 -1
  150. package/dist/output-gateway/public/ioc/Di.js.map +1 -1
  151. package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.d.ts +13 -0
  152. package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js +83 -0
  153. package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js.map +1 -0
  154. package/dist/output-gateway/shared/constants/route-version.d.ts +2 -1
  155. package/dist/output-gateway/shared/constants/route-version.js +1 -0
  156. package/dist/output-gateway/shared/constants/route-version.js.map +1 -1
  157. package/dist/output-gateway/{public → shared}/service/VPSubscriber.d.ts +4 -2
  158. package/dist/output-gateway/{public → shared}/service/VPSubscriber.js +1 -1
  159. package/dist/output-gateway/shared/service/VPSubscriber.js.map +1 -0
  160. package/dist/schema-definitions/jis/redis/const.d.ts +1 -0
  161. package/dist/schema-definitions/jis/redis/const.js +2 -1
  162. package/dist/schema-definitions/jis/redis/const.js.map +1 -1
  163. package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.d.ts +17 -0
  164. package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js +3 -0
  165. package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js.map +1 -0
  166. package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.d.ts +3 -0
  167. package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js +59 -0
  168. package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js.map +1 -0
  169. package/dist/schema-definitions/ropid-departures-presets/index.d.ts +1 -0
  170. package/dist/schema-definitions/ropid-departures-presets/index.js +3 -0
  171. package/dist/schema-definitions/ropid-departures-presets/index.js.map +1 -1
  172. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.d.ts +16 -0
  173. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js +3 -0
  174. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js.map +1 -0
  175. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopDto.d.ts +1 -0
  176. package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.d.ts +58 -0
  177. package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js +69 -0
  178. package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js.map +1 -0
  179. package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +1 -0
  180. package/dist/schema-definitions/ropid-gtfs/redis/const.js +2 -1
  181. package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -1
  182. package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.d.ts +3 -2
  183. package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js +4 -0
  184. package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js.map +1 -1
  185. package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts +1 -0
  186. package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto.d.ts +2 -0
  187. package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicStopTimeCacheDto.d.ts +1 -0
  188. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js +8 -0
  189. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js.map +1 -1
  190. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js +4 -1
  191. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js.map +1 -1
  192. package/docs/asyncapi.yaml +45 -0
  193. package/docs/cache/types/redis.md +82 -2
  194. package/docs/jis/index.md +15 -5
  195. package/docs/openapi-input.yaml +13 -2
  196. package/docs/openapi-output.yaml +326 -4
  197. package/package.json +2 -2
  198. package/dist/output-gateway/public/service/VPSubscriber.js.map +0 -1
@@ -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.InfotextFacade = void 0;
16
+ const JISInfotextsRedisRepository_1 = require("../../../jis/data-access/cache/JISInfotextsRedisRepository");
16
17
  const JISInfotextRepository_1 = require("../../data-access/JISInfotextRepository");
17
18
  const JISInfotextStopSuppressionFilter_1 = require("../../helpers/JISInfotextStopSuppressionFilter");
18
19
  const OgPidToken_1 = require("../../ioc/OgPidToken");
@@ -21,13 +22,16 @@ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
21
22
  const JISInfotextDepartureTransformation_1 = require("../transformations/JISInfotextDepartureTransformation");
22
23
  const JISInfotextOverviewTransformation_1 = require("../transformations/JISInfotextOverviewTransformation");
23
24
  const JISInfotextTransferTransformation_1 = require("../transformations/JISInfotextTransferTransformation");
25
+ const JISInfotextCacheTransferTransformation_1 = require("../transformations/JISInfotextCacheTransferTransformation");
24
26
  let InfotextFacade = exports.InfotextFacade = class InfotextFacade {
25
- constructor(infotextRepository, infotextDepartureTransformation, infotextTransferTransformation, infotextOverviewTransformation, infotextStopFilter) {
27
+ constructor(infotextRepository, infotextDepartureTransformation, infotextTransferTransformation, infotextOverviewTransformation, infotextStopFilter, infotextsRedisRepository, cacheTransferTransformation) {
26
28
  this.infotextRepository = infotextRepository;
27
29
  this.infotextDepartureTransformation = infotextDepartureTransformation;
28
30
  this.infotextTransferTransformation = infotextTransferTransformation;
29
31
  this.infotextOverviewTransformation = infotextOverviewTransformation;
30
32
  this.infotextStopFilter = infotextStopFilter;
33
+ this.infotextsRedisRepository = infotextsRedisRepository;
34
+ this.cacheTransferTransformation = cacheTransferTransformation;
31
35
  }
32
36
  async getInfotextsForDepartureBoards(stopIds, currentMoment, options) {
33
37
  try {
@@ -69,9 +73,8 @@ let InfotextFacade = exports.InfotextFacade = class InfotextFacade {
69
73
  return this.infotextTransferTransformation.transformArray(filteredInfotexts);
70
74
  }
71
75
  catch (error) {
72
- if (error instanceof golemio_errors_1.AbstractGolemioError) {
76
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
73
77
  throw error;
74
- }
75
78
  throw new golemio_errors_1.GeneralError("Failed to retrieve infotexts for transfer boards", this.constructor.name, error, 500);
76
79
  }
77
80
  }
@@ -94,6 +97,24 @@ let InfotextFacade = exports.InfotextFacade = class InfotextFacade {
94
97
  throw new golemio_errors_1.GeneralError("Failed to retrieve infotexts for overview", this.constructor.name, error, 500);
95
98
  }
96
99
  }
100
+ async getInfotextsCache(stopIds, currentMoment, timeFrom) {
101
+ try {
102
+ const infotexts = await this.infotextsRedisRepository.getActiveStopsInfotexts(stopIds, timeFrom ?? currentMoment);
103
+ if (infotexts.length === 0) {
104
+ return [];
105
+ }
106
+ const filteredInfotexts = this.infotextStopFilter.filterBySeverityLevel(infotexts);
107
+ if (filteredInfotexts.length === 0) {
108
+ return [];
109
+ }
110
+ return this.cacheTransferTransformation.transformArray(filteredInfotexts);
111
+ }
112
+ catch (error) {
113
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
114
+ throw error;
115
+ throw new golemio_errors_1.GeneralError("Failed to retrieve infotexts for V4 transfer boards", this.constructor.name, error, 500);
116
+ }
117
+ }
97
118
  };
98
119
  exports.InfotextFacade = InfotextFacade = __decorate([
99
120
  (0, tsyringe_1.injectable)(),
@@ -102,10 +123,14 @@ exports.InfotextFacade = InfotextFacade = __decorate([
102
123
  __param(2, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextTransferTransformation)),
103
124
  __param(3, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextOverviewTransformation)),
104
125
  __param(4, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextStopSuppressionFilter)),
126
+ __param(5, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextsRedisRepository)),
127
+ __param(6, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextCacheTransferTransformation)),
105
128
  __metadata("design:paramtypes", [JISInfotextRepository_1.JISInfotextRepository,
106
129
  JISInfotextDepartureTransformation_1.JISInfotextDepartureTransformation,
107
130
  JISInfotextTransferTransformation_1.JISInfotextTransferTransformation,
108
131
  JISInfotextOverviewTransformation_1.JISInfotextOverviewTransformation,
109
- JISInfotextStopSuppressionFilter_1.JISInfotextStopSuppressionFilter])
132
+ JISInfotextStopSuppressionFilter_1.JISInfotextStopSuppressionFilter,
133
+ JISInfotextsRedisRepository_1.JISInfotextsRedisRepository,
134
+ JISInfotextCacheTransferTransformation_1.JISInfotextCacheTransferTransformation])
110
135
  ], InfotextFacade);
111
136
  //# sourceMappingURL=InfotextFacade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfotextFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/InfotextFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mFAAkF;AAMlF,qGAAoG;AACpG,qDAAoD;AAEpD,6EAA8F;AAE9F,iEAAwE;AACxE,8GAA2G;AAC3G,4GAAyG;AACzG,4GAAyG;AAGlG,IAAM,cAAc,4BAApB,MAAM,cAAc;IACvB,YACsD,kBAAy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IAAI,CAAC,8BAA8B,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;SAChF;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,2CAA2C,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SAC1G;IACL,CAAC;CACJ,CAAA;yBAvGY,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,qBAAqB,CAAC,CAAA;IACxC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,kCAAkC,CAAC,CAAA;IAErD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,iCAAiC,CAAC,CAAA;IAEpD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,iCAAiC,CAAC,CAAA;IAEpD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,gCAAgC,CAAC,CAAA;qCAPkB,6CAAqB;QAElD,uEAAkC;QAEnC,qEAAiC;QAEjC,qEAAiC;QACQ,mEAAgC;GAT5G,cAAc,CAuG1B"}
1
+ {"version":3,"file":"InfotextFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/InfotextFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4GAAoG;AACpG,mFAAkF;AAOlF,qGAAoG;AACpG,qDAAoD;AAEpD,6EAA8F;AAE9F,iEAAwE;AACxE,8GAA2G;AAC3G,4GAAyG;AACzG,4GAAyG;AACzG,sHAAmH;AAG5G,IAAM,cAAc,4BAApB,MAAM,cAAc;IACvB,YACsD,kBAAyC,EAEnF,+BAAmE,EAEnE,8BAAiE,EAEjE,8BAAiE,EACZ,kBAAoD,EACzD,wBAAqD,EAErG,2BAAmE;QAVzB,uBAAkB,GAAlB,kBAAkB,CAAuB;QAEnF,oCAA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AAM,EAAC,uBAAU,CAAC,iCAAiC,CAAC,CAAA;IAEpD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,gCAAgC,CAAC,CAAA;IACnD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,2BAA2B,CAAC,CAAA;IAC9C,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,sCAAsC,CAAC,CAAA;qCATY,6CAAqB;QAElD,uEAAkC;QAEnC,qEAAiC;QAEjC,qEAAiC;QACQ,mEAAgC;QAC/B,yDAA2B;QAExE,+EAAsC;GAZtE,cAAc,CA8H1B"}
@@ -1,9 +1,18 @@
1
1
  import { CisStopGroupRepository } from "../../../ropid-gtfs/data-access/CisStopGroupRepository";
2
+ import { GtfsStopsRedisRepository } from "../../../ropid-gtfs/data-access/redis/GtfsStopsRedisRepository";
2
3
  export declare class StopFacade {
3
4
  private cisStopGroupsRepository;
4
- constructor(cisStopGroupsRepository: CisStopGroupRepository);
5
+ private gtfsStopsRedisRepository;
6
+ private readonly gtfsStopParser;
7
+ constructor(cisStopGroupsRepository: CisStopGroupRepository, gtfsStopsRedisRepository: GtfsStopsRedisRepository);
8
+ getStopIdsForTransferBoards(cisId: string): Promise<string[]>;
5
9
  /**
6
- * Retrieves ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
10
+ * Retrieve ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
7
11
  */
8
- getStopIdsForTransferBoards(cisId: string): Promise<string[]>;
12
+ getStopIdsForTransferBoardsByCisId(cisId: string): Promise<string[]>;
13
+ /**
14
+ * Retrieve ASW node ID for given ASW stop ID and then returns GTFS stop IDs for this ASW node
15
+ */
16
+ getStopIdsForTransferBoardsByAswId(aswId: string): Promise<string[]>;
17
+ private getStopIdsForTransferBoardsByAswNode;
9
18
  }
@@ -13,18 +13,19 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.StopFacade = void 0;
16
+ const GtfsStopParser_1 = require("../../../../helpers/GtfsStopParser");
16
17
  const OgPidToken_1 = require("../../ioc/OgPidToken");
17
- const CisStopGroupRepository_1 = require("../../../ropid-gtfs/data-access/CisStopGroupRepository");
18
18
  const models_1 = require("../../../ropid-gtfs/models");
19
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
19
+ const CisStopGroupRepository_1 = require("../../../ropid-gtfs/data-access/CisStopGroupRepository");
20
+ const GtfsStopsRedisRepository_1 = require("../../../ropid-gtfs/data-access/redis/GtfsStopsRedisRepository");
20
21
  const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
22
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
21
23
  let StopFacade = exports.StopFacade = class StopFacade {
22
- constructor(cisStopGroupsRepository) {
24
+ constructor(cisStopGroupsRepository, gtfsStopsRedisRepository) {
23
25
  this.cisStopGroupsRepository = cisStopGroupsRepository;
26
+ this.gtfsStopsRedisRepository = gtfsStopsRedisRepository;
27
+ this.gtfsStopParser = new GtfsStopParser_1.GtfsStopParser();
24
28
  }
25
- /**
26
- * Retrieves ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
27
- */
28
29
  async getStopIdsForTransferBoards(cisId) {
29
30
  //#region CIS stop node
30
31
  let aswNode;
@@ -56,10 +57,45 @@ let StopFacade = exports.StopFacade = class StopFacade {
56
57
  //#endregion
57
58
  return stopIds;
58
59
  }
60
+ /**
61
+ * Retrieve ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
62
+ */
63
+ async getStopIdsForTransferBoardsByCisId(cisId) {
64
+ try {
65
+ const aswNodeId = await this.gtfsStopsRedisRepository.getAswNodeIdFromCisId(cisId);
66
+ if (aswNodeId === null) {
67
+ return [];
68
+ }
69
+ return await this.getStopIdsForTransferBoardsByAswNode(aswNodeId);
70
+ }
71
+ catch (error) {
72
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
73
+ throw error;
74
+ throw new golemio_errors_1.GeneralError("Failed to retrieve CIS stop node", this.constructor.name, error, 500);
75
+ }
76
+ }
77
+ /**
78
+ * Retrieve ASW node ID for given ASW stop ID and then returns GTFS stop IDs for this ASW node
79
+ */
80
+ async getStopIdsForTransferBoardsByAswId(aswId) {
81
+ return await this.getStopIdsForTransferBoardsByAswNode(this.gtfsStopParser.getAswNodeFromId(aswId));
82
+ }
83
+ async getStopIdsForTransferBoardsByAswNode(aswNodeId) {
84
+ try {
85
+ return await this.gtfsStopsRedisRepository.getGtfsStopIdsByAswNode(aswNodeId);
86
+ }
87
+ catch (error) {
88
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
89
+ throw error;
90
+ throw new golemio_errors_1.GeneralError("Failed to retrieve GTFS stops", this.constructor.name, error, 500);
91
+ }
92
+ }
59
93
  };
60
94
  exports.StopFacade = StopFacade = __decorate([
61
95
  (0, tsyringe_1.injectable)(),
62
96
  __param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.CisStopGroupRepository)),
63
- __metadata("design:paramtypes", [CisStopGroupRepository_1.CisStopGroupRepository])
97
+ __param(1, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.GtfsStopsRedisRepository)),
98
+ __metadata("design:paramtypes", [CisStopGroupRepository_1.CisStopGroupRepository,
99
+ GtfsStopsRedisRepository_1.GtfsStopsRedisRepository])
64
100
  ], StopFacade);
65
101
  //# sourceMappingURL=StopFacade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StopFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/StopFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qDAAoD;AACpD,mGAA2F;AAC3F,uDAA+C;AAC/C,6EAA8F;AAC9F,iEAAwE;AAGjE,IAAM,UAAU,wBAAhB,MAAM,UAAU;IACnB,YAA+D,uBAA+C;QAA/C,4BAAuB,GAAvB,uBAAuB,CAAwB;IAAG,CAAC;IAElH;;OAEG;IACI,KAAK,CAAC,2BAA2B,CAAC,KAAa;QAClD,uBAAuB;QACvB,IAAI,OAAe,CAAC;QACpB,IAAI;YACA,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC7E,IAAI,WAAW,KAAK,IAAI,EAAE;gBACtB,OAAO,EAAE,CAAC;aACb;YAED,OAAO,GAAG,WAAW,CAAC;SACzB;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,kCAAkC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACjG;QACD,YAAY;QAEZ,uBAAuB;QACvB,IAAI,OAAO,GAAa,EAAE,CAAC;QAC3B,IAAI;YACA,OAAO,GAAG,MAAM,eAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;SACzE;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,+BAA+B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SAC9F;QACD,YAAY;QAEZ,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;qBAxCY,UAAU;IADtB,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,sBAAsB,CAAC,CAAA;qCAAkC,+CAAsB;GADrG,UAAU,CAwCtB"}
1
+ {"version":3,"file":"StopFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/StopFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAAyD;AACzD,qDAAoD;AACpD,uDAA+C;AAC/C,mGAA2F;AAC3F,6GAAqG;AACrG,iEAAwE;AACxE,6EA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B,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;YACnF,IAAI,SAAS,KAAK,IAAI,EAAE;gBACpB,OAAO,EAAE,CAAC;aACb;YACD,OAAO,MAAM,IAAI,CAAC,oCAAoC,CAAC,SAAS,CAAC,CAAC;SACrE;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB;gBAAE,MAAM,KAAK,CAAC;YACvD,MAAM,IAAI,6BAAY,CAAC,kCAAkC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACjG;IACL,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,kCAAkC,CAAC,KAAa;QACzD,OAAO,MAAM,IAAI,CAAC,oCAAoC,CAAC,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACxG,CAAC;IAEO,KAAK,CAAC,oCAAoC,CAAC,SAAiB;QAChE,IAAI;YACA,OAAO,MAAM,IAAI,CAAC,wBAAwB,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;SACjF;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB;gBAAE,MAAM,KAAK,CAAC;YACvD,MAAM,IAAI,6BAAY,CAAC,+BAA+B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SAC9F;IACL,CAAC;CACJ,CAAA;qBA1EY,UAAU;IADtB,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,sBAAsB,CAAC,CAAA;IACzC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,wBAAwB,CAAC,CAAA;qCADgC,+CAAsB;QACnB,mDAAwB;GALlG,UAAU,CA0EtB"}
@@ -1,18 +1,25 @@
1
- import { ITransferOutputDto } from "../..";
2
- import { DeparturesRepository } from "../../data-access";
1
+ import { IDepartureWithPosition, ITransferOutputDto, IV4TransferDto } from "../..";
3
2
  import { Moment } from "@golemio/core/dist/shared/moment-timezone";
4
3
  import { TransferDepartureTransformation } from "../transformations/TransferDepartureTransformation";
4
+ import { PublicGtfsDepartureRepository } from "../../../public/data-access/redis/PublicGtfsDepartureRepository";
5
+ import { IPublicGtfsDepartureCacheDto } from "../../../../schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto";
6
+ import { PublicVehiclePositionsRepository } from "../../../public/data-access/redis/PublicVehiclePositionsRepository";
7
+ import { IPublicApiCacheDto } from "../../../../schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto";
8
+ import { PublicStopTimeRepository } from "../../../public/data-access/redis/PublicStopTimeRepository";
9
+ import { DelayComputationRepository } from "../../../public/data-access/redis/DelayComputationRepository";
10
+ import { DeparturesRepository } from "../../data-access";
5
11
  export declare class TransferFacade {
6
- private departureRepository;
12
+ private publicDepartureRepository;
13
+ private departuresRepository;
7
14
  private departureTransformation;
8
- constructor(departureRepository: DeparturesRepository, departureTransformation: TransferDepartureTransformation);
9
- /**
10
- * Retrieves transfer departures for given GTFS stop IDs
11
- * - Get transfer departures from DB
12
- * - Process them (filter, sort, etc.)
13
- * - Transform them to DTO
14
- */
15
+ private tripRepository;
16
+ private stopTimeRepository;
17
+ private delayComputationRepository;
18
+ constructor(publicDepartureRepository: PublicGtfsDepartureRepository, departuresRepository: DeparturesRepository, departureTransformation: TransferDepartureTransformation, tripRepository: PublicVehiclePositionsRepository, stopTimeRepository: PublicStopTimeRepository, delayComputationRepository: DelayComputationRepository);
15
19
  getTransferDepartures(stopIds: string[], tripNumber: string | null, currentMoment: Moment, minutesOffset: number, timeZone?: string): Promise<ITransferOutputDto[]>;
20
+ getTransferCache(stopIds: string[], limit: number, reqNumber?: number, vehicleType?: number, timeFrom?: Date): Promise<IV4TransferDto>;
21
+ private findFallbackDeparture;
22
+ processMultiplePositionsForDeparturesAtOnce(departures: IPublicGtfsDepartureCacheDto[], positionsByTrip: Map<string, IPublicApiCacheDto[]>, stopIds: string[]): Promise<IDepartureWithPosition[]>;
16
23
  /**
17
24
  * Fallback options as defined by ROPID
18
25
  */
@@ -17,29 +17,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.TransferFacade = void 0;
19
19
  const pid_1 = require("../..");
20
- const data_access_1 = require("../../data-access");
21
20
  const OgPidToken_1 = require("../../ioc/OgPidToken");
22
- const PIDDepartureModel_1 = __importDefault(require("../../models/helpers/PIDDepartureModel"));
23
21
  const IPIDDepartureQueryOptions_1 = __importDefault(require("../../models/helpers/interfaces/IPIDDepartureQueryOptions"));
24
- const shared_1 = require("../../../shared");
25
22
  const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
26
23
  const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
27
24
  const TransferDepartureTransformation_1 = require("../transformations/TransferDepartureTransformation");
25
+ const PublicGtfsDepartureRepository_1 = require("../../../public/data-access/redis/PublicGtfsDepartureRepository");
26
+ const PublicVehiclePositionsRepository_1 = require("../../../public/data-access/redis/PublicVehiclePositionsRepository");
27
+ const PublicStopTimeRepository_1 = require("../../../public/data-access/redis/PublicStopTimeRepository");
28
+ const DelayComputationRepository_1 = require("../../../public/data-access/redis/DelayComputationRepository");
29
+ const monitoring_1 = require("@golemio/core/dist/monitoring");
30
+ const PIDDepartureModel_1 = __importDefault(require("../../models/helpers/PIDDepartureModel"));
31
+ const shared_1 = require("../../../shared");
32
+ const data_access_1 = require("../../data-access");
33
+ const const_1 = require("../../../../const");
34
+ const DateTimeUtils_1 = require("../../../../helpers/DateTimeUtils");
35
+ const RouteTypeEnums_1 = require("../../../../helpers/RouteTypeEnums");
28
36
  let TransferFacade = exports.TransferFacade = class TransferFacade {
29
- constructor(departureRepository, departureTransformation) {
30
- this.departureRepository = departureRepository;
37
+ constructor(publicDepartureRepository, departuresRepository, departureTransformation, tripRepository, stopTimeRepository, delayComputationRepository) {
38
+ this.publicDepartureRepository = publicDepartureRepository;
39
+ this.departuresRepository = departuresRepository;
31
40
  this.departureTransformation = departureTransformation;
41
+ this.tripRepository = tripRepository;
42
+ this.stopTimeRepository = stopTimeRepository;
43
+ this.delayComputationRepository = delayComputationRepository;
32
44
  }
33
- /**
34
- * Retrieves transfer departures for given GTFS stop IDs
35
- * - Get transfer departures from DB
36
- * - Process them (filter, sort, etc.)
37
- * - Transform them to DTO
38
- */
39
45
  async getTransferDepartures(stopIds, tripNumber, currentMoment, minutesOffset, timeZone = shared_1.RopidRouterUtils.TIMEZONE) {
40
46
  let departureEntities = [];
41
47
  try {
42
- departureEntities = await this.departureRepository.getTransferDepartures({
48
+ departureEntities = await this.departuresRepository.getTransferDepartures({
43
49
  stopsIds: stopIds,
44
50
  currentMoment,
45
51
  minutesOffset,
@@ -71,6 +77,137 @@ let TransferFacade = exports.TransferFacade = class TransferFacade {
71
77
  }
72
78
  return transferDepartures;
73
79
  }
80
+ async getTransferCache(stopIds, limit, reqNumber, vehicleType, timeFrom) {
81
+ const span = (0, monitoring_1.createChildSpan)(`Departures.getTransferCache`);
82
+ span?.setAttributes({ stopIds, limit, reqNumber, vehicleType });
83
+ try {
84
+ let departureEntities = [];
85
+ try {
86
+ departureEntities = await this.publicDepartureRepository.getPublicGtfsDepartureCache(stopIds, 60, // look forward up-to 1 hour, see JIS Transferboards Design Document
87
+ timeFrom, limit * 2 // should be (at least) 2x the limit from request
88
+ );
89
+ }
90
+ catch (error) {
91
+ span?.recordException(error);
92
+ if (error instanceof golemio_errors_1.AbstractGolemioError) {
93
+ throw error;
94
+ }
95
+ throw new golemio_errors_1.GeneralError("Failed to publicGtfsDepartureCache", this.constructor.name, error, 500);
96
+ }
97
+ const currentPosition = await this.tripRepository.getDetailedVehiclePosition(`service-${vehicleType}-${reqNumber}`);
98
+ let currentDeparture = null;
99
+ let currentStopTime = null;
100
+ if (currentPosition) {
101
+ const departureIndex = departureEntities.findIndex((departure) => {
102
+ return departure.trip_id === currentPosition.gtfs_trip_id;
103
+ }) ?? null;
104
+ // Remove currentDeparture from departureEntities
105
+ if (departureIndex !== -1) {
106
+ currentDeparture = departureEntities.splice(departureIndex, 1)[0];
107
+ }
108
+ const stopTimes = (await this.stopTimeRepository.getPublicStopTimeCache(currentPosition.vehicle_id, currentPosition.gtfs_trip_id)) || [];
109
+ currentStopTime = stopTimes.find((stopTime) => stopIds.includes(stopTime.stop_id)) ?? null;
110
+ }
111
+ if (currentPosition && !currentDeparture) {
112
+ // Important Fallback for last-stop of a trip
113
+ // because there is no Departure from such last-stop
114
+ currentDeparture = await this.findFallbackDeparture(currentPosition, stopIds);
115
+ }
116
+ const omitFutureTrips = true;
117
+ // One trip might go through more Stops in one Node
118
+ const uniqueDeparturesTripIds = Array.from(new Set(departureEntities.map((departure) => departure.trip_id)));
119
+ const positionsByTrip = await this.tripRepository.getAllVehiclePositionsForMultipleTrips(uniqueDeparturesTripIds, omitFutureTrips);
120
+ let transfers = [];
121
+ const moreDepartures = await this.processMultiplePositionsForDeparturesAtOnce(departureEntities, positionsByTrip, stopIds);
122
+ transfers.push(...moreDepartures);
123
+ return {
124
+ currentTrip: {
125
+ departure: currentDeparture,
126
+ position: currentPosition,
127
+ stopTime: currentStopTime,
128
+ },
129
+ transfers,
130
+ };
131
+ }
132
+ catch (error) {
133
+ span?.recordException(error);
134
+ if (error instanceof golemio_errors_1.AbstractGolemioError) {
135
+ throw error;
136
+ }
137
+ throw new golemio_errors_1.GeneralError("Error in getTransferCache", this.constructor.name, error, 500);
138
+ }
139
+ finally {
140
+ span?.end();
141
+ }
142
+ }
143
+ async findFallbackDeparture(currentPosition, stopIds) {
144
+ const stopTimes = (await this.delayComputationRepository.getDelayComputationCacheProperty(currentPosition.gtfs_trip_id, "stop_times"));
145
+ if (!stopTimes?.stop_times?.length) {
146
+ return null;
147
+ }
148
+ const departureAtStopId = stopTimes.stop_times.find((stopTime) => stopIds.includes(stopTime.stop_id)) || null;
149
+ if (departureAtStopId) {
150
+ const arrivalDate = DateTimeUtils_1.DateTimeUtils.getStopDateTimeForTripOrigin(departureAtStopId.arrival_time_seconds, currentPosition.detailed_info.origin_timestamp);
151
+ const departureDate = DateTimeUtils_1.DateTimeUtils.getStopDateTimeForTripOrigin(departureAtStopId.departure_time_seconds, currentPosition.detailed_info.origin_timestamp);
152
+ return {
153
+ stop_id: departureAtStopId.stop_id,
154
+ departure_datetime: departureDate.toISOString(),
155
+ arrival_datetime: arrivalDate.toISOString(),
156
+ route_short_name: currentPosition.gtfs_route_short_name,
157
+ route_type: currentPosition.route_type,
158
+ trip_id: currentPosition.gtfs_trip_id,
159
+ stop_sequence: departureAtStopId.stop_sequence,
160
+ platform_code: null,
161
+ trip_headsign: currentPosition.detailed_info.trip_headsign,
162
+ };
163
+ }
164
+ return null;
165
+ }
166
+ async processMultiplePositionsForDeparturesAtOnce(departures, positionsByTrip, stopIds) {
167
+ const outputGroup = [];
168
+ const trainIdTripIdTuples = [];
169
+ const trainDepartures = new Map();
170
+ for (const departure of departures) {
171
+ // for each departure, use its trip_id + multiple position
172
+ const positions = positionsByTrip.get(departure.trip_id) || [];
173
+ if (!positions.length) {
174
+ outputGroup.push({
175
+ departure,
176
+ position: null,
177
+ stopTime: null,
178
+ });
179
+ continue;
180
+ }
181
+ const validPositions = positions.filter((pos) => pos.state_position !== const_1.StatePositionEnum.CANCELED);
182
+ for (const pos of validPositions) {
183
+ if (pos.route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.TRAIN) {
184
+ trainDepartures.set(departure.trip_id, departure);
185
+ trainIdTripIdTuples.push([pos.vehicle_id, departure.trip_id]);
186
+ continue;
187
+ }
188
+ // not a train, thus no stopTime.cis_platform_code needed
189
+ outputGroup.push({
190
+ departure,
191
+ position: pos,
192
+ stopTime: null,
193
+ });
194
+ }
195
+ }
196
+ const stopTimeCachesByTripId = !trainIdTripIdTuples.length
197
+ ? new Map()
198
+ : await this.stopTimeRepository.getManyPublicStopTimeCaches(trainIdTripIdTuples);
199
+ for (const [tripId, stopTimeCache] of Array.from(stopTimeCachesByTripId.entries())) {
200
+ const departure = trainDepartures.get(tripId);
201
+ const position = positionsByTrip.get(tripId)[0];
202
+ const stopTime = stopTimeCache.find((stopTime) => stopIds.includes(stopTime.stop_id));
203
+ outputGroup.push({
204
+ departure,
205
+ position: position || null,
206
+ stopTime: stopTime || null,
207
+ });
208
+ }
209
+ return outputGroup;
210
+ }
74
211
  /**
75
212
  * Fallback options as defined by ROPID
76
213
  */
@@ -91,9 +228,17 @@ let TransferFacade = exports.TransferFacade = class TransferFacade {
91
228
  };
92
229
  exports.TransferFacade = TransferFacade = __decorate([
93
230
  (0, tsyringe_1.injectable)(),
94
- __param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.DeparturesRepository)),
95
- __param(1, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.TransferDepartureTransformation)),
96
- __metadata("design:paramtypes", [data_access_1.DeparturesRepository,
97
- TransferDepartureTransformation_1.TransferDepartureTransformation])
231
+ __param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.PublicGtfsDepartureRepository)),
232
+ __param(1, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.DeparturesRepository)),
233
+ __param(2, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.TransferDepartureTransformation)),
234
+ __param(3, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.PublicVehiclePositionsRepository)),
235
+ __param(4, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.PublicStopTimeRepository)),
236
+ __param(5, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.DelayComputationRepository)),
237
+ __metadata("design:paramtypes", [PublicGtfsDepartureRepository_1.PublicGtfsDepartureRepository,
238
+ data_access_1.DeparturesRepository,
239
+ TransferDepartureTransformation_1.TransferDepartureTransformation,
240
+ PublicVehiclePositionsRepository_1.PublicVehiclePositionsRepository,
241
+ PublicStopTimeRepository_1.PublicStopTimeRepository,
242
+ DelayComputationRepository_1.DelayComputationRepository])
98
243
  ], TransferFacade);
99
244
  //# sourceMappingURL=TransferFacade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransferFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/TransferFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAAgI;AAChI,mDAA2D;AAC3D,qDAAoD;AACpD,+FAA0E;AAC1E,0HAAoG;AACpG,4CAA8C;AAC9C,6EAA8F;AAE9F,iEAAwE;AACxE,wGAAqG;AAG9F,IAAM,cAAc,4BAApB,MAAM,cAAc;IACvB,YACqD,mBAAyC,EAC9B,uBAAwD;QADnE,wBAAmB,GAAnB,mBAAmB,CAAsB;QAC9B,4BAAuB,GAAvB,uBAAuB,CAAiC;IACrH,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CAC9B,OAAiB,EACjB,UAAyB,EACzB,aAAqB,EACrB,aAAqB,EACrB,QAAQ,GAAG,yBAAgB,CAAC,QAAQ;QAEpC,IAAI,iBAAiB,GAAyB,EAAE,CAAC;QACjD,IAAI;YACA,iBAAiB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,CAAC;gBACrE,QAAQ,EAAE,OAAO;gBACjB,aAAa;gBACb,aAAa;aAChB,CAAC,CAAC;SACN;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACvG;QAED,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,EAAE,CAAC;SACb;QAED,IAAI,kBAAkB,GAAyB,EAAE,CAAC;QAClD,IAAI;YACA,MAAM,mBAAmB,GAAG,IAAI,2BAAkB,CAAC,iBAAiB,EAAE;gBAClE,GAAG,IAAI,CAAC,cAAc;gBACtB,QAAQ,EAAE,QAAQ;gBAClB,UAAU;aACb,CAAC,CAAC,yBAAyB,EAAE,CAAC;YAE/B,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;SACzF;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,uCAAuC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACtG;QAED,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAY,cAAc;QACtB,OAAO;YACH,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,mBAAa,CAAC,UAAU;YAC9B,KAAK,EAAE,oBAAc,CAAC,IAAI;YAC1B,MAAM,EAAE,qBAAe,CAAC,6BAA6B;YACrD,IAAI,EAAE,CAAC,mBAAa,CAAC,QAAQ,CAAC;YAC9B,oBAAoB,EAAE,EAAE;YACxB,cAAc,EAAE,IAAI;YACpB,cAAc,EAAE,IAAI,EAAE,2BAA2B;SACpD,CAAC;IACN,CAAC;CACJ,CAAA;yBA3EY,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,oBAAoB,CAAC,CAAA;IACvC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,+BAA+B,CAAC,CAAA;qCADmB,kCAAoB;QACL,iEAA+B;GAH/G,cAAc,CA2E1B"}
1
+ {"version":3,"file":"TransferFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/TransferFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BASiB;AACjB,qDAAoD;AACpD,0HAAoG;AACpG,6EA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,EAAE,QAAQ,IAAI,IAAI;aAC7B,CAAC,CAAC;SACN;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAY,cAAc;QACtB,OAAO;YACH,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,mBAAa,CAAC,UAAU;YAC9B,KAAK,EAAE,oBAAc,CAAC,IAAI;YAC1B,MAAM,EAAE,qBAAe,CAAC,6BAA6B;YACrD,IAAI,EAAE,CAAC,mBAAa,CAAC,QAAQ,CAAC;YAC9B,oBAAoB,EAAE,EAAE;YACxB,cAAc,EAAE,IAAI;YACpB,cAAc,EAAE,IAAI,EAAE,2BAA2B;SACpD,CAAC;IACN,CAAC;CACJ,CAAA;yBAzQY,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,6BAA6B,CAAC,CAAA;IAChD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,oBAAoB,CAAC,CAAA;IACvC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,+BAA+B,CAAC,CAAA;IAClD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,gCAAgC,CAAC,CAAA;IACnD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,wBAAwB,CAAC,CAAA;IAC3C,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,0BAA0B,CAAC,CAAA;qCALuC,6DAA6B;QAC3C,kCAAoB;QACN,iEAA+B;QACvC,mEAAgC;QACpC,mDAAwB;QACd,uDAA0B;GAPxG,cAAc,CAyQ1B"}
@@ -1,4 +1,4 @@
1
- import { ITransferDeparture } from "../..";
1
+ import { ITransferDeparture, IDepartureWithPosition } from "../..";
2
2
  export declare class PlatformCodeResolver {
3
3
  /**
4
4
  * Platform code is determined by the following rules:
@@ -7,4 +7,10 @@ export declare class PlatformCodeResolver {
7
7
  * - for other route types, the departure platform code is used (GTFS)
8
8
  */
9
9
  static resolve(departure: ITransferDeparture): string | null;
10
+ /**
11
+ * Determine platform code based on the following rules:
12
+ * if current stop time is known, use its RT CIS platform code (if available)
13
+ * otherwise use GTFS schedule platform code
14
+ */
15
+ static determinePlatformCode(inputDto: IDepartureWithPosition): string | null;
10
16
  }
@@ -15,6 +15,15 @@ class PlatformCodeResolver {
15
15
  }
16
16
  return departure.platform_code;
17
17
  }
18
+ /**
19
+ * Determine platform code based on the following rules:
20
+ * if current stop time is known, use its RT CIS platform code (if available)
21
+ * otherwise use GTFS schedule platform code
22
+ */
23
+ static determinePlatformCode(inputDto) {
24
+ const { departure, stopTime } = inputDto;
25
+ return stopTime?.cis_stop_platform_code || departure.platform_code;
26
+ }
18
27
  }
19
28
  exports.PlatformCodeResolver = PlatformCodeResolver;
20
29
  //# sourceMappingURL=PlatformCodeResolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformCodeResolver.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/helpers/PlatformCodeResolver.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAG5D,MAAa,oBAAoB;IAC7B;;;;;OAKG;IACI,MAAM,CAAC,OAAO,CAAC,SAA6B;QAC/C,IAAI,SAAS,CAAC,UAAU,KAAK,kCAAiB,CAAC,KAAK,IAAI,SAAS,CAAC,6BAA6B,CAAC,KAAK,IAAI,EAAE;YACvG,OAAO,SAAS,CAAC,6BAA6B,CAAC,CAAC;SACnD;QAED,OAAO,SAAS,CAAC,aAAa,CAAC;IACnC,CAAC;CACJ;AAdD,oDAcC"}
1
+ {"version":3,"file":"PlatformCodeResolver.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/helpers/PlatformCodeResolver.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAG5D,MAAa,oBAAoB;IAC7B;;;;;OAKG;IACI,MAAM,CAAC,OAAO,CAAC,SAA6B;QAC/C,IAAI,SAAS,CAAC,UAAU,KAAK,kCAAiB,CAAC,KAAK,IAAI,SAAS,CAAC,6BAA6B,CAAC,KAAK,IAAI,EAAE;YACvG,OAAO,SAAS,CAAC,6BAA6B,CAAC,CAAC;SACnD;QAED,OAAO,SAAS,CAAC,aAAa,CAAC;IACnC,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,qBAAqB,CAAC,QAAgC;QAChE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;QAEzC,OAAO,QAAQ,EAAE,sBAAsB,IAAI,SAAS,CAAC,aAAa,CAAC;IACvE,CAAC;CACJ;AAxBD,oDAwBC"}
@@ -0,0 +1,13 @@
1
+ import { IV4InfotextTransferOutputDto } from "../../domain/InfotextInterfaces";
2
+ import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
3
+ import { IJISInfotextDto } from "../../../../schema-definitions/jis/redis/interfaces/IJISInfotextDto";
4
+ export declare class JISInfotextCacheTransferTransformation extends AbstractTransformation<IJISInfotextDto, IV4InfotextTransferOutputDto> {
5
+ name: string;
6
+ protected transformInternal: (infotext: IJISInfotextDto) => {
7
+ display_type: import("../../domain/InfotextDisplayTypeEnum").InfotextDisplayType;
8
+ text: {
9
+ cs: string;
10
+ en: string | null;
11
+ };
12
+ };
13
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.JISInfotextCacheTransferTransformation = void 0;
10
+ const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
11
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
12
+ const DisplayTypeMapper_1 = require("../helpers/DisplayTypeMapper");
13
+ let JISInfotextCacheTransferTransformation = exports.JISInfotextCacheTransferTransformation = class JISInfotextCacheTransferTransformation extends AbstractTransformation_1.AbstractTransformation {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.name = "JISInfotextCacheTransferTransformation";
17
+ this.transformInternal = (infotext) => {
18
+ return {
19
+ display_type: DisplayTypeMapper_1.DisplayTypeMapper.mapInputToOutputDisplayType(infotext.display_type),
20
+ text: {
21
+ cs: infotext.description_text.cs,
22
+ en: infotext.description_text.en ?? null,
23
+ },
24
+ };
25
+ };
26
+ }
27
+ };
28
+ exports.JISInfotextCacheTransferTransformation = JISInfotextCacheTransferTransformation = __decorate([
29
+ (0, tsyringe_1.injectable)()
30
+ ], JISInfotextCacheTransferTransformation);
31
+ //# sourceMappingURL=JISInfotextCacheTransferTransformation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JISInfotextCacheTransferTransformation.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.ts"],"names":[],"mappings":";;;;;;;;;AACA,6GAA0G;AAC1G,iEAAgE;AAChE,oEAAiE;AAI1D,IAAM,sCAAsC,oDAA5C,MAAM,sCAAuC,SAAQ,+CAG3D;IAHM;;QAII,SAAI,GAAG,wCAAwC,CAAC;QAE7C,sBAAiB,GAAG,CAAC,QAAyB,EAAE,EAAE;YACxD,OAAO;gBACH,YAAY,EAAE,qCAAiB,CAAC,2BAA2B,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAClF,IAAI,EAAE;oBACF,EAAE,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE;oBAChC,EAAE,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,IAAI,IAAI;iBAC3C;aACJ,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;iDAfY,sCAAsC;IADlD,IAAA,qBAAU,GAAE;GACA,sCAAsC,CAelD"}
@@ -0,0 +1,27 @@
1
+ import { IDepartureWithPosition, IV4TransferDepartureOutputDto } from "../..";
2
+ import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
3
+ import { GTFSRouteTypeEnum } from "../../../../helpers/RouteTypeEnums";
4
+ export declare class TransferDepartureCacheTransformation extends AbstractTransformation<IDepartureWithPosition, IV4TransferDepartureOutputDto> {
5
+ name: string;
6
+ transformArray: (data: IDepartureWithPosition[]) => IV4TransferDepartureOutputDto[];
7
+ protected transformInternal: (data: IDepartureWithPosition) => {
8
+ departure_timestamp: {
9
+ minutes: string[];
10
+ };
11
+ route: {
12
+ short_name: string;
13
+ type: GTFSRouteTypeEnum;
14
+ };
15
+ stop: {
16
+ platform_code: string | null;
17
+ };
18
+ trip: {
19
+ headsign: string;
20
+ id: string;
21
+ is_wheelchair_accessible: boolean | null;
22
+ };
23
+ icons: never[];
24
+ substitution_text: null;
25
+ };
26
+ private calculateDepartureMinutes;
27
+ }