@tmlmobilidade/types 20250911.1034.51 → 20250911.1425.9

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 (54) hide show
  1. package/dist/src/_common/comment.d.ts +20 -20
  2. package/dist/src/_common/document.d.ts +4 -4
  3. package/dist/src/_common/document.js +2 -2
  4. package/dist/src/_common/operational-date.d.ts +1 -1
  5. package/dist/src/_common/operational-date.js +1 -2
  6. package/dist/src/_common/proposed-change.d.ts +18 -40
  7. package/dist/src/_common/proposed-change.js +5 -14
  8. package/dist/src/agency.d.ts +19 -30
  9. package/dist/src/agency.js +1 -1
  10. package/dist/src/alert.d.ts +37 -63
  11. package/dist/src/alert.js +8 -48
  12. package/dist/src/auth/login.js +2 -8
  13. package/dist/src/auth/role.d.ts +15 -22
  14. package/dist/src/auth/role.js +1 -1
  15. package/dist/src/auth/session.d.ts +22 -38
  16. package/dist/src/auth/session.js +3 -3
  17. package/dist/src/auth/user.d.ts +22 -41
  18. package/dist/src/auth/user.js +3 -3
  19. package/dist/src/auth/verification-token.d.ts +22 -34
  20. package/dist/src/auth/verification-token.js +3 -3
  21. package/dist/src/gtfs.d.ts +6 -17
  22. package/dist/src/organization.d.ts +10 -13
  23. package/dist/src/organization.js +1 -1
  24. package/dist/src/plans/gtfs-validation.d.ts +34 -72
  25. package/dist/src/plans/gtfs-validation.js +2 -6
  26. package/dist/src/plans/plan-controller.d.ts +3 -8
  27. package/dist/src/plans/plan-controller.js +2 -2
  28. package/dist/src/plans/plan.d.ts +43 -95
  29. package/dist/src/plans/plan.js +2 -6
  30. package/dist/src/rides/ride-audit.d.ts +27 -30
  31. package/dist/src/rides/ride-audit.js +1 -1
  32. package/dist/src/rides/ride-justification.d.ts +69 -72
  33. package/dist/src/rides/ride-justification.js +1 -1
  34. package/dist/src/rides/ride.d.ts +55 -106
  35. package/dist/src/rides/ride.js +8 -8
  36. package/dist/src/sams/sam-analysis.d.ts +5 -13
  37. package/dist/src/sams/sam-analysis.js +3 -3
  38. package/dist/src/sams/sam.d.ts +46 -97
  39. package/dist/src/sams/sam.js +4 -4
  40. package/dist/src/simplified-apex/simplified-apex-location.d.ts +18 -25
  41. package/dist/src/simplified-apex/simplified-apex-location.js +2 -2
  42. package/dist/src/simplified-apex/simplified-apex-on-board-refund.d.ts +18 -25
  43. package/dist/src/simplified-apex/simplified-apex-on-board-refund.js +2 -2
  44. package/dist/src/simplified-apex/simplified-apex-on-board-sale.d.ts +28 -38
  45. package/dist/src/simplified-apex/simplified-apex-on-board-sale.js +3 -3
  46. package/dist/src/simplified-apex/simplified-apex-validation.d.ts +18 -25
  47. package/dist/src/simplified-apex/simplified-apex-validation.js +2 -2
  48. package/dist/src/stop.d.ts +133 -151
  49. package/dist/src/stop.js +11 -74
  50. package/dist/src/vehicle-event.d.ts +9 -14
  51. package/dist/src/vehicle-event.js +2 -2
  52. package/dist/src/zone.d.ts +9 -12
  53. package/dist/src/zone.js +1 -1
  54. package/package.json +1 -1
@@ -1,25 +1,23 @@
1
- import { type UnixTimestamp } from '../_common/unix-timestamp.js';
2
- import { type SamAnalysis } from './sam-analysis.js';
3
1
  import { z } from 'zod';
4
2
  export declare const SamSchema: z.ZodObject<{
5
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
6
- created_by: z.ZodDefault<z.ZodString>;
7
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
8
- updated_by: z.ZodDefault<z.ZodString>;
3
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
4
+ created_by: z.ZodOptional<z.ZodString>;
5
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
6
+ updated_by: z.ZodOptional<z.ZodString>;
9
7
  } & {
10
8
  _id: z.ZodNumber;
11
9
  agency_id: z.ZodString;
12
10
  analysis: z.ZodDefault<z.ZodArray<z.ZodObject<{
13
11
  apex_version: z.ZodNullable<z.ZodString>;
14
12
  device_id: z.ZodNullable<z.ZodString>;
15
- end_time: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
13
+ end_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
16
14
  first_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
17
15
  first_transaction_id: z.ZodNullable<z.ZodString>;
18
16
  first_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
19
17
  last_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
20
18
  last_transaction_id: z.ZodNullable<z.ZodString>;
21
19
  last_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
22
- start_time: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
20
+ start_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
23
21
  transactions_expected: z.ZodNullable<z.ZodNumber>;
24
22
  transactions_found: z.ZodNullable<z.ZodNumber>;
25
23
  transactions_missing: z.ZodNullable<z.ZodNumber>;
@@ -27,18 +25,14 @@ export declare const SamSchema: z.ZodObject<{
27
25
  }, "strict", z.ZodTypeAny, {
28
26
  apex_version: string | null;
29
27
  device_id: string | null;
30
- end_time: (number & {
31
- __brand: "UnixTimestamp";
32
- } & z.BRAND<"UnixTimestamp">) | null;
28
+ end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
33
29
  first_transaction_ase_counter_value: number | null;
34
30
  first_transaction_id: string | null;
35
31
  first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
36
32
  last_transaction_ase_counter_value: number | null;
37
33
  last_transaction_id: string | null;
38
34
  last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
39
- start_time: (number & {
40
- __brand: "UnixTimestamp";
41
- } & z.BRAND<"UnixTimestamp">) | null;
35
+ start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
42
36
  transactions_expected: number | null;
43
37
  transactions_found: number | null;
44
38
  transactions_missing: number | null;
@@ -61,8 +55,8 @@ export declare const SamSchema: z.ZodObject<{
61
55
  }>, "many">>;
62
56
  latest_apex_version: z.ZodNullable<z.ZodString>;
63
57
  remarks: z.ZodDefault<z.ZodNullable<z.ZodString>>;
64
- seen_first_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
65
- seen_last_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
58
+ seen_first_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
59
+ seen_last_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
66
60
  system_status: z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>;
67
61
  transactions_expected: z.ZodNullable<z.ZodNumber>;
68
62
  transactions_found: z.ZodNullable<z.ZodNumber>;
@@ -72,44 +66,36 @@ export declare const SamSchema: z.ZodObject<{
72
66
  created_at: number & {
73
67
  __brand: "UnixTimestamp";
74
68
  };
75
- created_by: string;
76
69
  updated_at: number & {
77
70
  __brand: "UnixTimestamp";
78
71
  };
79
- updated_by: string;
80
72
  agency_id: string;
81
73
  analysis: {
82
74
  apex_version: string | null;
83
75
  device_id: string | null;
84
- end_time: (number & {
85
- __brand: "UnixTimestamp";
86
- } & z.BRAND<"UnixTimestamp">) | null;
76
+ end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
87
77
  first_transaction_ase_counter_value: number | null;
88
78
  first_transaction_id: string | null;
89
79
  first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
90
80
  last_transaction_ase_counter_value: number | null;
91
81
  last_transaction_id: string | null;
92
82
  last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
93
- start_time: (number & {
94
- __brand: "UnixTimestamp";
95
- } & z.BRAND<"UnixTimestamp">) | null;
83
+ start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
96
84
  transactions_expected: number | null;
97
85
  transactions_found: number | null;
98
86
  transactions_missing: number | null;
99
87
  vehicle_id: number | null;
100
88
  }[];
101
- seen_first_at: (number & {
102
- __brand: "UnixTimestamp";
103
- } & z.BRAND<"UnixTimestamp">) | null;
104
- seen_last_at: (number & {
105
- __brand: "UnixTimestamp";
106
- } & z.BRAND<"UnixTimestamp">) | null;
89
+ seen_first_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
90
+ seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
107
91
  system_status: "waiting" | "processing" | "complete" | "error";
108
92
  transactions_expected: number | null;
109
93
  transactions_found: number | null;
110
94
  transactions_missing: number | null;
111
95
  latest_apex_version: string | null;
112
96
  remarks: string | null;
97
+ created_by?: string | undefined;
98
+ updated_by?: string | undefined;
113
99
  }, {
114
100
  _id: number;
115
101
  created_at: number;
@@ -143,24 +129,24 @@ export declare const SamSchema: z.ZodObject<{
143
129
  remarks?: string | null | undefined;
144
130
  }>;
145
131
  export declare const CreateSamSchema: z.ZodObject<Omit<{
146
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
147
- created_by: z.ZodDefault<z.ZodString>;
148
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
149
- updated_by: z.ZodDefault<z.ZodString>;
132
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
133
+ created_by: z.ZodOptional<z.ZodString>;
134
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
135
+ updated_by: z.ZodOptional<z.ZodString>;
150
136
  } & {
151
137
  _id: z.ZodNumber;
152
138
  agency_id: z.ZodString;
153
139
  analysis: z.ZodDefault<z.ZodArray<z.ZodObject<{
154
140
  apex_version: z.ZodNullable<z.ZodString>;
155
141
  device_id: z.ZodNullable<z.ZodString>;
156
- end_time: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
142
+ end_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
157
143
  first_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
158
144
  first_transaction_id: z.ZodNullable<z.ZodString>;
159
145
  first_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
160
146
  last_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
161
147
  last_transaction_id: z.ZodNullable<z.ZodString>;
162
148
  last_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
163
- start_time: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
149
+ start_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
164
150
  transactions_expected: z.ZodNullable<z.ZodNumber>;
165
151
  transactions_found: z.ZodNullable<z.ZodNumber>;
166
152
  transactions_missing: z.ZodNullable<z.ZodNumber>;
@@ -168,18 +154,14 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
168
154
  }, "strict", z.ZodTypeAny, {
169
155
  apex_version: string | null;
170
156
  device_id: string | null;
171
- end_time: (number & {
172
- __brand: "UnixTimestamp";
173
- } & z.BRAND<"UnixTimestamp">) | null;
157
+ end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
174
158
  first_transaction_ase_counter_value: number | null;
175
159
  first_transaction_id: string | null;
176
160
  first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
177
161
  last_transaction_ase_counter_value: number | null;
178
162
  last_transaction_id: string | null;
179
163
  last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
180
- start_time: (number & {
181
- __brand: "UnixTimestamp";
182
- } & z.BRAND<"UnixTimestamp">) | null;
164
+ start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
183
165
  transactions_expected: number | null;
184
166
  transactions_found: number | null;
185
167
  transactions_missing: number | null;
@@ -202,49 +184,41 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
202
184
  }>, "many">>;
203
185
  latest_apex_version: z.ZodNullable<z.ZodString>;
204
186
  remarks: z.ZodDefault<z.ZodNullable<z.ZodString>>;
205
- seen_first_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
206
- seen_last_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
187
+ seen_first_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
188
+ seen_last_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
207
189
  system_status: z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>;
208
190
  transactions_expected: z.ZodNullable<z.ZodNumber>;
209
191
  transactions_found: z.ZodNullable<z.ZodNumber>;
210
192
  transactions_missing: z.ZodNullable<z.ZodNumber>;
211
193
  }, "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
212
194
  _id: number;
213
- created_by: string;
214
- updated_by: string;
215
195
  agency_id: string;
216
196
  analysis: {
217
197
  apex_version: string | null;
218
198
  device_id: string | null;
219
- end_time: (number & {
220
- __brand: "UnixTimestamp";
221
- } & z.BRAND<"UnixTimestamp">) | null;
199
+ end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
222
200
  first_transaction_ase_counter_value: number | null;
223
201
  first_transaction_id: string | null;
224
202
  first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
225
203
  last_transaction_ase_counter_value: number | null;
226
204
  last_transaction_id: string | null;
227
205
  last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
228
- start_time: (number & {
229
- __brand: "UnixTimestamp";
230
- } & z.BRAND<"UnixTimestamp">) | null;
206
+ start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
231
207
  transactions_expected: number | null;
232
208
  transactions_found: number | null;
233
209
  transactions_missing: number | null;
234
210
  vehicle_id: number | null;
235
211
  }[];
236
- seen_first_at: (number & {
237
- __brand: "UnixTimestamp";
238
- } & z.BRAND<"UnixTimestamp">) | null;
239
- seen_last_at: (number & {
240
- __brand: "UnixTimestamp";
241
- } & z.BRAND<"UnixTimestamp">) | null;
212
+ seen_first_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
213
+ seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
242
214
  system_status: "waiting" | "processing" | "complete" | "error";
243
215
  transactions_expected: number | null;
244
216
  transactions_found: number | null;
245
217
  transactions_missing: number | null;
246
218
  latest_apex_version: string | null;
247
219
  remarks: string | null;
220
+ created_by?: string | undefined;
221
+ updated_by?: string | undefined;
248
222
  }, {
249
223
  _id: number;
250
224
  agency_id: string;
@@ -277,20 +251,19 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
277
251
  }>;
278
252
  export declare const UpdateSamSchema: z.ZodObject<{
279
253
  _id: z.ZodOptional<z.ZodNumber>;
280
- created_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
281
- updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
254
+ updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
282
255
  agency_id: z.ZodOptional<z.ZodString>;
283
256
  analysis: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
284
257
  apex_version: z.ZodNullable<z.ZodString>;
285
258
  device_id: z.ZodNullable<z.ZodString>;
286
- end_time: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
259
+ end_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
287
260
  first_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
288
261
  first_transaction_id: z.ZodNullable<z.ZodString>;
289
262
  first_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
290
263
  last_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
291
264
  last_transaction_id: z.ZodNullable<z.ZodString>;
292
265
  last_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
293
- start_time: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
266
+ start_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
294
267
  transactions_expected: z.ZodNullable<z.ZodNumber>;
295
268
  transactions_found: z.ZodNullable<z.ZodNumber>;
296
269
  transactions_missing: z.ZodNullable<z.ZodNumber>;
@@ -298,18 +271,14 @@ export declare const UpdateSamSchema: z.ZodObject<{
298
271
  }, "strict", z.ZodTypeAny, {
299
272
  apex_version: string | null;
300
273
  device_id: string | null;
301
- end_time: (number & {
302
- __brand: "UnixTimestamp";
303
- } & z.BRAND<"UnixTimestamp">) | null;
274
+ end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
304
275
  first_transaction_ase_counter_value: number | null;
305
276
  first_transaction_id: string | null;
306
277
  first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
307
278
  last_transaction_ase_counter_value: number | null;
308
279
  last_transaction_id: string | null;
309
280
  last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
310
- start_time: (number & {
311
- __brand: "UnixTimestamp";
312
- } & z.BRAND<"UnixTimestamp">) | null;
281
+ start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
313
282
  transactions_expected: number | null;
314
283
  transactions_found: number | null;
315
284
  transactions_missing: number | null;
@@ -330,8 +299,8 @@ export declare const UpdateSamSchema: z.ZodObject<{
330
299
  transactions_missing: number | null;
331
300
  vehicle_id: number | null;
332
301
  }>, "many">>>;
333
- seen_first_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
334
- seen_last_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
302
+ seen_first_at: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
303
+ seen_last_at: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
335
304
  system_status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>>;
336
305
  transactions_expected: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
337
306
  transactions_found: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -340,35 +309,26 @@ export declare const UpdateSamSchema: z.ZodObject<{
340
309
  remarks: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
341
310
  }, "strict", z.ZodTypeAny, {
342
311
  _id?: number | undefined;
343
- created_by?: string | undefined;
344
312
  updated_by?: string | undefined;
345
313
  agency_id?: string | undefined;
346
314
  analysis?: {
347
315
  apex_version: string | null;
348
316
  device_id: string | null;
349
- end_time: (number & {
350
- __brand: "UnixTimestamp";
351
- } & z.BRAND<"UnixTimestamp">) | null;
317
+ end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
352
318
  first_transaction_ase_counter_value: number | null;
353
319
  first_transaction_id: string | null;
354
320
  first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
355
321
  last_transaction_ase_counter_value: number | null;
356
322
  last_transaction_id: string | null;
357
323
  last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
358
- start_time: (number & {
359
- __brand: "UnixTimestamp";
360
- } & z.BRAND<"UnixTimestamp">) | null;
324
+ start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
361
325
  transactions_expected: number | null;
362
326
  transactions_found: number | null;
363
327
  transactions_missing: number | null;
364
328
  vehicle_id: number | null;
365
329
  }[] | undefined;
366
- seen_first_at?: (number & {
367
- __brand: "UnixTimestamp";
368
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
369
- seen_last_at?: (number & {
370
- __brand: "UnixTimestamp";
371
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
330
+ seen_first_at?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
331
+ seen_last_at?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
372
332
  system_status?: "waiting" | "processing" | "complete" | "error" | undefined;
373
333
  transactions_expected?: number | null | undefined;
374
334
  transactions_found?: number | null | undefined;
@@ -377,7 +337,6 @@ export declare const UpdateSamSchema: z.ZodObject<{
377
337
  remarks?: string | null | undefined;
378
338
  }, {
379
339
  _id?: number | undefined;
380
- created_by?: string | undefined;
381
340
  updated_by?: string | undefined;
382
341
  agency_id?: string | undefined;
383
342
  analysis?: {
@@ -412,16 +371,6 @@ export declare const UpdateSamSchema: z.ZodObject<{
412
371
  * the transactions are real, unique and incremental. This allows the system to
413
372
  * detect if a transaction has been tampered with or if any transactions are missing.
414
373
  */
415
- export interface Sam extends Omit<z.infer<typeof SamSchema>, 'analysis' | 'created_at' | 'seen_first_at' | 'seen_last_at' | 'updated_at'> {
416
- analysis: SamAnalysis[];
417
- created_at: UnixTimestamp;
418
- seen_first_at: null | UnixTimestamp;
419
- seen_last_at: null | UnixTimestamp;
420
- updated_at: UnixTimestamp;
421
- }
422
- export interface CreateSamDto extends Omit<z.infer<typeof CreateSamSchema>, 'analysis' | 'seen_first_at' | 'seen_last_at'> {
423
- analysis: SamAnalysis[];
424
- seen_first_at: null | UnixTimestamp;
425
- seen_last_at: null | UnixTimestamp;
426
- }
427
- export type UpdateSamDto = Partial<CreateSamDto>;
374
+ export type Sam = z.infer<typeof SamSchema>;
375
+ export type CreateSamDto = z.infer<typeof CreateSamSchema>;
376
+ export type UpdateSamDto = z.infer<typeof UpdateSamSchema>;
@@ -1,6 +1,6 @@
1
1
  /* * */
2
2
  import { DocumentSchema } from '../_common/document.js';
3
- import { validateUnixTimestamp } from '../_common/unix-timestamp.js';
3
+ import { unixTimeStampSchema } from '../_common/unix-timestamp.js';
4
4
  import { SamAnalysisSchema } from './sam-analysis.js';
5
5
  import { ProcessingStatusSchema } from '../system/processing-status.js';
6
6
  import { z } from 'zod';
@@ -11,12 +11,12 @@ export const SamSchema = DocumentSchema.extend({
11
11
  analysis: z.array(SamAnalysisSchema).default([]),
12
12
  latest_apex_version: z.string().nullable(),
13
13
  remarks: z.string().nullable().default(null),
14
- seen_first_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullable(),
15
- seen_last_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullable(),
14
+ seen_first_at: unixTimeStampSchema.nullable(),
15
+ seen_last_at: unixTimeStampSchema.nullable(),
16
16
  system_status: ProcessingStatusSchema.default('waiting'),
17
17
  transactions_expected: z.number().nullable(),
18
18
  transactions_found: z.number().nullable(),
19
19
  transactions_missing: z.number().nullable(),
20
20
  }).strict();
21
21
  export const CreateSamSchema = SamSchema.omit({ created_at: true, updated_at: true });
22
- export const UpdateSamSchema = CreateSamSchema.partial();
22
+ export const UpdateSamSchema = CreateSamSchema.omit({ created_by: true }).partial();
@@ -1,11 +1,10 @@
1
- import { type UnixTimestamp } from '../_common/unix-timestamp.js';
2
1
  import { z } from 'zod';
3
2
  export declare const SimplifiedApexLocationSchema: z.ZodObject<{
4
3
  _id: z.ZodString;
5
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
6
- created_by: z.ZodDefault<z.ZodString>;
7
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
8
- updated_by: z.ZodDefault<z.ZodString>;
4
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
5
+ created_by: z.ZodOptional<z.ZodString>;
6
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
7
+ updated_by: z.ZodOptional<z.ZodString>;
9
8
  } & {
10
9
  agency_id: z.ZodString;
11
10
  apex_version: z.ZodString;
@@ -14,7 +13,7 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
14
13
  mac_ase_counter_value: z.ZodNumber;
15
14
  mac_sam_serial_number: z.ZodNumber;
16
15
  pattern_id: z.ZodString;
17
- received_at: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
16
+ received_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
18
17
  stop_id: z.ZodString;
19
18
  trip_id: z.ZodString;
20
19
  vehicle_id: z.ZodNumber;
@@ -23,11 +22,9 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
23
22
  created_at: number & {
24
23
  __brand: "UnixTimestamp";
25
24
  };
26
- created_by: string;
27
25
  updated_at: number & {
28
26
  __brand: "UnixTimestamp";
29
27
  };
30
- updated_by: string;
31
28
  agency_id: string;
32
29
  line_id: string;
33
30
  trip_id: string;
@@ -39,8 +36,10 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
39
36
  mac_sam_serial_number: number;
40
37
  received_at: number & {
41
38
  __brand: "UnixTimestamp";
42
- } & z.BRAND<"UnixTimestamp">;
39
+ };
43
40
  stop_id: string;
41
+ created_by?: string | undefined;
42
+ updated_by?: string | undefined;
44
43
  }, {
45
44
  _id: string;
46
45
  created_at: number;
@@ -61,10 +60,10 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
61
60
  }>;
62
61
  export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
63
62
  _id: z.ZodOptional<z.ZodString>;
64
- created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>>;
65
- created_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
66
- updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>>;
67
- updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
63
+ created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
64
+ created_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
65
+ updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
66
+ updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
68
67
  agency_id: z.ZodOptional<z.ZodString>;
69
68
  apex_version: z.ZodOptional<z.ZodString>;
70
69
  device_id: z.ZodOptional<z.ZodString>;
@@ -72,15 +71,15 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
72
71
  mac_ase_counter_value: z.ZodOptional<z.ZodNumber>;
73
72
  mac_sam_serial_number: z.ZodOptional<z.ZodNumber>;
74
73
  pattern_id: z.ZodOptional<z.ZodString>;
75
- received_at: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
74
+ received_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
76
75
  stop_id: z.ZodOptional<z.ZodString>;
77
76
  trip_id: z.ZodOptional<z.ZodString>;
78
77
  vehicle_id: z.ZodOptional<z.ZodNumber>;
79
78
  }, "strict", z.ZodTypeAny, {
80
79
  _id?: string | undefined;
81
- created_at?: UnixTimestamp | undefined;
80
+ created_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
82
81
  created_by?: string | undefined;
83
- updated_at?: UnixTimestamp | undefined;
82
+ updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
84
83
  updated_by?: string | undefined;
85
84
  agency_id?: string | undefined;
86
85
  line_id?: string | undefined;
@@ -91,9 +90,7 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
91
90
  vehicle_id?: number | undefined;
92
91
  mac_ase_counter_value?: number | undefined;
93
92
  mac_sam_serial_number?: number | undefined;
94
- received_at?: (number & {
95
- __brand: "UnixTimestamp";
96
- } & z.BRAND<"UnixTimestamp">) | undefined;
93
+ received_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
97
94
  stop_id?: string | undefined;
98
95
  }, {
99
96
  _id?: string | undefined;
@@ -120,9 +117,5 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
120
117
  * of products. In summary, these transactions are generated every time the vehicle has a change
121
118
  * in the current stop ID, trip ID, route ID, pattern ID, etc.
122
119
  */
123
- export interface SimplifiedApexLocation extends Omit<z.infer<typeof SimplifiedApexLocationSchema>, 'created_at' | 'received_at' | 'updated_at'> {
124
- created_at: UnixTimestamp;
125
- received_at: UnixTimestamp;
126
- updated_at: UnixTimestamp;
127
- }
128
- export type UpdateSimplifiedApexLocationDto = Partial<SimplifiedApexLocation>;
120
+ export type SimplifiedApexLocation = z.infer<typeof SimplifiedApexLocationSchema>;
121
+ export type UpdateSimplifiedApexLocationDto = z.infer<typeof UpdateSimplifiedApexLocationSchema>;
@@ -1,6 +1,6 @@
1
1
  /* * */
2
2
  import { DocumentSchema } from '../_common/document.js';
3
- import { validateUnixTimestamp } from '../_common/unix-timestamp.js';
3
+ import { unixTimeStampSchema } from '../_common/unix-timestamp.js';
4
4
  import { z } from 'zod';
5
5
  /* * */
6
6
  export const SimplifiedApexLocationSchema = DocumentSchema.extend({
@@ -11,7 +11,7 @@ export const SimplifiedApexLocationSchema = DocumentSchema.extend({
11
11
  mac_ase_counter_value: z.number(),
12
12
  mac_sam_serial_number: z.number(),
13
13
  pattern_id: z.string(),
14
- received_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp'),
14
+ received_at: unixTimeStampSchema,
15
15
  stop_id: z.string(),
16
16
  trip_id: z.string(),
17
17
  vehicle_id: z.number(),
@@ -1,11 +1,10 @@
1
- import { type UnixTimestamp } from '../_common/unix-timestamp.js';
2
1
  import { z } from 'zod';
3
2
  export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<{
4
3
  _id: z.ZodString;
5
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
6
- created_by: z.ZodDefault<z.ZodString>;
7
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
8
- updated_by: z.ZodDefault<z.ZodString>;
4
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
5
+ created_by: z.ZodOptional<z.ZodString>;
6
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
7
+ updated_by: z.ZodOptional<z.ZodString>;
9
8
  } & {
10
9
  agency_id: z.ZodString;
11
10
  apex_version: z.ZodString;
@@ -23,7 +22,7 @@ export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<{
23
22
  price: z.ZodNumber;
24
23
  product_long_id: z.ZodString;
25
24
  product_quantity: z.ZodNumber;
26
- received_at: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
25
+ received_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
27
26
  stop_id: z.ZodNullable<z.ZodString>;
28
27
  trip_id: z.ZodNullable<z.ZodString>;
29
28
  validation_id: z.ZodNullable<z.ZodString>;
@@ -33,11 +32,9 @@ export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<{
33
32
  created_at: number & {
34
33
  __brand: "UnixTimestamp";
35
34
  };
36
- created_by: string;
37
35
  updated_at: number & {
38
36
  __brand: "UnixTimestamp";
39
37
  };
40
- updated_by: string;
41
38
  agency_id: string;
42
39
  line_id: string | null;
43
40
  validation_id: string | null;
@@ -50,7 +47,7 @@ export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<{
50
47
  mac_sam_serial_number: number;
51
48
  received_at: number & {
52
49
  __brand: "UnixTimestamp";
53
- } & z.BRAND<"UnixTimestamp">;
50
+ };
54
51
  stop_id: string | null;
55
52
  block_id: string | null;
56
53
  card_physical_type: number;
@@ -61,6 +58,8 @@ export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<{
61
58
  price: number;
62
59
  product_long_id: string;
63
60
  product_quantity: number;
61
+ created_by?: string | undefined;
62
+ updated_by?: string | undefined;
64
63
  }, {
65
64
  _id: string;
66
65
  created_at: number;
@@ -91,10 +90,10 @@ export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<{
91
90
  }>;
92
91
  export declare const UpdateSimplifiedApexOnBoardRefundSchema: z.ZodObject<{
93
92
  _id: z.ZodOptional<z.ZodString>;
94
- created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>>;
95
- created_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
96
- updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>>;
97
- updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
93
+ created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
94
+ created_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
95
+ updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
96
+ updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
98
97
  agency_id: z.ZodOptional<z.ZodString>;
99
98
  apex_version: z.ZodOptional<z.ZodString>;
100
99
  block_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -111,16 +110,16 @@ export declare const UpdateSimplifiedApexOnBoardRefundSchema: z.ZodObject<{
111
110
  price: z.ZodOptional<z.ZodNumber>;
112
111
  product_long_id: z.ZodOptional<z.ZodString>;
113
112
  product_quantity: z.ZodOptional<z.ZodNumber>;
114
- received_at: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
113
+ received_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
115
114
  stop_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
116
115
  trip_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
117
116
  validation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
117
  vehicle_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
119
118
  }, "strict", z.ZodTypeAny, {
120
119
  _id?: string | undefined;
121
- created_at?: UnixTimestamp | undefined;
120
+ created_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
122
121
  created_by?: string | undefined;
123
- updated_at?: UnixTimestamp | undefined;
122
+ updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
124
123
  updated_by?: string | undefined;
125
124
  agency_id?: string | undefined;
126
125
  line_id?: string | null | undefined;
@@ -132,9 +131,7 @@ export declare const UpdateSimplifiedApexOnBoardRefundSchema: z.ZodObject<{
132
131
  vehicle_id?: number | null | undefined;
133
132
  mac_ase_counter_value?: number | undefined;
134
133
  mac_sam_serial_number?: number | undefined;
135
- received_at?: (number & {
136
- __brand: "UnixTimestamp";
137
- } & z.BRAND<"UnixTimestamp">) | undefined;
134
+ received_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
138
135
  stop_id?: string | null | undefined;
139
136
  block_id?: string | null | undefined;
140
137
  card_physical_type?: number | undefined;
@@ -180,9 +177,5 @@ export declare const UpdateSimplifiedApexOnBoardRefundSchema: z.ZodObject<{
180
177
  * for on-board ticket sales inside vehicles only. Refunds of tickets when inside vehicles also generate a validation transaction.
181
178
  * Refunds can be refunded, and refunds are also APEX transactions of type 3.
182
179
  */
183
- export interface SimplifiedApexOnBoardRefund extends Omit<z.infer<typeof SimplifiedApexOnBoardRefundSchema>, 'created_at' | 'received_at' | 'updated_at'> {
184
- created_at: UnixTimestamp;
185
- received_at: UnixTimestamp;
186
- updated_at: UnixTimestamp;
187
- }
188
- export type UpdateSimplifiedApexOnBoardRefundDto = Partial<SimplifiedApexOnBoardRefund>;
180
+ export type SimplifiedApexOnBoardRefund = z.infer<typeof SimplifiedApexOnBoardRefundSchema>;
181
+ export type UpdateSimplifiedApexOnBoardRefundDto = z.infer<typeof UpdateSimplifiedApexOnBoardRefundSchema>;
@@ -1,6 +1,6 @@
1
1
  /* * */
2
2
  import { DocumentSchema } from '../_common/document.js';
3
- import { validateUnixTimestamp } from '../_common/unix-timestamp.js';
3
+ import { unixTimeStampSchema } from '../_common/unix-timestamp.js';
4
4
  import { z } from 'zod';
5
5
  /* * */
6
6
  export const SimplifiedApexOnBoardRefundSchema = DocumentSchema.extend({
@@ -20,7 +20,7 @@ export const SimplifiedApexOnBoardRefundSchema = DocumentSchema.extend({
20
20
  price: z.number(),
21
21
  product_long_id: z.string(),
22
22
  product_quantity: z.number(),
23
- received_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp'),
23
+ received_at: unixTimeStampSchema,
24
24
  stop_id: z.string().nullable(),
25
25
  trip_id: z.string().nullable(),
26
26
  validation_id: z.string().nullable(),