@tmlmobilidade/types 20250916.1050.43 → 20250916.1601.30

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.
@@ -5,13 +5,45 @@ export type RideAcceptanceStatus = z.infer<typeof RideAcceptanceStatusSchema>;
5
5
  export declare const RIDE_JUSTIFICATION_CAUSE_OPTIONS: readonly ["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"];
6
6
  export declare const RideJustificationCauseSchema: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
7
7
  export type RideJustificationCause = z.infer<typeof RideJustificationCauseSchema>;
8
- export declare const RIDE_JUSTIFICATION_SOURCE_OPTIONS: readonly ["MANUAL", "REALTIME_ALERT"];
9
- export declare const RideJustificationSourceSchema: z.ZodEnum<["MANUAL", "REALTIME_ALERT"]>;
8
+ export declare const RIDE_JUSTIFICATION_SOURCE_OPTIONS: readonly ["MANUAL", "ALERT"];
9
+ export declare const RideJustificationSourceSchema: z.ZodEnum<["MANUAL", "ALERT"]>;
10
10
  export type RideJustificationSource = z.infer<typeof RideJustificationSourceSchema>;
11
11
  export declare const RIDE_JUSTIFICATION_STATUS_TYPE_OPTIONS: readonly ["locked_status", "acceptance_status", "pto_message"];
12
12
  export declare const RideJustificationStatusTypeSchema: z.ZodEnum<["locked_status", "acceptance_status", "pto_message"]>;
13
13
  export type RideJustificationStatusType = z.infer<typeof RideJustificationStatusTypeSchema>;
14
- export declare const RideJustificationSchema: z.ZodObject<{
14
+ export declare const RideJustificationSchema: z.ZodObject<Omit<{
15
+ _id: z.ZodString;
16
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
17
+ created_by: z.ZodOptional<z.ZodString>;
18
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
19
+ updated_by: z.ZodOptional<z.ZodString>;
20
+ } & {
21
+ justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
22
+ justification_source: z.ZodEnum<["MANUAL", "ALERT"]>;
23
+ pto_message: z.ZodDefault<z.ZodString>;
24
+ }, "_id">, "strict", z.ZodTypeAny, {
25
+ created_at: number & {
26
+ __brand: "UnixTimestamp";
27
+ };
28
+ updated_at: number & {
29
+ __brand: "UnixTimestamp";
30
+ };
31
+ pto_message: string;
32
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
33
+ justification_source: "MANUAL" | "ALERT";
34
+ created_by?: string | undefined;
35
+ updated_by?: string | undefined;
36
+ }, {
37
+ created_at: number;
38
+ updated_at: number;
39
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
40
+ justification_source: "MANUAL" | "ALERT";
41
+ created_by?: string | undefined;
42
+ updated_by?: string | undefined;
43
+ pto_message?: string | undefined;
44
+ }>;
45
+ export type RideJustification = z.infer<typeof RideJustificationSchema>;
46
+ export declare const RideAcceptanceSchema: z.ZodObject<{
15
47
  _id: z.ZodString;
16
48
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
17
49
  created_by: z.ZodOptional<z.ZodString>;
@@ -19,458 +51,16 @@ export declare const RideJustificationSchema: z.ZodObject<{
19
51
  updated_by: z.ZodOptional<z.ZodString>;
20
52
  } & {
21
53
  acceptance_status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
22
- analysis: z.ZodNullable<z.ZodObject<{
23
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: z.ZodObject<{
24
- error_message: z.ZodOptional<z.ZodString>;
25
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
26
- } & {
27
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "NO_VEHICLE_EVENTS_ON_FIRST_STOP", "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP"]>;
28
- value: z.ZodNullable<z.ZodNumber>;
29
- }, "strict", z.ZodTypeAny, {
30
- value: number | null;
31
- grade: "error" | "pass" | "fail" | "skip";
32
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
33
- error_message?: string | undefined;
34
- }, {
35
- value: number | null;
36
- grade: "error" | "pass" | "fail" | "skip";
37
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
38
- error_message?: string | undefined;
39
- }>;
40
- ENDED_AT_LAST_STOP: z.ZodObject<{
41
- error_message: z.ZodOptional<z.ZodString>;
42
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
43
- } & {
44
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "ENDED_AT_LAST_STOP", "ENDED_OUTSIDE_OF_LAST_STOP"]>;
45
- }, "strict", z.ZodTypeAny, {
46
- grade: "error" | "pass" | "fail" | "skip";
47
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
48
- error_message?: string | undefined;
49
- }, {
50
- grade: "error" | "pass" | "fail" | "skip";
51
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
52
- error_message?: string | undefined;
53
- }>;
54
- EXPECTED_APEX_VALIDATION_INTERVAL: z.ZodObject<{
55
- error_message: z.ZodOptional<z.ZodString>;
56
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
57
- } & {
58
- reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "NOT_ENOUGH_VALIDATIONS", "INTERVALS_TOO_SHORT", "NON_ORGANIC_INTERVALS", "EXPECTED_VALIDATION_INTERVALS"]>;
59
- }, "strict", z.ZodTypeAny, {
60
- grade: "error" | "pass" | "fail" | "skip";
61
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
62
- error_message?: string | undefined;
63
- }, {
64
- grade: "error" | "pass" | "fail" | "skip";
65
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
66
- error_message?: string | undefined;
67
- }>;
68
- EXPECTED_DRIVER_ID_QTY: z.ZodObject<{
69
- error_message: z.ZodOptional<z.ZodString>;
70
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
71
- } & {
72
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_DRIVER_ID_QTY", "EXPECTED_DRIVER_ID_QTY"]>;
73
- value: z.ZodNullable<z.ZodNumber>;
74
- }, "strict", z.ZodTypeAny, {
75
- value: number | null;
76
- grade: "error" | "pass" | "fail" | "skip";
77
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
78
- error_message?: string | undefined;
79
- }, {
80
- value: number | null;
81
- grade: "error" | "pass" | "fail" | "skip";
82
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
83
- error_message?: string | undefined;
84
- }>;
85
- EXPECTED_START_TIME: z.ZodObject<{
86
- error_message: z.ZodOptional<z.ZodString>;
87
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
88
- } & {
89
- reason: z.ZodEnum<["NO_START_TIME_SCHEDULED", "NO_VEHICLE_EVENTS", "UNKNOWN_START", "EARLY_START", "LATE_START", "START_ON_TIME"]>;
90
- value: z.ZodNullable<z.ZodNumber>;
91
- }, "strict", z.ZodTypeAny, {
92
- value: number | null;
93
- grade: "error" | "pass" | "fail" | "skip";
94
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
95
- error_message?: string | undefined;
96
- }, {
97
- value: number | null;
98
- grade: "error" | "pass" | "fail" | "skip";
99
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
100
- error_message?: string | undefined;
101
- }>;
102
- EXPECTED_VEHICLE_EVENT_DELAY: z.ZodObject<{
103
- error_message: z.ZodOptional<z.ZodString>;
104
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
105
- } & {
106
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_VEHICLE_EVENTS_DELAY", "EXPECTED_VEHICLE_EVENTS_DELAY"]>;
107
- value: z.ZodNullable<z.ZodNumber>;
108
- }, "strict", z.ZodTypeAny, {
109
- value: number | null;
110
- grade: "error" | "pass" | "fail" | "skip";
111
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
112
- error_message?: string | undefined;
113
- }, {
114
- value: number | null;
115
- grade: "error" | "pass" | "fail" | "skip";
116
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
117
- error_message?: string | undefined;
118
- }>;
119
- EXPECTED_VEHICLE_EVENT_INTERVAL: z.ZodObject<{
120
- error_message: z.ZodOptional<z.ZodString>;
121
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
122
- } & {
123
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_INTERVAL", "UNEXPECTED_VEHICLE_EVENT_INTERVAL"]>;
124
- value: z.ZodNullable<z.ZodNumber>;
125
- }, "strict", z.ZodTypeAny, {
126
- value: number | null;
127
- grade: "error" | "pass" | "fail" | "skip";
128
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
129
- error_message?: string | undefined;
130
- }, {
131
- value: number | null;
132
- grade: "error" | "pass" | "fail" | "skip";
133
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
134
- error_message?: string | undefined;
135
- }>;
136
- EXPECTED_VEHICLE_EVENT_QTY: z.ZodObject<{
137
- error_message: z.ZodOptional<z.ZodString>;
138
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
139
- } & {
140
- expected_qty: z.ZodNullable<z.ZodNumber>;
141
- found_qty: z.ZodNullable<z.ZodNumber>;
142
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_QTY", "UNEXPECTED_VEHICLE_EVENT_QTY"]>;
143
- }, "strict", z.ZodTypeAny, {
144
- grade: "error" | "pass" | "fail" | "skip";
145
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
146
- expected_qty: number | null;
147
- found_qty: number | null;
148
- error_message?: string | undefined;
149
- }, {
150
- grade: "error" | "pass" | "fail" | "skip";
151
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
152
- expected_qty: number | null;
153
- found_qty: number | null;
154
- error_message?: string | undefined;
155
- }>;
156
- EXPECTED_VEHICLE_ID_QTY: z.ZodObject<{
157
- error_message: z.ZodOptional<z.ZodString>;
158
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
159
- } & {
160
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "NO_APEX_VALIDATIONS", "UNEXPECTED_VEHICLE_ID_QTY", "EXPECTED_VEHICLE_ID_QTY"]>;
161
- value: z.ZodNullable<z.ZodNumber>;
162
- }, "strict", z.ZodTypeAny, {
163
- value: number | null;
164
- grade: "error" | "pass" | "fail" | "skip";
165
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
166
- error_message?: string | undefined;
167
- }, {
168
- value: number | null;
169
- grade: "error" | "pass" | "fail" | "skip";
170
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
171
- error_message?: string | undefined;
172
- }>;
173
- MATCHING_APEX_LOCATIONS: z.ZodObject<{
174
- error_message: z.ZodOptional<z.ZodString>;
175
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
176
- } & {
177
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_APEX_LOCATIONS", "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP", "MATCHING_APEX_LOCATIONS"]>;
178
- }, "strict", z.ZodTypeAny, {
179
- grade: "error" | "pass" | "fail" | "skip";
180
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
181
- error_message?: string | undefined;
182
- }, {
183
- grade: "error" | "pass" | "fail" | "skip";
184
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
185
- error_message?: string | undefined;
186
- }>;
187
- MATCHING_VEHICLE_IDS: z.ZodObject<{
188
- error_message: z.ZodOptional<z.ZodString>;
189
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
190
- } & {
191
- reason: z.ZodEnum<["MATCHING_VEHICLE_IDS", "VEHICLE_ID_MISMATCH", "NO_VEHICLE_EVENTS", "NO_APEX_TRANSACTIONS"]>;
192
- }, "strict", z.ZodTypeAny, {
193
- grade: "error" | "pass" | "fail" | "skip";
194
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
195
- error_message?: string | undefined;
196
- }, {
197
- grade: "error" | "pass" | "fail" | "skip";
198
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
199
- error_message?: string | undefined;
200
- }>;
201
- SIMPLE_ONE_APEX_VALIDATION: z.ZodObject<{
202
- error_message: z.ZodOptional<z.ZodString>;
203
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
204
- } & {
205
- reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "ONE_OR_MORE_APEX_VALIDATIONS"]>;
206
- value: z.ZodNullable<z.ZodNumber>;
207
- }, "strict", z.ZodTypeAny, {
208
- value: number | null;
209
- grade: "error" | "pass" | "fail" | "skip";
210
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
211
- error_message?: string | undefined;
212
- }, {
213
- value: number | null;
214
- grade: "error" | "pass" | "fail" | "skip";
215
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
216
- error_message?: string | undefined;
217
- }>;
218
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: z.ZodObject<{
219
- error_message: z.ZodOptional<z.ZodString>;
220
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
221
- } & {
222
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS", "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION"]>;
223
- }, "strict", z.ZodTypeAny, {
224
- grade: "error" | "pass" | "fail" | "skip";
225
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
226
- error_message?: string | undefined;
227
- }, {
228
- grade: "error" | "pass" | "fail" | "skip";
229
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
230
- error_message?: string | undefined;
231
- }>;
232
- SIMPLE_THREE_VEHICLE_EVENTS: z.ZodObject<{
233
- error_message: z.ZodOptional<z.ZodString>;
234
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
235
- } & {
236
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "MISSING_FIRST_STOPS", "MISSING_MIDDLE_STOPS", "MISSING_LAST_STOPS", "ALL_STOPS_FOUND"]>;
237
- stop_ids_first: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
238
- stop_ids_last: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
239
- stop_ids_middle: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
240
- }, "strict", z.ZodTypeAny, {
241
- grade: "error" | "pass" | "fail" | "skip";
242
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
243
- stop_ids_first: string[] | null;
244
- stop_ids_last: string[] | null;
245
- stop_ids_middle: string[] | null;
246
- error_message?: string | undefined;
247
- }, {
248
- grade: "error" | "pass" | "fail" | "skip";
249
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
250
- stop_ids_first: string[] | null;
251
- stop_ids_last: string[] | null;
252
- stop_ids_middle: string[] | null;
253
- error_message?: string | undefined;
254
- }>;
255
- TRANSACTION_SEQUENTIALITY: z.ZodObject<{
256
- error_message: z.ZodOptional<z.ZodString>;
257
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
258
- } & {
259
- expected_qty: z.ZodNullable<z.ZodNumber>;
260
- found_qty: z.ZodNullable<z.ZodNumber>;
261
- missing_qty: z.ZodNullable<z.ZodNumber>;
262
- reason: z.ZodEnum<["NO_TRANSACTIONS", "MISSING_TRANSACTIONS", "ALL_TRANSACTIONS_RECEIVED"]>;
263
- }, "strict", z.ZodTypeAny, {
264
- grade: "error" | "pass" | "fail" | "skip";
265
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
266
- expected_qty: number | null;
267
- found_qty: number | null;
268
- missing_qty: number | null;
269
- error_message?: string | undefined;
270
- }, {
271
- grade: "error" | "pass" | "fail" | "skip";
272
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
273
- expected_qty: number | null;
274
- found_qty: number | null;
275
- missing_qty: number | null;
276
- error_message?: string | undefined;
277
- }>;
278
- }, "strip", z.ZodTypeAny, {
279
- EXPECTED_DRIVER_ID_QTY: {
280
- value: number | null;
281
- grade: "error" | "pass" | "fail" | "skip";
282
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
283
- error_message?: string | undefined;
284
- };
285
- EXPECTED_VEHICLE_ID_QTY: {
286
- value: number | null;
287
- grade: "error" | "pass" | "fail" | "skip";
288
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
289
- error_message?: string | undefined;
290
- };
291
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
292
- value: number | null;
293
- grade: "error" | "pass" | "fail" | "skip";
294
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
295
- error_message?: string | undefined;
296
- };
297
- ENDED_AT_LAST_STOP: {
298
- grade: "error" | "pass" | "fail" | "skip";
299
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
300
- error_message?: string | undefined;
301
- };
302
- EXPECTED_VEHICLE_EVENT_QTY: {
303
- grade: "error" | "pass" | "fail" | "skip";
304
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
305
- expected_qty: number | null;
306
- found_qty: number | null;
307
- error_message?: string | undefined;
308
- };
309
- MATCHING_APEX_LOCATIONS: {
310
- grade: "error" | "pass" | "fail" | "skip";
311
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
312
- error_message?: string | undefined;
313
- };
314
- MATCHING_VEHICLE_IDS: {
315
- grade: "error" | "pass" | "fail" | "skip";
316
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
317
- error_message?: string | undefined;
318
- };
319
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
320
- value: number | null;
321
- grade: "error" | "pass" | "fail" | "skip";
322
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
323
- error_message?: string | undefined;
324
- };
325
- EXPECTED_APEX_VALIDATION_INTERVAL: {
326
- grade: "error" | "pass" | "fail" | "skip";
327
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
328
- error_message?: string | undefined;
329
- };
330
- EXPECTED_START_TIME: {
331
- value: number | null;
332
- grade: "error" | "pass" | "fail" | "skip";
333
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
334
- error_message?: string | undefined;
335
- };
336
- EXPECTED_VEHICLE_EVENT_DELAY: {
337
- value: number | null;
338
- grade: "error" | "pass" | "fail" | "skip";
339
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
340
- error_message?: string | undefined;
341
- };
342
- SIMPLE_ONE_APEX_VALIDATION: {
343
- value: number | null;
344
- grade: "error" | "pass" | "fail" | "skip";
345
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
346
- error_message?: string | undefined;
347
- };
348
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
349
- grade: "error" | "pass" | "fail" | "skip";
350
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
351
- error_message?: string | undefined;
352
- };
353
- SIMPLE_THREE_VEHICLE_EVENTS: {
354
- grade: "error" | "pass" | "fail" | "skip";
355
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
356
- stop_ids_first: string[] | null;
357
- stop_ids_last: string[] | null;
358
- stop_ids_middle: string[] | null;
359
- error_message?: string | undefined;
360
- };
361
- TRANSACTION_SEQUENTIALITY: {
362
- grade: "error" | "pass" | "fail" | "skip";
363
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
364
- expected_qty: number | null;
365
- found_qty: number | null;
366
- missing_qty: number | null;
367
- error_message?: string | undefined;
368
- };
369
- }, {
370
- EXPECTED_DRIVER_ID_QTY: {
371
- value: number | null;
372
- grade: "error" | "pass" | "fail" | "skip";
373
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
374
- error_message?: string | undefined;
375
- };
376
- EXPECTED_VEHICLE_ID_QTY: {
377
- value: number | null;
378
- grade: "error" | "pass" | "fail" | "skip";
379
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
380
- error_message?: string | undefined;
381
- };
382
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
383
- value: number | null;
384
- grade: "error" | "pass" | "fail" | "skip";
385
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
386
- error_message?: string | undefined;
387
- };
388
- ENDED_AT_LAST_STOP: {
389
- grade: "error" | "pass" | "fail" | "skip";
390
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
391
- error_message?: string | undefined;
392
- };
393
- EXPECTED_VEHICLE_EVENT_QTY: {
394
- grade: "error" | "pass" | "fail" | "skip";
395
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
396
- expected_qty: number | null;
397
- found_qty: number | null;
398
- error_message?: string | undefined;
399
- };
400
- MATCHING_APEX_LOCATIONS: {
401
- grade: "error" | "pass" | "fail" | "skip";
402
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
403
- error_message?: string | undefined;
404
- };
405
- MATCHING_VEHICLE_IDS: {
406
- grade: "error" | "pass" | "fail" | "skip";
407
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
408
- error_message?: string | undefined;
409
- };
410
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
411
- value: number | null;
412
- grade: "error" | "pass" | "fail" | "skip";
413
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
414
- error_message?: string | undefined;
415
- };
416
- EXPECTED_APEX_VALIDATION_INTERVAL: {
417
- grade: "error" | "pass" | "fail" | "skip";
418
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
419
- error_message?: string | undefined;
420
- };
421
- EXPECTED_START_TIME: {
422
- value: number | null;
423
- grade: "error" | "pass" | "fail" | "skip";
424
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
425
- error_message?: string | undefined;
426
- };
427
- EXPECTED_VEHICLE_EVENT_DELAY: {
428
- value: number | null;
429
- grade: "error" | "pass" | "fail" | "skip";
430
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
431
- error_message?: string | undefined;
432
- };
433
- SIMPLE_ONE_APEX_VALIDATION: {
434
- value: number | null;
435
- grade: "error" | "pass" | "fail" | "skip";
436
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
437
- error_message?: string | undefined;
438
- };
439
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
440
- grade: "error" | "pass" | "fail" | "skip";
441
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
442
- error_message?: string | undefined;
443
- };
444
- SIMPLE_THREE_VEHICLE_EVENTS: {
445
- grade: "error" | "pass" | "fail" | "skip";
446
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
447
- stop_ids_first: string[] | null;
448
- stop_ids_last: string[] | null;
449
- stop_ids_middle: string[] | null;
450
- error_message?: string | undefined;
451
- };
452
- TRANSACTION_SEQUENTIALITY: {
453
- grade: "error" | "pass" | "fail" | "skip";
454
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
455
- expected_qty: number | null;
456
- found_qty: number | null;
457
- missing_qty: number | null;
458
- error_message?: string | undefined;
459
- };
460
- }>>;
461
- analysisSummary: z.ZodObject<{
462
- error_message: z.ZodOptional<z.ZodString>;
54
+ analysis_summary: z.ZodRecord<z.ZodString, z.ZodObject<{
463
55
  grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
464
56
  reason: z.ZodString;
465
- }, "strict", z.ZodTypeAny, {
57
+ }, "strip", z.ZodTypeAny, {
466
58
  grade: "error" | "pass" | "fail" | "skip";
467
59
  reason: string;
468
- error_message?: string | undefined;
469
60
  }, {
470
61
  grade: "error" | "pass" | "fail" | "skip";
471
62
  reason: string;
472
- error_message?: string | undefined;
473
- }>;
63
+ }>>;
474
64
  comments: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
475
65
  _id: z.ZodString;
476
66
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
@@ -586,10 +176,38 @@ export declare const RideJustificationSchema: z.ZodObject<{
586
176
  prev_value?: any;
587
177
  }>, "many">>;
588
178
  is_locked: z.ZodDefault<z.ZodBoolean>;
589
- justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
590
- justification_source: z.ZodEnum<["MANUAL", "REALTIME_ALERT"]>;
591
- pto_message: z.ZodDefault<z.ZodString>;
592
- trip_id: z.ZodString;
179
+ justification: z.ZodNullable<z.ZodObject<Omit<{
180
+ _id: z.ZodString;
181
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
182
+ created_by: z.ZodOptional<z.ZodString>;
183
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
184
+ updated_by: z.ZodOptional<z.ZodString>;
185
+ } & {
186
+ justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
187
+ justification_source: z.ZodEnum<["MANUAL", "ALERT"]>;
188
+ pto_message: z.ZodDefault<z.ZodString>;
189
+ }, "_id">, "strict", z.ZodTypeAny, {
190
+ created_at: number & {
191
+ __brand: "UnixTimestamp";
192
+ };
193
+ updated_at: number & {
194
+ __brand: "UnixTimestamp";
195
+ };
196
+ pto_message: string;
197
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
198
+ justification_source: "MANUAL" | "ALERT";
199
+ created_by?: string | undefined;
200
+ updated_by?: string | undefined;
201
+ }, {
202
+ created_at: number;
203
+ updated_at: number;
204
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
205
+ justification_source: "MANUAL" | "ALERT";
206
+ created_by?: string | undefined;
207
+ updated_by?: string | undefined;
208
+ pto_message?: string | undefined;
209
+ }>>;
210
+ ride_id: z.ZodString;
593
211
  }, "strict", z.ZodTypeAny, {
594
212
  _id: string;
595
213
  created_at: number & {
@@ -627,215 +245,46 @@ export declare const RideJustificationSchema: z.ZodObject<{
627
245
  metadata?: Record<string, unknown> | null | undefined;
628
246
  prev_value?: any;
629
247
  })[];
248
+ ride_id: string;
630
249
  acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
631
- pto_message: string;
632
- analysis: {
633
- EXPECTED_DRIVER_ID_QTY: {
634
- value: number | null;
635
- grade: "error" | "pass" | "fail" | "skip";
636
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
637
- error_message?: string | undefined;
638
- };
639
- EXPECTED_VEHICLE_ID_QTY: {
640
- value: number | null;
641
- grade: "error" | "pass" | "fail" | "skip";
642
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
643
- error_message?: string | undefined;
644
- };
645
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
646
- value: number | null;
647
- grade: "error" | "pass" | "fail" | "skip";
648
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
649
- error_message?: string | undefined;
650
- };
651
- ENDED_AT_LAST_STOP: {
652
- grade: "error" | "pass" | "fail" | "skip";
653
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
654
- error_message?: string | undefined;
655
- };
656
- EXPECTED_VEHICLE_EVENT_QTY: {
657
- grade: "error" | "pass" | "fail" | "skip";
658
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
659
- expected_qty: number | null;
660
- found_qty: number | null;
661
- error_message?: string | undefined;
662
- };
663
- MATCHING_APEX_LOCATIONS: {
664
- grade: "error" | "pass" | "fail" | "skip";
665
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
666
- error_message?: string | undefined;
667
- };
668
- MATCHING_VEHICLE_IDS: {
669
- grade: "error" | "pass" | "fail" | "skip";
670
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
671
- error_message?: string | undefined;
672
- };
673
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
674
- value: number | null;
675
- grade: "error" | "pass" | "fail" | "skip";
676
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
677
- error_message?: string | undefined;
678
- };
679
- EXPECTED_APEX_VALIDATION_INTERVAL: {
680
- grade: "error" | "pass" | "fail" | "skip";
681
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
682
- error_message?: string | undefined;
683
- };
684
- EXPECTED_START_TIME: {
685
- value: number | null;
686
- grade: "error" | "pass" | "fail" | "skip";
687
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
688
- error_message?: string | undefined;
689
- };
690
- EXPECTED_VEHICLE_EVENT_DELAY: {
691
- value: number | null;
692
- grade: "error" | "pass" | "fail" | "skip";
693
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
694
- error_message?: string | undefined;
695
- };
696
- SIMPLE_ONE_APEX_VALIDATION: {
697
- value: number | null;
698
- grade: "error" | "pass" | "fail" | "skip";
699
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
700
- error_message?: string | undefined;
701
- };
702
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
703
- grade: "error" | "pass" | "fail" | "skip";
704
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
705
- error_message?: string | undefined;
706
- };
707
- SIMPLE_THREE_VEHICLE_EVENTS: {
708
- grade: "error" | "pass" | "fail" | "skip";
709
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
710
- stop_ids_first: string[] | null;
711
- stop_ids_last: string[] | null;
712
- stop_ids_middle: string[] | null;
713
- error_message?: string | undefined;
250
+ analysis_summary: Record<string, {
251
+ grade: "error" | "pass" | "fail" | "skip";
252
+ reason: string;
253
+ }>;
254
+ justification: {
255
+ created_at: number & {
256
+ __brand: "UnixTimestamp";
714
257
  };
715
- TRANSACTION_SEQUENTIALITY: {
716
- grade: "error" | "pass" | "fail" | "skip";
717
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
718
- expected_qty: number | null;
719
- found_qty: number | null;
720
- missing_qty: number | null;
721
- error_message?: string | undefined;
258
+ updated_at: number & {
259
+ __brand: "UnixTimestamp";
722
260
  };
261
+ pto_message: string;
262
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
263
+ justification_source: "MANUAL" | "ALERT";
264
+ created_by?: string | undefined;
265
+ updated_by?: string | undefined;
723
266
  } | null;
724
- analysisSummary: {
725
- grade: "error" | "pass" | "fail" | "skip";
726
- reason: string;
727
- error_message?: string | undefined;
728
- };
729
- justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
730
- justification_source: "MANUAL" | "REALTIME_ALERT";
731
- trip_id: string;
732
267
  created_by?: string | undefined;
733
268
  updated_by?: string | undefined;
734
269
  }, {
735
270
  _id: string;
736
271
  created_at: number;
737
272
  updated_at: number;
273
+ ride_id: string;
738
274
  acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
739
- analysis: {
740
- EXPECTED_DRIVER_ID_QTY: {
741
- value: number | null;
742
- grade: "error" | "pass" | "fail" | "skip";
743
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
744
- error_message?: string | undefined;
745
- };
746
- EXPECTED_VEHICLE_ID_QTY: {
747
- value: number | null;
748
- grade: "error" | "pass" | "fail" | "skip";
749
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
750
- error_message?: string | undefined;
751
- };
752
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
753
- value: number | null;
754
- grade: "error" | "pass" | "fail" | "skip";
755
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
756
- error_message?: string | undefined;
757
- };
758
- ENDED_AT_LAST_STOP: {
759
- grade: "error" | "pass" | "fail" | "skip";
760
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
761
- error_message?: string | undefined;
762
- };
763
- EXPECTED_VEHICLE_EVENT_QTY: {
764
- grade: "error" | "pass" | "fail" | "skip";
765
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
766
- expected_qty: number | null;
767
- found_qty: number | null;
768
- error_message?: string | undefined;
769
- };
770
- MATCHING_APEX_LOCATIONS: {
771
- grade: "error" | "pass" | "fail" | "skip";
772
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
773
- error_message?: string | undefined;
774
- };
775
- MATCHING_VEHICLE_IDS: {
776
- grade: "error" | "pass" | "fail" | "skip";
777
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
778
- error_message?: string | undefined;
779
- };
780
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
781
- value: number | null;
782
- grade: "error" | "pass" | "fail" | "skip";
783
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
784
- error_message?: string | undefined;
785
- };
786
- EXPECTED_APEX_VALIDATION_INTERVAL: {
787
- grade: "error" | "pass" | "fail" | "skip";
788
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
789
- error_message?: string | undefined;
790
- };
791
- EXPECTED_START_TIME: {
792
- value: number | null;
793
- grade: "error" | "pass" | "fail" | "skip";
794
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
795
- error_message?: string | undefined;
796
- };
797
- EXPECTED_VEHICLE_EVENT_DELAY: {
798
- value: number | null;
799
- grade: "error" | "pass" | "fail" | "skip";
800
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
801
- error_message?: string | undefined;
802
- };
803
- SIMPLE_ONE_APEX_VALIDATION: {
804
- value: number | null;
805
- grade: "error" | "pass" | "fail" | "skip";
806
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
807
- error_message?: string | undefined;
808
- };
809
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
810
- grade: "error" | "pass" | "fail" | "skip";
811
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
812
- error_message?: string | undefined;
813
- };
814
- SIMPLE_THREE_VEHICLE_EVENTS: {
815
- grade: "error" | "pass" | "fail" | "skip";
816
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
817
- stop_ids_first: string[] | null;
818
- stop_ids_last: string[] | null;
819
- stop_ids_middle: string[] | null;
820
- error_message?: string | undefined;
821
- };
822
- TRANSACTION_SEQUENTIALITY: {
823
- grade: "error" | "pass" | "fail" | "skip";
824
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
825
- expected_qty: number | null;
826
- found_qty: number | null;
827
- missing_qty: number | null;
828
- error_message?: string | undefined;
829
- };
830
- } | null;
831
- analysisSummary: {
275
+ analysis_summary: Record<string, {
832
276
  grade: "error" | "pass" | "fail" | "skip";
833
277
  reason: string;
834
- error_message?: string | undefined;
835
- };
836
- justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
837
- justification_source: "MANUAL" | "REALTIME_ALERT";
838
- trip_id: string;
278
+ }>;
279
+ justification: {
280
+ created_at: number;
281
+ updated_at: number;
282
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
283
+ justification_source: "MANUAL" | "ALERT";
284
+ created_by?: string | undefined;
285
+ updated_by?: string | undefined;
286
+ pto_message?: string | undefined;
287
+ } | null;
839
288
  created_by?: string | undefined;
840
289
  updated_by?: string | undefined;
841
290
  is_locked?: boolean | undefined;
@@ -859,9 +308,8 @@ export declare const RideJustificationSchema: z.ZodObject<{
859
308
  metadata?: Record<string, unknown> | null | undefined;
860
309
  prev_value?: any;
861
310
  })[] | undefined;
862
- pto_message?: string | undefined;
863
311
  }>;
864
- export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
312
+ export declare const CreateRideAcceptanceSchema: z.ZodObject<Omit<{
865
313
  _id: z.ZodOptional<z.ZodString>;
866
314
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
867
315
  created_by: z.ZodOptional<z.ZodString>;
@@ -982,463 +430,49 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
982
430
  metadata?: Record<string, unknown> | null | undefined;
983
431
  prev_value?: any;
984
432
  }>, "many">>;
433
+ ride_id: z.ZodString;
985
434
  acceptance_status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
986
- pto_message: z.ZodDefault<z.ZodString>;
987
- analysis: z.ZodNullable<z.ZodObject<{
988
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: z.ZodObject<{
989
- error_message: z.ZodOptional<z.ZodString>;
990
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
991
- } & {
992
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "NO_VEHICLE_EVENTS_ON_FIRST_STOP", "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP"]>;
993
- value: z.ZodNullable<z.ZodNumber>;
994
- }, "strict", z.ZodTypeAny, {
995
- value: number | null;
996
- grade: "error" | "pass" | "fail" | "skip";
997
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
998
- error_message?: string | undefined;
999
- }, {
1000
- value: number | null;
1001
- grade: "error" | "pass" | "fail" | "skip";
1002
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
1003
- error_message?: string | undefined;
1004
- }>;
1005
- ENDED_AT_LAST_STOP: z.ZodObject<{
1006
- error_message: z.ZodOptional<z.ZodString>;
1007
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1008
- } & {
1009
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "ENDED_AT_LAST_STOP", "ENDED_OUTSIDE_OF_LAST_STOP"]>;
1010
- }, "strict", z.ZodTypeAny, {
1011
- grade: "error" | "pass" | "fail" | "skip";
1012
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
1013
- error_message?: string | undefined;
1014
- }, {
1015
- grade: "error" | "pass" | "fail" | "skip";
1016
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
1017
- error_message?: string | undefined;
1018
- }>;
1019
- EXPECTED_APEX_VALIDATION_INTERVAL: z.ZodObject<{
1020
- error_message: z.ZodOptional<z.ZodString>;
1021
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1022
- } & {
1023
- reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "NOT_ENOUGH_VALIDATIONS", "INTERVALS_TOO_SHORT", "NON_ORGANIC_INTERVALS", "EXPECTED_VALIDATION_INTERVALS"]>;
1024
- }, "strict", z.ZodTypeAny, {
1025
- grade: "error" | "pass" | "fail" | "skip";
1026
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
1027
- error_message?: string | undefined;
1028
- }, {
1029
- grade: "error" | "pass" | "fail" | "skip";
1030
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
1031
- error_message?: string | undefined;
1032
- }>;
1033
- EXPECTED_DRIVER_ID_QTY: z.ZodObject<{
1034
- error_message: z.ZodOptional<z.ZodString>;
1035
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1036
- } & {
1037
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_DRIVER_ID_QTY", "EXPECTED_DRIVER_ID_QTY"]>;
1038
- value: z.ZodNullable<z.ZodNumber>;
1039
- }, "strict", z.ZodTypeAny, {
1040
- value: number | null;
1041
- grade: "error" | "pass" | "fail" | "skip";
1042
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
1043
- error_message?: string | undefined;
1044
- }, {
1045
- value: number | null;
1046
- grade: "error" | "pass" | "fail" | "skip";
1047
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
1048
- error_message?: string | undefined;
1049
- }>;
1050
- EXPECTED_START_TIME: z.ZodObject<{
1051
- error_message: z.ZodOptional<z.ZodString>;
1052
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1053
- } & {
1054
- reason: z.ZodEnum<["NO_START_TIME_SCHEDULED", "NO_VEHICLE_EVENTS", "UNKNOWN_START", "EARLY_START", "LATE_START", "START_ON_TIME"]>;
1055
- value: z.ZodNullable<z.ZodNumber>;
1056
- }, "strict", z.ZodTypeAny, {
1057
- value: number | null;
1058
- grade: "error" | "pass" | "fail" | "skip";
1059
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
1060
- error_message?: string | undefined;
1061
- }, {
1062
- value: number | null;
1063
- grade: "error" | "pass" | "fail" | "skip";
1064
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
1065
- error_message?: string | undefined;
1066
- }>;
1067
- EXPECTED_VEHICLE_EVENT_DELAY: z.ZodObject<{
1068
- error_message: z.ZodOptional<z.ZodString>;
1069
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1070
- } & {
1071
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_VEHICLE_EVENTS_DELAY", "EXPECTED_VEHICLE_EVENTS_DELAY"]>;
1072
- value: z.ZodNullable<z.ZodNumber>;
1073
- }, "strict", z.ZodTypeAny, {
1074
- value: number | null;
1075
- grade: "error" | "pass" | "fail" | "skip";
1076
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
1077
- error_message?: string | undefined;
1078
- }, {
1079
- value: number | null;
1080
- grade: "error" | "pass" | "fail" | "skip";
1081
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
1082
- error_message?: string | undefined;
1083
- }>;
1084
- EXPECTED_VEHICLE_EVENT_INTERVAL: z.ZodObject<{
1085
- error_message: z.ZodOptional<z.ZodString>;
1086
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1087
- } & {
1088
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_INTERVAL", "UNEXPECTED_VEHICLE_EVENT_INTERVAL"]>;
1089
- value: z.ZodNullable<z.ZodNumber>;
1090
- }, "strict", z.ZodTypeAny, {
1091
- value: number | null;
1092
- grade: "error" | "pass" | "fail" | "skip";
1093
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
1094
- error_message?: string | undefined;
1095
- }, {
1096
- value: number | null;
1097
- grade: "error" | "pass" | "fail" | "skip";
1098
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
1099
- error_message?: string | undefined;
1100
- }>;
1101
- EXPECTED_VEHICLE_EVENT_QTY: z.ZodObject<{
1102
- error_message: z.ZodOptional<z.ZodString>;
1103
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1104
- } & {
1105
- expected_qty: z.ZodNullable<z.ZodNumber>;
1106
- found_qty: z.ZodNullable<z.ZodNumber>;
1107
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_QTY", "UNEXPECTED_VEHICLE_EVENT_QTY"]>;
1108
- }, "strict", z.ZodTypeAny, {
1109
- grade: "error" | "pass" | "fail" | "skip";
1110
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
1111
- expected_qty: number | null;
1112
- found_qty: number | null;
1113
- error_message?: string | undefined;
1114
- }, {
1115
- grade: "error" | "pass" | "fail" | "skip";
1116
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
1117
- expected_qty: number | null;
1118
- found_qty: number | null;
1119
- error_message?: string | undefined;
1120
- }>;
1121
- EXPECTED_VEHICLE_ID_QTY: z.ZodObject<{
1122
- error_message: z.ZodOptional<z.ZodString>;
1123
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1124
- } & {
1125
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "NO_APEX_VALIDATIONS", "UNEXPECTED_VEHICLE_ID_QTY", "EXPECTED_VEHICLE_ID_QTY"]>;
1126
- value: z.ZodNullable<z.ZodNumber>;
1127
- }, "strict", z.ZodTypeAny, {
1128
- value: number | null;
1129
- grade: "error" | "pass" | "fail" | "skip";
1130
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
1131
- error_message?: string | undefined;
1132
- }, {
1133
- value: number | null;
1134
- grade: "error" | "pass" | "fail" | "skip";
1135
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
1136
- error_message?: string | undefined;
1137
- }>;
1138
- MATCHING_APEX_LOCATIONS: z.ZodObject<{
1139
- error_message: z.ZodOptional<z.ZodString>;
1140
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1141
- } & {
1142
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_APEX_LOCATIONS", "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP", "MATCHING_APEX_LOCATIONS"]>;
1143
- }, "strict", z.ZodTypeAny, {
1144
- grade: "error" | "pass" | "fail" | "skip";
1145
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
1146
- error_message?: string | undefined;
1147
- }, {
1148
- grade: "error" | "pass" | "fail" | "skip";
1149
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
1150
- error_message?: string | undefined;
1151
- }>;
1152
- MATCHING_VEHICLE_IDS: z.ZodObject<{
1153
- error_message: z.ZodOptional<z.ZodString>;
1154
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1155
- } & {
1156
- reason: z.ZodEnum<["MATCHING_VEHICLE_IDS", "VEHICLE_ID_MISMATCH", "NO_VEHICLE_EVENTS", "NO_APEX_TRANSACTIONS"]>;
1157
- }, "strict", z.ZodTypeAny, {
1158
- grade: "error" | "pass" | "fail" | "skip";
1159
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
1160
- error_message?: string | undefined;
1161
- }, {
1162
- grade: "error" | "pass" | "fail" | "skip";
1163
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
1164
- error_message?: string | undefined;
1165
- }>;
1166
- SIMPLE_ONE_APEX_VALIDATION: z.ZodObject<{
1167
- error_message: z.ZodOptional<z.ZodString>;
1168
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1169
- } & {
1170
- reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "ONE_OR_MORE_APEX_VALIDATIONS"]>;
1171
- value: z.ZodNullable<z.ZodNumber>;
1172
- }, "strict", z.ZodTypeAny, {
1173
- value: number | null;
1174
- grade: "error" | "pass" | "fail" | "skip";
1175
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
1176
- error_message?: string | undefined;
1177
- }, {
1178
- value: number | null;
1179
- grade: "error" | "pass" | "fail" | "skip";
1180
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
1181
- error_message?: string | undefined;
1182
- }>;
1183
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: z.ZodObject<{
1184
- error_message: z.ZodOptional<z.ZodString>;
1185
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1186
- } & {
1187
- reason: z.ZodEnum<["NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS", "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION"]>;
1188
- }, "strict", z.ZodTypeAny, {
1189
- grade: "error" | "pass" | "fail" | "skip";
1190
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
1191
- error_message?: string | undefined;
1192
- }, {
1193
- grade: "error" | "pass" | "fail" | "skip";
1194
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
1195
- error_message?: string | undefined;
1196
- }>;
1197
- SIMPLE_THREE_VEHICLE_EVENTS: z.ZodObject<{
1198
- error_message: z.ZodOptional<z.ZodString>;
1199
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1200
- } & {
1201
- reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "MISSING_FIRST_STOPS", "MISSING_MIDDLE_STOPS", "MISSING_LAST_STOPS", "ALL_STOPS_FOUND"]>;
1202
- stop_ids_first: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
1203
- stop_ids_last: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
1204
- stop_ids_middle: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
1205
- }, "strict", z.ZodTypeAny, {
1206
- grade: "error" | "pass" | "fail" | "skip";
1207
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
1208
- stop_ids_first: string[] | null;
1209
- stop_ids_last: string[] | null;
1210
- stop_ids_middle: string[] | null;
1211
- error_message?: string | undefined;
1212
- }, {
1213
- grade: "error" | "pass" | "fail" | "skip";
1214
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
1215
- stop_ids_first: string[] | null;
1216
- stop_ids_last: string[] | null;
1217
- stop_ids_middle: string[] | null;
1218
- error_message?: string | undefined;
1219
- }>;
1220
- TRANSACTION_SEQUENTIALITY: z.ZodObject<{
1221
- error_message: z.ZodOptional<z.ZodString>;
1222
- grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1223
- } & {
1224
- expected_qty: z.ZodNullable<z.ZodNumber>;
1225
- found_qty: z.ZodNullable<z.ZodNumber>;
1226
- missing_qty: z.ZodNullable<z.ZodNumber>;
1227
- reason: z.ZodEnum<["NO_TRANSACTIONS", "MISSING_TRANSACTIONS", "ALL_TRANSACTIONS_RECEIVED"]>;
1228
- }, "strict", z.ZodTypeAny, {
1229
- grade: "error" | "pass" | "fail" | "skip";
1230
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
1231
- expected_qty: number | null;
1232
- found_qty: number | null;
1233
- missing_qty: number | null;
1234
- error_message?: string | undefined;
1235
- }, {
1236
- grade: "error" | "pass" | "fail" | "skip";
1237
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
1238
- expected_qty: number | null;
1239
- found_qty: number | null;
1240
- missing_qty: number | null;
1241
- error_message?: string | undefined;
1242
- }>;
1243
- }, "strip", z.ZodTypeAny, {
1244
- EXPECTED_DRIVER_ID_QTY: {
1245
- value: number | null;
1246
- grade: "error" | "pass" | "fail" | "skip";
1247
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
1248
- error_message?: string | undefined;
1249
- };
1250
- EXPECTED_VEHICLE_ID_QTY: {
1251
- value: number | null;
1252
- grade: "error" | "pass" | "fail" | "skip";
1253
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
1254
- error_message?: string | undefined;
1255
- };
1256
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
1257
- value: number | null;
1258
- grade: "error" | "pass" | "fail" | "skip";
1259
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
1260
- error_message?: string | undefined;
1261
- };
1262
- ENDED_AT_LAST_STOP: {
1263
- grade: "error" | "pass" | "fail" | "skip";
1264
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
1265
- error_message?: string | undefined;
1266
- };
1267
- EXPECTED_VEHICLE_EVENT_QTY: {
1268
- grade: "error" | "pass" | "fail" | "skip";
1269
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
1270
- expected_qty: number | null;
1271
- found_qty: number | null;
1272
- error_message?: string | undefined;
1273
- };
1274
- MATCHING_APEX_LOCATIONS: {
1275
- grade: "error" | "pass" | "fail" | "skip";
1276
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
1277
- error_message?: string | undefined;
1278
- };
1279
- MATCHING_VEHICLE_IDS: {
1280
- grade: "error" | "pass" | "fail" | "skip";
1281
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
1282
- error_message?: string | undefined;
1283
- };
1284
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
1285
- value: number | null;
1286
- grade: "error" | "pass" | "fail" | "skip";
1287
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
1288
- error_message?: string | undefined;
1289
- };
1290
- EXPECTED_APEX_VALIDATION_INTERVAL: {
1291
- grade: "error" | "pass" | "fail" | "skip";
1292
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
1293
- error_message?: string | undefined;
1294
- };
1295
- EXPECTED_START_TIME: {
1296
- value: number | null;
1297
- grade: "error" | "pass" | "fail" | "skip";
1298
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
1299
- error_message?: string | undefined;
1300
- };
1301
- EXPECTED_VEHICLE_EVENT_DELAY: {
1302
- value: number | null;
1303
- grade: "error" | "pass" | "fail" | "skip";
1304
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
1305
- error_message?: string | undefined;
1306
- };
1307
- SIMPLE_ONE_APEX_VALIDATION: {
1308
- value: number | null;
1309
- grade: "error" | "pass" | "fail" | "skip";
1310
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
1311
- error_message?: string | undefined;
1312
- };
1313
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
1314
- grade: "error" | "pass" | "fail" | "skip";
1315
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
1316
- error_message?: string | undefined;
1317
- };
1318
- SIMPLE_THREE_VEHICLE_EVENTS: {
1319
- grade: "error" | "pass" | "fail" | "skip";
1320
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
1321
- stop_ids_first: string[] | null;
1322
- stop_ids_last: string[] | null;
1323
- stop_ids_middle: string[] | null;
1324
- error_message?: string | undefined;
1325
- };
1326
- TRANSACTION_SEQUENTIALITY: {
1327
- grade: "error" | "pass" | "fail" | "skip";
1328
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
1329
- expected_qty: number | null;
1330
- found_qty: number | null;
1331
- missing_qty: number | null;
1332
- error_message?: string | undefined;
1333
- };
1334
- }, {
1335
- EXPECTED_DRIVER_ID_QTY: {
1336
- value: number | null;
1337
- grade: "error" | "pass" | "fail" | "skip";
1338
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
1339
- error_message?: string | undefined;
1340
- };
1341
- EXPECTED_VEHICLE_ID_QTY: {
1342
- value: number | null;
1343
- grade: "error" | "pass" | "fail" | "skip";
1344
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
1345
- error_message?: string | undefined;
1346
- };
1347
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
1348
- value: number | null;
1349
- grade: "error" | "pass" | "fail" | "skip";
1350
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
1351
- error_message?: string | undefined;
1352
- };
1353
- ENDED_AT_LAST_STOP: {
1354
- grade: "error" | "pass" | "fail" | "skip";
1355
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
1356
- error_message?: string | undefined;
1357
- };
1358
- EXPECTED_VEHICLE_EVENT_QTY: {
1359
- grade: "error" | "pass" | "fail" | "skip";
1360
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
1361
- expected_qty: number | null;
1362
- found_qty: number | null;
1363
- error_message?: string | undefined;
1364
- };
1365
- MATCHING_APEX_LOCATIONS: {
1366
- grade: "error" | "pass" | "fail" | "skip";
1367
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
1368
- error_message?: string | undefined;
1369
- };
1370
- MATCHING_VEHICLE_IDS: {
1371
- grade: "error" | "pass" | "fail" | "skip";
1372
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
1373
- error_message?: string | undefined;
1374
- };
1375
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
1376
- value: number | null;
1377
- grade: "error" | "pass" | "fail" | "skip";
1378
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
1379
- error_message?: string | undefined;
1380
- };
1381
- EXPECTED_APEX_VALIDATION_INTERVAL: {
1382
- grade: "error" | "pass" | "fail" | "skip";
1383
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
1384
- error_message?: string | undefined;
1385
- };
1386
- EXPECTED_START_TIME: {
1387
- value: number | null;
1388
- grade: "error" | "pass" | "fail" | "skip";
1389
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
1390
- error_message?: string | undefined;
1391
- };
1392
- EXPECTED_VEHICLE_EVENT_DELAY: {
1393
- value: number | null;
1394
- grade: "error" | "pass" | "fail" | "skip";
1395
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
1396
- error_message?: string | undefined;
1397
- };
1398
- SIMPLE_ONE_APEX_VALIDATION: {
1399
- value: number | null;
1400
- grade: "error" | "pass" | "fail" | "skip";
1401
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
1402
- error_message?: string | undefined;
1403
- };
1404
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
1405
- grade: "error" | "pass" | "fail" | "skip";
1406
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
1407
- error_message?: string | undefined;
1408
- };
1409
- SIMPLE_THREE_VEHICLE_EVENTS: {
1410
- grade: "error" | "pass" | "fail" | "skip";
1411
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
1412
- stop_ids_first: string[] | null;
1413
- stop_ids_last: string[] | null;
1414
- stop_ids_middle: string[] | null;
1415
- error_message?: string | undefined;
1416
- };
1417
- TRANSACTION_SEQUENTIALITY: {
1418
- grade: "error" | "pass" | "fail" | "skip";
1419
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
1420
- expected_qty: number | null;
1421
- found_qty: number | null;
1422
- missing_qty: number | null;
1423
- error_message?: string | undefined;
1424
- };
1425
- }>>;
1426
- analysisSummary: z.ZodObject<{
1427
- error_message: z.ZodOptional<z.ZodString>;
435
+ analysis_summary: z.ZodRecord<z.ZodString, z.ZodObject<{
1428
436
  grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1429
437
  reason: z.ZodString;
1430
- }, "strict", z.ZodTypeAny, {
438
+ }, "strip", z.ZodTypeAny, {
1431
439
  grade: "error" | "pass" | "fail" | "skip";
1432
440
  reason: string;
1433
- error_message?: string | undefined;
1434
441
  }, {
1435
442
  grade: "error" | "pass" | "fail" | "skip";
1436
443
  reason: string;
1437
- error_message?: string | undefined;
1438
- }>;
1439
- justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
1440
- justification_source: z.ZodEnum<["MANUAL", "REALTIME_ALERT"]>;
1441
- trip_id: z.ZodString;
444
+ }>>;
445
+ justification: z.ZodNullable<z.ZodObject<Omit<{
446
+ _id: z.ZodString;
447
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
448
+ created_by: z.ZodOptional<z.ZodString>;
449
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
450
+ updated_by: z.ZodOptional<z.ZodString>;
451
+ } & {
452
+ justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
453
+ justification_source: z.ZodEnum<["MANUAL", "ALERT"]>;
454
+ pto_message: z.ZodDefault<z.ZodString>;
455
+ }, "_id">, "strict", z.ZodTypeAny, {
456
+ created_at: number & {
457
+ __brand: "UnixTimestamp";
458
+ };
459
+ updated_at: number & {
460
+ __brand: "UnixTimestamp";
461
+ };
462
+ pto_message: string;
463
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
464
+ justification_source: "MANUAL" | "ALERT";
465
+ created_by?: string | undefined;
466
+ updated_by?: string | undefined;
467
+ }, {
468
+ created_at: number;
469
+ updated_at: number;
470
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
471
+ justification_source: "MANUAL" | "ALERT";
472
+ created_by?: string | undefined;
473
+ updated_by?: string | undefined;
474
+ pto_message?: string | undefined;
475
+ }>>;
1442
476
  }, "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
1443
477
  is_locked: boolean;
1444
478
  comments: ({
@@ -1469,213 +503,44 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
1469
503
  metadata?: Record<string, unknown> | null | undefined;
1470
504
  prev_value?: any;
1471
505
  })[];
506
+ ride_id: string;
1472
507
  acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
1473
- pto_message: string;
1474
- analysis: {
1475
- EXPECTED_DRIVER_ID_QTY: {
1476
- value: number | null;
1477
- grade: "error" | "pass" | "fail" | "skip";
1478
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
1479
- error_message?: string | undefined;
1480
- };
1481
- EXPECTED_VEHICLE_ID_QTY: {
1482
- value: number | null;
1483
- grade: "error" | "pass" | "fail" | "skip";
1484
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
1485
- error_message?: string | undefined;
1486
- };
1487
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
1488
- value: number | null;
1489
- grade: "error" | "pass" | "fail" | "skip";
1490
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
1491
- error_message?: string | undefined;
1492
- };
1493
- ENDED_AT_LAST_STOP: {
1494
- grade: "error" | "pass" | "fail" | "skip";
1495
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
1496
- error_message?: string | undefined;
1497
- };
1498
- EXPECTED_VEHICLE_EVENT_QTY: {
1499
- grade: "error" | "pass" | "fail" | "skip";
1500
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
1501
- expected_qty: number | null;
1502
- found_qty: number | null;
1503
- error_message?: string | undefined;
1504
- };
1505
- MATCHING_APEX_LOCATIONS: {
1506
- grade: "error" | "pass" | "fail" | "skip";
1507
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
1508
- error_message?: string | undefined;
1509
- };
1510
- MATCHING_VEHICLE_IDS: {
1511
- grade: "error" | "pass" | "fail" | "skip";
1512
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
1513
- error_message?: string | undefined;
1514
- };
1515
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
1516
- value: number | null;
1517
- grade: "error" | "pass" | "fail" | "skip";
1518
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
1519
- error_message?: string | undefined;
1520
- };
1521
- EXPECTED_APEX_VALIDATION_INTERVAL: {
1522
- grade: "error" | "pass" | "fail" | "skip";
1523
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
1524
- error_message?: string | undefined;
1525
- };
1526
- EXPECTED_START_TIME: {
1527
- value: number | null;
1528
- grade: "error" | "pass" | "fail" | "skip";
1529
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
1530
- error_message?: string | undefined;
1531
- };
1532
- EXPECTED_VEHICLE_EVENT_DELAY: {
1533
- value: number | null;
1534
- grade: "error" | "pass" | "fail" | "skip";
1535
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
1536
- error_message?: string | undefined;
1537
- };
1538
- SIMPLE_ONE_APEX_VALIDATION: {
1539
- value: number | null;
1540
- grade: "error" | "pass" | "fail" | "skip";
1541
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
1542
- error_message?: string | undefined;
1543
- };
1544
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
1545
- grade: "error" | "pass" | "fail" | "skip";
1546
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
1547
- error_message?: string | undefined;
1548
- };
1549
- SIMPLE_THREE_VEHICLE_EVENTS: {
1550
- grade: "error" | "pass" | "fail" | "skip";
1551
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
1552
- stop_ids_first: string[] | null;
1553
- stop_ids_last: string[] | null;
1554
- stop_ids_middle: string[] | null;
1555
- error_message?: string | undefined;
508
+ analysis_summary: Record<string, {
509
+ grade: "error" | "pass" | "fail" | "skip";
510
+ reason: string;
511
+ }>;
512
+ justification: {
513
+ created_at: number & {
514
+ __brand: "UnixTimestamp";
1556
515
  };
1557
- TRANSACTION_SEQUENTIALITY: {
1558
- grade: "error" | "pass" | "fail" | "skip";
1559
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
1560
- expected_qty: number | null;
1561
- found_qty: number | null;
1562
- missing_qty: number | null;
1563
- error_message?: string | undefined;
516
+ updated_at: number & {
517
+ __brand: "UnixTimestamp";
1564
518
  };
519
+ pto_message: string;
520
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
521
+ justification_source: "MANUAL" | "ALERT";
522
+ created_by?: string | undefined;
523
+ updated_by?: string | undefined;
1565
524
  } | null;
1566
- analysisSummary: {
1567
- grade: "error" | "pass" | "fail" | "skip";
1568
- reason: string;
1569
- error_message?: string | undefined;
1570
- };
1571
- justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
1572
- justification_source: "MANUAL" | "REALTIME_ALERT";
1573
- trip_id: string;
1574
525
  _id?: string | undefined;
1575
526
  created_by?: string | undefined;
1576
527
  updated_by?: string | undefined;
1577
528
  }, {
529
+ ride_id: string;
1578
530
  acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
1579
- analysis: {
1580
- EXPECTED_DRIVER_ID_QTY: {
1581
- value: number | null;
1582
- grade: "error" | "pass" | "fail" | "skip";
1583
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
1584
- error_message?: string | undefined;
1585
- };
1586
- EXPECTED_VEHICLE_ID_QTY: {
1587
- value: number | null;
1588
- grade: "error" | "pass" | "fail" | "skip";
1589
- reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
1590
- error_message?: string | undefined;
1591
- };
1592
- EXPECTED_VEHICLE_EVENT_INTERVAL: {
1593
- value: number | null;
1594
- grade: "error" | "pass" | "fail" | "skip";
1595
- reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
1596
- error_message?: string | undefined;
1597
- };
1598
- ENDED_AT_LAST_STOP: {
1599
- grade: "error" | "pass" | "fail" | "skip";
1600
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
1601
- error_message?: string | undefined;
1602
- };
1603
- EXPECTED_VEHICLE_EVENT_QTY: {
1604
- grade: "error" | "pass" | "fail" | "skip";
1605
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
1606
- expected_qty: number | null;
1607
- found_qty: number | null;
1608
- error_message?: string | undefined;
1609
- };
1610
- MATCHING_APEX_LOCATIONS: {
1611
- grade: "error" | "pass" | "fail" | "skip";
1612
- reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
1613
- error_message?: string | undefined;
1614
- };
1615
- MATCHING_VEHICLE_IDS: {
1616
- grade: "error" | "pass" | "fail" | "skip";
1617
- reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
1618
- error_message?: string | undefined;
1619
- };
1620
- AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
1621
- value: number | null;
1622
- grade: "error" | "pass" | "fail" | "skip";
1623
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
1624
- error_message?: string | undefined;
1625
- };
1626
- EXPECTED_APEX_VALIDATION_INTERVAL: {
1627
- grade: "error" | "pass" | "fail" | "skip";
1628
- reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
1629
- error_message?: string | undefined;
1630
- };
1631
- EXPECTED_START_TIME: {
1632
- value: number | null;
1633
- grade: "error" | "pass" | "fail" | "skip";
1634
- reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
1635
- error_message?: string | undefined;
1636
- };
1637
- EXPECTED_VEHICLE_EVENT_DELAY: {
1638
- value: number | null;
1639
- grade: "error" | "pass" | "fail" | "skip";
1640
- reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
1641
- error_message?: string | undefined;
1642
- };
1643
- SIMPLE_ONE_APEX_VALIDATION: {
1644
- value: number | null;
1645
- grade: "error" | "pass" | "fail" | "skip";
1646
- reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
1647
- error_message?: string | undefined;
1648
- };
1649
- SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
1650
- grade: "error" | "pass" | "fail" | "skip";
1651
- reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
1652
- error_message?: string | undefined;
1653
- };
1654
- SIMPLE_THREE_VEHICLE_EVENTS: {
1655
- grade: "error" | "pass" | "fail" | "skip";
1656
- reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
1657
- stop_ids_first: string[] | null;
1658
- stop_ids_last: string[] | null;
1659
- stop_ids_middle: string[] | null;
1660
- error_message?: string | undefined;
1661
- };
1662
- TRANSACTION_SEQUENTIALITY: {
1663
- grade: "error" | "pass" | "fail" | "skip";
1664
- reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
1665
- expected_qty: number | null;
1666
- found_qty: number | null;
1667
- missing_qty: number | null;
1668
- error_message?: string | undefined;
1669
- };
1670
- } | null;
1671
- analysisSummary: {
531
+ analysis_summary: Record<string, {
1672
532
  grade: "error" | "pass" | "fail" | "skip";
1673
533
  reason: string;
1674
- error_message?: string | undefined;
1675
- };
1676
- justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
1677
- justification_source: "MANUAL" | "REALTIME_ALERT";
1678
- trip_id: string;
534
+ }>;
535
+ justification: {
536
+ created_at: number;
537
+ updated_at: number;
538
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
539
+ justification_source: "MANUAL" | "ALERT";
540
+ created_by?: string | undefined;
541
+ updated_by?: string | undefined;
542
+ pto_message?: string | undefined;
543
+ } | null;
1679
544
  _id?: string | undefined;
1680
545
  created_by?: string | undefined;
1681
546
  updated_by?: string | undefined;
@@ -1700,10 +565,10 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
1700
565
  metadata?: Record<string, unknown> | null | undefined;
1701
566
  prev_value?: any;
1702
567
  })[] | undefined;
1703
- pto_message?: string | undefined;
1704
568
  }>;
1705
- export declare const UpdateRideJustificationSchema: z.ZodObject<{
1706
- _id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
569
+ export declare const UpdateRideAcceptanceSchema: z.ZodObject<{
570
+ _id: z.ZodOptional<z.ZodString>;
571
+ updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
1707
572
  updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1708
573
  is_locked: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1709
574
  comments: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -1820,25 +685,52 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
1820
685
  metadata?: Record<string, unknown> | null | undefined;
1821
686
  prev_value?: any;
1822
687
  }>, "many">>>;
688
+ ride_id: z.ZodOptional<z.ZodString>;
1823
689
  acceptance_status: z.ZodOptional<z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>>;
1824
- pto_message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1825
- analysisSummary: z.ZodOptional<z.ZodObject<{
1826
- error_message: z.ZodOptional<z.ZodString>;
690
+ analysis_summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1827
691
  grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
1828
692
  reason: z.ZodString;
1829
- }, "strict", z.ZodTypeAny, {
693
+ }, "strip", z.ZodTypeAny, {
1830
694
  grade: "error" | "pass" | "fail" | "skip";
1831
695
  reason: string;
1832
- error_message?: string | undefined;
1833
696
  }, {
1834
697
  grade: "error" | "pass" | "fail" | "skip";
1835
698
  reason: string;
1836
- error_message?: string | undefined;
1837
- }>>;
1838
- justification_cause: z.ZodOptional<z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>>;
1839
- trip_id: z.ZodOptional<z.ZodString>;
699
+ }>>>;
700
+ justification: z.ZodOptional<z.ZodNullable<z.ZodObject<Omit<{
701
+ _id: z.ZodString;
702
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
703
+ created_by: z.ZodOptional<z.ZodString>;
704
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
705
+ updated_by: z.ZodOptional<z.ZodString>;
706
+ } & {
707
+ justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
708
+ justification_source: z.ZodEnum<["MANUAL", "ALERT"]>;
709
+ pto_message: z.ZodDefault<z.ZodString>;
710
+ }, "_id">, "strict", z.ZodTypeAny, {
711
+ created_at: number & {
712
+ __brand: "UnixTimestamp";
713
+ };
714
+ updated_at: number & {
715
+ __brand: "UnixTimestamp";
716
+ };
717
+ pto_message: string;
718
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
719
+ justification_source: "MANUAL" | "ALERT";
720
+ created_by?: string | undefined;
721
+ updated_by?: string | undefined;
722
+ }, {
723
+ created_at: number;
724
+ updated_at: number;
725
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
726
+ justification_source: "MANUAL" | "ALERT";
727
+ created_by?: string | undefined;
728
+ updated_by?: string | undefined;
729
+ pto_message?: string | undefined;
730
+ }>>>;
1840
731
  }, "strict", z.ZodTypeAny, {
1841
732
  _id?: string | undefined;
733
+ updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
1842
734
  updated_by?: string | undefined;
1843
735
  is_locked?: boolean | undefined;
1844
736
  comments?: ({
@@ -1869,17 +761,28 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
1869
761
  metadata?: Record<string, unknown> | null | undefined;
1870
762
  prev_value?: any;
1871
763
  })[] | undefined;
764
+ ride_id?: string | undefined;
1872
765
  acceptance_status?: "accepted" | "justification_required" | "under_review" | "rejected" | undefined;
1873
- pto_message?: string | undefined;
1874
- analysisSummary?: {
766
+ analysis_summary?: Record<string, {
1875
767
  grade: "error" | "pass" | "fail" | "skip";
1876
768
  reason: string;
1877
- error_message?: string | undefined;
1878
- } | undefined;
1879
- justification_cause?: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER" | undefined;
1880
- trip_id?: string | undefined;
769
+ }> | undefined;
770
+ justification?: {
771
+ created_at: number & {
772
+ __brand: "UnixTimestamp";
773
+ };
774
+ updated_at: number & {
775
+ __brand: "UnixTimestamp";
776
+ };
777
+ pto_message: string;
778
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
779
+ justification_source: "MANUAL" | "ALERT";
780
+ created_by?: string | undefined;
781
+ updated_by?: string | undefined;
782
+ } | null | undefined;
1881
783
  }, {
1882
784
  _id?: string | undefined;
785
+ updated_at?: number | undefined;
1883
786
  updated_by?: string | undefined;
1884
787
  is_locked?: boolean | undefined;
1885
788
  comments?: ({
@@ -1902,16 +805,22 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
1902
805
  metadata?: Record<string, unknown> | null | undefined;
1903
806
  prev_value?: any;
1904
807
  })[] | undefined;
808
+ ride_id?: string | undefined;
1905
809
  acceptance_status?: "accepted" | "justification_required" | "under_review" | "rejected" | undefined;
1906
- pto_message?: string | undefined;
1907
- analysisSummary?: {
810
+ analysis_summary?: Record<string, {
1908
811
  grade: "error" | "pass" | "fail" | "skip";
1909
812
  reason: string;
1910
- error_message?: string | undefined;
1911
- } | undefined;
1912
- justification_cause?: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER" | undefined;
1913
- trip_id?: string | undefined;
813
+ }> | undefined;
814
+ justification?: {
815
+ created_at: number;
816
+ updated_at: number;
817
+ justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
818
+ justification_source: "MANUAL" | "ALERT";
819
+ created_by?: string | undefined;
820
+ updated_by?: string | undefined;
821
+ pto_message?: string | undefined;
822
+ } | null | undefined;
1914
823
  }>;
1915
- export type RideJustification = z.infer<typeof RideJustificationSchema>;
1916
- export type CreateRideJustificationDto = z.infer<typeof CreateRideJustificationSchema>;
1917
- export type UpdateRideJustificationDto = z.infer<typeof UpdateRideJustificationSchema>;
824
+ export type RideAcceptance = z.infer<typeof RideAcceptanceSchema>;
825
+ export type CreateRideAcceptanceDto = z.infer<typeof CreateRideAcceptanceSchema>;
826
+ export type UpdateRideAcceptanceDto = z.infer<typeof UpdateRideAcceptanceSchema>;