vr-commons 1.0.154 → 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;
@@ -2,32 +2,27 @@ import { z } from "zod";
2
2
  export declare const createPlanSchema: z.ZodObject<{
3
3
  body: z.ZodObject<{
4
4
  userId: z.ZodString;
5
- deviceIds: z.ZodArray<z.ZodString, "many">;
6
5
  pricingId: z.ZodString;
7
6
  productId: z.ZodString;
8
7
  }, "strip", z.ZodTypeAny, {
9
- productId: string;
10
8
  userId: string;
11
- deviceIds: string[];
9
+ productId: string;
12
10
  pricingId: string;
13
11
  }, {
14
- productId: string;
15
12
  userId: string;
16
- deviceIds: string[];
13
+ productId: string;
17
14
  pricingId: string;
18
15
  }>;
19
16
  }, "strip", z.ZodTypeAny, {
20
17
  body: {
21
- productId: string;
22
18
  userId: string;
23
- deviceIds: string[];
19
+ productId: string;
24
20
  pricingId: string;
25
21
  };
26
22
  }, {
27
23
  body: {
28
- productId: string;
29
24
  userId: string;
30
- deviceIds: string[];
25
+ productId: string;
31
26
  pricingId: string;
32
27
  };
33
28
  }>;
@@ -43,48 +38,48 @@ export declare const listPlansSchema: z.ZodObject<{
43
38
  sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "updatedAt", "nextInstallmentDueAt", "paidAmount", "outstandingAmount"]>>;
44
39
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
45
40
  }, "strip", z.ZodTypeAny, {
46
- page: number;
47
41
  limit: number;
48
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
42
+ page: number;
49
43
  search?: string | undefined;
50
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
51
- sortOrder?: "ASC" | "DESC" | undefined;
52
44
  userId?: string | undefined;
45
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
53
46
  isOverdue?: "true" | "false" | undefined;
47
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
48
+ sortOrder?: "DESC" | "ASC" | undefined;
54
49
  deviceId?: string | undefined;
55
50
  }, {
56
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
57
- page?: string | undefined;
58
- limit?: string | undefined;
59
51
  search?: string | undefined;
60
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
61
- sortOrder?: "ASC" | "DESC" | undefined;
52
+ limit?: string | undefined;
62
53
  userId?: string | undefined;
54
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
63
55
  isOverdue?: "true" | "false" | undefined;
56
+ page?: string | undefined;
57
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
58
+ sortOrder?: "DESC" | "ASC" | undefined;
64
59
  deviceId?: string | undefined;
65
60
  }>;
66
61
  }, "strip", z.ZodTypeAny, {
67
62
  query: {
68
- page: number;
69
63
  limit: number;
70
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
64
+ page: number;
71
65
  search?: string | undefined;
72
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
73
- sortOrder?: "ASC" | "DESC" | undefined;
74
66
  userId?: string | undefined;
67
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
75
68
  isOverdue?: "true" | "false" | undefined;
69
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
70
+ sortOrder?: "DESC" | "ASC" | undefined;
76
71
  deviceId?: string | undefined;
77
72
  };
78
73
  }, {
79
74
  query: {
80
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
81
- page?: string | undefined;
82
- limit?: string | undefined;
83
75
  search?: string | undefined;
84
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
85
- sortOrder?: "ASC" | "DESC" | undefined;
76
+ limit?: string | undefined;
86
77
  userId?: string | undefined;
78
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
87
79
  isOverdue?: "true" | "false" | undefined;
80
+ page?: string | undefined;
81
+ sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
82
+ sortOrder?: "DESC" | "ASC" | undefined;
88
83
  deviceId?: string | undefined;
89
84
  };
90
85
  }>;
@@ -117,10 +112,10 @@ export declare const getUserPlansSchema: z.ZodObject<{
117
112
  status: z.ZodOptional<z.ZodEnum<["PENDING", "ACTIVE", "COMPLETED", "DEFAULTED", "CANCELLED"]>>;
118
113
  includeCompleted: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
119
114
  }, "strip", z.ZodTypeAny, {
120
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
115
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
121
116
  includeCompleted?: "true" | "false" | undefined;
122
117
  }, {
123
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
118
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
124
119
  includeCompleted?: "true" | "false" | undefined;
125
120
  }>>;
126
121
  }, "strip", z.ZodTypeAny, {
@@ -128,7 +123,7 @@ export declare const getUserPlansSchema: z.ZodObject<{
128
123
  userId: string;
129
124
  };
130
125
  query?: {
131
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
126
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
132
127
  includeCompleted?: "true" | "false" | undefined;
133
128
  } | undefined;
134
129
  }, {
@@ -136,7 +131,7 @@ export declare const getUserPlansSchema: z.ZodObject<{
136
131
  userId: string;
137
132
  };
138
133
  query?: {
139
- status?: "ACTIVE" | "PENDING" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
134
+ status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
140
135
  includeCompleted?: "true" | "false" | undefined;
141
136
  } | undefined;
142
137
  }>;
@@ -168,49 +163,42 @@ export declare const limitedUpdateSchema: z.ZodObject<{
168
163
  body: z.ZodEffects<z.ZodObject<{
169
164
  pricingId: z.ZodOptional<z.ZodString>;
170
165
  productId: z.ZodOptional<z.ZodString>;
171
- deviceIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
172
166
  userId: z.ZodOptional<z.ZodString>;
173
167
  }, "strip", z.ZodTypeAny, {
174
- productId?: string | undefined;
175
168
  userId?: string | undefined;
176
- deviceIds?: string[] | undefined;
169
+ productId?: string | undefined;
177
170
  pricingId?: string | undefined;
178
171
  }, {
179
- productId?: string | undefined;
180
172
  userId?: string | undefined;
181
- deviceIds?: string[] | undefined;
173
+ productId?: string | undefined;
182
174
  pricingId?: string | undefined;
183
175
  }>, {
184
- productId?: string | undefined;
185
176
  userId?: string | undefined;
186
- deviceIds?: string[] | undefined;
177
+ productId?: string | undefined;
187
178
  pricingId?: string | undefined;
188
179
  }, {
189
- productId?: string | undefined;
190
180
  userId?: string | undefined;
191
- deviceIds?: string[] | undefined;
181
+ productId?: string | undefined;
192
182
  pricingId?: string | undefined;
193
183
  }>;
194
184
  }, "strip", z.ZodTypeAny, {
195
- params: {
196
- id: string;
197
- };
198
185
  body: {
199
- productId?: string | undefined;
200
186
  userId?: string | undefined;
201
- deviceIds?: string[] | undefined;
187
+ productId?: string | undefined;
202
188
  pricingId?: string | undefined;
203
189
  };
204
- }, {
205
190
  params: {
206
191
  id: string;
207
192
  };
193
+ }, {
208
194
  body: {
209
- productId?: string | undefined;
210
195
  userId?: string | undefined;
211
- deviceIds?: string[] | undefined;
196
+ productId?: string | undefined;
212
197
  pricingId?: string | undefined;
213
198
  };
199
+ params: {
200
+ id: string;
201
+ };
214
202
  }>;
215
203
  export declare const recordPaymentSchema: z.ZodObject<{
216
204
  params: z.ZodObject<{
@@ -246,9 +234,6 @@ export declare const recordPaymentSchema: z.ZodObject<{
246
234
  notes?: string | undefined;
247
235
  }>;
248
236
  }, "strip", z.ZodTypeAny, {
249
- params: {
250
- id: string;
251
- };
252
237
  body: {
253
238
  amount: number;
254
239
  provider: "AIRTEL_MONEY" | "CASH" | "MOMO_PAY";
@@ -258,10 +243,10 @@ export declare const recordPaymentSchema: z.ZodObject<{
258
243
  customerName?: string | undefined;
259
244
  notes?: string | undefined;
260
245
  };
261
- }, {
262
246
  params: {
263
247
  id: string;
264
248
  };
249
+ }, {
265
250
  body: {
266
251
  amount: number;
267
252
  metadata?: Record<string, any> | undefined;
@@ -271,6 +256,9 @@ export declare const recordPaymentSchema: z.ZodObject<{
271
256
  customerName?: string | undefined;
272
257
  notes?: string | undefined;
273
258
  };
259
+ params: {
260
+ id: string;
261
+ };
274
262
  }>;
275
263
  export declare const deletePlanSchema: z.ZodObject<{
276
264
  params: z.ZodObject<{
@@ -7,10 +7,6 @@ const vr_models_1 = require("vr-models");
7
7
  exports.createPlanSchema = zod_1.z.object({
8
8
  body: zod_1.z.object({
9
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
10
  pricingId: zod_1.z.string().uuid("Invalid pricing ID"),
15
11
  productId: zod_1.z.string().uuid("Invalid product ID"),
16
12
  }),
@@ -69,18 +65,12 @@ exports.limitedUpdateSchema = zod_1.z.object({
69
65
  // All fields are optional - can update any combination
70
66
  pricingId: zod_1.z.string().uuid("Invalid pricing ID").optional(),
71
67
  productId: zod_1.z.string().uuid("Invalid product ID").optional(),
72
- deviceIds: zod_1.z
73
- .array(zod_1.z.string().uuid("Invalid device ID"))
74
- .min(1, "At least one device required")
75
- .max(10, "Maximum 10 devices per plan")
76
- .optional(),
77
68
  userId: zod_1.z.string().uuid("Invalid user ID").optional(),
78
69
  })
79
70
  .refine((data) => Object.keys(data).length > 0, {
80
71
  message: "At least one field to update is required",
81
72
  }),
82
73
  });
83
- // src/modules/devicePaymentPlans/validations/devicePaymentPlans.validations.ts
84
74
  exports.recordPaymentSchema = zod_1.z.object({
85
75
  params: zod_1.z.object({
86
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
  }>;