vr-commons 1.0.105 → 1.0.106

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.
@@ -4,26 +4,31 @@ export declare const createPlanSchema: z.ZodObject<{
4
4
  userId: z.ZodString;
5
5
  deviceIds: z.ZodArray<z.ZodString, "many">;
6
6
  pricingId: z.ZodString;
7
+ productId: z.ZodString;
7
8
  }, "strip", z.ZodTypeAny, {
8
9
  userId: string;
9
10
  deviceIds: string[];
10
11
  pricingId: string;
12
+ productId: string;
11
13
  }, {
12
14
  userId: string;
13
15
  deviceIds: string[];
14
16
  pricingId: string;
17
+ productId: string;
15
18
  }>;
16
19
  }, "strip", z.ZodTypeAny, {
17
20
  body: {
18
21
  userId: string;
19
22
  deviceIds: string[];
20
23
  pricingId: string;
24
+ productId: string;
21
25
  };
22
26
  }, {
23
27
  body: {
24
28
  userId: string;
25
29
  deviceIds: string[];
26
30
  pricingId: string;
31
+ productId: string;
27
32
  };
28
33
  }>;
29
34
  export declare const listPlansSchema: z.ZodObject<{
@@ -38,49 +43,49 @@ export declare const listPlansSchema: z.ZodObject<{
38
43
  sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "updatedAt", "nextInstallmentDueAt", "paidAmount", "outstandingAmount"]>>;
39
44
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
40
45
  }, "strip", z.ZodTypeAny, {
41
- limit: number;
42
46
  page: number;
43
- search?: string | undefined;
47
+ limit: number;
48
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
44
49
  userId?: string | undefined;
45
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
46
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
47
- sortOrder?: "DESC" | "ASC" | undefined;
48
50
  deviceId?: string | undefined;
49
51
  isOverdue?: "true" | "false" | undefined;
50
- }, {
51
52
  search?: string | undefined;
52
- limit?: string | undefined;
53
+ sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
54
+ sortOrder?: "ASC" | "DESC" | undefined;
55
+ }, {
56
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
53
57
  userId?: string | undefined;
54
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
55
58
  page?: string | undefined;
56
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
57
- sortOrder?: "DESC" | "ASC" | undefined;
59
+ limit?: string | undefined;
58
60
  deviceId?: string | undefined;
59
61
  isOverdue?: "true" | "false" | undefined;
62
+ search?: string | undefined;
63
+ sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
64
+ sortOrder?: "ASC" | "DESC" | undefined;
60
65
  }>;
61
66
  }, "strip", z.ZodTypeAny, {
62
67
  query: {
63
- limit: number;
64
68
  page: number;
65
- search?: string | undefined;
69
+ limit: number;
70
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
66
71
  userId?: string | undefined;
67
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
68
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
69
- sortOrder?: "DESC" | "ASC" | undefined;
70
72
  deviceId?: string | undefined;
71
73
  isOverdue?: "true" | "false" | undefined;
74
+ search?: string | undefined;
75
+ sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
76
+ sortOrder?: "ASC" | "DESC" | undefined;
72
77
  };
73
78
  }, {
74
79
  query: {
75
- search?: string | undefined;
76
- limit?: string | undefined;
80
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
77
81
  userId?: string | undefined;
78
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
79
82
  page?: string | undefined;
80
- sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
81
- sortOrder?: "DESC" | "ASC" | undefined;
83
+ limit?: string | undefined;
82
84
  deviceId?: string | undefined;
83
85
  isOverdue?: "true" | "false" | undefined;
86
+ search?: string | undefined;
87
+ sortBy?: "createdAt" | "updatedAt" | "nextInstallmentDueAt" | "paidAmount" | "outstandingAmount" | undefined;
88
+ sortOrder?: "ASC" | "DESC" | undefined;
84
89
  };
85
90
  }>;
86
91
  export declare const getPlanSchema: z.ZodObject<{
@@ -112,10 +117,10 @@ export declare const getUserPlansSchema: z.ZodObject<{
112
117
  status: z.ZodOptional<z.ZodEnum<["ACTIVE", "COMPLETED", "DEFAULTED", "CANCELLED"]>>;
113
118
  includeCompleted: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
114
119
  }, "strip", z.ZodTypeAny, {
115
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
120
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
116
121
  includeCompleted?: "true" | "false" | undefined;
117
122
  }, {
118
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
123
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
119
124
  includeCompleted?: "true" | "false" | undefined;
120
125
  }>>;
121
126
  }, "strip", z.ZodTypeAny, {
@@ -123,7 +128,7 @@ export declare const getUserPlansSchema: z.ZodObject<{
123
128
  userId: string;
124
129
  };
125
130
  query?: {
126
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
131
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
127
132
  includeCompleted?: "true" | "false" | undefined;
128
133
  } | undefined;
129
134
  }, {
@@ -131,7 +136,7 @@ export declare const getUserPlansSchema: z.ZodObject<{
131
136
  userId: string;
132
137
  };
133
138
  query?: {
134
- status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
139
+ status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
135
140
  includeCompleted?: "true" | "false" | undefined;
136
141
  } | undefined;
137
142
  }>;
@@ -162,36 +167,43 @@ export declare const limitedUpdateSchema: z.ZodObject<{
162
167
  }>;
163
168
  body: z.ZodEffects<z.ZodObject<{
164
169
  pricingId: z.ZodOptional<z.ZodString>;
170
+ productId: z.ZodString;
165
171
  userId: z.ZodOptional<z.ZodString>;
166
172
  }, "strip", z.ZodTypeAny, {
173
+ productId: string;
167
174
  userId?: string | undefined;
168
175
  pricingId?: string | undefined;
169
176
  }, {
177
+ productId: string;
170
178
  userId?: string | undefined;
171
179
  pricingId?: string | undefined;
172
180
  }>, {
181
+ productId: string;
173
182
  userId?: string | undefined;
174
183
  pricingId?: string | undefined;
175
184
  }, {
185
+ productId: string;
176
186
  userId?: string | undefined;
177
187
  pricingId?: string | undefined;
178
188
  }>;
179
189
  }, "strip", z.ZodTypeAny, {
190
+ params: {
191
+ id: string;
192
+ };
180
193
  body: {
194
+ productId: string;
181
195
  userId?: string | undefined;
182
196
  pricingId?: string | undefined;
183
197
  };
198
+ }, {
184
199
  params: {
185
200
  id: string;
186
201
  };
187
- }, {
188
202
  body: {
203
+ productId: string;
189
204
  userId?: string | undefined;
190
205
  pricingId?: string | undefined;
191
206
  };
192
- params: {
193
- id: string;
194
- };
195
207
  }>;
196
208
  export declare const recordPaymentSchema: z.ZodObject<{
197
209
  params: z.ZodObject<{
@@ -209,33 +221,33 @@ export declare const recordPaymentSchema: z.ZodObject<{
209
221
  }, "strip", z.ZodTypeAny, {
210
222
  amount: number;
211
223
  provider: "mtn_momo" | "airtel_money";
212
- metadata?: Record<string, any> | undefined;
213
224
  providerReference?: string | undefined;
225
+ metadata?: Record<string, any> | undefined;
214
226
  }, {
215
227
  amount: number;
216
228
  provider: "mtn_momo" | "airtel_money";
217
- metadata?: Record<string, any> | undefined;
218
229
  providerReference?: string | undefined;
230
+ metadata?: Record<string, any> | undefined;
219
231
  }>;
220
232
  }, "strip", z.ZodTypeAny, {
233
+ params: {
234
+ id: string;
235
+ };
221
236
  body: {
222
237
  amount: number;
223
238
  provider: "mtn_momo" | "airtel_money";
224
- metadata?: Record<string, any> | undefined;
225
239
  providerReference?: string | undefined;
240
+ metadata?: Record<string, any> | undefined;
226
241
  };
242
+ }, {
227
243
  params: {
228
244
  id: string;
229
245
  };
230
- }, {
231
246
  body: {
232
247
  amount: number;
233
248
  provider: "mtn_momo" | "airtel_money";
234
- metadata?: Record<string, any> | undefined;
235
249
  providerReference?: string | undefined;
236
- };
237
- params: {
238
- id: string;
250
+ metadata?: Record<string, any> | undefined;
239
251
  };
240
252
  }>;
241
253
  export declare const deletePlanSchema: z.ZodObject<{
@@ -12,6 +12,7 @@ exports.createPlanSchema = zod_1.z.object({
12
12
  .min(1, "At least one device required")
13
13
  .max(10, "Maximum 10 devices per plan"),
14
14
  pricingId: zod_1.z.string().uuid("Invalid pricing ID"),
15
+ productId: zod_1.z.string().uuid("Invalid product ID"),
15
16
  }),
16
17
  });
17
18
  // ==================== READ ====================
@@ -67,6 +68,7 @@ exports.limitedUpdateSchema = zod_1.z.object({
67
68
  .object({
68
69
  // Can update pricing before any payments
69
70
  pricingId: zod_1.z.string().uuid("Invalid pricing ID").optional(),
71
+ productId: zod_1.z.string().uuid("Invalid product ID"),
70
72
  // Can reassign to different user before any payments
71
73
  userId: zod_1.z.string().uuid("Invalid user ID").optional(),
72
74
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.105",
3
+ "version": "1.0.106",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",