@tmlmobilidade/go-interfaces-labdb 20260908.2038.54 → 20260908.2240.51
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 { type HashedShape, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventCoverageGeo, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality
|
|
3
|
+
import { type HashedShape, type HashedTrip, type Ride, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventCoverageGeo, 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 SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
|
|
5
5
|
export declare class OperationDatabase {
|
|
6
6
|
readonly hashedShapes: ClickHouseInterfaceTemplate<HashedShape>;
|
|
@@ -21,7 +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
|
|
24
|
+
readonly rides: ClickHouseInterfaceTemplate<Ride>;
|
|
25
25
|
readonly simplifiedVehicleEvents: ClickHouseInterfaceTemplate<SimplifiedVehicleEvent>;
|
|
26
26
|
private readonly databaseName;
|
|
27
27
|
constructor(instance: ClickHouseClient);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { ClickHouseInterfaceTemplate } from '../interface.template.js';
|
|
3
|
-
import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventCoverageGeoTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema,
|
|
3
|
+
import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventCoverageGeoTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema, ridesTableSchema, simplifiedVehicleEventTableSchema } from '../schemas/operation.js';
|
|
4
4
|
/* * */
|
|
5
5
|
export class OperationDatabase {
|
|
6
6
|
//
|
|
@@ -22,7 +22,7 @@ export class OperationDatabase {
|
|
|
22
22
|
rideAnalysisSimpleOneVehicleEventOrApexValidation;
|
|
23
23
|
rideAnalysisSimpleThreeVehicleEvents;
|
|
24
24
|
rideAnalysisTransactionSequentiality;
|
|
25
|
-
|
|
25
|
+
rides;
|
|
26
26
|
simplifiedVehicleEvents;
|
|
27
27
|
databaseName = 'operation';
|
|
28
28
|
constructor(instance) {
|
|
@@ -116,7 +116,7 @@ export class OperationDatabase {
|
|
|
116
116
|
orderBy: ['ride_id'],
|
|
117
117
|
partitionBy: 'intDiv(operational_date, 100)',
|
|
118
118
|
});
|
|
119
|
-
this.
|
|
119
|
+
this.rides = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'rides', ridesTableSchema, {
|
|
120
120
|
engine: 'ReplacingMergeTree(updated_at)',
|
|
121
121
|
orderBy: ['agency_id', 'operational_date', 'route_short_name', 'shape_id', 'start_time_scheduled', '_id'],
|
|
122
122
|
partitionBy: 'intDiv(operational_date, 100)',
|
|
@@ -146,7 +146,7 @@ export class OperationDatabase {
|
|
|
146
146
|
await this.rideAnalysisSimpleOneVehicleEventOrApexValidation.init();
|
|
147
147
|
await this.rideAnalysisSimpleThreeVehicleEvents.init();
|
|
148
148
|
await this.rideAnalysisTransactionSequentiality.init();
|
|
149
|
-
await this.
|
|
149
|
+
await this.rides.init();
|
|
150
150
|
await this.simplifiedVehicleEvents.init();
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ClickHouseTableSchema } from '@tmlmobilidade/go-clients-clickhouse';
|
|
2
|
-
import { type HashedShape, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventCoverageGeo, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality
|
|
2
|
+
import { type HashedShape, type HashedTrip, type Ride, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventCoverageGeo, 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 hashedShapeTableSchema: ClickHouseTableSchema<HashedShape>;
|
|
5
5
|
export declare const hashedTripTableSchema: ClickHouseTableSchema<HashedTrip>;
|
|
@@ -19,5 +19,5 @@ export declare const rideAnalysisSimpleOneApexValidationTableSchema: ClickHouseT
|
|
|
19
19
|
export declare const rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema: ClickHouseTableSchema<RideAnalysisSimpleOneVehicleEventOrApexValidation>;
|
|
20
20
|
export declare const rideAnalysisSimpleThreeVehicleEventsTableSchema: ClickHouseTableSchema<RideAnalysisSimpleThreeVehicleEvents>;
|
|
21
21
|
export declare const rideAnalysisTransactionSequentialityTableSchema: ClickHouseTableSchema<RideAnalysisTransactionSequentiality>;
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const ridesTableSchema: ClickHouseTableSchema<Ride>;
|
|
23
23
|
export declare const simplifiedVehicleEventTableSchema: ClickHouseTableSchema<SimplifiedVehicleEvent>;
|
|
@@ -136,7 +136,7 @@ export const rideAnalysisTransactionSequentialityTableSchema = {
|
|
|
136
136
|
missing_transactions_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
|
|
137
137
|
};
|
|
138
138
|
/* * */
|
|
139
|
-
export const
|
|
139
|
+
export const ridesTableSchema = {
|
|
140
140
|
_id: { type: 'String' },
|
|
141
141
|
agency_code: { type: 'LowCardinality(String)' },
|
|
142
142
|
agency_id: { type: 'LowCardinality(String)' },
|