@tmlmobilidade/types 20250915.936.53 → 20250915.959.39
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,6 +5,9 @@ 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"]>;
|
|
10
|
+
export type RideJustificationSource = z.infer<typeof RideJustificationSourceSchema>;
|
|
8
11
|
export declare const RideJustificationSchema: z.ZodObject<{
|
|
9
12
|
_id: z.ZodString;
|
|
10
13
|
created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
@@ -242,6 +245,7 @@ export declare const RideJustificationSchema: z.ZodObject<{
|
|
|
242
245
|
updated_by?: string | undefined;
|
|
243
246
|
}>, "many">>;
|
|
244
247
|
justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
|
|
248
|
+
justification_source: z.ZodEnum<["MANUAL", "REALTIME_ALERT"]>;
|
|
245
249
|
pto_message: z.ZodDefault<z.ZodString>;
|
|
246
250
|
trip_id: z.ZodString;
|
|
247
251
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -297,6 +301,7 @@ export declare const RideJustificationSchema: z.ZodObject<{
|
|
|
297
301
|
error_message?: string | undefined;
|
|
298
302
|
};
|
|
299
303
|
justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
|
|
304
|
+
justification_source: "MANUAL" | "REALTIME_ALERT";
|
|
300
305
|
pto_message: string;
|
|
301
306
|
trip_id: string;
|
|
302
307
|
created_by?: string | undefined;
|
|
@@ -312,6 +317,7 @@ export declare const RideJustificationSchema: z.ZodObject<{
|
|
|
312
317
|
error_message?: string | undefined;
|
|
313
318
|
};
|
|
314
319
|
justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
|
|
320
|
+
justification_source: "MANUAL" | "REALTIME_ALERT";
|
|
315
321
|
trip_id: string;
|
|
316
322
|
created_by?: string | undefined;
|
|
317
323
|
updated_by?: string | undefined;
|
|
@@ -579,6 +585,7 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
|
|
|
579
585
|
error_message?: string | undefined;
|
|
580
586
|
}>;
|
|
581
587
|
justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
|
|
588
|
+
justification_source: z.ZodEnum<["MANUAL", "REALTIME_ALERT"]>;
|
|
582
589
|
pto_message: z.ZodDefault<z.ZodString>;
|
|
583
590
|
trip_id: z.ZodString;
|
|
584
591
|
}, "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
@@ -627,6 +634,7 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
|
|
|
627
634
|
error_message?: string | undefined;
|
|
628
635
|
};
|
|
629
636
|
justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
|
|
637
|
+
justification_source: "MANUAL" | "REALTIME_ALERT";
|
|
630
638
|
pto_message: string;
|
|
631
639
|
trip_id: string;
|
|
632
640
|
_id?: string | undefined;
|
|
@@ -640,6 +648,7 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
|
|
|
640
648
|
error_message?: string | undefined;
|
|
641
649
|
};
|
|
642
650
|
justification_cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER";
|
|
651
|
+
justification_source: "MANUAL" | "REALTIME_ALERT";
|
|
643
652
|
trip_id: string;
|
|
644
653
|
_id?: string | undefined;
|
|
645
654
|
created_by?: string | undefined;
|
|
@@ -891,19 +900,6 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
|
|
|
891
900
|
updated_by?: string | undefined;
|
|
892
901
|
}>, "many">>>;
|
|
893
902
|
acceptance_status: z.ZodOptional<z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>>;
|
|
894
|
-
analysis: z.ZodOptional<z.ZodObject<{
|
|
895
|
-
error_message: z.ZodOptional<z.ZodString>;
|
|
896
|
-
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
|
|
897
|
-
reason: z.ZodString;
|
|
898
|
-
}, "strict", z.ZodTypeAny, {
|
|
899
|
-
grade: "error" | "pass" | "fail" | "skip";
|
|
900
|
-
reason: string;
|
|
901
|
-
error_message?: string | undefined;
|
|
902
|
-
}, {
|
|
903
|
-
grade: "error" | "pass" | "fail" | "skip";
|
|
904
|
-
reason: string;
|
|
905
|
-
error_message?: string | undefined;
|
|
906
|
-
}>>;
|
|
907
903
|
justification_cause: z.ZodOptional<z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>>;
|
|
908
904
|
pto_message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
909
905
|
trip_id: z.ZodOptional<z.ZodString>;
|
|
@@ -949,11 +945,6 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
|
|
|
949
945
|
updated_by?: string | undefined;
|
|
950
946
|
})[] | undefined;
|
|
951
947
|
acceptance_status?: "accepted" | "justification_required" | "under_review" | "rejected" | undefined;
|
|
952
|
-
analysis?: {
|
|
953
|
-
grade: "error" | "pass" | "fail" | "skip";
|
|
954
|
-
reason: string;
|
|
955
|
-
error_message?: string | undefined;
|
|
956
|
-
} | undefined;
|
|
957
948
|
justification_cause?: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER" | undefined;
|
|
958
949
|
pto_message?: string | undefined;
|
|
959
950
|
trip_id?: string | undefined;
|
|
@@ -987,11 +978,6 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
|
|
|
987
978
|
updated_by?: string | undefined;
|
|
988
979
|
})[] | undefined;
|
|
989
980
|
acceptance_status?: "accepted" | "justification_required" | "under_review" | "rejected" | undefined;
|
|
990
|
-
analysis?: {
|
|
991
|
-
grade: "error" | "pass" | "fail" | "skip";
|
|
992
|
-
reason: string;
|
|
993
|
-
error_message?: string | undefined;
|
|
994
|
-
} | undefined;
|
|
995
981
|
justification_cause?: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "TECHNICAL_PROBLEM" | "WEATHER" | undefined;
|
|
996
982
|
pto_message?: string | undefined;
|
|
997
983
|
trip_id?: string | undefined;
|
|
@@ -8,6 +8,8 @@ export const RIDE_ACCEPTANCE_STATUS_OPTIONS = ['justification_required', 'under_
|
|
|
8
8
|
export const RideAcceptanceStatusSchema = z.enum(RIDE_ACCEPTANCE_STATUS_OPTIONS);
|
|
9
9
|
export const RIDE_JUSTIFICATION_CAUSE_OPTIONS = ['TECHNICAL_PROBLEM', 'DEMONSTRATION', 'ACCIDENT', 'WEATHER', 'CONSTRUCTION', 'POLICE_ACTIVITY', 'MEDICAL_EMERGENCY', 'OTHER_CAUSE'];
|
|
10
10
|
export const RideJustificationCauseSchema = z.enum(RIDE_JUSTIFICATION_CAUSE_OPTIONS);
|
|
11
|
+
export const RIDE_JUSTIFICATION_SOURCE_OPTIONS = ['MANUAL', 'REALTIME_ALERT'];
|
|
12
|
+
export const RideJustificationSourceSchema = z.enum(RIDE_JUSTIFICATION_SOURCE_OPTIONS);
|
|
11
13
|
/* * */
|
|
12
14
|
const CommentSchemaWithRideJustificationStatus = CommentSchema.superRefine((data, ctx) => {
|
|
13
15
|
if (data.type === CommentTypeSchema.enum.statusChanged) {
|
|
@@ -34,8 +36,9 @@ export const RideJustificationSchema = DocumentSchema.extend({
|
|
|
34
36
|
analysis: RideAnalysisSchema,
|
|
35
37
|
comments: z.array(CommentSchemaWithRideJustificationStatus).default([]),
|
|
36
38
|
justification_cause: RideJustificationCauseSchema,
|
|
39
|
+
justification_source: RideJustificationSourceSchema,
|
|
37
40
|
pto_message: z.string().min(2).max(5000).default(''),
|
|
38
41
|
trip_id: z.string(),
|
|
39
42
|
}).strict();
|
|
40
43
|
export const CreateRideJustificationSchema = RideJustificationSchema.partial({ _id: true }).omit({ created_at: true, updated_at: true });
|
|
41
|
-
export const UpdateRideJustificationSchema = CreateRideJustificationSchema.omit({ created_by: true }).partial();
|
|
44
|
+
export const UpdateRideJustificationSchema = CreateRideJustificationSchema.omit({ analysis: true, created_by: true, justification_source: true }).partial();
|
package/package.json
CHANGED