vr-commons 1.0.31 → 1.0.33

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.
@@ -1,3 +1,3 @@
1
1
  export { validate } from "./validate.validations";
2
2
  export { riderLoginSchema, forgotPasswordSchema, userLoginSchema, } from "./auth.validations";
3
- export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, getRiderProfileSchema, changePasswordSchema, deactivateAccountSchema, deleteAccountSchema, } from "./profiles.validations";
3
+ export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, updateRiderProfileSchema, createRiderSchema, changePasswordSchema, deactivateAccountSchema, deleteAccountSchema, } from "./profiles.validations";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.getRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
3
+ exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
4
4
  var validate_validations_1 = require("./validate.validations");
5
5
  Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_validations_1.validate; } });
6
6
  var auth_validations_1 = require("./auth.validations");
@@ -19,7 +19,8 @@ Object.defineProperty(exports, "viewProfileSchema", { enumerable: true, get: fun
19
19
  Object.defineProperty(exports, "passengerSignupSchema", { enumerable: true, get: function () { return profiles_validations_1.passengerSignupSchema; } });
20
20
  Object.defineProperty(exports, "updatePassengerProfileSchema", { enumerable: true, get: function () { return profiles_validations_1.updatePassengerProfileSchema; } });
21
21
  // Rider Schemas
22
- Object.defineProperty(exports, "getRiderProfileSchema", { enumerable: true, get: function () { return profiles_validations_1.getRiderProfileSchema; } });
22
+ Object.defineProperty(exports, "updateRiderProfileSchema", { enumerable: true, get: function () { return profiles_validations_1.updateRiderProfileSchema; } });
23
+ Object.defineProperty(exports, "createRiderSchema", { enumerable: true, get: function () { return profiles_validations_1.createRiderSchema; } });
23
24
  // Account Management Schemas
24
25
  Object.defineProperty(exports, "changePasswordSchema", { enumerable: true, get: function () { return profiles_validations_1.changePasswordSchema; } });
25
26
  Object.defineProperty(exports, "deactivateAccountSchema", { enumerable: true, get: function () { return profiles_validations_1.deactivateAccountSchema; } });
@@ -14,22 +14,22 @@ export declare const createUserSchema: z.ZodObject<{
14
14
  firstName: string;
15
15
  lastName: string;
16
16
  phoneNumber: string;
17
- password: string;
18
17
  nationalId: string;
19
- role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
20
- jacketId?: string | null | undefined;
18
+ password: string;
19
+ role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
21
20
  email?: string | null | undefined;
22
21
  plateNumber?: string | null | undefined;
22
+ jacketId?: string | null | undefined;
23
23
  }, {
24
24
  firstName: string;
25
25
  lastName: string;
26
26
  phoneNumber: string;
27
- password: string;
28
27
  nationalId: string;
29
- role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
30
- jacketId?: string | null | undefined;
28
+ password: string;
29
+ role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
31
30
  email?: string | null | undefined;
32
31
  plateNumber?: string | null | undefined;
32
+ jacketId?: string | null | undefined;
33
33
  }>;
34
34
  headers: z.ZodObject<{
35
35
  authorization: z.ZodString;
@@ -43,12 +43,12 @@ export declare const createUserSchema: z.ZodObject<{
43
43
  firstName: string;
44
44
  lastName: string;
45
45
  phoneNumber: string;
46
- password: string;
47
46
  nationalId: string;
48
- role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
49
- jacketId?: string | null | undefined;
47
+ password: string;
48
+ role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
50
49
  email?: string | null | undefined;
51
50
  plateNumber?: string | null | undefined;
51
+ jacketId?: string | null | undefined;
52
52
  };
53
53
  headers: {
54
54
  authorization: string;
@@ -58,12 +58,12 @@ export declare const createUserSchema: z.ZodObject<{
58
58
  firstName: string;
59
59
  lastName: string;
60
60
  phoneNumber: string;
61
- password: string;
62
61
  nationalId: string;
63
- role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
64
- jacketId?: string | null | undefined;
62
+ password: string;
63
+ role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
65
64
  email?: string | null | undefined;
66
65
  plateNumber?: string | null | undefined;
66
+ jacketId?: string | null | undefined;
67
67
  };
68
68
  headers: {
69
69
  authorization: string;
@@ -166,6 +166,9 @@ export declare const updateUserProfileSchema: z.ZodObject<{
166
166
  authorization: string;
167
167
  }>;
168
168
  }, "strip", z.ZodTypeAny, {
169
+ params: {
170
+ userId: string;
171
+ };
169
172
  body: {
170
173
  firstName?: string | undefined;
171
174
  lastName?: string | undefined;
@@ -177,13 +180,13 @@ export declare const updateUserProfileSchema: z.ZodObject<{
177
180
  isSuspended?: boolean | undefined;
178
181
  isDeactivated?: boolean | undefined;
179
182
  };
180
- params: {
181
- userId: string;
182
- };
183
183
  headers: {
184
184
  authorization: string;
185
185
  };
186
186
  }, {
187
+ params: {
188
+ userId: string;
189
+ };
187
190
  body: {
188
191
  firstName?: string | undefined;
189
192
  lastName?: string | undefined;
@@ -195,9 +198,6 @@ export declare const updateUserProfileSchema: z.ZodObject<{
195
198
  isSuspended?: boolean | undefined;
196
199
  isDeactivated?: boolean | undefined;
197
200
  };
198
- params: {
199
- userId: string;
200
- };
201
201
  headers: {
202
202
  authorization: string;
203
203
  };
@@ -216,29 +216,29 @@ export declare const getAllUsersSchema: z.ZodObject<{
216
216
  sortBy: z.ZodDefault<z.ZodEnum<["firstName", "lastLoginAt", "createdAt"]>>;
217
217
  order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
218
218
  }, "strip", z.ZodTypeAny, {
219
- order: "asc" | "desc";
220
219
  sortBy: "firstName" | "lastLoginAt" | "createdAt";
221
- search?: string | undefined;
222
- limit?: number | undefined;
220
+ order: "asc" | "desc";
221
+ role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
223
222
  isActive?: boolean | undefined;
224
223
  isSuspended?: boolean | undefined;
225
- role?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
226
224
  page?: number | undefined;
225
+ limit?: number | undefined;
227
226
  isBanned?: boolean | undefined;
227
+ search?: string | undefined;
228
228
  startDate?: string | undefined;
229
229
  endDate?: string | undefined;
230
230
  }, {
231
- search?: string | undefined;
232
- order?: "asc" | "desc" | undefined;
233
- limit?: string | undefined;
231
+ role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
234
232
  isActive?: "true" | "false" | undefined;
235
233
  isSuspended?: "true" | "false" | undefined;
236
- role?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
237
234
  page?: string | undefined;
235
+ limit?: string | undefined;
238
236
  isBanned?: "true" | "false" | undefined;
237
+ search?: string | undefined;
239
238
  startDate?: string | undefined;
240
239
  endDate?: string | undefined;
241
240
  sortBy?: "firstName" | "lastLoginAt" | "createdAt" | undefined;
241
+ order?: "asc" | "desc" | undefined;
242
242
  }>;
243
243
  headers: z.ZodObject<{
244
244
  authorization: z.ZodString;
@@ -248,38 +248,38 @@ export declare const getAllUsersSchema: z.ZodObject<{
248
248
  authorization: string;
249
249
  }>;
250
250
  }, "strip", z.ZodTypeAny, {
251
+ headers: {
252
+ authorization: string;
253
+ };
251
254
  query: {
252
- order: "asc" | "desc";
253
255
  sortBy: "firstName" | "lastLoginAt" | "createdAt";
254
- search?: string | undefined;
255
- limit?: number | undefined;
256
+ order: "asc" | "desc";
257
+ role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
256
258
  isActive?: boolean | undefined;
257
259
  isSuspended?: boolean | undefined;
258
- role?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
259
260
  page?: number | undefined;
261
+ limit?: number | undefined;
260
262
  isBanned?: boolean | undefined;
263
+ search?: string | undefined;
261
264
  startDate?: string | undefined;
262
265
  endDate?: string | undefined;
263
266
  };
267
+ }, {
264
268
  headers: {
265
269
  authorization: string;
266
270
  };
267
- }, {
268
271
  query: {
269
- search?: string | undefined;
270
- order?: "asc" | "desc" | undefined;
271
- limit?: string | undefined;
272
+ role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
272
273
  isActive?: "true" | "false" | undefined;
273
274
  isSuspended?: "true" | "false" | undefined;
274
- role?: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN" | undefined;
275
275
  page?: string | undefined;
276
+ limit?: string | undefined;
276
277
  isBanned?: "true" | "false" | undefined;
278
+ search?: string | undefined;
277
279
  startDate?: string | undefined;
278
280
  endDate?: string | undefined;
279
281
  sortBy?: "firstName" | "lastLoginAt" | "createdAt" | undefined;
280
- };
281
- headers: {
282
- authorization: string;
282
+ order?: "asc" | "desc" | undefined;
283
283
  };
284
284
  }>;
285
285
  export declare const viewProfileSchema: z.ZodObject<{
@@ -297,16 +297,16 @@ export declare const viewProfileSchema: z.ZodObject<{
297
297
  headers: {
298
298
  authorization: string;
299
299
  };
300
+ params?: {} | undefined;
300
301
  body?: {} | undefined;
301
302
  query?: {} | undefined;
302
- params?: {} | undefined;
303
303
  }, {
304
304
  headers: {
305
305
  authorization: string;
306
306
  };
307
+ params?: {} | undefined;
307
308
  body?: {} | undefined;
308
309
  query?: {} | undefined;
309
- params?: {} | undefined;
310
310
  }>;
311
311
  export declare const passengerSignupSchema: z.ZodObject<{
312
312
  body: z.ZodObject<{
@@ -323,19 +323,19 @@ export declare const passengerSignupSchema: z.ZodObject<{
323
323
  lastName: string;
324
324
  phoneNumber: string;
325
325
  nationalId: string;
326
- jacketId?: string | undefined;
327
326
  email?: string | null | undefined;
328
327
  password?: string | null | undefined;
329
328
  plateNumber?: string | null | undefined;
329
+ jacketId?: string | undefined;
330
330
  }, {
331
331
  firstName: string;
332
332
  lastName: string;
333
333
  phoneNumber: string;
334
334
  nationalId: string;
335
- jacketId?: string | undefined;
336
335
  email?: string | null | undefined;
337
336
  password?: string | null | undefined;
338
337
  plateNumber?: string | null | undefined;
338
+ jacketId?: string | undefined;
339
339
  }>;
340
340
  headers: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
341
341
  }, "strip", z.ZodTypeAny, {
@@ -344,10 +344,10 @@ export declare const passengerSignupSchema: z.ZodObject<{
344
344
  lastName: string;
345
345
  phoneNumber: string;
346
346
  nationalId: string;
347
- jacketId?: string | undefined;
348
347
  email?: string | null | undefined;
349
348
  password?: string | null | undefined;
350
349
  plateNumber?: string | null | undefined;
350
+ jacketId?: string | undefined;
351
351
  };
352
352
  headers?: {} | undefined;
353
353
  }, {
@@ -356,10 +356,10 @@ export declare const passengerSignupSchema: z.ZodObject<{
356
356
  lastName: string;
357
357
  phoneNumber: string;
358
358
  nationalId: string;
359
- jacketId?: string | undefined;
360
359
  email?: string | null | undefined;
361
360
  password?: string | null | undefined;
362
361
  plateNumber?: string | null | undefined;
362
+ jacketId?: string | undefined;
363
363
  };
364
364
  headers?: {} | undefined;
365
365
  }>;
@@ -368,28 +368,18 @@ export declare const updatePassengerProfileSchema: z.ZodObject<{
368
368
  body: z.ZodEffects<z.ZodObject<{
369
369
  firstName: z.ZodOptional<z.ZodString>;
370
370
  lastName: z.ZodOptional<z.ZodString>;
371
- email: z.ZodUnion<[z.ZodNullable<z.ZodOptional<z.ZodString>>, z.ZodLiteral<"">]>;
372
- plateNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
373
371
  }, "strip", z.ZodTypeAny, {
374
372
  firstName?: string | undefined;
375
373
  lastName?: string | undefined;
376
- email?: string | null | undefined;
377
- plateNumber?: string | null | undefined;
378
374
  }, {
379
375
  firstName?: string | undefined;
380
376
  lastName?: string | undefined;
381
- email?: string | null | undefined;
382
- plateNumber?: string | null | undefined;
383
377
  }>, {
384
378
  firstName?: string | undefined;
385
379
  lastName?: string | undefined;
386
- email?: string | null | undefined;
387
- plateNumber?: string | null | undefined;
388
380
  }, {
389
381
  firstName?: string | undefined;
390
382
  lastName?: string | undefined;
391
- email?: string | null | undefined;
392
- plateNumber?: string | null | undefined;
393
383
  }>;
394
384
  headers: z.ZodObject<{
395
385
  authorization: z.ZodString;
@@ -402,8 +392,6 @@ export declare const updatePassengerProfileSchema: z.ZodObject<{
402
392
  body: {
403
393
  firstName?: string | undefined;
404
394
  lastName?: string | undefined;
405
- email?: string | null | undefined;
406
- plateNumber?: string | null | undefined;
407
395
  };
408
396
  headers: {
409
397
  authorization: string;
@@ -413,39 +401,69 @@ export declare const updatePassengerProfileSchema: z.ZodObject<{
413
401
  body: {
414
402
  firstName?: string | undefined;
415
403
  lastName?: string | undefined;
416
- email?: string | null | undefined;
417
- plateNumber?: string | null | undefined;
418
404
  };
419
405
  headers: {
420
406
  authorization: string;
421
407
  };
422
408
  params?: {} | undefined;
423
409
  }>;
424
- export declare const getRiderProfileSchema: z.ZodObject<{
425
- params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
426
- body: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
427
- query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
428
- headers: z.ZodObject<{
429
- authorization: z.ZodString;
410
+ export declare const createRiderSchema: z.ZodObject<{
411
+ body: z.ZodObject<{
412
+ firstName: z.ZodString;
413
+ lastName: z.ZodString;
414
+ phoneNumber: z.ZodString;
415
+ nationalId: z.ZodString;
416
+ email: z.ZodUnion<[z.ZodNullable<z.ZodOptional<z.ZodString>>, z.ZodLiteral<"">]>;
417
+ password: z.ZodNullable<z.ZodOptional<z.ZodString>>;
418
+ plateNumber: z.ZodString;
419
+ securityClearanceId: z.ZodString;
430
420
  }, "strip", z.ZodTypeAny, {
431
- authorization: string;
421
+ firstName: string;
422
+ lastName: string;
423
+ phoneNumber: string;
424
+ nationalId: string;
425
+ plateNumber: string;
426
+ securityClearanceId: string;
427
+ email?: string | null | undefined;
428
+ password?: string | null | undefined;
432
429
  }, {
433
- authorization: string;
430
+ firstName: string;
431
+ lastName: string;
432
+ phoneNumber: string;
433
+ nationalId: string;
434
+ plateNumber: string;
435
+ securityClearanceId: string;
436
+ email?: string | null | undefined;
437
+ password?: string | null | undefined;
434
438
  }>;
439
+ params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
440
+ query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
435
441
  }, "strip", z.ZodTypeAny, {
436
- headers: {
437
- authorization: string;
442
+ body: {
443
+ firstName: string;
444
+ lastName: string;
445
+ phoneNumber: string;
446
+ nationalId: string;
447
+ plateNumber: string;
448
+ securityClearanceId: string;
449
+ email?: string | null | undefined;
450
+ password?: string | null | undefined;
438
451
  };
439
- body?: {} | undefined;
440
- query?: {} | undefined;
441
452
  params?: {} | undefined;
453
+ query?: {} | undefined;
442
454
  }, {
443
- headers: {
444
- authorization: string;
455
+ body: {
456
+ firstName: string;
457
+ lastName: string;
458
+ phoneNumber: string;
459
+ nationalId: string;
460
+ plateNumber: string;
461
+ securityClearanceId: string;
462
+ email?: string | null | undefined;
463
+ password?: string | null | undefined;
445
464
  };
446
- body?: {} | undefined;
447
- query?: {} | undefined;
448
465
  params?: {} | undefined;
466
+ query?: {} | undefined;
449
467
  }>;
450
468
  export declare const changePasswordSchema: z.ZodObject<{
451
469
  params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
@@ -561,6 +579,77 @@ export declare const deleteAccountSchema: z.ZodObject<{
561
579
  };
562
580
  params?: {} | undefined;
563
581
  }>;
582
+ export declare const updateRiderProfileSchema: z.ZodObject<{
583
+ params: z.ZodObject<{
584
+ riderId: z.ZodString;
585
+ }, "strip", z.ZodTypeAny, {
586
+ riderId: string;
587
+ }, {
588
+ riderId: string;
589
+ }>;
590
+ body: z.ZodEffects<z.ZodObject<{
591
+ firstName: z.ZodOptional<z.ZodString>;
592
+ lastName: z.ZodOptional<z.ZodString>;
593
+ email: z.ZodUnion<[z.ZodNullable<z.ZodOptional<z.ZodString>>, z.ZodLiteral<"">]>;
594
+ plateNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
595
+ }, "strip", z.ZodTypeAny, {
596
+ firstName?: string | undefined;
597
+ lastName?: string | undefined;
598
+ email?: string | null | undefined;
599
+ plateNumber?: string | null | undefined;
600
+ }, {
601
+ firstName?: string | undefined;
602
+ lastName?: string | undefined;
603
+ email?: string | null | undefined;
604
+ plateNumber?: string | null | undefined;
605
+ }>, {
606
+ firstName?: string | undefined;
607
+ lastName?: string | undefined;
608
+ email?: string | null | undefined;
609
+ plateNumber?: string | null | undefined;
610
+ }, {
611
+ firstName?: string | undefined;
612
+ lastName?: string | undefined;
613
+ email?: string | null | undefined;
614
+ plateNumber?: string | null | undefined;
615
+ }>;
616
+ query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
617
+ headers: z.ZodObject<{
618
+ authorization: z.ZodString;
619
+ }, "strip", z.ZodTypeAny, {
620
+ authorization: string;
621
+ }, {
622
+ authorization: string;
623
+ }>;
624
+ }, "strip", z.ZodTypeAny, {
625
+ params: {
626
+ riderId: string;
627
+ };
628
+ body: {
629
+ firstName?: string | undefined;
630
+ lastName?: string | undefined;
631
+ email?: string | null | undefined;
632
+ plateNumber?: string | null | undefined;
633
+ };
634
+ headers: {
635
+ authorization: string;
636
+ };
637
+ query?: {} | undefined;
638
+ }, {
639
+ params: {
640
+ riderId: string;
641
+ };
642
+ body: {
643
+ firstName?: string | undefined;
644
+ lastName?: string | undefined;
645
+ email?: string | null | undefined;
646
+ plateNumber?: string | null | undefined;
647
+ };
648
+ headers: {
649
+ authorization: string;
650
+ };
651
+ query?: {} | undefined;
652
+ }>;
564
653
  export type CreateUserInput = z.infer<typeof createUserSchema>;
565
654
  export type GetUserByIdInput = z.infer<typeof getUserByIdSchema>;
566
655
  export type UpdateUserProfileInput = z.infer<typeof updateUserProfileSchema>;
@@ -568,7 +657,8 @@ export type GetAllUsersInput = z.infer<typeof getAllUsersSchema>;
568
657
  export type ViewProfileInput = z.infer<typeof viewProfileSchema>;
569
658
  export type PassengerSignupInput = z.infer<typeof passengerSignupSchema>;
570
659
  export type UpdatePassengerProfileInput = z.infer<typeof updatePassengerProfileSchema>;
571
- export type GetRiderProfileInput = z.infer<typeof getRiderProfileSchema>;
660
+ export type CreateRiderInput = z.infer<typeof createRiderSchema>;
661
+ export type UpdateRiderProfileInput = z.infer<typeof updateRiderProfileSchema>;
572
662
  export type ChangePasswordInput = z.infer<typeof changePasswordSchema>;
573
663
  export type DeactivateAccountInput = z.infer<typeof deactivateAccountSchema>;
574
664
  export type DeleteAccountInput = z.infer<typeof deleteAccountSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.getRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = void 0;
3
+ exports.updateRiderProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.createRiderSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  // ============================================================================
6
6
  // COMMON VALIDATIONS
@@ -226,17 +226,6 @@ exports.updatePassengerProfileSchema = zod_1.z.object({
226
226
  .min(2, "Last name must be at least 2 characters")
227
227
  .max(100, "Last name cannot exceed 100 characters")
228
228
  .optional(),
229
- email: zod_1.z
230
- .string()
231
- .email("Invalid email address")
232
- .optional()
233
- .nullable()
234
- .or(zod_1.z.literal("")),
235
- plateNumber: zod_1.z
236
- .string()
237
- .max(20, "Plate number cannot exceed 20 characters")
238
- .optional()
239
- .nullable(),
240
229
  })
241
230
  .refine((data) => Object.keys(data).length > 0, {
242
231
  message: "At least one field must be provided for update",
@@ -250,16 +239,39 @@ exports.updatePassengerProfileSchema = zod_1.z.object({
250
239
  // ============================================================================
251
240
  // RIDER SCHEMAS
252
241
  // ============================================================================
253
- // Get Rider Profile Schema
254
- exports.getRiderProfileSchema = zod_1.z.object({
242
+ exports.createRiderSchema = zod_1.z.object({
243
+ body: zod_1.z.object({
244
+ firstName: zod_1.z
245
+ .string()
246
+ .min(2, "First name must be at least 2 characters")
247
+ .max(100, "First name cannot exceed 100 characters"),
248
+ lastName: zod_1.z
249
+ .string()
250
+ .min(2, "Last name must be at least 2 characters")
251
+ .max(100, "Last name cannot exceed 100 characters"),
252
+ phoneNumber: zod_1.z
253
+ .string()
254
+ .regex(phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
255
+ nationalId: zod_1.z
256
+ .string()
257
+ .regex(nationalIdRegex, "National ID must be 16 digits"),
258
+ email: zod_1.z
259
+ .string()
260
+ .email("Invalid email address")
261
+ .optional()
262
+ .nullable()
263
+ .or(zod_1.z.literal("")),
264
+ password: zod_1.z
265
+ .string()
266
+ .min(6, "Password must be at least 6 characters")
267
+ .max(100, "Password cannot exceed 100 characters")
268
+ .optional()
269
+ .nullable(),
270
+ plateNumber: zod_1.z.string().max(20, "Plate number cannot exceed 20 characters"),
271
+ securityClearanceId: zod_1.z.string().max(30, "SecurityClearanceId required"),
272
+ }),
255
273
  params: zod_1.z.object({}).optional(),
256
- body: zod_1.z.object({}).optional(),
257
274
  query: zod_1.z.object({}).optional(),
258
- headers: zod_1.z.object({
259
- authorization: zod_1.z.string().regex(/^Bearer /, {
260
- message: "Authorization header must start with 'Bearer '",
261
- }),
262
- }),
263
275
  });
264
276
  // ============================================================================
265
277
  // ACCOUNT MANAGEMENT SCHEMAS
@@ -316,3 +328,42 @@ exports.deleteAccountSchema = zod_1.z.object({
316
328
  }),
317
329
  }),
318
330
  });
331
+ // Update Rider Profile Schema
332
+ exports.updateRiderProfileSchema = zod_1.z.object({
333
+ params: zod_1.z.object({
334
+ riderId: zod_1.z.string().uuid("Invalid rider ID format"),
335
+ }),
336
+ body: zod_1.z
337
+ .object({
338
+ firstName: zod_1.z
339
+ .string()
340
+ .min(2, "First name must be at least 2 characters")
341
+ .max(100, "First name cannot exceed 100 characters")
342
+ .optional(),
343
+ lastName: zod_1.z
344
+ .string()
345
+ .min(2, "Last name must be at least 2 characters")
346
+ .max(100, "Last name cannot exceed 100 characters")
347
+ .optional(),
348
+ email: zod_1.z
349
+ .string()
350
+ .email("Invalid email address")
351
+ .optional()
352
+ .nullable()
353
+ .or(zod_1.z.literal("")),
354
+ plateNumber: zod_1.z
355
+ .string()
356
+ .max(20, "Plate number cannot exceed 20 characters")
357
+ .optional()
358
+ .nullable(),
359
+ })
360
+ .refine((data) => Object.keys(data).length > 0, {
361
+ message: "At least one field must be provided for update",
362
+ }),
363
+ query: zod_1.z.object({}).optional(),
364
+ headers: zod_1.z.object({
365
+ authorization: zod_1.z.string().regex(/^Bearer /, {
366
+ message: "Authorization header must start with 'Bearer '",
367
+ }),
368
+ }),
369
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",