@tmlmobilidade/types 20250915.1051.20 → 20250915.1142.45

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,12 +1,11 @@
1
- import { type UnixTimestamp } from './unix-timestamp.js';
2
1
  import { z } from 'zod';
3
2
  export declare const CommentTypeSchema: z.ZodEnum<["statusChanged", "note", "system_info"]>;
4
3
  export type CommentType = z.infer<typeof CommentTypeSchema>;
5
4
  export declare const NoteCommentSchema: z.ZodObject<{
6
5
  _id: z.ZodString;
7
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
6
+ created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
8
7
  created_by: z.ZodOptional<z.ZodString>;
9
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
8
+ updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
10
9
  updated_by: z.ZodOptional<z.ZodString>;
11
10
  } & {
12
11
  message: z.ZodString;
@@ -34,8 +33,8 @@ export declare const NoteCommentSchema: z.ZodObject<{
34
33
  }>;
35
34
  export declare const SystemInfoCommentSchema: z.ZodObject<{
36
35
  _id: z.ZodString;
37
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
38
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
36
+ created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
37
+ updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
39
38
  } & {
40
39
  created_by: z.ZodLiteral<"system">;
41
40
  message: z.ZodString;
@@ -64,9 +63,9 @@ export declare const SystemInfoCommentSchema: z.ZodObject<{
64
63
  }>;
65
64
  export declare const StatusChangedCommentSchema: z.ZodObject<{
66
65
  _id: z.ZodString;
67
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
66
+ created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
68
67
  created_by: z.ZodOptional<z.ZodString>;
69
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
68
+ updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
70
69
  updated_by: z.ZodOptional<z.ZodString>;
71
70
  } & {
72
71
  curr_status: z.ZodString;
@@ -97,9 +96,9 @@ export declare const StatusChangedCommentSchema: z.ZodObject<{
97
96
  }>;
98
97
  export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
99
98
  _id: z.ZodString;
100
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
99
+ created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
101
100
  created_by: z.ZodOptional<z.ZodString>;
102
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
101
+ updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
103
102
  updated_by: z.ZodOptional<z.ZodString>;
104
103
  } & {
105
104
  message: z.ZodString;
@@ -126,8 +125,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
126
125
  updated_by?: string | undefined;
127
126
  }>, z.ZodObject<{
128
127
  _id: z.ZodString;
129
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
130
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
128
+ created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
129
+ updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
131
130
  } & {
132
131
  created_by: z.ZodLiteral<"system">;
133
132
  message: z.ZodString;
@@ -155,9 +154,9 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
155
154
  type: "system_info";
156
155
  }>, z.ZodObject<{
157
156
  _id: z.ZodString;
158
- created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
157
+ created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
159
158
  created_by: z.ZodOptional<z.ZodString>;
160
- updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
159
+ updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
161
160
  updated_by: z.ZodOptional<z.ZodString>;
162
161
  } & {
163
162
  curr_status: z.ZodString;
@@ -248,9 +247,6 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
248
247
  created_by?: string | undefined;
249
248
  updated_by?: string | undefined;
250
249
  }>;
251
- export interface Comment extends Omit<z.infer<typeof CommentSchema>, 'created_at' | 'updated_at'> {
252
- created_at: UnixTimestamp;
253
- updated_at: UnixTimestamp;
254
- }
255
- export type CreateCommentDto = Omit<z.infer<typeof CommentSchema>, 'created_at' | 'updated_at'>;
256
- export type UpdateCommentDto = Partial<Omit<CreateCommentDto, 'created_by'>>;
250
+ export type Comment = z.infer<typeof CommentSchema>;
251
+ export type CreateCommentDto = z.infer<typeof CommentSchema>;
252
+ export type UpdateCommentDto = Partial<CreateCommentDto>;
@@ -8,6 +8,222 @@ export type RideJustificationCause = z.infer<typeof RideJustificationCauseSchema
8
8
  export declare const RIDE_JUSTIFICATION_SOURCE_OPTIONS: readonly ["MANUAL", "REALTIME_ALERT"];
9
9
  export declare const RideJustificationSourceSchema: z.ZodEnum<["MANUAL", "REALTIME_ALERT"]>;
10
10
  export type RideJustificationSource = z.infer<typeof RideJustificationSourceSchema>;
11
+ declare const CommentSchemaWithRideJustificationStatus: z.ZodEffects<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
12
+ _id: z.ZodString;
13
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
14
+ created_by: z.ZodOptional<z.ZodString>;
15
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
16
+ updated_by: z.ZodOptional<z.ZodString>;
17
+ } & {
18
+ message: z.ZodString;
19
+ type: z.ZodLiteral<"note">;
20
+ }, "strip", z.ZodTypeAny, {
21
+ _id: string;
22
+ created_at: number & {
23
+ __brand: "UnixTimestamp";
24
+ };
25
+ updated_at: number & {
26
+ __brand: "UnixTimestamp";
27
+ };
28
+ message: string;
29
+ type: "note";
30
+ created_by?: string | undefined;
31
+ updated_by?: string | undefined;
32
+ }, {
33
+ _id: string;
34
+ created_at: number;
35
+ updated_at: number;
36
+ message: string;
37
+ type: "note";
38
+ created_by?: string | undefined;
39
+ updated_by?: string | undefined;
40
+ }>, z.ZodObject<{
41
+ _id: z.ZodString;
42
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
43
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
44
+ } & {
45
+ created_by: z.ZodLiteral<"system">;
46
+ message: z.ZodString;
47
+ type: z.ZodLiteral<"system_info">;
48
+ updated_by: z.ZodLiteral<"system">;
49
+ }, "strip", z.ZodTypeAny, {
50
+ _id: string;
51
+ created_at: number & {
52
+ __brand: "UnixTimestamp";
53
+ };
54
+ created_by: "system";
55
+ updated_at: number & {
56
+ __brand: "UnixTimestamp";
57
+ };
58
+ updated_by: "system";
59
+ message: string;
60
+ type: "system_info";
61
+ }, {
62
+ _id: string;
63
+ created_at: number;
64
+ created_by: "system";
65
+ updated_at: number;
66
+ updated_by: "system";
67
+ message: string;
68
+ type: "system_info";
69
+ }>, z.ZodObject<{
70
+ _id: z.ZodString;
71
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
72
+ created_by: z.ZodOptional<z.ZodString>;
73
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
74
+ updated_by: z.ZodOptional<z.ZodString>;
75
+ } & {
76
+ curr_status: z.ZodString;
77
+ prev_status: z.ZodString;
78
+ type: z.ZodLiteral<"statusChanged">;
79
+ }, "strip", z.ZodTypeAny, {
80
+ _id: string;
81
+ created_at: number & {
82
+ __brand: "UnixTimestamp";
83
+ };
84
+ updated_at: number & {
85
+ __brand: "UnixTimestamp";
86
+ };
87
+ type: "statusChanged";
88
+ curr_status: string;
89
+ prev_status: string;
90
+ created_by?: string | undefined;
91
+ updated_by?: string | undefined;
92
+ }, {
93
+ _id: string;
94
+ created_at: number;
95
+ updated_at: number;
96
+ type: "statusChanged";
97
+ curr_status: string;
98
+ prev_status: string;
99
+ created_by?: string | undefined;
100
+ updated_by?: string | undefined;
101
+ }>]>, {
102
+ _id: string;
103
+ created_at: number & {
104
+ __brand: "UnixTimestamp";
105
+ };
106
+ updated_at: number & {
107
+ __brand: "UnixTimestamp";
108
+ };
109
+ message: string;
110
+ type: "note";
111
+ created_by?: string | undefined;
112
+ updated_by?: string | undefined;
113
+ } | {
114
+ _id: string;
115
+ created_at: number & {
116
+ __brand: "UnixTimestamp";
117
+ };
118
+ created_by: "system";
119
+ updated_at: number & {
120
+ __brand: "UnixTimestamp";
121
+ };
122
+ updated_by: "system";
123
+ message: string;
124
+ type: "system_info";
125
+ } | {
126
+ _id: string;
127
+ created_at: number & {
128
+ __brand: "UnixTimestamp";
129
+ };
130
+ updated_at: number & {
131
+ __brand: "UnixTimestamp";
132
+ };
133
+ type: "statusChanged";
134
+ curr_status: string;
135
+ prev_status: string;
136
+ created_by?: string | undefined;
137
+ updated_by?: string | undefined;
138
+ }, {
139
+ _id: string;
140
+ created_at: number;
141
+ updated_at: number;
142
+ message: string;
143
+ type: "note";
144
+ created_by?: string | undefined;
145
+ updated_by?: string | undefined;
146
+ } | {
147
+ _id: string;
148
+ created_at: number;
149
+ created_by: "system";
150
+ updated_at: number;
151
+ updated_by: "system";
152
+ message: string;
153
+ type: "system_info";
154
+ } | {
155
+ _id: string;
156
+ created_at: number;
157
+ updated_at: number;
158
+ type: "statusChanged";
159
+ curr_status: string;
160
+ prev_status: string;
161
+ created_by?: string | undefined;
162
+ updated_by?: string | undefined;
163
+ }>, {
164
+ _id: string;
165
+ created_at: number & {
166
+ __brand: "UnixTimestamp";
167
+ };
168
+ updated_at: number & {
169
+ __brand: "UnixTimestamp";
170
+ };
171
+ message: string;
172
+ type: "note";
173
+ created_by?: string | undefined;
174
+ updated_by?: string | undefined;
175
+ } | {
176
+ _id: string;
177
+ created_at: number & {
178
+ __brand: "UnixTimestamp";
179
+ };
180
+ created_by: "system";
181
+ updated_at: number & {
182
+ __brand: "UnixTimestamp";
183
+ };
184
+ updated_by: "system";
185
+ message: string;
186
+ type: "system_info";
187
+ } | {
188
+ _id: string;
189
+ created_at: number & {
190
+ __brand: "UnixTimestamp";
191
+ };
192
+ updated_at: number & {
193
+ __brand: "UnixTimestamp";
194
+ };
195
+ type: "statusChanged";
196
+ curr_status: string;
197
+ prev_status: string;
198
+ created_by?: string | undefined;
199
+ updated_by?: string | undefined;
200
+ }, {
201
+ _id: string;
202
+ created_at: number;
203
+ updated_at: number;
204
+ message: string;
205
+ type: "note";
206
+ created_by?: string | undefined;
207
+ updated_by?: string | undefined;
208
+ } | {
209
+ _id: string;
210
+ created_at: number;
211
+ created_by: "system";
212
+ updated_at: number;
213
+ updated_by: "system";
214
+ message: string;
215
+ type: "system_info";
216
+ } | {
217
+ _id: string;
218
+ created_at: number;
219
+ updated_at: number;
220
+ type: "statusChanged";
221
+ curr_status: string;
222
+ prev_status: string;
223
+ created_by?: string | undefined;
224
+ updated_by?: string | undefined;
225
+ }>;
226
+ export type RideJustificationComment = z.infer<typeof CommentSchemaWithRideJustificationStatus>;
11
227
  export declare const RideJustificationSchema: z.ZodObject<{
12
228
  _id: z.ZodString;
13
229
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
@@ -244,6 +460,7 @@ export declare const RideJustificationSchema: z.ZodObject<{
244
460
  created_by?: string | undefined;
245
461
  updated_by?: string | undefined;
246
462
  }>, "many">>;
463
+ is_locked: z.ZodDefault<z.ZodBoolean>;
247
464
  justification_cause: z.ZodEnum<["TECHNICAL_PROBLEM", "DEMONSTRATION", "ACCIDENT", "WEATHER", "CONSTRUCTION", "POLICE_ACTIVITY", "MEDICAL_EMERGENCY", "OTHER_CAUSE"]>;
248
465
  justification_source: z.ZodEnum<["MANUAL", "REALTIME_ALERT"]>;
249
466
  pto_message: z.ZodDefault<z.ZodString>;
@@ -256,6 +473,7 @@ export declare const RideJustificationSchema: z.ZodObject<{
256
473
  updated_at: number & {
257
474
  __brand: "UnixTimestamp";
258
475
  };
476
+ is_locked: boolean;
259
477
  comments: ({
260
478
  _id: string;
261
479
  created_at: number & {
@@ -321,6 +539,7 @@ export declare const RideJustificationSchema: z.ZodObject<{
321
539
  trip_id: string;
322
540
  created_by?: string | undefined;
323
541
  updated_by?: string | undefined;
542
+ is_locked?: boolean | undefined;
324
543
  comments?: ({
325
544
  _id: string;
326
545
  created_at: number;
@@ -355,6 +574,7 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
355
574
  created_by: z.ZodOptional<z.ZodString>;
356
575
  updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
357
576
  updated_by: z.ZodOptional<z.ZodString>;
577
+ is_locked: z.ZodDefault<z.ZodBoolean>;
358
578
  comments: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
359
579
  _id: z.ZodString;
360
580
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
@@ -589,6 +809,7 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
589
809
  pto_message: z.ZodDefault<z.ZodString>;
590
810
  trip_id: z.ZodString;
591
811
  }, "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
812
+ is_locked: boolean;
592
813
  comments: ({
593
814
  _id: string;
594
815
  created_at: number & {
@@ -653,6 +874,7 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
653
874
  _id?: string | undefined;
654
875
  created_by?: string | undefined;
655
876
  updated_by?: string | undefined;
877
+ is_locked?: boolean | undefined;
656
878
  comments?: ({
657
879
  _id: string;
658
880
  created_at: number;
@@ -684,6 +906,7 @@ export declare const CreateRideJustificationSchema: z.ZodObject<Omit<{
684
906
  export declare const UpdateRideJustificationSchema: z.ZodObject<{
685
907
  _id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
686
908
  updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
909
+ is_locked: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
687
910
  comments: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
688
911
  _id: z.ZodString;
689
912
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
@@ -906,6 +1129,7 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
906
1129
  }, "strict", z.ZodTypeAny, {
907
1130
  _id?: string | undefined;
908
1131
  updated_by?: string | undefined;
1132
+ is_locked?: boolean | undefined;
909
1133
  comments?: ({
910
1134
  _id: string;
911
1135
  created_at: number & {
@@ -951,6 +1175,7 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
951
1175
  }, {
952
1176
  _id?: string | undefined;
953
1177
  updated_by?: string | undefined;
1178
+ is_locked?: boolean | undefined;
954
1179
  comments?: ({
955
1180
  _id: string;
956
1181
  created_at: number;
@@ -985,3 +1210,4 @@ export declare const UpdateRideJustificationSchema: z.ZodObject<{
985
1210
  export type RideJustification = z.infer<typeof RideJustificationSchema>;
986
1211
  export type CreateRideJustificationDto = z.infer<typeof CreateRideJustificationSchema>;
987
1212
  export type UpdateRideJustificationDto = z.infer<typeof UpdateRideJustificationSchema>;
1213
+ export {};
@@ -35,6 +35,7 @@ export const RideJustificationSchema = DocumentSchema.extend({
35
35
  acceptance_status: RideAcceptanceStatusSchema,
36
36
  analysis: RideAnalysisSchema,
37
37
  comments: z.array(CommentSchemaWithRideJustificationStatus).default([]),
38
+ is_locked: z.boolean().default(false),
38
39
  justification_cause: RideJustificationCauseSchema,
39
40
  justification_source: RideJustificationSourceSchema,
40
41
  pto_message: z.string().min(2).max(5000).default(''),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20250915.1051.20",
3
+ "version": "20250915.1142.45",
4
4
  "author": "João de Vasconcelos & Jusi Monteiro",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "homepage": "https://github.com/tmlmobilidade/services#readme",