@tmlmobilidade/databases 20260330.1756.23 → 20260331.1620.53

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.
@@ -13,25 +13,25 @@ declare class SimplifiedApexOnBoardRefundsNewClass extends ClickHouseInterfaceTe
13
13
  __brand: "UnixTimestamp";
14
14
  };
15
15
  agency_id: string;
16
+ received_at: number & {
17
+ __brand: "UnixTimestamp";
18
+ };
19
+ price: number;
16
20
  apex_version: string;
17
21
  device_id: string;
18
22
  line_id: string | null;
19
23
  mac_ase_counter_value: number;
20
24
  mac_sam_serial_number: number;
21
25
  pattern_id: string | null;
22
- received_at: number & {
23
- __brand: "UnixTimestamp";
24
- };
25
26
  stop_id: string | null;
26
27
  trip_id: string | null;
27
28
  vehicle_id: number | null;
29
+ card_serial_number: string;
28
30
  block_id: string | null;
29
31
  card_physical_type: number;
30
- card_serial_number: string;
31
32
  duty_id: string | null;
32
33
  on_board_sale_id: string | null;
33
34
  payment_method: number;
34
- price: number;
35
35
  product_long_id: string;
36
36
  product_quantity: number;
37
37
  validation_id: string | null;
@@ -13,24 +13,24 @@ declare class SimplifiedApexOnBoardSalesNewClass extends ClickHouseInterfaceTemp
13
13
  __brand: "UnixTimestamp";
14
14
  };
15
15
  agency_id: string;
16
+ received_at: number & {
17
+ __brand: "UnixTimestamp";
18
+ };
19
+ price: number;
16
20
  apex_version: string;
17
21
  device_id: string;
18
22
  line_id: string | null;
19
23
  mac_ase_counter_value: number;
20
24
  mac_sam_serial_number: number;
21
25
  pattern_id: string | null;
22
- received_at: number & {
23
- __brand: "UnixTimestamp";
24
- };
25
26
  stop_id: string | null;
26
27
  trip_id: string | null;
27
28
  vehicle_id: number | null;
29
+ card_serial_number: string;
28
30
  block_id: string | null;
29
31
  card_physical_type: number;
30
- card_serial_number: string;
31
32
  duty_id: string | null;
32
33
  payment_method: number;
33
- price: number;
34
34
  product_long_id: string;
35
35
  product_quantity: number;
36
36
  validation_id: string | null;
@@ -9,31 +9,30 @@ declare class SimplifiedApexValidationsNewClass extends ClickHouseInterfaceTempl
9
9
  created_at: number & {
10
10
  __brand: "UnixTimestamp";
11
11
  };
12
- updated_at: number & {
12
+ agency_id: string;
13
+ is_ok: boolean;
14
+ received_at: number & {
13
15
  __brand: "UnixTimestamp";
14
16
  };
15
- agency_id: string;
16
17
  apex_version: string;
17
18
  device_id: string;
19
+ event_type: number;
20
+ is_ok_pcgi: boolean;
18
21
  line_id: string;
19
22
  mac_ase_counter_value: number;
20
23
  mac_sam_serial_number: number;
21
24
  pattern_id: string;
22
- received_at: number & {
23
- __brand: "UnixTimestamp";
24
- };
25
+ product_id: string;
25
26
  stop_id: string;
26
27
  trip_id: string;
28
+ units_qty: number | null;
27
29
  vehicle_id: number;
28
30
  card_serial_number: string;
29
31
  on_board_sale_id: string | null;
30
32
  is_passenger: boolean;
31
33
  on_board_refund_id: string | null;
32
- category: "on_board_sale" | "prepaid" | "subscription";
33
- event_type: number;
34
- product_id: string;
35
- units_qty: number | null;
36
- validation_status: 0 | 1 | 2 | 12 | 4 | 3 | 5 | 6 | 11 | 10 | 7 | 8 | 9 | 13;
34
+ category: "prepaid" | "subscription" | "on_board_sale" | null;
35
+ validation_status: 0 | 1 | 2 | 12 | 4 | 3 | 5 | 6 | 11 | 10 | 8 | 7 | 9 | 13;
37
36
  }>;
38
37
  protected readonly tableName = "simplified_apex_validations";
39
38
  /**
@@ -12,6 +12,8 @@ const tableSchema = {
12
12
  created_at: { type: 'Int64' },
13
13
  device_id: { type: 'String' },
14
14
  event_type: { type: 'Int64' },
15
+ is_ok: { type: 'Bool' },
16
+ is_ok_pcgi: { type: 'Bool' },
15
17
  is_passenger: { type: 'Bool' },
16
18
  line_id: { type: 'String' },
17
19
  mac_ase_counter_value: { type: 'Int64' },
@@ -24,7 +26,6 @@ const tableSchema = {
24
26
  stop_id: { type: 'String' },
25
27
  trip_id: { type: 'String' },
26
28
  units_qty: { type: 'Nullable(Int64)' },
27
- updated_at: { type: 'Int64' },
28
29
  validation_status: { type: 'Int64' },
29
30
  vehicle_id: { type: 'String' },
30
31
  };
@@ -0,0 +1,50 @@
1
+ // /* * */
2
+ export {};
3
+ // import { PCGIRawClient } from '../../clients/pcgi-raw.js';
4
+ // import { MongoInterfaceTemplate } from '../../templates/mongodb.js';
5
+ // import { type SimplifiedMongoIndex } from '../../types/mongo/index-description.js';
6
+ // import { type RawVehicleEvent, RawVehicleEventSchema } from '@tmlmobilidade/types';
7
+ // import { asyncSingletonProxy } from '@tmlmobilidade/utils';
8
+ // /* * */
9
+ // class RawVehicleEventsNewClass extends MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent, Partial<RawVehicleEvent>> {
10
+ // //
11
+ // private static _instance: null | Promise<RawVehicleEventsNewClass> = null;
12
+ // protected override readonly collectionName = 'raw_vehicle_events_ledger';
13
+ // protected override readonly databaseName = 'raw';
14
+ // protected override readonly indexDescription: SimplifiedMongoIndex<RawVehicleEvent>[] = [
15
+ // { key: { created_at: 1 } },
16
+ // { key: { agency_id: 1, created_at: 1 } },
17
+ // // eslint-disable-next-line perfectionist/sort-objects
18
+ // { key: { version: 1, created_at: 1 } },
19
+ // // eslint-disable-next-line perfectionist/sort-objects
20
+ // { key: { version: 1, received_at: 1 } },
21
+ // ];
22
+ // protected override createSchema = RawVehicleEventSchema;
23
+ // protected override updateSchema = null;
24
+ // /**
25
+ // * Returns the singleton instance of the subclass.
26
+ // */
27
+ // public static async getInstance() {
28
+ // // If no instance exists, create one and store the promise.
29
+ // // This ensures that if multiple calls to getInstance() happen concurrently,
30
+ // // they will all await the same initialization process.
31
+ // if (!this._instance) {
32
+ // this._instance = (async () => {
33
+ // const instance = new RawVehicleEventsNewClass();
34
+ // // This behaves like the constructor,
35
+ // // but allows for async initialization.
36
+ // await instance.init();
37
+ // return instance;
38
+ // })();
39
+ // }
40
+ // // Await the instance if it's still initializing,
41
+ // // or return it immediately if ready.
42
+ // return await this._instance;
43
+ // }
44
+ // protected override connectToClient() {
45
+ // return PCGIRawClient.getClient();
46
+ // }
47
+ // //
48
+ // }
49
+ // /* * */
50
+ // export const rawVehicleEventsNew = asyncSingletonProxy(RawVehicleEventsNewClass);