vr-commons 1.0.96 → 1.0.98
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/utils/admin.device.utils.d.ts +59 -0
- package/dist/utils/admin.device.utils.js +231 -0
- package/dist/utils/admin.devicePayment.utils.d.ts +46 -0
- package/dist/utils/admin.devicePayment.utils.js +206 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +5 -1
- package/dist/utils/types.d.ts +7 -0
- package/dist/validations/admin.devicePayment.validations.d.ts +270 -0
- package/dist/validations/admin.devicePayment.validations.js +98 -0
- package/dist/validations/admin.devices.validations.d.ts +297 -0
- package/dist/validations/admin.devices.validations.js +118 -0
- package/dist/validations/appSpecs.validations.d.ts +16 -16
- package/dist/validations/appeals.validations.d.ts +8 -8
- package/dist/validations/auth.validations.d.ts +2 -2
- package/dist/validations/bans.validations.d.ts +8 -8
- package/dist/validations/devicePaymentPlan.validations.d.ts +12 -12
- package/dist/validations/index.d.ts +2 -0
- package/dist/validations/index.js +22 -1
- package/dist/validations/moderation.validations.d.ts +105 -105
- package/dist/validations/payinstallment.validations.d.ts +5 -5
- package/dist/validations/pricing.validations.d.ts +313 -0
- package/dist/validations/pricing.validations.js +376 -0
- package/dist/validations/pricings.validations.d.ts +54 -54
- package/dist/validations/product.validations.d.ts +42 -42
- package/dist/validations/profiles.validations.d.ts +46 -46
- package/dist/validations/suspensions.validations.d.ts +8 -8
- package/dist/validations/users.admin.validations.d.ts +44 -44
- package/package.json +1 -1
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const createPlanSchema: z.ZodObject<{
|
|
3
|
+
body: z.ZodObject<{
|
|
4
|
+
userId: z.ZodString;
|
|
5
|
+
deviceIds: z.ZodArray<z.ZodString, "many">;
|
|
6
|
+
pricingId: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
userId: string;
|
|
9
|
+
deviceIds: string[];
|
|
10
|
+
pricingId: string;
|
|
11
|
+
}, {
|
|
12
|
+
userId: string;
|
|
13
|
+
deviceIds: string[];
|
|
14
|
+
pricingId: string;
|
|
15
|
+
}>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
body: {
|
|
18
|
+
userId: string;
|
|
19
|
+
deviceIds: string[];
|
|
20
|
+
pricingId: string;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
body: {
|
|
24
|
+
userId: string;
|
|
25
|
+
deviceIds: string[];
|
|
26
|
+
pricingId: string;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export declare const listPlansSchema: z.ZodObject<{
|
|
30
|
+
query: z.ZodObject<{
|
|
31
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>>;
|
|
32
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>>;
|
|
33
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
status: z.ZodOptional<z.ZodEnum<["PENDING", "SUCCESSFUL", "FAILED"]>>;
|
|
36
|
+
isOverdue: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
|
|
37
|
+
search: z.ZodOptional<z.ZodString>;
|
|
38
|
+
sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "updatedAt", "nextInstallmentDueAt", "paidAmount", "outstandingAmount"]>>;
|
|
39
|
+
sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
limit: number;
|
|
42
|
+
page: number;
|
|
43
|
+
search?: string | undefined;
|
|
44
|
+
userId?: string | undefined;
|
|
45
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
46
|
+
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
47
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
48
|
+
deviceId?: string | undefined;
|
|
49
|
+
isOverdue?: "true" | "false" | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
search?: string | undefined;
|
|
52
|
+
limit?: string | undefined;
|
|
53
|
+
userId?: string | undefined;
|
|
54
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
55
|
+
page?: string | undefined;
|
|
56
|
+
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
57
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
58
|
+
deviceId?: string | undefined;
|
|
59
|
+
isOverdue?: "true" | "false" | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
query: {
|
|
63
|
+
limit: number;
|
|
64
|
+
page: number;
|
|
65
|
+
search?: string | undefined;
|
|
66
|
+
userId?: string | undefined;
|
|
67
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
68
|
+
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
69
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
70
|
+
deviceId?: string | undefined;
|
|
71
|
+
isOverdue?: "true" | "false" | undefined;
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
query: {
|
|
75
|
+
search?: string | undefined;
|
|
76
|
+
limit?: string | undefined;
|
|
77
|
+
userId?: string | undefined;
|
|
78
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
79
|
+
page?: string | undefined;
|
|
80
|
+
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
81
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
82
|
+
deviceId?: string | undefined;
|
|
83
|
+
isOverdue?: "true" | "false" | undefined;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
export declare const getPlanSchema: z.ZodObject<{
|
|
87
|
+
params: z.ZodObject<{
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
id: string;
|
|
91
|
+
}, {
|
|
92
|
+
id: string;
|
|
93
|
+
}>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
params: {
|
|
96
|
+
id: string;
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
params: {
|
|
100
|
+
id: string;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
103
|
+
export declare const getUserPlansSchema: z.ZodObject<{
|
|
104
|
+
params: z.ZodObject<{
|
|
105
|
+
userId: z.ZodString;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
userId: string;
|
|
108
|
+
}, {
|
|
109
|
+
userId: string;
|
|
110
|
+
}>;
|
|
111
|
+
query: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
status: z.ZodOptional<z.ZodEnum<["PENDING", "SUCCESSFUL", "FAILED"]>>;
|
|
113
|
+
includeCompleted: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
116
|
+
includeCompleted?: "true" | "false" | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
119
|
+
includeCompleted?: "true" | "false" | undefined;
|
|
120
|
+
}>>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
params: {
|
|
123
|
+
userId: string;
|
|
124
|
+
};
|
|
125
|
+
query?: {
|
|
126
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
127
|
+
includeCompleted?: "true" | "false" | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
params: {
|
|
131
|
+
userId: string;
|
|
132
|
+
};
|
|
133
|
+
query?: {
|
|
134
|
+
status?: "PENDING" | "SUCCESSFUL" | "FAILED" | undefined;
|
|
135
|
+
includeCompleted?: "true" | "false" | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
}>;
|
|
138
|
+
export declare const getDevicePlanSchema: z.ZodObject<{
|
|
139
|
+
params: z.ZodObject<{
|
|
140
|
+
deviceId: z.ZodString;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
deviceId: string;
|
|
143
|
+
}, {
|
|
144
|
+
deviceId: string;
|
|
145
|
+
}>;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
params: {
|
|
148
|
+
deviceId: string;
|
|
149
|
+
};
|
|
150
|
+
}, {
|
|
151
|
+
params: {
|
|
152
|
+
deviceId: string;
|
|
153
|
+
};
|
|
154
|
+
}>;
|
|
155
|
+
export declare const limitedUpdateSchema: z.ZodObject<{
|
|
156
|
+
params: z.ZodObject<{
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
id: string;
|
|
160
|
+
}, {
|
|
161
|
+
id: string;
|
|
162
|
+
}>;
|
|
163
|
+
body: z.ZodEffects<z.ZodObject<{
|
|
164
|
+
pricingId: z.ZodOptional<z.ZodString>;
|
|
165
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
userId?: string | undefined;
|
|
168
|
+
pricingId?: string | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
userId?: string | undefined;
|
|
171
|
+
pricingId?: string | undefined;
|
|
172
|
+
}>, {
|
|
173
|
+
userId?: string | undefined;
|
|
174
|
+
pricingId?: string | undefined;
|
|
175
|
+
}, {
|
|
176
|
+
userId?: string | undefined;
|
|
177
|
+
pricingId?: string | undefined;
|
|
178
|
+
}>;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
body: {
|
|
181
|
+
userId?: string | undefined;
|
|
182
|
+
pricingId?: string | undefined;
|
|
183
|
+
};
|
|
184
|
+
params: {
|
|
185
|
+
id: string;
|
|
186
|
+
};
|
|
187
|
+
}, {
|
|
188
|
+
body: {
|
|
189
|
+
userId?: string | undefined;
|
|
190
|
+
pricingId?: string | undefined;
|
|
191
|
+
};
|
|
192
|
+
params: {
|
|
193
|
+
id: string;
|
|
194
|
+
};
|
|
195
|
+
}>;
|
|
196
|
+
export declare const recordPaymentSchema: z.ZodObject<{
|
|
197
|
+
params: z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
id: string;
|
|
201
|
+
}, {
|
|
202
|
+
id: string;
|
|
203
|
+
}>;
|
|
204
|
+
body: z.ZodObject<{
|
|
205
|
+
amount: z.ZodNumber;
|
|
206
|
+
provider: z.ZodEnum<["mtn_momo", "airtel_money"]>;
|
|
207
|
+
providerReference: z.ZodOptional<z.ZodString>;
|
|
208
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
amount: number;
|
|
211
|
+
provider: "mtn_momo" | "airtel_money";
|
|
212
|
+
metadata?: Record<string, any> | undefined;
|
|
213
|
+
providerReference?: string | undefined;
|
|
214
|
+
}, {
|
|
215
|
+
amount: number;
|
|
216
|
+
provider: "mtn_momo" | "airtel_money";
|
|
217
|
+
metadata?: Record<string, any> | undefined;
|
|
218
|
+
providerReference?: string | undefined;
|
|
219
|
+
}>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
body: {
|
|
222
|
+
amount: number;
|
|
223
|
+
provider: "mtn_momo" | "airtel_money";
|
|
224
|
+
metadata?: Record<string, any> | undefined;
|
|
225
|
+
providerReference?: string | undefined;
|
|
226
|
+
};
|
|
227
|
+
params: {
|
|
228
|
+
id: string;
|
|
229
|
+
};
|
|
230
|
+
}, {
|
|
231
|
+
body: {
|
|
232
|
+
amount: number;
|
|
233
|
+
provider: "mtn_momo" | "airtel_money";
|
|
234
|
+
metadata?: Record<string, any> | undefined;
|
|
235
|
+
providerReference?: string | undefined;
|
|
236
|
+
};
|
|
237
|
+
params: {
|
|
238
|
+
id: string;
|
|
239
|
+
};
|
|
240
|
+
}>;
|
|
241
|
+
export declare const deletePlanSchema: z.ZodObject<{
|
|
242
|
+
params: z.ZodObject<{
|
|
243
|
+
id: z.ZodString;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
id: string;
|
|
246
|
+
}, {
|
|
247
|
+
id: string;
|
|
248
|
+
}>;
|
|
249
|
+
body: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
reason?: string | undefined;
|
|
253
|
+
}, {
|
|
254
|
+
reason?: string | undefined;
|
|
255
|
+
}>>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
params: {
|
|
258
|
+
id: string;
|
|
259
|
+
};
|
|
260
|
+
body?: {
|
|
261
|
+
reason?: string | undefined;
|
|
262
|
+
} | undefined;
|
|
263
|
+
}, {
|
|
264
|
+
params: {
|
|
265
|
+
id: string;
|
|
266
|
+
};
|
|
267
|
+
body?: {
|
|
268
|
+
reason?: string | undefined;
|
|
269
|
+
} | undefined;
|
|
270
|
+
}>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deletePlanSchema = exports.recordPaymentSchema = exports.limitedUpdateSchema = exports.getDevicePlanSchema = exports.getUserPlansSchema = exports.getPlanSchema = exports.listPlansSchema = exports.createPlanSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const vr_models_1 = require("vr-models");
|
|
6
|
+
// ==================== CREATE ====================
|
|
7
|
+
exports.createPlanSchema = zod_1.z.object({
|
|
8
|
+
body: zod_1.z.object({
|
|
9
|
+
userId: zod_1.z.string().uuid("Invalid user ID"),
|
|
10
|
+
deviceIds: zod_1.z
|
|
11
|
+
.array(zod_1.z.string().uuid("Invalid device ID"))
|
|
12
|
+
.min(1, "At least one device required")
|
|
13
|
+
.max(10, "Maximum 10 devices per plan"),
|
|
14
|
+
pricingId: zod_1.z.string().uuid("Invalid pricing ID"),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
// ==================== READ ====================
|
|
18
|
+
exports.listPlansSchema = zod_1.z.object({
|
|
19
|
+
query: zod_1.z.object({
|
|
20
|
+
page: zod_1.z.string().regex(/^\d+$/).transform(Number).optional().default("1"),
|
|
21
|
+
limit: zod_1.z.string().regex(/^\d+$/).transform(Number).optional().default("20"),
|
|
22
|
+
userId: zod_1.z.string().uuid().optional(),
|
|
23
|
+
deviceId: zod_1.z.string().uuid().optional(),
|
|
24
|
+
status: zod_1.z.enum(vr_models_1.PAYMENT_STATUS).optional(),
|
|
25
|
+
isOverdue: zod_1.z.enum(["true", "false"]).optional(),
|
|
26
|
+
search: zod_1.z.string().optional(),
|
|
27
|
+
sortBy: zod_1.z
|
|
28
|
+
.enum([
|
|
29
|
+
"createdAt",
|
|
30
|
+
"updatedAt",
|
|
31
|
+
"nextInstallmentDueAt",
|
|
32
|
+
"paidAmount",
|
|
33
|
+
"outstandingAmount",
|
|
34
|
+
])
|
|
35
|
+
.optional(),
|
|
36
|
+
sortOrder: zod_1.z.enum(["ASC", "DESC"]).optional(),
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
exports.getPlanSchema = zod_1.z.object({
|
|
40
|
+
params: zod_1.z.object({
|
|
41
|
+
id: zod_1.z.string().uuid("Invalid plan ID"),
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
44
|
+
exports.getUserPlansSchema = zod_1.z.object({
|
|
45
|
+
params: zod_1.z.object({
|
|
46
|
+
userId: zod_1.z.string().uuid("Invalid user ID"),
|
|
47
|
+
}),
|
|
48
|
+
query: zod_1.z
|
|
49
|
+
.object({
|
|
50
|
+
status: zod_1.z.enum(vr_models_1.PAYMENT_STATUS).optional(),
|
|
51
|
+
includeCompleted: zod_1.z.enum(["true", "false"]).optional(),
|
|
52
|
+
})
|
|
53
|
+
.optional(),
|
|
54
|
+
});
|
|
55
|
+
exports.getDevicePlanSchema = zod_1.z.object({
|
|
56
|
+
params: zod_1.z.object({
|
|
57
|
+
deviceId: zod_1.z.string().uuid("Invalid device ID"),
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
// ==================== UPDATE ====================
|
|
61
|
+
// validations/operations.validation.ts
|
|
62
|
+
exports.limitedUpdateSchema = zod_1.z.object({
|
|
63
|
+
params: zod_1.z.object({
|
|
64
|
+
id: zod_1.z.string().uuid("Invalid plan ID"),
|
|
65
|
+
}),
|
|
66
|
+
body: zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
// Can update pricing before any payments
|
|
69
|
+
pricingId: zod_1.z.string().uuid("Invalid pricing ID").optional(),
|
|
70
|
+
// Can reassign to different user before any payments
|
|
71
|
+
userId: zod_1.z.string().uuid("Invalid user ID").optional(),
|
|
72
|
+
})
|
|
73
|
+
.refine((data) => Object.keys(data).length > 0, {
|
|
74
|
+
message: "At least one field to update is required",
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
77
|
+
exports.recordPaymentSchema = zod_1.z.object({
|
|
78
|
+
params: zod_1.z.object({
|
|
79
|
+
id: zod_1.z.string().uuid("Invalid plan ID"),
|
|
80
|
+
}),
|
|
81
|
+
body: zod_1.z.object({
|
|
82
|
+
amount: zod_1.z.number().positive("Payment amount must be positive"),
|
|
83
|
+
provider: zod_1.z.enum(vr_models_1.PAYMENT_PROVIDER),
|
|
84
|
+
providerReference: zod_1.z.string().optional(),
|
|
85
|
+
metadata: zod_1.z.record(zod_1.z.any()).optional(),
|
|
86
|
+
}),
|
|
87
|
+
});
|
|
88
|
+
// ==================== DELETE ====================
|
|
89
|
+
exports.deletePlanSchema = zod_1.z.object({
|
|
90
|
+
params: zod_1.z.object({
|
|
91
|
+
id: zod_1.z.string().uuid("Invalid plan ID"),
|
|
92
|
+
}),
|
|
93
|
+
body: zod_1.z
|
|
94
|
+
.object({
|
|
95
|
+
reason: zod_1.z.string().max(500).optional(),
|
|
96
|
+
})
|
|
97
|
+
.optional(),
|
|
98
|
+
});
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const createDeviceSchema: z.ZodObject<{
|
|
3
|
+
body: z.ZodObject<{
|
|
4
|
+
serialNumber: z.ZodString;
|
|
5
|
+
productId: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
serialNumber: string;
|
|
8
|
+
productId: string;
|
|
9
|
+
}, {
|
|
10
|
+
serialNumber: string;
|
|
11
|
+
productId: string;
|
|
12
|
+
}>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
body: {
|
|
15
|
+
serialNumber: string;
|
|
16
|
+
productId: string;
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
body: {
|
|
20
|
+
serialNumber: string;
|
|
21
|
+
productId: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
export declare const bulkCreateDevicesSchema: z.ZodObject<{
|
|
25
|
+
body: z.ZodObject<{
|
|
26
|
+
productId: z.ZodString;
|
|
27
|
+
serialNumbers: z.ZodArray<z.ZodString, "many">;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
productId: string;
|
|
30
|
+
serialNumbers: string[];
|
|
31
|
+
}, {
|
|
32
|
+
productId: string;
|
|
33
|
+
serialNumbers: string[];
|
|
34
|
+
}>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
body: {
|
|
37
|
+
productId: string;
|
|
38
|
+
serialNumbers: string[];
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
body: {
|
|
42
|
+
productId: string;
|
|
43
|
+
serialNumbers: string[];
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
export declare const updateDeviceSchema: z.ZodObject<{
|
|
47
|
+
params: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, {
|
|
52
|
+
id: string;
|
|
53
|
+
}>;
|
|
54
|
+
body: z.ZodObject<{
|
|
55
|
+
serialNumber: z.ZodOptional<z.ZodString>;
|
|
56
|
+
status: z.ZodOptional<z.ZodEnum<["locked", "unlocked", "disabled"]>>;
|
|
57
|
+
dedicatedUser: z.ZodOptional<z.ZodNullable<z.ZodEnum<["PASSENGER", "RIDER", "N/A"]>>>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
60
|
+
serialNumber?: string | undefined;
|
|
61
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
64
|
+
serialNumber?: string | undefined;
|
|
65
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
params: {
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
71
|
+
body: {
|
|
72
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
73
|
+
serialNumber?: string | undefined;
|
|
74
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
|
|
75
|
+
};
|
|
76
|
+
}, {
|
|
77
|
+
params: {
|
|
78
|
+
id: string;
|
|
79
|
+
};
|
|
80
|
+
body: {
|
|
81
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
82
|
+
serialNumber?: string | undefined;
|
|
83
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
export declare const getDeviceSchema: z.ZodObject<{
|
|
87
|
+
params: z.ZodObject<{
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
id: string;
|
|
91
|
+
}, {
|
|
92
|
+
id: string;
|
|
93
|
+
}>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
params: {
|
|
96
|
+
id: string;
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
params: {
|
|
100
|
+
id: string;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
103
|
+
export declare const getDevicesSchema: z.ZodObject<{
|
|
104
|
+
query: z.ZodObject<{
|
|
105
|
+
page: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
106
|
+
limit: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
107
|
+
productId: z.ZodOptional<z.ZodString>;
|
|
108
|
+
status: z.ZodOptional<z.ZodEnum<["locked", "unlocked", "disabled"]>>;
|
|
109
|
+
dedicatedUser: z.ZodOptional<z.ZodEnum<["PASSENGER", "RIDER", "N/A"]>>;
|
|
110
|
+
isPermanentlyUnlocked: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
|
|
111
|
+
isAssigned: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
|
|
112
|
+
search: z.ZodOptional<z.ZodString>;
|
|
113
|
+
sortBy: z.ZodOptional<z.ZodEnum<["serialNumber", "status", "createdAt", "updatedAt"]>>;
|
|
114
|
+
sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
117
|
+
productId?: string | undefined;
|
|
118
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
119
|
+
page?: number | undefined;
|
|
120
|
+
limit?: number | undefined;
|
|
121
|
+
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
122
|
+
isAssigned?: "true" | "false" | undefined;
|
|
123
|
+
search?: string | undefined;
|
|
124
|
+
sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
|
|
125
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
126
|
+
}, {
|
|
127
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
128
|
+
productId?: string | undefined;
|
|
129
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
130
|
+
page?: string | undefined;
|
|
131
|
+
limit?: string | undefined;
|
|
132
|
+
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
133
|
+
isAssigned?: "true" | "false" | undefined;
|
|
134
|
+
search?: string | undefined;
|
|
135
|
+
sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
|
|
136
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
137
|
+
}>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
query: {
|
|
140
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
141
|
+
productId?: string | undefined;
|
|
142
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
143
|
+
page?: number | undefined;
|
|
144
|
+
limit?: number | undefined;
|
|
145
|
+
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
146
|
+
isAssigned?: "true" | "false" | undefined;
|
|
147
|
+
search?: string | undefined;
|
|
148
|
+
sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
|
|
149
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
150
|
+
};
|
|
151
|
+
}, {
|
|
152
|
+
query: {
|
|
153
|
+
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
154
|
+
productId?: string | undefined;
|
|
155
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
156
|
+
page?: string | undefined;
|
|
157
|
+
limit?: string | undefined;
|
|
158
|
+
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
159
|
+
isAssigned?: "true" | "false" | undefined;
|
|
160
|
+
search?: string | undefined;
|
|
161
|
+
sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
|
|
162
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
163
|
+
};
|
|
164
|
+
}>;
|
|
165
|
+
export declare const deleteDeviceSchema: z.ZodObject<{
|
|
166
|
+
params: z.ZodObject<{
|
|
167
|
+
id: z.ZodString;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
id: string;
|
|
170
|
+
}, {
|
|
171
|
+
id: string;
|
|
172
|
+
}>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
params: {
|
|
175
|
+
id: string;
|
|
176
|
+
};
|
|
177
|
+
}, {
|
|
178
|
+
params: {
|
|
179
|
+
id: string;
|
|
180
|
+
};
|
|
181
|
+
}>;
|
|
182
|
+
export declare const adminLockDeviceSchema: z.ZodObject<{
|
|
183
|
+
params: z.ZodObject<{
|
|
184
|
+
id: z.ZodString;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
id: string;
|
|
187
|
+
}, {
|
|
188
|
+
id: string;
|
|
189
|
+
}>;
|
|
190
|
+
body: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
reason?: string | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
reason?: string | undefined;
|
|
196
|
+
}>>;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
params: {
|
|
199
|
+
id: string;
|
|
200
|
+
};
|
|
201
|
+
body?: {
|
|
202
|
+
reason?: string | undefined;
|
|
203
|
+
} | undefined;
|
|
204
|
+
}, {
|
|
205
|
+
params: {
|
|
206
|
+
id: string;
|
|
207
|
+
};
|
|
208
|
+
body?: {
|
|
209
|
+
reason?: string | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
}>;
|
|
212
|
+
export declare const adminUnlockDeviceSchema: z.ZodObject<{
|
|
213
|
+
params: z.ZodObject<{
|
|
214
|
+
id: z.ZodString;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
id: string;
|
|
217
|
+
}, {
|
|
218
|
+
id: string;
|
|
219
|
+
}>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
params: {
|
|
222
|
+
id: string;
|
|
223
|
+
};
|
|
224
|
+
}, {
|
|
225
|
+
params: {
|
|
226
|
+
id: string;
|
|
227
|
+
};
|
|
228
|
+
}>;
|
|
229
|
+
export declare const disableDeviceSchema: z.ZodObject<{
|
|
230
|
+
params: z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
id: string;
|
|
234
|
+
}, {
|
|
235
|
+
id: string;
|
|
236
|
+
}>;
|
|
237
|
+
body: z.ZodObject<{
|
|
238
|
+
reason: z.ZodString;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
reason: string;
|
|
241
|
+
}, {
|
|
242
|
+
reason: string;
|
|
243
|
+
}>;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
params: {
|
|
246
|
+
id: string;
|
|
247
|
+
};
|
|
248
|
+
body: {
|
|
249
|
+
reason: string;
|
|
250
|
+
};
|
|
251
|
+
}, {
|
|
252
|
+
params: {
|
|
253
|
+
id: string;
|
|
254
|
+
};
|
|
255
|
+
body: {
|
|
256
|
+
reason: string;
|
|
257
|
+
};
|
|
258
|
+
}>;
|
|
259
|
+
export declare const makePermanentSchema: z.ZodObject<{
|
|
260
|
+
params: z.ZodObject<{
|
|
261
|
+
id: z.ZodString;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
id: string;
|
|
264
|
+
}, {
|
|
265
|
+
id: string;
|
|
266
|
+
}>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
params: {
|
|
269
|
+
id: string;
|
|
270
|
+
};
|
|
271
|
+
}, {
|
|
272
|
+
params: {
|
|
273
|
+
id: string;
|
|
274
|
+
};
|
|
275
|
+
}>;
|
|
276
|
+
export declare const checkAvailabilitySchema: z.ZodObject<{
|
|
277
|
+
query: z.ZodObject<{
|
|
278
|
+
productId: z.ZodString;
|
|
279
|
+
quantity: z.ZodEffects<z.ZodEnum<["1", "2"]>, number, "1" | "2">;
|
|
280
|
+
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
productId: string;
|
|
282
|
+
quantity: number;
|
|
283
|
+
}, {
|
|
284
|
+
productId: string;
|
|
285
|
+
quantity: "1" | "2";
|
|
286
|
+
}>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
query: {
|
|
289
|
+
productId: string;
|
|
290
|
+
quantity: number;
|
|
291
|
+
};
|
|
292
|
+
}, {
|
|
293
|
+
query: {
|
|
294
|
+
productId: string;
|
|
295
|
+
quantity: "1" | "2";
|
|
296
|
+
};
|
|
297
|
+
}>;
|