vr-commons 1.0.187 → 1.0.188
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/constants/regex.constants.d.ts +2 -2
- package/dist/constants/regex.constants.js +6 -3
- package/dist/utils/admin/admin.devices.utils.d.ts +3 -5
- package/dist/utils/admin/admin.devices.utils.js +14 -11
- package/dist/validations/admin/admin.devicePayments.validations.d.ts +6 -6
- package/dist/validations/admin/admin.devicePayments.validations.js +2 -2
- package/dist/validations/admin/admin.devices.validations.d.ts +8 -8
- package/dist/validations/admin/admin.devices.validations.js +11 -8
- package/dist/validations/admin/admin.eventLogs.validations.d.ts +24 -24
- package/dist/validations/admin/admin.installments.validations.d.ts +4 -4
- package/dist/validations/admin/admin.pricings.validations.d.ts +8 -8
- package/dist/validations/admin/admin.products.validations.d.ts +12 -12
- package/dist/validations/admin/admin.users.validations.d.ts +50 -50
- package/dist/validations/shared/shared.account.validations.d.ts +10 -10
- package/dist/validations/shared/shared.appSpecs.validations.d.ts +54 -54
- package/dist/validations/shared/shared.auth.validations.d.ts +28 -28
- package/dist/validations/shared/shared.moderation.validations.d.ts +18 -18
- package/dist/validations/shared/shared.profiles.validations.d.ts +86 -86
- package/dist/validations/users/users.devicePaymentPlans.validations.d.ts +6 -6
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEVICE_SERIAL_PREFIXES, DEVICE_PAIR_ID_REGEX, DEVICE_PAIR_ID_SUFFIX_REGEX, DEVICE_SERIAL_NUMBER_REGEX } from "vr-models";
|
|
1
2
|
/** Shared regular expressions used across validation and utility modules. */
|
|
2
3
|
export declare const PHONE_NUMBER_REGEX: RegExp;
|
|
3
4
|
export declare const LOCAL_RWANDA_PHONE_NUMBER_REGEX: RegExp;
|
|
@@ -9,8 +10,7 @@ export declare const FOUR_DIGIT_PIN_REGEX: RegExp;
|
|
|
9
10
|
export declare const JACKET_ID_REGEX: RegExp;
|
|
10
11
|
export declare const PLATE_NUMBER_REGEX: RegExp;
|
|
11
12
|
export declare const RWANDA_PLATE_NUMBER_REGEX: RegExp;
|
|
12
|
-
export
|
|
13
|
-
export declare const DEVICE_PAIR_ID_REGEX: RegExp;
|
|
13
|
+
export { DEVICE_SERIAL_PREFIXES, DEVICE_SERIAL_NUMBER_REGEX, DEVICE_PAIR_ID_REGEX, DEVICE_PAIR_ID_SUFFIX_REGEX, };
|
|
14
14
|
export declare const ISO_DATE_REGEX: RegExp;
|
|
15
15
|
export declare const DAY_MONTH_YEAR_REGEX: RegExp;
|
|
16
16
|
export declare const DAY_MONTH_YEAR_SLASH_REGEX: RegExp;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BEARER_TOKEN_PREFIX_REGEX = exports.NUMERIC_STRING_REGEX = exports.ISO_DATE_SLASH_REGEX = exports.DAY_MONTH_YEAR_SLASH_REGEX = exports.DAY_MONTH_YEAR_REGEX = exports.ISO_DATE_REGEX = exports.DEVICE_PAIR_ID_REGEX = exports.DEVICE_SERIAL_NUMBER_REGEX = exports.RWANDA_PLATE_NUMBER_REGEX = exports.PLATE_NUMBER_REGEX = exports.JACKET_ID_REGEX = exports.FOUR_DIGIT_PIN_REGEX = exports.RIDER_PIN_REGEX = exports.STRONG_PASSWORD_REGEX = exports.PASSWORD_REGEX = exports.EMAIL_ADDRESS_REGEX = exports.LOCAL_RWANDA_PHONE_NUMBER_REGEX = exports.PHONE_NUMBER_REGEX = void 0;
|
|
3
|
+
exports.BEARER_TOKEN_PREFIX_REGEX = exports.NUMERIC_STRING_REGEX = exports.ISO_DATE_SLASH_REGEX = exports.DAY_MONTH_YEAR_SLASH_REGEX = exports.DAY_MONTH_YEAR_REGEX = exports.ISO_DATE_REGEX = exports.DEVICE_PAIR_ID_SUFFIX_REGEX = exports.DEVICE_PAIR_ID_REGEX = exports.DEVICE_SERIAL_NUMBER_REGEX = exports.DEVICE_SERIAL_PREFIXES = exports.RWANDA_PLATE_NUMBER_REGEX = exports.PLATE_NUMBER_REGEX = exports.JACKET_ID_REGEX = exports.FOUR_DIGIT_PIN_REGEX = exports.RIDER_PIN_REGEX = exports.STRONG_PASSWORD_REGEX = exports.PASSWORD_REGEX = exports.EMAIL_ADDRESS_REGEX = exports.LOCAL_RWANDA_PHONE_NUMBER_REGEX = exports.PHONE_NUMBER_REGEX = void 0;
|
|
4
|
+
const vr_models_1 = require("vr-models");
|
|
5
|
+
Object.defineProperty(exports, "DEVICE_SERIAL_PREFIXES", { enumerable: true, get: function () { return vr_models_1.DEVICE_SERIAL_PREFIXES; } });
|
|
6
|
+
Object.defineProperty(exports, "DEVICE_PAIR_ID_REGEX", { enumerable: true, get: function () { return vr_models_1.DEVICE_PAIR_ID_REGEX; } });
|
|
7
|
+
Object.defineProperty(exports, "DEVICE_PAIR_ID_SUFFIX_REGEX", { enumerable: true, get: function () { return vr_models_1.DEVICE_PAIR_ID_SUFFIX_REGEX; } });
|
|
8
|
+
Object.defineProperty(exports, "DEVICE_SERIAL_NUMBER_REGEX", { enumerable: true, get: function () { return vr_models_1.DEVICE_SERIAL_NUMBER_REGEX; } });
|
|
4
9
|
/** Shared regular expressions used across validation and utility modules. */
|
|
5
10
|
exports.PHONE_NUMBER_REGEX = /^\+250(78|79|73|72)[0-9]{7}$/;
|
|
6
11
|
exports.LOCAL_RWANDA_PHONE_NUMBER_REGEX = /^(078|079|072|073)\d{7}$/;
|
|
@@ -14,8 +19,6 @@ exports.JACKET_ID_REGEX = /^JKT-\d{9}$/;
|
|
|
14
19
|
// centralized until the product requirements choose one canonical plate format.
|
|
15
20
|
exports.PLATE_NUMBER_REGEX = /^[A-Z0-9]{3,10}$/i;
|
|
16
21
|
exports.RWANDA_PLATE_NUMBER_REGEX = /^R[ABCDEFGHIJKLMNPQRSTUVWXYZ]\s?\d{3}\s?[ABCDEFGHIJKLMNPQRSTUVWXYZ]$/;
|
|
17
|
-
exports.DEVICE_SERIAL_NUMBER_REGEX = /^(VBRD|VIBERIDE)-(PASSENGER|RIDER)-([A-Z]{2}\d{3}[A-Z])$/;
|
|
18
|
-
exports.DEVICE_PAIR_ID_REGEX = /^[A-NP-Z]{2}[0-9]{3}[A-NP-Z]{1}$/;
|
|
19
22
|
exports.ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
20
23
|
exports.DAY_MONTH_YEAR_REGEX = /^\d{2}-\d{2}-\d{4}$/;
|
|
21
24
|
exports.DAY_MONTH_YEAR_SLASH_REGEX = /^\d{2}\/\d{2}\/\d{4}$/;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Device, UserRole } from "vr-models";
|
|
2
|
+
import type { DeviceSerialPrefix, DeviceSerialRole } from "vr-models";
|
|
2
3
|
import { Transaction } from "sequelize";
|
|
3
4
|
import { DeviceResetOptions, DeviceResetResult, StockChangeResult } from "../shared/shared.types";
|
|
4
5
|
export declare const stockUtil: {
|
|
@@ -56,11 +57,8 @@ export declare const stockUtil: {
|
|
|
56
57
|
transaction?: Transaction;
|
|
57
58
|
actorId?: string;
|
|
58
59
|
}): Promise<StockChangeResult>;
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
* Format: VIBERIDE-{RIDER|PASSENGER}-{pairId}
|
|
62
|
-
*/
|
|
63
|
-
generateSerialNumber(pairId: string, dedication: string): string;
|
|
60
|
+
/** Generate a device serial from a raw suffix or namespaced pair ID. */
|
|
61
|
+
generateSerialNumber(pairId: string, dedication: DeviceSerialRole, serialPrefix?: DeviceSerialPrefix): string;
|
|
64
62
|
/**
|
|
65
63
|
* Validate pair ID format
|
|
66
64
|
* No letter 'O' to avoid confusion with 0
|
|
@@ -14,11 +14,8 @@ const isValidUUID = (str) => {
|
|
|
14
14
|
* Extract dedication from serial number
|
|
15
15
|
*/
|
|
16
16
|
const extractDedicationFromSerial = (serialNumber) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (serialNumber.includes("PASSENGER"))
|
|
20
|
-
return "PASSENGER";
|
|
21
|
-
return "N/A";
|
|
17
|
+
const match = vr_models_1.SERIAL_PATTERN.exec(serialNumber);
|
|
18
|
+
return match ? match[2] : "N/A";
|
|
22
19
|
};
|
|
23
20
|
// ==================== HELPER FUNCTIONS ====================
|
|
24
21
|
function buildWhereClause(condition) {
|
|
@@ -393,12 +390,18 @@ exports.stockUtil = {
|
|
|
393
390
|
actorType: actorType,
|
|
394
391
|
});
|
|
395
392
|
},
|
|
396
|
-
/**
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
393
|
+
/** Generate a device serial from a raw suffix or namespaced pair ID. */
|
|
394
|
+
generateSerialNumber(pairId, dedication, serialPrefix = "VIBERIDE") {
|
|
395
|
+
const pairMatch = vr_models_1.PAIR_ID_PATTERN.exec(pairId);
|
|
396
|
+
if (!pairMatch) {
|
|
397
|
+
throw new Error(`Invalid pair ID format: ${pairId}`);
|
|
398
|
+
}
|
|
399
|
+
const resolvedPrefix = (pairMatch[1] || serialPrefix);
|
|
400
|
+
const serialNumber = `${resolvedPrefix}-${dedication}-${pairMatch[2]}`;
|
|
401
|
+
if (!vr_models_1.SERIAL_PATTERN.test(serialNumber)) {
|
|
402
|
+
throw new Error(`Invalid device serial format: ${serialNumber}`);
|
|
403
|
+
}
|
|
404
|
+
return serialNumber;
|
|
402
405
|
},
|
|
403
406
|
/**
|
|
404
407
|
* Validate pair ID format
|
|
@@ -45,17 +45,17 @@ export declare const listPlansSchema: z.ZodObject<{
|
|
|
45
45
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
46
46
|
isOverdue?: "true" | "false" | undefined;
|
|
47
47
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
48
|
-
sortOrder?: "
|
|
48
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
49
49
|
deviceId?: string | undefined;
|
|
50
50
|
}, {
|
|
51
51
|
search?: string | undefined;
|
|
52
52
|
limit?: string | undefined;
|
|
53
53
|
userId?: string | undefined;
|
|
54
|
+
page?: string | undefined;
|
|
54
55
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
55
56
|
isOverdue?: "true" | "false" | undefined;
|
|
56
|
-
page?: string | undefined;
|
|
57
57
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
58
|
-
sortOrder?: "
|
|
58
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
59
59
|
deviceId?: string | undefined;
|
|
60
60
|
}>;
|
|
61
61
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -67,7 +67,7 @@ export declare const listPlansSchema: z.ZodObject<{
|
|
|
67
67
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
68
68
|
isOverdue?: "true" | "false" | undefined;
|
|
69
69
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
70
|
-
sortOrder?: "
|
|
70
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
71
71
|
deviceId?: string | undefined;
|
|
72
72
|
};
|
|
73
73
|
}, {
|
|
@@ -75,11 +75,11 @@ export declare const listPlansSchema: z.ZodObject<{
|
|
|
75
75
|
search?: string | undefined;
|
|
76
76
|
limit?: string | undefined;
|
|
77
77
|
userId?: string | undefined;
|
|
78
|
+
page?: string | undefined;
|
|
78
79
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
79
80
|
isOverdue?: "true" | "false" | undefined;
|
|
80
|
-
page?: string | undefined;
|
|
81
81
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
82
|
-
sortOrder?: "
|
|
82
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
83
83
|
deviceId?: string | undefined;
|
|
84
84
|
};
|
|
85
85
|
}>;
|
|
@@ -61,10 +61,10 @@ exports.replacePlanDevicesSchema = zod_1.z.object({
|
|
|
61
61
|
id: zod_1.z.string().uuid("Invalid payment plan ID"),
|
|
62
62
|
}),
|
|
63
63
|
body: zod_1.z.object({
|
|
64
|
-
replacementPrefix: zod_1.z.enum(
|
|
64
|
+
replacementPrefix: zod_1.z.enum(vr_models_1.DEVICE_SERIAL_PREFIXES),
|
|
65
65
|
replacementPairID: zod_1.z
|
|
66
66
|
.string()
|
|
67
|
-
.regex(regex_constants_1.
|
|
67
|
+
.regex(regex_constants_1.DEVICE_PAIR_ID_SUFFIX_REGEX, "Invalid pair ID format"),
|
|
68
68
|
}),
|
|
69
69
|
});
|
|
70
70
|
// ==================== UPDATE ====================
|
|
@@ -68,22 +68,22 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
68
68
|
}, "strip", z.ZodTypeAny, {
|
|
69
69
|
search?: string | undefined;
|
|
70
70
|
limit?: number | undefined;
|
|
71
|
+
page?: number | undefined;
|
|
71
72
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
72
73
|
productId?: string | undefined;
|
|
73
|
-
page?: number | undefined;
|
|
74
74
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
75
|
-
sortOrder?: "
|
|
75
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
76
76
|
dedicatedUser?: "RIDER" | "PASSENGER" | "N/A" | undefined;
|
|
77
77
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
78
78
|
isAssigned?: "true" | "false" | undefined;
|
|
79
79
|
}, {
|
|
80
80
|
search?: string | undefined;
|
|
81
81
|
limit?: string | undefined;
|
|
82
|
+
page?: string | undefined;
|
|
82
83
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
83
84
|
productId?: string | undefined;
|
|
84
|
-
page?: string | undefined;
|
|
85
85
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
86
|
-
sortOrder?: "
|
|
86
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
87
87
|
dedicatedUser?: "RIDER" | "PASSENGER" | "N/A" | undefined;
|
|
88
88
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
89
89
|
isAssigned?: "true" | "false" | undefined;
|
|
@@ -92,11 +92,11 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
92
92
|
query: {
|
|
93
93
|
search?: string | undefined;
|
|
94
94
|
limit?: number | undefined;
|
|
95
|
+
page?: number | undefined;
|
|
95
96
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
96
97
|
productId?: string | undefined;
|
|
97
|
-
page?: number | undefined;
|
|
98
98
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
99
|
-
sortOrder?: "
|
|
99
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
100
100
|
dedicatedUser?: "RIDER" | "PASSENGER" | "N/A" | undefined;
|
|
101
101
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
102
102
|
isAssigned?: "true" | "false" | undefined;
|
|
@@ -105,11 +105,11 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
105
105
|
query: {
|
|
106
106
|
search?: string | undefined;
|
|
107
107
|
limit?: string | undefined;
|
|
108
|
+
page?: string | undefined;
|
|
108
109
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
109
110
|
productId?: string | undefined;
|
|
110
|
-
page?: string | undefined;
|
|
111
111
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
112
|
-
sortOrder?: "
|
|
112
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
113
113
|
dedicatedUser?: "RIDER" | "PASSENGER" | "N/A" | undefined;
|
|
114
114
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
115
115
|
isAssigned?: "true" | "false" | undefined;
|
|
@@ -4,11 +4,14 @@ exports.customDeviceResetSchema = exports.triggerDeviceResetSchema = exports.che
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const vr_models_1 = require("vr-models");
|
|
6
6
|
const regex_constants_1 = require("../../constants/regex.constants");
|
|
7
|
-
//
|
|
8
|
-
// Example: AA001A, AB123B, XZ999Z
|
|
9
|
-
// No letter 'O' to avoid confusion with 0
|
|
7
|
+
// Supports both the raw registration suffix and the persisted namespaced key.
|
|
10
8
|
exports.PAIR_ID_REGEX = regex_constants_1.DEVICE_PAIR_ID_REGEX;
|
|
11
|
-
const PAIR_ID_ERROR = "Pair ID must be
|
|
9
|
+
const PAIR_ID_ERROR = "Pair ID must be a six-character suffix or a namespaced ID such as VBRD-AA001A or VIBERIDE-AA001A";
|
|
10
|
+
const PAIR_ID_SUFFIX_ERROR = "Pair ID suffix must be 6 characters: 2 letters (excluding O) + 3 digits + 1 letter (excluding O). Example: AA001A";
|
|
11
|
+
const pairIdFilterSchema = zod_1.z.union([
|
|
12
|
+
zod_1.z.string().regex(exports.PAIR_ID_REGEX, PAIR_ID_ERROR),
|
|
13
|
+
zod_1.z.array(zod_1.z.string().regex(exports.PAIR_ID_REGEX, PAIR_ID_ERROR)),
|
|
14
|
+
]);
|
|
12
15
|
// ✅ Helper to remove duplicates and return unique pair IDs
|
|
13
16
|
const deduplicatePairIds = (pairIds) => {
|
|
14
17
|
return [...new Set(pairIds)];
|
|
@@ -21,10 +24,10 @@ exports.createDevicePairsSchema = zod_1.z.object({
|
|
|
21
24
|
.object({
|
|
22
25
|
productId: zod_1.z.string().uuid("Invalid product ID"),
|
|
23
26
|
pairIds: zod_1.z
|
|
24
|
-
.array(zod_1.z.string().regex(
|
|
27
|
+
.array(zod_1.z.string().regex(regex_constants_1.DEVICE_PAIR_ID_SUFFIX_REGEX, PAIR_ID_SUFFIX_ERROR))
|
|
25
28
|
.min(1, "At least one pair ID required")
|
|
26
29
|
.max(100, "Cannot create more than 100 pairs at once"),
|
|
27
|
-
serialPrefix: zod_1.z.enum(
|
|
30
|
+
serialPrefix: zod_1.z.enum(vr_models_1.DEVICE_SERIAL_PREFIXES).default("VIBERIDE"),
|
|
28
31
|
})
|
|
29
32
|
.transform((data) => {
|
|
30
33
|
// ✅ Remove duplicates and keep unique pair IDs
|
|
@@ -169,8 +172,8 @@ exports.customDeviceResetSchema = zod_1.z.object({
|
|
|
169
172
|
status: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
170
173
|
excludeStatus: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
171
174
|
isPermanentlyUnlocked: zod_1.z.boolean().optional(),
|
|
172
|
-
pairId:
|
|
173
|
-
excludePairIds:
|
|
175
|
+
pairId: pairIdFilterSchema.optional(),
|
|
176
|
+
excludePairIds: pairIdFilterSchema.optional(),
|
|
174
177
|
productId: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
175
178
|
dedicatedUser: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
176
179
|
createdBefore: zod_1.z.string().datetime().optional(),
|
|
@@ -20,19 +20,19 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
20
20
|
}, "strip", z.ZodTypeAny, {
|
|
21
21
|
limit: number;
|
|
22
22
|
page: number;
|
|
23
|
-
sortBy: "createdAt" | "
|
|
24
|
-
sortOrder: "
|
|
23
|
+
sortBy: "createdAt" | "action" | "entity" | "actorType";
|
|
24
|
+
sortOrder: "ASC" | "DESC";
|
|
25
25
|
hasDeviceSession: boolean;
|
|
26
26
|
search?: string | undefined;
|
|
27
27
|
firstName?: string | undefined;
|
|
28
28
|
lastName?: string | undefined;
|
|
29
|
-
|
|
30
|
-
toDate?: string | undefined;
|
|
31
|
-
actorType?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
29
|
+
entityId?: string | undefined;
|
|
32
30
|
actorId?: string | undefined;
|
|
33
31
|
action?: string | undefined;
|
|
34
32
|
entity?: string | undefined;
|
|
35
|
-
|
|
33
|
+
fromDate?: string | undefined;
|
|
34
|
+
toDate?: string | undefined;
|
|
35
|
+
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
36
36
|
actorName?: string | undefined;
|
|
37
37
|
}, {
|
|
38
38
|
search?: string | undefined;
|
|
@@ -40,15 +40,15 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
40
40
|
firstName?: string | undefined;
|
|
41
41
|
lastName?: string | undefined;
|
|
42
42
|
page?: string | undefined;
|
|
43
|
-
|
|
44
|
-
fromDate?: string | undefined;
|
|
45
|
-
toDate?: string | undefined;
|
|
46
|
-
sortOrder?: "DESC" | "ASC" | undefined;
|
|
47
|
-
actorType?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
43
|
+
entityId?: string | undefined;
|
|
48
44
|
actorId?: string | undefined;
|
|
49
45
|
action?: string | undefined;
|
|
50
46
|
entity?: string | undefined;
|
|
51
|
-
|
|
47
|
+
sortBy?: "createdAt" | "action" | "entity" | "actorType" | undefined;
|
|
48
|
+
fromDate?: string | undefined;
|
|
49
|
+
toDate?: string | undefined;
|
|
50
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
51
|
+
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
52
52
|
actorName?: string | undefined;
|
|
53
53
|
hasDeviceSession?: string | undefined;
|
|
54
54
|
}>, any, {
|
|
@@ -57,15 +57,15 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
57
57
|
firstName?: string | undefined;
|
|
58
58
|
lastName?: string | undefined;
|
|
59
59
|
page?: string | undefined;
|
|
60
|
-
|
|
61
|
-
fromDate?: string | undefined;
|
|
62
|
-
toDate?: string | undefined;
|
|
63
|
-
sortOrder?: "DESC" | "ASC" | undefined;
|
|
64
|
-
actorType?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
60
|
+
entityId?: string | undefined;
|
|
65
61
|
actorId?: string | undefined;
|
|
66
62
|
action?: string | undefined;
|
|
67
63
|
entity?: string | undefined;
|
|
68
|
-
|
|
64
|
+
sortBy?: "createdAt" | "action" | "entity" | "actorType" | undefined;
|
|
65
|
+
fromDate?: string | undefined;
|
|
66
|
+
toDate?: string | undefined;
|
|
67
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
68
|
+
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
69
69
|
actorName?: string | undefined;
|
|
70
70
|
hasDeviceSession?: string | undefined;
|
|
71
71
|
}>;
|
|
@@ -78,15 +78,15 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
78
78
|
firstName?: string | undefined;
|
|
79
79
|
lastName?: string | undefined;
|
|
80
80
|
page?: string | undefined;
|
|
81
|
-
|
|
82
|
-
fromDate?: string | undefined;
|
|
83
|
-
toDate?: string | undefined;
|
|
84
|
-
sortOrder?: "DESC" | "ASC" | undefined;
|
|
85
|
-
actorType?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
81
|
+
entityId?: string | undefined;
|
|
86
82
|
actorId?: string | undefined;
|
|
87
83
|
action?: string | undefined;
|
|
88
84
|
entity?: string | undefined;
|
|
89
|
-
|
|
85
|
+
sortBy?: "createdAt" | "action" | "entity" | "actorType" | undefined;
|
|
86
|
+
fromDate?: string | undefined;
|
|
87
|
+
toDate?: string | undefined;
|
|
88
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
89
|
+
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
90
90
|
actorName?: string | undefined;
|
|
91
91
|
hasDeviceSession?: string | undefined;
|
|
92
92
|
};
|
|
@@ -7,27 +7,27 @@ export declare const getInstallmentsSchema: z.ZodObject<{
|
|
|
7
7
|
limit: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
limit?: number | undefined;
|
|
10
|
-
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
11
10
|
page?: number | undefined;
|
|
11
|
+
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
12
12
|
planId?: string | undefined;
|
|
13
13
|
}, {
|
|
14
14
|
limit?: string | undefined;
|
|
15
|
-
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
16
15
|
page?: string | undefined;
|
|
16
|
+
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
17
17
|
planId?: string | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
20
|
query: {
|
|
21
21
|
limit?: number | undefined;
|
|
22
|
-
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
23
22
|
page?: number | undefined;
|
|
23
|
+
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
24
24
|
planId?: string | undefined;
|
|
25
25
|
};
|
|
26
26
|
}, {
|
|
27
27
|
query: {
|
|
28
28
|
limit?: string | undefined;
|
|
29
|
-
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
30
29
|
page?: string | undefined;
|
|
30
|
+
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
31
31
|
planId?: string | undefined;
|
|
32
32
|
};
|
|
33
33
|
}>;
|
|
@@ -249,10 +249,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
249
249
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
250
250
|
limit?: number | undefined;
|
|
251
251
|
isActive?: "true" | "false" | undefined;
|
|
252
|
-
productId?: string | undefined;
|
|
253
252
|
page?: number | undefined;
|
|
253
|
+
productId?: string | undefined;
|
|
254
254
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
255
|
-
sortOrder?: "
|
|
255
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
256
256
|
minAmount?: number | undefined;
|
|
257
257
|
maxAmount?: number | undefined;
|
|
258
258
|
}, {
|
|
@@ -260,10 +260,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
260
260
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
261
261
|
limit?: string | undefined;
|
|
262
262
|
isActive?: "true" | "false" | undefined;
|
|
263
|
-
productId?: string | undefined;
|
|
264
263
|
page?: string | undefined;
|
|
264
|
+
productId?: string | undefined;
|
|
265
265
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
266
|
-
sortOrder?: "
|
|
266
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
267
267
|
minAmount?: string | undefined;
|
|
268
268
|
maxAmount?: string | undefined;
|
|
269
269
|
}>;
|
|
@@ -273,10 +273,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
273
273
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
274
274
|
limit?: number | undefined;
|
|
275
275
|
isActive?: "true" | "false" | undefined;
|
|
276
|
-
productId?: string | undefined;
|
|
277
276
|
page?: number | undefined;
|
|
277
|
+
productId?: string | undefined;
|
|
278
278
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
279
|
-
sortOrder?: "
|
|
279
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
280
280
|
minAmount?: number | undefined;
|
|
281
281
|
maxAmount?: number | undefined;
|
|
282
282
|
};
|
|
@@ -286,10 +286,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
286
286
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
287
287
|
limit?: string | undefined;
|
|
288
288
|
isActive?: "true" | "false" | undefined;
|
|
289
|
-
productId?: string | undefined;
|
|
290
289
|
page?: string | undefined;
|
|
290
|
+
productId?: string | undefined;
|
|
291
291
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
292
|
-
sortOrder?: "
|
|
292
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
293
293
|
minAmount?: string | undefined;
|
|
294
294
|
maxAmount?: string | undefined;
|
|
295
295
|
};
|
|
@@ -40,20 +40,20 @@ export declare const updateProductSchema: z.ZodObject<{
|
|
|
40
40
|
stock: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
41
41
|
isActive: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
isActive?: boolean | undefined;
|
|
44
43
|
description?: string | null | undefined;
|
|
44
|
+
isActive?: boolean | undefined;
|
|
45
45
|
name?: string | undefined;
|
|
46
46
|
stock?: number | undefined;
|
|
47
47
|
}, {
|
|
48
|
-
isActive?: unknown;
|
|
49
48
|
description?: unknown;
|
|
49
|
+
isActive?: unknown;
|
|
50
50
|
name?: unknown;
|
|
51
51
|
stock?: unknown;
|
|
52
52
|
}>;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
54
|
body: {
|
|
55
|
-
isActive?: boolean | undefined;
|
|
56
55
|
description?: string | null | undefined;
|
|
56
|
+
isActive?: boolean | undefined;
|
|
57
57
|
name?: string | undefined;
|
|
58
58
|
stock?: number | undefined;
|
|
59
59
|
};
|
|
@@ -62,8 +62,8 @@ export declare const updateProductSchema: z.ZodObject<{
|
|
|
62
62
|
};
|
|
63
63
|
}, {
|
|
64
64
|
body: {
|
|
65
|
-
isActive?: unknown;
|
|
66
65
|
description?: unknown;
|
|
66
|
+
isActive?: unknown;
|
|
67
67
|
name?: unknown;
|
|
68
68
|
stock?: unknown;
|
|
69
69
|
};
|
|
@@ -103,7 +103,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
103
103
|
isActive?: "true" | "false" | undefined;
|
|
104
104
|
page?: number | undefined;
|
|
105
105
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
106
|
-
sortOrder?: "
|
|
106
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
107
107
|
minStock?: number | undefined;
|
|
108
108
|
}, {
|
|
109
109
|
search?: string | undefined;
|
|
@@ -111,7 +111,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
111
111
|
isActive?: "true" | "false" | undefined;
|
|
112
112
|
page?: string | undefined;
|
|
113
113
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
114
|
-
sortOrder?: "
|
|
114
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
115
115
|
minStock?: string | undefined;
|
|
116
116
|
}>;
|
|
117
117
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -121,7 +121,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
121
121
|
isActive?: "true" | "false" | undefined;
|
|
122
122
|
page?: number | undefined;
|
|
123
123
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
124
|
-
sortOrder?: "
|
|
124
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
125
125
|
minStock?: number | undefined;
|
|
126
126
|
};
|
|
127
127
|
}, {
|
|
@@ -131,7 +131,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
131
131
|
isActive?: "true" | "false" | undefined;
|
|
132
132
|
page?: string | undefined;
|
|
133
133
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
134
|
-
sortOrder?: "
|
|
134
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
135
135
|
minStock?: string | undefined;
|
|
136
136
|
};
|
|
137
137
|
}>;
|
|
@@ -199,15 +199,15 @@ export declare const updateStockSchema: z.ZodObject<{
|
|
|
199
199
|
amount: z.ZodNumber;
|
|
200
200
|
}, "strip", z.ZodTypeAny, {
|
|
201
201
|
amount: number;
|
|
202
|
-
operation: "
|
|
202
|
+
operation: "set" | "increment" | "decrement";
|
|
203
203
|
}, {
|
|
204
204
|
amount: number;
|
|
205
|
-
operation: "
|
|
205
|
+
operation: "set" | "increment" | "decrement";
|
|
206
206
|
}>;
|
|
207
207
|
}, "strip", z.ZodTypeAny, {
|
|
208
208
|
body: {
|
|
209
209
|
amount: number;
|
|
210
|
-
operation: "
|
|
210
|
+
operation: "set" | "increment" | "decrement";
|
|
211
211
|
};
|
|
212
212
|
params: {
|
|
213
213
|
id: string;
|
|
@@ -215,7 +215,7 @@ export declare const updateStockSchema: z.ZodObject<{
|
|
|
215
215
|
}, {
|
|
216
216
|
body: {
|
|
217
217
|
amount: number;
|
|
218
|
-
operation: "
|
|
218
|
+
operation: "set" | "increment" | "decrement";
|
|
219
219
|
};
|
|
220
220
|
params: {
|
|
221
221
|
id: string;
|