vr-commons 1.0.125 → 1.0.127

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.
@@ -9,26 +9,46 @@ export declare const updateProfileSchema: z.ZodObject<{
9
9
  firstName: z.ZodOptional<z.ZodString>;
10
10
  lastName: z.ZodOptional<z.ZodString>;
11
11
  plateNumber: z.ZodOptional<z.ZodString>;
12
+ gender: z.ZodOptional<z.ZodEnum<["male", "female"]>>;
13
+ birthDate: z.ZodOptional<z.ZodNumber>;
14
+ birthMonth: z.ZodOptional<z.ZodNumber>;
15
+ birthYear: z.ZodOptional<z.ZodNumber>;
12
16
  }, "strip", z.ZodTypeAny, {
13
17
  firstName?: string | undefined;
14
18
  lastName?: string | undefined;
15
19
  plateNumber?: string | undefined;
20
+ gender?: "male" | "female" | undefined;
21
+ birthDate?: number | undefined;
22
+ birthMonth?: number | undefined;
23
+ birthYear?: number | undefined;
16
24
  }, {
17
25
  firstName?: string | undefined;
18
26
  lastName?: string | undefined;
19
27
  plateNumber?: string | undefined;
28
+ gender?: "male" | "female" | undefined;
29
+ birthDate?: number | undefined;
30
+ birthMonth?: number | undefined;
31
+ birthYear?: number | undefined;
20
32
  }>;
21
33
  }, "strip", z.ZodTypeAny, {
22
34
  body: {
23
35
  firstName?: string | undefined;
24
36
  lastName?: string | undefined;
25
37
  plateNumber?: string | undefined;
38
+ gender?: "male" | "female" | undefined;
39
+ birthDate?: number | undefined;
40
+ birthMonth?: number | undefined;
41
+ birthYear?: number | undefined;
26
42
  };
27
43
  }, {
28
44
  body: {
29
45
  firstName?: string | undefined;
30
46
  lastName?: string | undefined;
31
47
  plateNumber?: string | undefined;
48
+ gender?: "male" | "female" | undefined;
49
+ birthDate?: number | undefined;
50
+ birthMonth?: number | undefined;
51
+ birthYear?: number | undefined;
32
52
  };
33
53
  }>;
34
54
  export declare const updateContactSchema: z.ZodObject<{
@@ -36,6 +36,20 @@ exports.updateProfileSchema = zod_1.z.object({
36
36
  .string()
37
37
  .regex(plateRegex, "Invalid plate number")
38
38
  .optional(),
39
+ gender: zod_1.z
40
+ .enum(["male", "female"], {
41
+ errorMap: () => ({
42
+ message: "Gender must be either 'male' or 'female'",
43
+ }),
44
+ })
45
+ .optional(),
46
+ birthDate: zod_1.z.number().min(1).max(31).optional(),
47
+ birthMonth: zod_1.z.number().min(1).max(12).optional(),
48
+ birthYear: zod_1.z
49
+ .number()
50
+ .min(1900, "Birth year must be between 1900 and current year")
51
+ .max(new Date().getFullYear(), "Birth year cannot be in the future")
52
+ .optional(),
39
53
  }),
40
54
  });
41
55
  // Schema for updating contact (email or phone)
@@ -166,50 +166,50 @@ export declare const limitedUpdateSchema: z.ZodObject<{
166
166
  id: string;
167
167
  }>;
168
168
  body: z.ZodEffects<z.ZodObject<{
169
- pricingId: z.ZodString;
170
- productId: z.ZodString;
169
+ pricingId: z.ZodOptional<z.ZodString>;
170
+ productId: z.ZodOptional<z.ZodString>;
171
171
  deviceIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
172
- userId: z.ZodString;
172
+ userId: z.ZodOptional<z.ZodString>;
173
173
  }, "strip", z.ZodTypeAny, {
174
- userId: string;
175
- pricingId: string;
176
- productId: string;
174
+ userId?: string | undefined;
177
175
  deviceIds?: string[] | undefined;
176
+ pricingId?: string | undefined;
177
+ productId?: string | undefined;
178
178
  }, {
179
- userId: string;
180
- pricingId: string;
181
- productId: string;
179
+ userId?: string | undefined;
182
180
  deviceIds?: string[] | undefined;
181
+ pricingId?: string | undefined;
182
+ productId?: string | undefined;
183
183
  }>, {
184
- userId: string;
185
- pricingId: string;
186
- productId: string;
184
+ userId?: string | undefined;
187
185
  deviceIds?: string[] | undefined;
186
+ pricingId?: string | undefined;
187
+ productId?: string | undefined;
188
188
  }, {
189
- userId: string;
190
- pricingId: string;
191
- productId: string;
189
+ userId?: string | undefined;
192
190
  deviceIds?: string[] | undefined;
191
+ pricingId?: string | undefined;
192
+ productId?: string | undefined;
193
193
  }>;
194
194
  }, "strip", z.ZodTypeAny, {
195
195
  params: {
196
196
  id: string;
197
197
  };
198
198
  body: {
199
- userId: string;
200
- pricingId: string;
201
- productId: string;
199
+ userId?: string | undefined;
202
200
  deviceIds?: string[] | undefined;
201
+ pricingId?: string | undefined;
202
+ productId?: string | undefined;
203
203
  };
204
204
  }, {
205
205
  params: {
206
206
  id: string;
207
207
  };
208
208
  body: {
209
- userId: string;
210
- pricingId: string;
211
- productId: string;
209
+ userId?: string | undefined;
212
210
  deviceIds?: string[] | undefined;
211
+ pricingId?: string | undefined;
212
+ productId?: string | undefined;
213
213
  };
214
214
  }>;
215
215
  export declare const recordPaymentSchema: z.ZodObject<{
@@ -66,16 +66,15 @@ exports.limitedUpdateSchema = zod_1.z.object({
66
66
  }),
67
67
  body: zod_1.z
68
68
  .object({
69
- // Can update pricing before any payments
70
- pricingId: zod_1.z.string().uuid("Invalid pricing ID"),
71
- productId: zod_1.z.string().uuid("Invalid product ID"),
69
+ // All fields are optional - can update any combination
70
+ pricingId: zod_1.z.string().uuid("Invalid pricing ID").optional(),
71
+ productId: zod_1.z.string().uuid("Invalid product ID").optional(),
72
72
  deviceIds: zod_1.z
73
73
  .array(zod_1.z.string().uuid("Invalid device ID"))
74
74
  .min(1, "At least one device required")
75
75
  .max(10, "Maximum 10 devices per plan")
76
76
  .optional(),
77
- // Can reassign to different user before any payments
78
- userId: zod_1.z.string().uuid("Invalid user ID"),
77
+ userId: zod_1.z.string().uuid("Invalid user ID").optional(),
79
78
  })
80
79
  .refine((data) => Object.keys(data).length > 0, {
81
80
  message: "At least one field to update is required",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.125",
3
+ "version": "1.0.127",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",