@tmlmobilidade/types 20250829.1512.5 → 20250829.2329.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,37 @@
1
1
  import { z } from 'zod';
2
- export declare const ACCEPTANCE_STATUS_OPTIONS: readonly ["justification_required", "under_review", "accepted", "rejected"];
3
- export declare const AcceptanceStatusSchema: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
2
+ export declare const RIDE_ACCEPTANCE_STATUS_OPTIONS: readonly ["justification_required", "under_review", "accepted", "rejected"];
3
+ export declare const RideAcceptanceStatusSchema: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
4
+ export declare const RideAcceptanceSchema: z.ZodObject<{
5
+ _id: z.ZodString;
6
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
7
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
8
+ } & {
9
+ analysis_summary: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<["pass", "fail", "error"]>>>>;
10
+ created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
11
+ mode: z.ZodEnum<["manual", "auto"]>;
12
+ status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
13
+ }, "strict", z.ZodTypeAny, {
14
+ _id: string;
15
+ status: "accepted" | "justification_required" | "under_review" | "rejected";
16
+ created_by: string | null;
17
+ analysis_summary: Record<string, "error" | "pass" | "fail"> | null;
18
+ mode: "manual" | "auto";
19
+ created_at?: (number & {
20
+ __brand: "UnixTimestamp";
21
+ } & z.BRAND<"UnixTimestamp">) | null | undefined;
22
+ updated_at?: (number & {
23
+ __brand: "UnixTimestamp";
24
+ } & z.BRAND<"UnixTimestamp">) | null | undefined;
25
+ }, {
26
+ _id: string;
27
+ status: "accepted" | "justification_required" | "under_review" | "rejected";
28
+ mode: "manual" | "auto";
29
+ created_at?: number | null | undefined;
30
+ updated_at?: number | null | undefined;
31
+ created_by?: string | null | undefined;
32
+ analysis_summary?: Record<string, "error" | "pass" | "fail"> | null | undefined;
33
+ }>;
34
+ export type RideAcceptance = z.infer<typeof RideAcceptanceSchema>;
4
35
  export declare const RideJustificationSchema: z.ZodObject<{
5
36
  comments: z.ZodDefault<z.ZodArray<z.ZodObject<{
6
37
  created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
@@ -28,7 +59,6 @@ export declare const RideJustificationSchema: z.ZodObject<{
28
59
  }>, "many">>;
29
60
  file_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
30
61
  pto_message: z.ZodDefault<z.ZodString>;
31
- updated_trip_id: z.ZodNullable<z.ZodString>;
32
62
  }, "strict", z.ZodTypeAny, {
33
63
  file_ids: string[];
34
64
  comments: {
@@ -43,9 +73,7 @@ export declare const RideJustificationSchema: z.ZodObject<{
43
73
  } & z.BRAND<"UnixTimestamp">) | null | undefined;
44
74
  }[];
45
75
  pto_message: string;
46
- updated_trip_id: string | null;
47
76
  }, {
48
- updated_trip_id: string | null;
49
77
  file_ids?: string[] | undefined;
50
78
  comments?: {
51
79
  _id: string;
@@ -57,19 +85,34 @@ export declare const RideJustificationSchema: z.ZodObject<{
57
85
  pto_message?: string | undefined;
58
86
  }>;
59
87
  export type RideJustification = z.infer<typeof RideJustificationSchema>;
60
- export declare const RidePaymentSchema: z.ZodObject<{
61
- acceptance_status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
62
- comments: z.ZodDefault<z.ZodArray<z.ZodObject<{
88
+ export declare const RideOverridesSchema: z.ZodObject<{
89
+ trip_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
90
+ }, "strict", z.ZodTypeAny, {
91
+ trip_id: string | null;
92
+ }, {
93
+ trip_id?: string | null | undefined;
94
+ }>;
95
+ export type RideOverrides = z.infer<typeof RideOverridesSchema>;
96
+ export declare const RideAnnotationSchema: z.ZodObject<{
97
+ _id: z.ZodString;
98
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
99
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
100
+ } & {
101
+ acceptance: z.ZodDefault<z.ZodArray<z.ZodObject<{
102
+ _id: z.ZodString;
63
103
  created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
64
104
  updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
65
105
  } & {
66
- _id: z.ZodString;
67
- text: z.ZodString;
68
- user_id: z.ZodString;
106
+ analysis_summary: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<["pass", "fail", "error"]>>>>;
107
+ created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
108
+ mode: z.ZodEnum<["manual", "auto"]>;
109
+ status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
69
110
  }, "strict", z.ZodTypeAny, {
70
111
  _id: string;
71
- text: string;
72
- user_id: string;
112
+ status: "accepted" | "justification_required" | "under_review" | "rejected";
113
+ created_by: string | null;
114
+ analysis_summary: Record<string, "error" | "pass" | "fail"> | null;
115
+ mode: "manual" | "auto";
73
116
  created_at?: (number & {
74
117
  __brand: "UnixTimestamp";
75
118
  } & z.BRAND<"UnixTimestamp">) | null | undefined;
@@ -78,51 +121,15 @@ export declare const RidePaymentSchema: z.ZodObject<{
78
121
  } & z.BRAND<"UnixTimestamp">) | null | undefined;
79
122
  }, {
80
123
  _id: string;
81
- text: string;
82
- user_id: string;
124
+ status: "accepted" | "justification_required" | "under_review" | "rejected";
125
+ mode: "manual" | "auto";
83
126
  created_at?: number | null | undefined;
84
127
  updated_at?: number | null | undefined;
128
+ created_by?: string | null | undefined;
129
+ analysis_summary?: Record<string, "error" | "pass" | "fail"> | null | undefined;
85
130
  }>, "many">>;
86
- file_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
87
- pto_message: z.ZodDefault<z.ZodString>;
88
- updated_trip_id: z.ZodNullable<z.ZodString>;
89
- }, "strict", z.ZodTypeAny, {
90
- file_ids: string[];
91
- comments: {
92
- _id: string;
93
- text: string;
94
- user_id: string;
95
- created_at?: (number & {
96
- __brand: "UnixTimestamp";
97
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
98
- updated_at?: (number & {
99
- __brand: "UnixTimestamp";
100
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
101
- }[];
102
- pto_message: string;
103
- updated_trip_id: string | null;
104
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
105
- }, {
106
- updated_trip_id: string | null;
107
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
108
- file_ids?: string[] | undefined;
109
- comments?: {
110
- _id: string;
111
- text: string;
112
- user_id: string;
113
- created_at?: number | null | undefined;
114
- updated_at?: number | null | undefined;
115
- }[] | undefined;
116
- pto_message?: string | undefined;
117
- }>;
118
- export type RidePayment = z.infer<typeof RidePaymentSchema>;
119
- export declare const RideAnnotationSchema: z.ZodObject<{
120
- _id: z.ZodString;
121
- created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
122
- updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
123
- } & {
124
- acceptance_status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
125
- justification: z.ZodObject<{
131
+ is_locked: z.ZodDefault<z.ZodBoolean>;
132
+ justification: z.ZodDefault<z.ZodNullable<z.ZodObject<{
126
133
  comments: z.ZodDefault<z.ZodArray<z.ZodObject<{
127
134
  created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
128
135
  updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
@@ -149,7 +156,6 @@ export declare const RideAnnotationSchema: z.ZodObject<{
149
156
  }>, "many">>;
150
157
  file_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
151
158
  pto_message: z.ZodDefault<z.ZodString>;
152
- updated_trip_id: z.ZodNullable<z.ZodString>;
153
159
  }, "strict", z.ZodTypeAny, {
154
160
  file_ids: string[];
155
161
  comments: {
@@ -164,9 +170,7 @@ export declare const RideAnnotationSchema: z.ZodObject<{
164
170
  } & z.BRAND<"UnixTimestamp">) | null | undefined;
165
171
  }[];
166
172
  pto_message: string;
167
- updated_trip_id: string | null;
168
173
  }, {
169
- updated_trip_id: string | null;
170
174
  file_ids?: string[] | undefined;
171
175
  comments?: {
172
176
  _id: string;
@@ -176,68 +180,31 @@ export declare const RideAnnotationSchema: z.ZodObject<{
176
180
  updated_at?: number | null | undefined;
177
181
  }[] | undefined;
178
182
  pto_message?: string | undefined;
179
- }>;
180
- payment: z.ZodObject<{
181
- acceptance_status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
182
- comments: z.ZodDefault<z.ZodArray<z.ZodObject<{
183
- created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
184
- updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
185
- } & {
186
- _id: z.ZodString;
187
- text: z.ZodString;
188
- user_id: z.ZodString;
189
- }, "strict", z.ZodTypeAny, {
190
- _id: string;
191
- text: string;
192
- user_id: string;
193
- created_at?: (number & {
194
- __brand: "UnixTimestamp";
195
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
196
- updated_at?: (number & {
197
- __brand: "UnixTimestamp";
198
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
199
- }, {
200
- _id: string;
201
- text: string;
202
- user_id: string;
203
- created_at?: number | null | undefined;
204
- updated_at?: number | null | undefined;
205
- }>, "many">>;
206
- file_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
207
- pto_message: z.ZodDefault<z.ZodString>;
208
- updated_trip_id: z.ZodNullable<z.ZodString>;
183
+ }>>>;
184
+ overrides: z.ZodDefault<z.ZodNullable<z.ZodObject<{
185
+ trip_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
209
186
  }, "strict", z.ZodTypeAny, {
210
- file_ids: string[];
211
- comments: {
212
- _id: string;
213
- text: string;
214
- user_id: string;
215
- created_at?: (number & {
216
- __brand: "UnixTimestamp";
217
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
218
- updated_at?: (number & {
219
- __brand: "UnixTimestamp";
220
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
221
- }[];
222
- pto_message: string;
223
- updated_trip_id: string | null;
224
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
187
+ trip_id: string | null;
225
188
  }, {
226
- updated_trip_id: string | null;
227
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
228
- file_ids?: string[] | undefined;
229
- comments?: {
230
- _id: string;
231
- text: string;
232
- user_id: string;
233
- created_at?: number | null | undefined;
234
- updated_at?: number | null | undefined;
235
- }[] | undefined;
236
- pto_message?: string | undefined;
237
- }>;
189
+ trip_id?: string | null | undefined;
190
+ }>>>;
191
+ ride_id: z.ZodString;
238
192
  }, "strict", z.ZodTypeAny, {
239
193
  _id: string;
240
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
194
+ is_locked: boolean;
195
+ acceptance: {
196
+ _id: string;
197
+ status: "accepted" | "justification_required" | "under_review" | "rejected";
198
+ created_by: string | null;
199
+ analysis_summary: Record<string, "error" | "pass" | "fail"> | null;
200
+ mode: "manual" | "auto";
201
+ created_at?: (number & {
202
+ __brand: "UnixTimestamp";
203
+ } & z.BRAND<"UnixTimestamp">) | null | undefined;
204
+ updated_at?: (number & {
205
+ __brand: "UnixTimestamp";
206
+ } & z.BRAND<"UnixTimestamp">) | null | undefined;
207
+ }[];
241
208
  justification: {
242
209
  file_ids: string[];
243
210
  comments: {
@@ -252,25 +219,11 @@ export declare const RideAnnotationSchema: z.ZodObject<{
252
219
  } & z.BRAND<"UnixTimestamp">) | null | undefined;
253
220
  }[];
254
221
  pto_message: string;
255
- updated_trip_id: string | null;
256
- };
257
- payment: {
258
- file_ids: string[];
259
- comments: {
260
- _id: string;
261
- text: string;
262
- user_id: string;
263
- created_at?: (number & {
264
- __brand: "UnixTimestamp";
265
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
266
- updated_at?: (number & {
267
- __brand: "UnixTimestamp";
268
- } & z.BRAND<"UnixTimestamp">) | null | undefined;
269
- }[];
270
- pto_message: string;
271
- updated_trip_id: string | null;
272
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
273
- };
222
+ } | null;
223
+ overrides: {
224
+ trip_id: string | null;
225
+ } | null;
226
+ ride_id: string;
274
227
  created_at?: (number & {
275
228
  __brand: "UnixTimestamp";
276
229
  } & z.BRAND<"UnixTimestamp">) | null | undefined;
@@ -279,22 +232,20 @@ export declare const RideAnnotationSchema: z.ZodObject<{
279
232
  } & z.BRAND<"UnixTimestamp">) | null | undefined;
280
233
  }, {
281
234
  _id: string;
282
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
283
- justification: {
284
- updated_trip_id: string | null;
285
- file_ids?: string[] | undefined;
286
- comments?: {
287
- _id: string;
288
- text: string;
289
- user_id: string;
290
- created_at?: number | null | undefined;
291
- updated_at?: number | null | undefined;
292
- }[] | undefined;
293
- pto_message?: string | undefined;
294
- };
295
- payment: {
296
- updated_trip_id: string | null;
297
- acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
235
+ ride_id: string;
236
+ created_at?: number | null | undefined;
237
+ updated_at?: number | null | undefined;
238
+ is_locked?: boolean | undefined;
239
+ acceptance?: {
240
+ _id: string;
241
+ status: "accepted" | "justification_required" | "under_review" | "rejected";
242
+ mode: "manual" | "auto";
243
+ created_at?: number | null | undefined;
244
+ updated_at?: number | null | undefined;
245
+ created_by?: string | null | undefined;
246
+ analysis_summary?: Record<string, "error" | "pass" | "fail"> | null | undefined;
247
+ }[] | undefined;
248
+ justification?: {
298
249
  file_ids?: string[] | undefined;
299
250
  comments?: {
300
251
  _id: string;
@@ -304,8 +255,9 @@ export declare const RideAnnotationSchema: z.ZodObject<{
304
255
  updated_at?: number | null | undefined;
305
256
  }[] | undefined;
306
257
  pto_message?: string | undefined;
307
- };
308
- created_at?: number | null | undefined;
309
- updated_at?: number | null | undefined;
258
+ } | null | undefined;
259
+ overrides?: {
260
+ trip_id?: string | null | undefined;
261
+ } | null | undefined;
310
262
  }>;
311
263
  export type RideAnnotation = z.infer<typeof RideAnnotationSchema>;
@@ -1,42 +1,32 @@
1
1
  /* * */
2
2
  import { CommentSchema } from '../_common/comment.js';
3
3
  import { DocumentSchema } from '../_common/document.js';
4
+ import { RideAnalysisGradeSchema } from './ride-analysis.js';
4
5
  import { z } from 'zod';
5
6
  /* * */
6
- export const ACCEPTANCE_STATUS_OPTIONS = ['justification_required', 'under_review', 'accepted', 'rejected'];
7
- export const AcceptanceStatusSchema = z.enum(ACCEPTANCE_STATUS_OPTIONS);
7
+ export const RIDE_ACCEPTANCE_STATUS_OPTIONS = ['justification_required', 'under_review', 'accepted', 'rejected'];
8
+ export const RideAcceptanceStatusSchema = z.enum(RIDE_ACCEPTANCE_STATUS_OPTIONS);
9
+ export const RideAcceptanceSchema = DocumentSchema.extend({
10
+ analysis_summary: z.record(RideAnalysisGradeSchema).nullable().default(null),
11
+ created_by: z.string().nullable().default(null),
12
+ mode: z.enum(['manual', 'auto']),
13
+ status: RideAcceptanceStatusSchema,
14
+ }).strict();
8
15
  /* * */
9
16
  export const RideJustificationSchema = z.object({
10
17
  comments: z.array(CommentSchema).default([]),
11
18
  file_ids: z.array(z.string()).default([]),
12
19
  pto_message: z.string().min(2).max(5000).default(''),
13
- updated_trip_id: z.string().min(2).max(100).nullable(),
14
20
  }).strict();
15
21
  /* * */
16
- export const RidePaymentSchema = z.object({
17
- acceptance_status: AcceptanceStatusSchema,
18
- comments: z.array(CommentSchema).default([]),
19
- file_ids: z.array(z.string()).default([]),
20
- pto_message: z.string().min(2).max(5000).default(''),
21
- updated_trip_id: z.string().min(2).max(100).nullable(),
22
+ export const RideOverridesSchema = z.object({
23
+ trip_id: z.string().nullable().default(null),
22
24
  }).strict();
23
25
  /* * */
24
26
  export const RideAnnotationSchema = DocumentSchema.extend({
25
- acceptance_status: AcceptanceStatusSchema,
26
- justification: RideJustificationSchema,
27
- payment: RidePaymentSchema,
27
+ acceptance: z.array(RideAcceptanceSchema).default([]),
28
+ is_locked: z.boolean().default(false),
29
+ justification: RideJustificationSchema.nullable().default(null),
30
+ overrides: RideOverridesSchema.nullable().default(null),
31
+ ride_id: z.string(),
28
32
  }).strict();
29
- /**
30
- * Uma ride-annotation é gerada 3 dias depois da hora prevista de conclusão.
31
- *
32
- */
33
- const rideAnnotation = {
34
- _id: 'some-id',
35
- _ride_id: '123',
36
- justification: {
37
- comments: [],
38
- file_ids: [],
39
- pto_message: '',
40
- updated_trip_id: null,
41
- },
42
- };