vr-commons 1.0.155 → 1.0.156

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.
@@ -15,3 +15,4 @@ export { DPP_OperationsUtil } from "./admin.devicePayment.utils";
15
15
  export { PendingRegistration, VerificationMethod, ConfirmResponse, UploadResult, StockChangeResult, } from "./types";
16
16
  export { formatDeviceSession, formatEventLog, formatEventLogs, buildEventLogWhereClause, buildSearchConditions, buildUserSearchConditions, } from "./eventlogs.admin.utils";
17
17
  export { extractDedicatedUserFromSerial } from "./deviceUtils";
18
+ export { logApi, logAuth, logCronjob, logDebug, logDevice, logError, logInfo, logPayment, logSecurity, logSystem, logWarning, } from "./systemLog.utils";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateContactValue = exports.detectContactType = exports.sendVerificationCode = exports.sendSMS = exports.sendEmail = exports.getVerificationMethod = exports.getOTPExpiry = exports.generateOTP = exports.createDeviceSession = exports.suspensionUtil = exports.banUtil = exports.hasHigherAuthority = exports.getModeratableRoles = exports.canModerateUser = exports.canModerate = exports.softDeleteUser = exports.hashPassword = exports.validatePassword = exports.validateUniqueFields = exports.generateJacketId = exports.getSortOrder = exports.generateEventSearchConditions = exports.generateUserSearchConditions = exports.findSecurityClearanceByRole = exports.getUsersByRole = exports.getUserById = exports.isAccountAccessible = exports.canModifyAccount = exports.hasAllPermissions = exports.hasAnyPermission = exports.hasPermission = exports.hasRole = exports.formatUserListResponse = exports.formatUserProfile = exports.sendErrorResponse = exports.sendSuccessResponse = exports.logEvent = exports.formatTimeRemaining = exports.getTokenTimeRemaining = exports.generateToken = exports.shouldRefreshToken = exports.verifyToken = exports.generateRiderToken = exports.generatePassengerToken = exports.generateAdminToken = exports.checkSuspensionStatus = exports.checkIsUserBannedOrSuspended = exports.checkBanStatus = exports.hasActiveDependencies = exports.checkAccountDependencies = void 0;
4
- exports.extractDedicatedUserFromSerial = exports.buildUserSearchConditions = exports.buildSearchConditions = exports.buildEventLogWhereClause = exports.formatEventLogs = exports.formatEventLog = exports.formatDeviceSession = exports.DPP_OperationsUtil = exports.cloudinaryUtil = exports.stockUtil = exports.hierarchicalView = exports.validateHierarchy = exports.isSuperiorOrEqual = exports.isSuperior = exports.isSubordinateOrEqual = exports.isSubordinate = exports.isRankEqual = exports.getUserLevel = void 0;
4
+ exports.logWarning = exports.logSystem = exports.logSecurity = exports.logPayment = exports.logInfo = exports.logError = exports.logDevice = exports.logDebug = exports.logCronjob = exports.logAuth = exports.logApi = exports.extractDedicatedUserFromSerial = exports.buildUserSearchConditions = exports.buildSearchConditions = exports.buildEventLogWhereClause = exports.formatEventLogs = exports.formatEventLog = exports.formatDeviceSession = exports.DPP_OperationsUtil = exports.cloudinaryUtil = exports.stockUtil = exports.hierarchicalView = exports.validateHierarchy = exports.isSuperiorOrEqual = exports.isSuperior = exports.isSubordinateOrEqual = exports.isSubordinate = exports.isRankEqual = exports.getUserLevel = void 0;
5
5
  var account_utils_1 = require("./account.utils");
6
6
  Object.defineProperty(exports, "checkAccountDependencies", { enumerable: true, get: function () { return account_utils_1.checkAccountDependencies; } });
7
7
  Object.defineProperty(exports, "hasActiveDependencies", { enumerable: true, get: function () { return account_utils_1.hasActiveDependencies; } });
@@ -93,3 +93,15 @@ Object.defineProperty(exports, "buildSearchConditions", { enumerable: true, get:
93
93
  Object.defineProperty(exports, "buildUserSearchConditions", { enumerable: true, get: function () { return eventlogs_admin_utils_1.buildUserSearchConditions; } });
94
94
  var deviceUtils_1 = require("./deviceUtils");
95
95
  Object.defineProperty(exports, "extractDedicatedUserFromSerial", { enumerable: true, get: function () { return deviceUtils_1.extractDedicatedUserFromSerial; } });
96
+ var systemLog_utils_1 = require("./systemLog.utils");
97
+ Object.defineProperty(exports, "logApi", { enumerable: true, get: function () { return systemLog_utils_1.logApi; } });
98
+ Object.defineProperty(exports, "logAuth", { enumerable: true, get: function () { return systemLog_utils_1.logAuth; } });
99
+ Object.defineProperty(exports, "logCronjob", { enumerable: true, get: function () { return systemLog_utils_1.logCronjob; } });
100
+ Object.defineProperty(exports, "logDebug", { enumerable: true, get: function () { return systemLog_utils_1.logDebug; } });
101
+ Object.defineProperty(exports, "logDevice", { enumerable: true, get: function () { return systemLog_utils_1.logDevice; } });
102
+ Object.defineProperty(exports, "logError", { enumerable: true, get: function () { return systemLog_utils_1.logError; } });
103
+ Object.defineProperty(exports, "logInfo", { enumerable: true, get: function () { return systemLog_utils_1.logInfo; } });
104
+ Object.defineProperty(exports, "logPayment", { enumerable: true, get: function () { return systemLog_utils_1.logPayment; } });
105
+ Object.defineProperty(exports, "logSecurity", { enumerable: true, get: function () { return systemLog_utils_1.logSecurity; } });
106
+ Object.defineProperty(exports, "logSystem", { enumerable: true, get: function () { return systemLog_utils_1.logSystem; } });
107
+ Object.defineProperty(exports, "logWarning", { enumerable: true, get: function () { return systemLog_utils_1.logWarning; } });
@@ -0,0 +1,60 @@
1
+ import { LogLevel, LogCategory, UserRole } from "vr-models";
2
+ import { Transaction } from "sequelize";
3
+ export interface SystemLogInput {
4
+ level?: LogLevel;
5
+ category?: LogCategory;
6
+ message: string;
7
+ details?: Record<string, any> | null;
8
+ source?: string | null;
9
+ userId?: string | null;
10
+ userRole?: UserRole | null;
11
+ ipAddress?: string | null;
12
+ userAgent?: string | null;
13
+ timestamp?: Date;
14
+ transaction?: Transaction;
15
+ }
16
+ /**
17
+ * Create a system log entry
18
+ * Uses the static methods from SystemLog model
19
+ */
20
+ export declare const logSystem: ({ level, category, message, details, source, userId, userRole, ipAddress, userAgent, timestamp, transaction, }: SystemLogInput) => Promise<void>;
21
+ /**
22
+ * Log an error
23
+ */
24
+ export declare const logError: (message: string, options?: Omit<SystemLogInput, "level" | "message">) => Promise<void>;
25
+ /**
26
+ * Log a warning
27
+ */
28
+ export declare const logWarning: (message: string, options?: Omit<SystemLogInput, "level" | "message">) => Promise<void>;
29
+ /**
30
+ * Log an info message
31
+ */
32
+ export declare const logInfo: (message: string, options?: Omit<SystemLogInput, "level" | "message">) => Promise<void>;
33
+ /**
34
+ * Log debug info
35
+ */
36
+ export declare const logDebug: (message: string, options?: Omit<SystemLogInput, "level" | "message">) => Promise<void>;
37
+ /**
38
+ * Log a cronjob event
39
+ */
40
+ export declare const logCronjob: (message: string, options?: Omit<SystemLogInput, "level" | "category" | "message">) => Promise<void>;
41
+ /**
42
+ * Log a payment event
43
+ */
44
+ export declare const logPayment: (message: string, options?: Omit<SystemLogInput, "level" | "category" | "message">) => Promise<void>;
45
+ /**
46
+ * Log a device event
47
+ */
48
+ export declare const logDevice: (message: string, options?: Omit<SystemLogInput, "level" | "category" | "message">) => Promise<void>;
49
+ /**
50
+ * Log an auth event
51
+ */
52
+ export declare const logAuth: (message: string, options?: Omit<SystemLogInput, "level" | "category" | "message">) => Promise<void>;
53
+ /**
54
+ * Log a security event
55
+ */
56
+ export declare const logSecurity: (message: string, options?: Omit<SystemLogInput, "level" | "category" | "message">) => Promise<void>;
57
+ /**
58
+ * Log an API request
59
+ */
60
+ export declare const logApi: (message: string, options?: Omit<SystemLogInput, "level" | "category" | "message">) => Promise<void>;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logApi = exports.logSecurity = exports.logAuth = exports.logDevice = exports.logPayment = exports.logCronjob = exports.logDebug = exports.logInfo = exports.logWarning = exports.logError = exports.logSystem = void 0;
4
+ // src/utils/systemLog.utils.ts
5
+ const vr_models_1 = require("vr-models");
6
+ /**
7
+ * Create a system log entry
8
+ * Uses the static methods from SystemLog model
9
+ */
10
+ const logSystem = async ({ level = "INFO", category = "SYSTEM", message, details = null, source = null, userId = null, userRole = null, ipAddress = null, userAgent = null, timestamp, transaction, }) => {
11
+ try {
12
+ const logData = {
13
+ level,
14
+ category,
15
+ message,
16
+ details,
17
+ source,
18
+ userId,
19
+ userRole,
20
+ ipAddress,
21
+ userAgent,
22
+ timestamp,
23
+ };
24
+ // Create log entry with optional transaction
25
+ await vr_models_1.SystemLog.create(logData, { transaction });
26
+ }
27
+ catch (err) {
28
+ console.error("❌ Failed to create system log:", err);
29
+ // Don't throw - system logging should not break the main operation
30
+ }
31
+ };
32
+ exports.logSystem = logSystem;
33
+ /**
34
+ * Log an error
35
+ */
36
+ const logError = async (message, options = {}) => {
37
+ await (0, exports.logSystem)({
38
+ level: "ERROR",
39
+ message,
40
+ ...options,
41
+ });
42
+ };
43
+ exports.logError = logError;
44
+ /**
45
+ * Log a warning
46
+ */
47
+ const logWarning = async (message, options = {}) => {
48
+ await (0, exports.logSystem)({
49
+ level: "WARNING",
50
+ message,
51
+ ...options,
52
+ });
53
+ };
54
+ exports.logWarning = logWarning;
55
+ /**
56
+ * Log an info message
57
+ */
58
+ const logInfo = async (message, options = {}) => {
59
+ await (0, exports.logSystem)({
60
+ level: "INFO",
61
+ message,
62
+ ...options,
63
+ });
64
+ };
65
+ exports.logInfo = logInfo;
66
+ /**
67
+ * Log debug info
68
+ */
69
+ const logDebug = async (message, options = {}) => {
70
+ await (0, exports.logSystem)({
71
+ level: "DEBUG",
72
+ message,
73
+ ...options,
74
+ });
75
+ };
76
+ exports.logDebug = logDebug;
77
+ /**
78
+ * Log a cronjob event
79
+ */
80
+ const logCronjob = async (message, options = {}) => {
81
+ await (0, exports.logSystem)({
82
+ level: "INFO",
83
+ category: "CRONJOB",
84
+ message,
85
+ ...options,
86
+ });
87
+ };
88
+ exports.logCronjob = logCronjob;
89
+ /**
90
+ * Log a payment event
91
+ */
92
+ const logPayment = async (message, options = {}) => {
93
+ await (0, exports.logSystem)({
94
+ level: "INFO",
95
+ category: "PAYMENT",
96
+ message,
97
+ ...options,
98
+ });
99
+ };
100
+ exports.logPayment = logPayment;
101
+ /**
102
+ * Log a device event
103
+ */
104
+ const logDevice = async (message, options = {}) => {
105
+ await (0, exports.logSystem)({
106
+ level: "INFO",
107
+ category: "DEVICE",
108
+ message,
109
+ ...options,
110
+ });
111
+ };
112
+ exports.logDevice = logDevice;
113
+ /**
114
+ * Log an auth event
115
+ */
116
+ const logAuth = async (message, options = {}) => {
117
+ await (0, exports.logSystem)({
118
+ level: "INFO",
119
+ category: "AUTH",
120
+ message,
121
+ ...options,
122
+ });
123
+ };
124
+ exports.logAuth = logAuth;
125
+ /**
126
+ * Log a security event
127
+ */
128
+ const logSecurity = async (message, options = {}) => {
129
+ await (0, exports.logSystem)({
130
+ level: "INFO",
131
+ category: "SECURITY",
132
+ message,
133
+ ...options,
134
+ });
135
+ };
136
+ exports.logSecurity = logSecurity;
137
+ /**
138
+ * Log an API request
139
+ */
140
+ const logApi = async (message, options = {}) => {
141
+ await (0, exports.logSystem)({
142
+ level: "INFO",
143
+ category: "API",
144
+ message,
145
+ ...options,
146
+ });
147
+ };
148
+ exports.logApi = logApi;
@@ -6,24 +6,24 @@ export declare const createPlanSchema: z.ZodObject<{
6
6
  productId: z.ZodString;
7
7
  }, "strip", z.ZodTypeAny, {
8
8
  userId: string;
9
- pricingId: string;
10
9
  productId: string;
10
+ pricingId: string;
11
11
  }, {
12
12
  userId: string;
13
- pricingId: string;
14
13
  productId: string;
14
+ pricingId: string;
15
15
  }>;
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  body: {
18
18
  userId: string;
19
- pricingId: string;
20
19
  productId: string;
20
+ pricingId: string;
21
21
  };
22
22
  }, {
23
23
  body: {
24
24
  userId: string;
25
- pricingId: string;
26
25
  productId: string;
26
+ pricingId: string;
27
27
  };
28
28
  }>;
29
29
  export declare const listPlansSchema: z.ZodObject<{
@@ -38,49 +38,49 @@ export declare const listPlansSchema: z.ZodObject<{
38
38
  sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "updatedAt", "nextInstallmentDueAt", "paidAmount", "outstandingAmount"]>>;
39
39
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
40
40
  }, "strip", z.ZodTypeAny, {
41
- page: number;
42
41
  limit: number;
43
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
42
+ page: number;
43
+ search?: string | undefined;
44
44
  userId?: string | undefined;
45
- deviceId?: string | undefined;
45
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
46
46
  isOverdue?: "true" | "false" | undefined;
47
- search?: string | undefined;
48
- sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
49
- sortOrder?: "ASC" | "DESC" | undefined;
47
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
48
+ sortOrder?: "DESC" | "ASC" | undefined;
49
+ deviceId?: string | undefined;
50
50
  }, {
51
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
51
+ search?: string | undefined;
52
+ limit?: string | undefined;
52
53
  userId?: string | undefined;
54
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
55
+ isOverdue?: "true" | "false" | undefined;
53
56
  page?: string | undefined;
54
- limit?: string | undefined;
57
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
58
+ sortOrder?: "DESC" | "ASC" | undefined;
55
59
  deviceId?: string | undefined;
56
- isOverdue?: "true" | "false" | undefined;
57
- search?: string | undefined;
58
- sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
59
- sortOrder?: "ASC" | "DESC" | undefined;
60
60
  }>;
61
61
  }, "strip", z.ZodTypeAny, {
62
62
  query: {
63
- page: number;
64
63
  limit: number;
65
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
64
+ page: number;
65
+ search?: string | undefined;
66
66
  userId?: string | undefined;
67
- deviceId?: string | undefined;
67
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
68
68
  isOverdue?: "true" | "false" | undefined;
69
- search?: string | undefined;
70
- sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
71
- sortOrder?: "ASC" | "DESC" | undefined;
69
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
70
+ sortOrder?: "DESC" | "ASC" | undefined;
71
+ deviceId?: string | undefined;
72
72
  };
73
73
  }, {
74
74
  query: {
75
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
75
+ search?: string | undefined;
76
+ limit?: string | undefined;
76
77
  userId?: string | undefined;
78
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
79
+ isOverdue?: "true" | "false" | undefined;
77
80
  page?: string | undefined;
78
- limit?: string | undefined;
81
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
82
+ sortOrder?: "DESC" | "ASC" | undefined;
79
83
  deviceId?: string | undefined;
80
- isOverdue?: "true" | "false" | undefined;
81
- search?: string | undefined;
82
- sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
83
- sortOrder?: "ASC" | "DESC" | undefined;
84
84
  };
85
85
  }>;
86
86
  export declare const getPlanSchema: z.ZodObject<{
@@ -112,10 +112,10 @@ export declare const getUserPlansSchema: z.ZodObject<{
112
112
  status: z.ZodOptional<z.ZodEnum<["PENDING", "ACTIVE", "COMPLETED", "DEFAULTED", "CANCELLED"]>>;
113
113
  includeCompleted: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
114
114
  }, "strip", z.ZodTypeAny, {
115
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
115
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
116
116
  includeCompleted?: "true" | "false" | undefined;
117
117
  }, {
118
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
118
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
119
119
  includeCompleted?: "true" | "false" | undefined;
120
120
  }>>;
121
121
  }, "strip", z.ZodTypeAny, {
@@ -123,7 +123,7 @@ export declare const getUserPlansSchema: z.ZodObject<{
123
123
  userId: string;
124
124
  };
125
125
  query?: {
126
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
126
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
127
127
  includeCompleted?: "true" | "false" | undefined;
128
128
  } | undefined;
129
129
  }, {
@@ -131,7 +131,7 @@ export declare const getUserPlansSchema: z.ZodObject<{
131
131
  userId: string;
132
132
  };
133
133
  query?: {
134
- status?: "PENDING" | "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
134
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
135
135
  includeCompleted?: "true" | "false" | undefined;
136
136
  } | undefined;
137
137
  }>;
@@ -166,38 +166,38 @@ export declare const limitedUpdateSchema: z.ZodObject<{
166
166
  userId: z.ZodOptional<z.ZodString>;
167
167
  }, "strip", z.ZodTypeAny, {
168
168
  userId?: string | undefined;
169
- pricingId?: string | undefined;
170
169
  productId?: string | undefined;
170
+ pricingId?: string | undefined;
171
171
  }, {
172
172
  userId?: string | undefined;
173
- pricingId?: string | undefined;
174
173
  productId?: string | undefined;
174
+ pricingId?: string | undefined;
175
175
  }>, {
176
176
  userId?: string | undefined;
177
- pricingId?: string | undefined;
178
177
  productId?: string | undefined;
178
+ pricingId?: string | undefined;
179
179
  }, {
180
180
  userId?: string | undefined;
181
- pricingId?: string | undefined;
182
181
  productId?: string | undefined;
182
+ pricingId?: string | undefined;
183
183
  }>;
184
184
  }, "strip", z.ZodTypeAny, {
185
- params: {
186
- id: string;
187
- };
188
185
  body: {
189
186
  userId?: string | undefined;
190
- pricingId?: string | undefined;
191
187
  productId?: string | undefined;
188
+ pricingId?: string | undefined;
192
189
  };
193
- }, {
194
190
  params: {
195
191
  id: string;
196
192
  };
193
+ }, {
197
194
  body: {
198
195
  userId?: string | undefined;
199
- pricingId?: string | undefined;
200
196
  productId?: string | undefined;
197
+ pricingId?: string | undefined;
198
+ };
199
+ params: {
200
+ id: string;
201
201
  };
202
202
  }>;
203
203
  export declare const recordPaymentSchema: z.ZodObject<{
@@ -219,45 +219,45 @@ export declare const recordPaymentSchema: z.ZodObject<{
219
219
  }, "strip", z.ZodTypeAny, {
220
220
  amount: number;
221
221
  provider: "AIRTEL_MONEY" | "CASH" | "MOMO_PAY";
222
+ metadata?: Record<string, any> | undefined;
222
223
  providerReference?: string | undefined;
223
224
  customerPhone?: string | undefined;
224
225
  customerName?: string | undefined;
225
226
  notes?: string | undefined;
226
- metadata?: Record<string, any> | undefined;
227
227
  }, {
228
228
  amount: number;
229
+ metadata?: Record<string, any> | undefined;
229
230
  provider?: "AIRTEL_MONEY" | "CASH" | "MOMO_PAY" | undefined;
230
231
  providerReference?: string | undefined;
231
232
  customerPhone?: string | undefined;
232
233
  customerName?: string | undefined;
233
234
  notes?: string | undefined;
234
- metadata?: Record<string, any> | undefined;
235
235
  }>;
236
236
  }, "strip", z.ZodTypeAny, {
237
- params: {
238
- id: string;
239
- };
240
237
  body: {
241
238
  amount: number;
242
239
  provider: "AIRTEL_MONEY" | "CASH" | "MOMO_PAY";
240
+ metadata?: Record<string, any> | undefined;
243
241
  providerReference?: string | undefined;
244
242
  customerPhone?: string | undefined;
245
243
  customerName?: string | undefined;
246
244
  notes?: string | undefined;
247
- metadata?: Record<string, any> | undefined;
248
245
  };
249
- }, {
250
246
  params: {
251
247
  id: string;
252
248
  };
249
+ }, {
253
250
  body: {
254
251
  amount: number;
252
+ metadata?: Record<string, any> | undefined;
255
253
  provider?: "AIRTEL_MONEY" | "CASH" | "MOMO_PAY" | undefined;
256
254
  providerReference?: string | undefined;
257
255
  customerPhone?: string | undefined;
258
256
  customerName?: string | undefined;
259
257
  notes?: string | undefined;
260
- metadata?: Record<string, any> | undefined;
258
+ };
259
+ params: {
260
+ id: string;
261
261
  };
262
262
  }>;
263
263
  export declare const deletePlanSchema: z.ZodObject<{
@@ -71,7 +71,6 @@ exports.limitedUpdateSchema = zod_1.z.object({
71
71
  message: "At least one field to update is required",
72
72
  }),
73
73
  });
74
- // src/modules/devicePaymentPlans/validations/devicePaymentPlans.validations.ts
75
74
  exports.recordPaymentSchema = zod_1.z.object({
76
75
  params: zod_1.z.object({
77
76
  id: zod_1.z.string().uuid("Invalid payment plan ID"),
@@ -59,53 +59,53 @@ export declare const getDevicesSchema: z.ZodObject<{
59
59
  sortBy: z.ZodOptional<z.ZodEnum<["serialNumber", "status", "createdAt", "updatedAt"]>>;
60
60
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
61
61
  }, "strip", z.ZodTypeAny, {
62
- productId?: string | undefined;
62
+ search?: string | undefined;
63
+ limit?: number | undefined;
63
64
  status?: "locked" | "unlocked" | "disabled" | undefined;
64
65
  page?: number | undefined;
65
- limit?: number | undefined;
66
+ sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
67
+ sortOrder?: "DESC" | "ASC" | undefined;
68
+ productId?: string | undefined;
66
69
  dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
67
70
  isPermanentlyUnlocked?: "true" | "false" | undefined;
68
71
  isAssigned?: "true" | "false" | undefined;
69
- search?: string | undefined;
70
- sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
71
- sortOrder?: "ASC" | "DESC" | undefined;
72
72
  }, {
73
- productId?: string | undefined;
73
+ search?: string | undefined;
74
+ limit?: string | undefined;
74
75
  status?: "locked" | "unlocked" | "disabled" | undefined;
75
76
  page?: string | undefined;
76
- limit?: string | undefined;
77
+ sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
78
+ sortOrder?: "DESC" | "ASC" | undefined;
79
+ productId?: string | undefined;
77
80
  dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
78
81
  isPermanentlyUnlocked?: "true" | "false" | undefined;
79
82
  isAssigned?: "true" | "false" | undefined;
80
- search?: string | undefined;
81
- sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
82
- sortOrder?: "ASC" | "DESC" | undefined;
83
83
  }>;
84
84
  }, "strip", z.ZodTypeAny, {
85
85
  query: {
86
- productId?: string | undefined;
86
+ search?: string | undefined;
87
+ limit?: number | undefined;
87
88
  status?: "locked" | "unlocked" | "disabled" | undefined;
88
89
  page?: number | undefined;
89
- limit?: number | undefined;
90
+ sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
91
+ sortOrder?: "DESC" | "ASC" | undefined;
92
+ productId?: string | undefined;
90
93
  dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
91
94
  isPermanentlyUnlocked?: "true" | "false" | undefined;
92
95
  isAssigned?: "true" | "false" | undefined;
93
- search?: string | undefined;
94
- sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
95
- sortOrder?: "ASC" | "DESC" | undefined;
96
96
  };
97
97
  }, {
98
98
  query: {
99
- productId?: string | undefined;
99
+ search?: string | undefined;
100
+ limit?: string | undefined;
100
101
  status?: "locked" | "unlocked" | "disabled" | undefined;
101
102
  page?: string | undefined;
102
- limit?: string | undefined;
103
+ sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
104
+ sortOrder?: "DESC" | "ASC" | undefined;
105
+ productId?: string | undefined;
103
106
  dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
104
107
  isPermanentlyUnlocked?: "true" | "false" | undefined;
105
108
  isAssigned?: "true" | "false" | undefined;
106
- search?: string | undefined;
107
- sortBy?: "status" | "serialNumber" | "createdAt" | "updatedAt" | undefined;
108
- sortOrder?: "ASC" | "DESC" | undefined;
109
109
  };
110
110
  }>;
111
111
  export declare const deleteDevicesByPairsSchema: z.ZodObject<{
@@ -153,32 +153,32 @@ export declare const lockDevicesSchema: z.ZodObject<{
153
153
  pairIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
154
154
  serialNumbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
155
155
  }, "strip", z.ZodTypeAny, {
156
- pairIds?: string[] | undefined;
157
156
  reason?: string | undefined;
157
+ pairIds?: string[] | undefined;
158
158
  serialNumbers?: string[] | undefined;
159
159
  }, {
160
- pairIds?: string[] | undefined;
161
160
  reason?: string | undefined;
161
+ pairIds?: string[] | undefined;
162
162
  serialNumbers?: string[] | undefined;
163
163
  }>, {
164
- pairIds?: string[] | undefined;
165
164
  reason?: string | undefined;
165
+ pairIds?: string[] | undefined;
166
166
  serialNumbers?: string[] | undefined;
167
167
  }, {
168
- pairIds?: string[] | undefined;
169
168
  reason?: string | undefined;
169
+ pairIds?: string[] | undefined;
170
170
  serialNumbers?: string[] | undefined;
171
171
  }>;
172
172
  }, "strip", z.ZodTypeAny, {
173
173
  body: {
174
- pairIds?: string[] | undefined;
175
174
  reason?: string | undefined;
175
+ pairIds?: string[] | undefined;
176
176
  serialNumbers?: string[] | undefined;
177
177
  };
178
178
  }, {
179
179
  body: {
180
- pairIds?: string[] | undefined;
181
180
  reason?: string | undefined;
181
+ pairIds?: string[] | undefined;
182
182
  serialNumbers?: string[] | undefined;
183
183
  };
184
184
  }>;
@@ -6,28 +6,28 @@ export declare const getInstallmentsSchema: z.ZodObject<{
6
6
  page: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
7
7
  limit: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
8
8
  }, "strip", z.ZodTypeAny, {
9
+ limit?: number | undefined;
9
10
  status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
10
11
  page?: number | undefined;
11
- limit?: number | undefined;
12
12
  planId?: string | undefined;
13
13
  }, {
14
+ limit?: string | undefined;
14
15
  status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
15
16
  page?: string | undefined;
16
- limit?: string | undefined;
17
17
  planId?: string | undefined;
18
18
  }>;
19
19
  }, "strip", z.ZodTypeAny, {
20
20
  query: {
21
+ limit?: number | undefined;
21
22
  status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
22
23
  page?: number | undefined;
23
- limit?: number | undefined;
24
24
  planId?: string | undefined;
25
25
  };
26
26
  }, {
27
27
  query: {
28
+ limit?: string | undefined;
28
29
  status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
29
30
  page?: string | undefined;
30
- limit?: string | undefined;
31
31
  planId?: string | undefined;
32
32
  };
33
33
  }>;
@@ -79,9 +79,6 @@ export declare const payInstallmentSchema: z.ZodObject<{
79
79
  notes?: string | undefined;
80
80
  }>;
81
81
  }, "strip", z.ZodTypeAny, {
82
- params: {
83
- id: string;
84
- };
85
82
  body: {
86
83
  amount: number;
87
84
  provider: "AIRTEL_MONEY" | "CASH" | "MOMO_PAY";
@@ -90,10 +87,10 @@ export declare const payInstallmentSchema: z.ZodObject<{
90
87
  metadata?: Record<string, any> | undefined;
91
88
  notes?: string | undefined;
92
89
  };
93
- }, {
94
90
  params: {
95
91
  id: string;
96
92
  };
93
+ }, {
97
94
  body: {
98
95
  amount: number;
99
96
  providerReference: string;
@@ -102,4 +99,7 @@ export declare const payInstallmentSchema: z.ZodObject<{
102
99
  provider?: "AIRTEL_MONEY" | "CASH" | "MOMO_PAY" | undefined;
103
100
  notes?: string | undefined;
104
101
  };
102
+ params: {
103
+ id: string;
104
+ };
105
105
  }>;
@@ -18,7 +18,6 @@ exports.getInstallmentByIdSchema = zod_1.z.object({
18
18
  id: zod_1.z.string().uuid(),
19
19
  }),
20
20
  });
21
- // src/modules/installments/validations/installments.validations.ts
22
21
  exports.payInstallmentSchema = zod_1.z.object({
23
22
  params: zod_1.z.object({
24
23
  id: zod_1.z.string().uuid("Invalid installment ID"),