@tmlmobilidade/go-interfaces-labdb 20260902.1058.18 → 20260902.1453.48

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.
@@ -1,6 +1,6 @@
1
1
  import { ClickHouseInterfaceTemplate } from '../interface.template.js';
2
2
  import { ClickHouseClient } from '@tmlmobilidade/go-clients-clickhouse';
3
- import { HashedShape, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
3
+ import { HashedShape, RideProcessingWindow, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
4
4
  import { type Ride } from '@tmlmobilidade/go-types-operation';
5
5
  import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
6
6
  export declare class OperationDatabase {
@@ -21,6 +21,7 @@ export declare class OperationDatabase {
21
21
  readonly rideAnalysisSimpleOneVehicleEventOrApexValidation: ClickHouseInterfaceTemplate<RideAnalysisSimpleOneVehicleEventOrApexValidation>;
22
22
  readonly rideAnalysisSimpleThreeVehicleEvents: ClickHouseInterfaceTemplate<RideAnalysisSimpleThreeVehicleEvents>;
23
23
  readonly rideAnalysisTransactionSequentiality: ClickHouseInterfaceTemplate<RideAnalysisTransactionSequentiality>;
24
+ readonly rideProcessingWindows: ClickHouseInterfaceTemplate<RideProcessingWindow>;
24
25
  readonly rides: ClickHouseInterfaceTemplate<Ride>;
25
26
  readonly simplifiedVehicleEvents: ClickHouseInterfaceTemplate<SimplifiedVehicleEvent>;
26
27
  private readonly databaseName;
@@ -1,6 +1,6 @@
1
1
  /* * */
2
2
  import { ClickHouseInterfaceTemplate } from '../interface.template.js';
3
- import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema, ridesTableSchema, simplifiedVehicleEventTableSchema } from '../schemas/operation.js';
3
+ import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema, rideProcessingWindowTableSchema, ridesTableSchema, simplifiedVehicleEventTableSchema } from '../schemas/operation.js';
4
4
  /* * */
5
5
  export class OperationDatabase {
6
6
  //
@@ -21,6 +21,7 @@ export class OperationDatabase {
21
21
  rideAnalysisSimpleOneVehicleEventOrApexValidation;
22
22
  rideAnalysisSimpleThreeVehicleEvents;
23
23
  rideAnalysisTransactionSequentiality;
24
+ rideProcessingWindows;
24
25
  rides;
25
26
  simplifiedVehicleEvents;
26
27
  databaseName = 'operation';
@@ -110,6 +111,10 @@ export class OperationDatabase {
110
111
  orderBy: ['ride_id'],
111
112
  partitionBy: 'intDiv(operational_date, 100)',
112
113
  });
114
+ this.rideProcessingWindows = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_processing_windows', rideProcessingWindowTableSchema, {
115
+ engine: 'ReplacingMergeTree(generated_at)',
116
+ orderBy: ['agency_id', 'trip_id', 'window_start', 'window_end'],
117
+ });
113
118
  this.rides = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'rides', ridesTableSchema, {
114
119
  engine: 'ReplacingMergeTree(updated_at)',
115
120
  orderBy: ['agency_id', 'operational_date', 'route_short_name', 'shape_id', 'start_time_scheduled', '_id'],
@@ -139,6 +144,7 @@ export class OperationDatabase {
139
144
  await this.rideAnalysisSimpleOneVehicleEventOrApexValidation.init();
140
145
  await this.rideAnalysisSimpleThreeVehicleEvents.init();
141
146
  await this.rideAnalysisTransactionSequentiality.init();
147
+ await this.rideProcessingWindows.init();
142
148
  await this.rides.init();
143
149
  await this.simplifiedVehicleEvents.init();
144
150
  }
@@ -1,5 +1,5 @@
1
1
  import { type ClickHouseTableSchema } from '@tmlmobilidade/go-clients-clickhouse';
2
- import { type HashedShape, type HashedTrip, type Ride, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
2
+ import { RideProcessingWindow, type HashedShape, type HashedTrip, type Ride, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
3
3
  import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
4
4
  export declare const simplifiedVehicleEventTableSchema: ClickHouseTableSchema<SimplifiedVehicleEvent>;
5
5
  export declare const hashedShapeTableSchema: ClickHouseTableSchema<HashedShape>;
@@ -20,3 +20,4 @@ export declare const rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchem
20
20
  export declare const rideAnalysisSimpleThreeVehicleEventsTableSchema: ClickHouseTableSchema<RideAnalysisSimpleThreeVehicleEvents>;
21
21
  export declare const rideAnalysisTransactionSequentialityTableSchema: ClickHouseTableSchema<RideAnalysisTransactionSequentiality>;
22
22
  export declare const ridesTableSchema: ClickHouseTableSchema<Ride>;
23
+ export declare const rideProcessingWindowTableSchema: ClickHouseTableSchema<RideProcessingWindow>;
@@ -197,3 +197,12 @@ export const ridesTableSchema = {
197
197
  updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
198
198
  vehicle_ids: { type: 'Array(LowCardinality(String))' },
199
199
  };
200
+ /* * */
201
+ export const rideProcessingWindowTableSchema = {
202
+ agency_id: { type: 'LowCardinality(String)' },
203
+ trip_id: { type: 'LowCardinality(String)' },
204
+ window_start: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
205
+ window_end: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
206
+ operational_dates: { type: 'Array(UInt32 CODEC(T64, ZSTD))' },
207
+ generated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
208
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/go-interfaces-labdb",
3
- "version": "20260902.1058.18",
3
+ "version": "20260902.1453.48",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"