@tmlmobilidade/types 20250827.1706.15 → 20250827.2130.35
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.
package/dist/src/auth/user.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
|
|
2
2
|
import { type Permission } from './permission.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
export declare const UserPreferenceValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>;
|
|
5
|
+
export type UserPreferenceValue = z.infer<typeof UserPreferenceValueSchema>;
|
|
4
6
|
export declare const UserSchema: z.ZodObject<{
|
|
5
7
|
_id: z.ZodString;
|
|
6
8
|
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
@@ -28,7 +30,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
28
30
|
resource?: Record<string, any> | null | undefined;
|
|
29
31
|
}>, "many">;
|
|
30
32
|
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
-
preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.
|
|
33
|
+
preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
|
|
32
34
|
role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
33
35
|
session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
34
36
|
theme_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -60,7 +62,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
60
62
|
__brand: "UnixTimestamp";
|
|
61
63
|
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
62
64
|
password_hash?: string | null | undefined;
|
|
63
|
-
preferences?: Record<string, Record<string,
|
|
65
|
+
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
|
|
64
66
|
theme_id?: string | null | undefined;
|
|
65
67
|
}, {
|
|
66
68
|
_id: string;
|
|
@@ -80,7 +82,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
80
82
|
email_verified?: number | null | undefined;
|
|
81
83
|
organization_ids?: string[] | undefined;
|
|
82
84
|
password_hash?: string | null | undefined;
|
|
83
|
-
preferences?: Record<string, Record<string,
|
|
85
|
+
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
|
|
84
86
|
role_ids?: string[] | undefined;
|
|
85
87
|
session_ids?: string[] | undefined;
|
|
86
88
|
theme_id?: string | null | undefined;
|
|
@@ -113,7 +115,7 @@ export declare const CreateUserSchema: z.ZodObject<Omit<{
|
|
|
113
115
|
resource?: Record<string, any> | null | undefined;
|
|
114
116
|
}>, "many">;
|
|
115
117
|
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
-
preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.
|
|
118
|
+
preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
|
|
117
119
|
role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
118
120
|
session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
119
121
|
theme_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -138,7 +140,7 @@ export declare const CreateUserSchema: z.ZodObject<Omit<{
|
|
|
138
140
|
__brand: "UnixTimestamp";
|
|
139
141
|
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
140
142
|
password_hash?: string | null | undefined;
|
|
141
|
-
preferences?: Record<string, Record<string,
|
|
143
|
+
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
|
|
142
144
|
theme_id?: string | null | undefined;
|
|
143
145
|
}, {
|
|
144
146
|
email: string;
|
|
@@ -155,7 +157,7 @@ export declare const CreateUserSchema: z.ZodObject<Omit<{
|
|
|
155
157
|
email_verified?: number | null | undefined;
|
|
156
158
|
organization_ids?: string[] | undefined;
|
|
157
159
|
password_hash?: string | null | undefined;
|
|
158
|
-
preferences?: Record<string, Record<string,
|
|
160
|
+
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
|
|
159
161
|
role_ids?: string[] | undefined;
|
|
160
162
|
session_ids?: string[] | undefined;
|
|
161
163
|
theme_id?: string | null | undefined;
|
|
@@ -184,7 +186,7 @@ export declare const UpdateUserSchema: z.ZodObject<{
|
|
|
184
186
|
last_name: z.ZodOptional<z.ZodString>;
|
|
185
187
|
organization_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
186
188
|
password_hash: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
187
|
-
preferences: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.
|
|
189
|
+
preferences: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>>;
|
|
188
190
|
role_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
189
191
|
session_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
190
192
|
theme_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
@@ -206,7 +208,7 @@ export declare const UpdateUserSchema: z.ZodObject<{
|
|
|
206
208
|
last_name?: string | undefined;
|
|
207
209
|
organization_ids?: string[] | undefined;
|
|
208
210
|
password_hash?: string | null | undefined;
|
|
209
|
-
preferences?: Record<string, Record<string,
|
|
211
|
+
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
|
|
210
212
|
role_ids?: string[] | undefined;
|
|
211
213
|
session_ids?: string[] | undefined;
|
|
212
214
|
theme_id?: string | null | undefined;
|
|
@@ -226,7 +228,7 @@ export declare const UpdateUserSchema: z.ZodObject<{
|
|
|
226
228
|
last_name?: string | undefined;
|
|
227
229
|
organization_ids?: string[] | undefined;
|
|
228
230
|
password_hash?: string | null | undefined;
|
|
229
|
-
preferences?: Record<string, Record<string,
|
|
231
|
+
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
|
|
230
232
|
role_ids?: string[] | undefined;
|
|
231
233
|
session_ids?: string[] | undefined;
|
|
232
234
|
theme_id?: string | null | undefined;
|
package/dist/src/auth/user.js
CHANGED
|
@@ -4,6 +4,14 @@ import { validateUnixTimestamp } from '../_common/unix-timestamp.js';
|
|
|
4
4
|
import { PermissionSchema } from './permission.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
/* * */
|
|
7
|
+
export const UserPreferenceValueSchema = z.union([
|
|
8
|
+
z.string(),
|
|
9
|
+
z.number(),
|
|
10
|
+
z.boolean(),
|
|
11
|
+
z.array(z.string()),
|
|
12
|
+
z.array(z.number()),
|
|
13
|
+
]);
|
|
14
|
+
/* * */
|
|
7
15
|
export const UserSchema = DocumentSchema.extend({
|
|
8
16
|
avatar: z.string().nullish(),
|
|
9
17
|
bio: z.string().nullish(),
|
|
@@ -15,7 +23,7 @@ export const UserSchema = DocumentSchema.extend({
|
|
|
15
23
|
password_hash: z.string().nullish(),
|
|
16
24
|
permissions: z.array(PermissionSchema),
|
|
17
25
|
phone: z.string().nullish(),
|
|
18
|
-
preferences: z.record(z.record(
|
|
26
|
+
preferences: z.record(z.record(UserPreferenceValueSchema)).nullish(),
|
|
19
27
|
role_ids: z.array(z.string()).default([]),
|
|
20
28
|
session_ids: z.array(z.string()).default([]),
|
|
21
29
|
theme_id: z.string().nullish(),
|
|
@@ -23,27 +31,3 @@ export const UserSchema = DocumentSchema.extend({
|
|
|
23
31
|
}).strict();
|
|
24
32
|
export const CreateUserSchema = UserSchema.omit({ _id: true, created_at: true, updated_at: true });
|
|
25
33
|
export const UpdateUserSchema = CreateUserSchema.partial();
|
|
26
|
-
// const newUser: User = {
|
|
27
|
-
// _id: 'string',
|
|
28
|
-
// avatar: 'avatar.png',
|
|
29
|
-
// bio: 'This is a bio',
|
|
30
|
-
// created_at: 1 as UnixTimestamp,
|
|
31
|
-
// email: 'user@example.com',
|
|
32
|
-
// email_verified: null,
|
|
33
|
-
// first_name: 'First',
|
|
34
|
-
// last_name: 'Last',
|
|
35
|
-
// organization_ids: [],
|
|
36
|
-
// password_hash: 'hashed_password',
|
|
37
|
-
// permissions: [],
|
|
38
|
-
// phone: null,
|
|
39
|
-
// preferences: {
|
|
40
|
-
// theme: {
|
|
41
|
-
// darkMode: 'system',
|
|
42
|
-
// },
|
|
43
|
-
// },
|
|
44
|
-
// role_ids: [],
|
|
45
|
-
// session_ids: [],
|
|
46
|
-
// theme_id: null,
|
|
47
|
-
// updated_at: 1 as UnixTimestamp,
|
|
48
|
-
// verification_token_ids: [],
|
|
49
|
-
// };
|
|
@@ -0,0 +1,311 @@
|
|
|
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"]>;
|
|
4
|
+
export declare const RideJustificationSchema: z.ZodObject<{
|
|
5
|
+
comments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
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
|
+
_id: z.ZodString;
|
|
10
|
+
text: z.ZodString;
|
|
11
|
+
user_id: z.ZodString;
|
|
12
|
+
}, "strict", z.ZodTypeAny, {
|
|
13
|
+
_id: string;
|
|
14
|
+
text: string;
|
|
15
|
+
user_id: string;
|
|
16
|
+
created_at?: (number & {
|
|
17
|
+
__brand: "UnixTimestamp";
|
|
18
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
19
|
+
updated_at?: (number & {
|
|
20
|
+
__brand: "UnixTimestamp";
|
|
21
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
_id: string;
|
|
24
|
+
text: string;
|
|
25
|
+
user_id: string;
|
|
26
|
+
created_at?: number | null | undefined;
|
|
27
|
+
updated_at?: number | null | undefined;
|
|
28
|
+
}>, "many">>;
|
|
29
|
+
file_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
30
|
+
pto_message: z.ZodDefault<z.ZodString>;
|
|
31
|
+
updated_trip_id: z.ZodNullable<z.ZodString>;
|
|
32
|
+
}, "strict", z.ZodTypeAny, {
|
|
33
|
+
file_ids: string[];
|
|
34
|
+
comments: {
|
|
35
|
+
_id: string;
|
|
36
|
+
text: string;
|
|
37
|
+
user_id: string;
|
|
38
|
+
created_at?: (number & {
|
|
39
|
+
__brand: "UnixTimestamp";
|
|
40
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
41
|
+
updated_at?: (number & {
|
|
42
|
+
__brand: "UnixTimestamp";
|
|
43
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
44
|
+
}[];
|
|
45
|
+
pto_message: string;
|
|
46
|
+
updated_trip_id: string | null;
|
|
47
|
+
}, {
|
|
48
|
+
updated_trip_id: string | null;
|
|
49
|
+
file_ids?: string[] | undefined;
|
|
50
|
+
comments?: {
|
|
51
|
+
_id: string;
|
|
52
|
+
text: string;
|
|
53
|
+
user_id: string;
|
|
54
|
+
created_at?: number | null | undefined;
|
|
55
|
+
updated_at?: number | null | undefined;
|
|
56
|
+
}[] | undefined;
|
|
57
|
+
pto_message?: string | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
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<{
|
|
63
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
64
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
65
|
+
} & {
|
|
66
|
+
_id: z.ZodString;
|
|
67
|
+
text: z.ZodString;
|
|
68
|
+
user_id: z.ZodString;
|
|
69
|
+
}, "strict", z.ZodTypeAny, {
|
|
70
|
+
_id: string;
|
|
71
|
+
text: string;
|
|
72
|
+
user_id: string;
|
|
73
|
+
created_at?: (number & {
|
|
74
|
+
__brand: "UnixTimestamp";
|
|
75
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
76
|
+
updated_at?: (number & {
|
|
77
|
+
__brand: "UnixTimestamp";
|
|
78
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
_id: string;
|
|
81
|
+
text: string;
|
|
82
|
+
user_id: string;
|
|
83
|
+
created_at?: number | null | undefined;
|
|
84
|
+
updated_at?: number | null | undefined;
|
|
85
|
+
}>, "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<{
|
|
126
|
+
comments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
127
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
128
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
129
|
+
} & {
|
|
130
|
+
_id: z.ZodString;
|
|
131
|
+
text: z.ZodString;
|
|
132
|
+
user_id: z.ZodString;
|
|
133
|
+
}, "strict", z.ZodTypeAny, {
|
|
134
|
+
_id: string;
|
|
135
|
+
text: string;
|
|
136
|
+
user_id: string;
|
|
137
|
+
created_at?: (number & {
|
|
138
|
+
__brand: "UnixTimestamp";
|
|
139
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
140
|
+
updated_at?: (number & {
|
|
141
|
+
__brand: "UnixTimestamp";
|
|
142
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
_id: string;
|
|
145
|
+
text: string;
|
|
146
|
+
user_id: string;
|
|
147
|
+
created_at?: number | null | undefined;
|
|
148
|
+
updated_at?: number | null | undefined;
|
|
149
|
+
}>, "many">>;
|
|
150
|
+
file_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
151
|
+
pto_message: z.ZodDefault<z.ZodString>;
|
|
152
|
+
updated_trip_id: z.ZodNullable<z.ZodString>;
|
|
153
|
+
}, "strict", z.ZodTypeAny, {
|
|
154
|
+
file_ids: string[];
|
|
155
|
+
comments: {
|
|
156
|
+
_id: string;
|
|
157
|
+
text: string;
|
|
158
|
+
user_id: string;
|
|
159
|
+
created_at?: (number & {
|
|
160
|
+
__brand: "UnixTimestamp";
|
|
161
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
162
|
+
updated_at?: (number & {
|
|
163
|
+
__brand: "UnixTimestamp";
|
|
164
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
165
|
+
}[];
|
|
166
|
+
pto_message: string;
|
|
167
|
+
updated_trip_id: string | null;
|
|
168
|
+
}, {
|
|
169
|
+
updated_trip_id: string | null;
|
|
170
|
+
file_ids?: string[] | undefined;
|
|
171
|
+
comments?: {
|
|
172
|
+
_id: string;
|
|
173
|
+
text: string;
|
|
174
|
+
user_id: string;
|
|
175
|
+
created_at?: number | null | undefined;
|
|
176
|
+
updated_at?: number | null | undefined;
|
|
177
|
+
}[] | undefined;
|
|
178
|
+
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>;
|
|
209
|
+
}, "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";
|
|
225
|
+
}, {
|
|
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
|
+
}>;
|
|
238
|
+
}, "strict", z.ZodTypeAny, {
|
|
239
|
+
_id: string;
|
|
240
|
+
acceptance_status: "accepted" | "justification_required" | "under_review" | "rejected";
|
|
241
|
+
justification: {
|
|
242
|
+
file_ids: string[];
|
|
243
|
+
comments: {
|
|
244
|
+
_id: string;
|
|
245
|
+
text: string;
|
|
246
|
+
user_id: string;
|
|
247
|
+
created_at?: (number & {
|
|
248
|
+
__brand: "UnixTimestamp";
|
|
249
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
250
|
+
updated_at?: (number & {
|
|
251
|
+
__brand: "UnixTimestamp";
|
|
252
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
253
|
+
}[];
|
|
254
|
+
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
|
+
};
|
|
274
|
+
created_at?: (number & {
|
|
275
|
+
__brand: "UnixTimestamp";
|
|
276
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
277
|
+
updated_at?: (number & {
|
|
278
|
+
__brand: "UnixTimestamp";
|
|
279
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
280
|
+
}, {
|
|
281
|
+
_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";
|
|
298
|
+
file_ids?: string[] | undefined;
|
|
299
|
+
comments?: {
|
|
300
|
+
_id: string;
|
|
301
|
+
text: string;
|
|
302
|
+
user_id: string;
|
|
303
|
+
created_at?: number | null | undefined;
|
|
304
|
+
updated_at?: number | null | undefined;
|
|
305
|
+
}[] | undefined;
|
|
306
|
+
pto_message?: string | undefined;
|
|
307
|
+
};
|
|
308
|
+
created_at?: number | null | undefined;
|
|
309
|
+
updated_at?: number | null | undefined;
|
|
310
|
+
}>;
|
|
311
|
+
export type RideAnnotation = z.infer<typeof RideAnnotationSchema>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { CommentSchema } from '../_common/comment.js';
|
|
3
|
+
import { DocumentSchema } from '../_common/document.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/* * */
|
|
6
|
+
export const ACCEPTANCE_STATUS_OPTIONS = ['justification_required', 'under_review', 'accepted', 'rejected'];
|
|
7
|
+
export const AcceptanceStatusSchema = z.enum(ACCEPTANCE_STATUS_OPTIONS);
|
|
8
|
+
/* * */
|
|
9
|
+
export const RideJustificationSchema = z.object({
|
|
10
|
+
comments: z.array(CommentSchema).default([]),
|
|
11
|
+
file_ids: z.array(z.string()).default([]),
|
|
12
|
+
pto_message: z.string().min(2).max(5000).default(''),
|
|
13
|
+
updated_trip_id: z.string().min(2).max(100).nullable(),
|
|
14
|
+
}).strict();
|
|
15
|
+
/* * */
|
|
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
|
+
}).strict();
|
|
23
|
+
/* * */
|
|
24
|
+
export const RideAnnotationSchema = DocumentSchema.extend({
|
|
25
|
+
acceptance_status: AcceptanceStatusSchema,
|
|
26
|
+
justification: RideJustificationSchema,
|
|
27
|
+
payment: RidePaymentSchema,
|
|
28
|
+
}).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
|
+
};
|
|
@@ -261,7 +261,7 @@ export declare const SimplifiedApexValidationSchema: z.ZodObject<{
|
|
|
261
261
|
event_type: number;
|
|
262
262
|
product_id: string;
|
|
263
263
|
units_qty: number | null;
|
|
264
|
-
validation_status: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 |
|
|
264
|
+
validation_status: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 | 5 | 10 | 6 | 7 | 9 | 13;
|
|
265
265
|
created_at?: (number & {
|
|
266
266
|
__brand: "UnixTimestamp";
|
|
267
267
|
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
@@ -288,7 +288,7 @@ export declare const SimplifiedApexValidationSchema: z.ZodObject<{
|
|
|
288
288
|
event_type: number;
|
|
289
289
|
product_id: string;
|
|
290
290
|
units_qty: number | null;
|
|
291
|
-
validation_status: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 |
|
|
291
|
+
validation_status: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 | 5 | 10 | 6 | 7 | 9 | 13;
|
|
292
292
|
created_at?: number | null | undefined;
|
|
293
293
|
updated_at?: number | null | undefined;
|
|
294
294
|
}>;
|
|
@@ -414,7 +414,7 @@ export declare const UpdateSimplifiedApexValidationSchema: z.ZodObject<{
|
|
|
414
414
|
event_type?: number | undefined;
|
|
415
415
|
product_id?: string | undefined;
|
|
416
416
|
units_qty?: number | null | undefined;
|
|
417
|
-
validation_status?: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 |
|
|
417
|
+
validation_status?: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 | 5 | 10 | 6 | 7 | 9 | 13 | undefined;
|
|
418
418
|
}, {
|
|
419
419
|
_id?: string | undefined;
|
|
420
420
|
created_at?: number | null | undefined;
|
|
@@ -437,7 +437,7 @@ export declare const UpdateSimplifiedApexValidationSchema: z.ZodObject<{
|
|
|
437
437
|
event_type?: number | undefined;
|
|
438
438
|
product_id?: string | undefined;
|
|
439
439
|
units_qty?: number | null | undefined;
|
|
440
|
-
validation_status?: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 |
|
|
440
|
+
validation_status?: 0 | 1 | 2 | 3 | 12 | 11 | 4 | 8 | 5 | 10 | 6 | 7 | 9 | 13 | undefined;
|
|
441
441
|
}>;
|
|
442
442
|
/**
|
|
443
443
|
* APEX Validations are APEX transactions of type 11 that are generated when a card holder touches a validator
|
package/package.json
CHANGED