@venulog/phasing-engine-schemas 0.4.1 → 0.4.3

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,4 +1,4 @@
1
- import { z } from './zod';
1
+ import { z } from './zod.js';
2
2
  export declare const getAccessTokenParamsSchema: z.ZodObject<{
3
3
  bookingId: z.ZodCoercedNumber<unknown>;
4
4
  }, z.core.$strip>;
@@ -20,4 +20,5 @@ export declare const getAccessTokenResponseSchema: z.ZodObject<{
20
20
  }, z.core.$strip>;
21
21
  export type GetAccessTokenParams = z.infer<typeof getAccessTokenParamsSchema>;
22
22
  export type AccessTokenData = z.infer<typeof accessTokenDataSchema>;
23
+ export type AccessTokenData2 = z.infer<typeof accessTokenDataSchema>;
23
24
  export type GetAccessTokenResponse = z.infer<typeof getAccessTokenResponseSchema>;
@@ -1,5 +1,5 @@
1
- import { z } from './zod';
2
- import { createMessageDataResponseSchema } from './common';
1
+ import { z } from './zod.js';
2
+ import { createMessageDataResponseSchema } from './common.js';
3
3
  export const getAccessTokenParamsSchema = z
4
4
  .object({
5
5
  bookingId: z.coerce
@@ -1,3 +1,4 @@
1
1
  export * from './bookingStatus.js';
2
2
  export * from './phaseSlotScheduleType.js';
3
3
  export * from './parkingAreaScheduleType.js';
4
+ export * from './vehicleType.js';
@@ -2,3 +2,4 @@
2
2
  export * from './bookingStatus.js';
3
3
  export * from './phaseSlotScheduleType.js';
4
4
  export * from './parkingAreaScheduleType.js';
5
+ export * from './vehicleType.js';
@@ -0,0 +1,6 @@
1
+ export declare enum VehicleType {
2
+ PL = "PL",// Poids lourd (heavy vehicle)
3
+ VUL = "VUL",// Véhicule utilitaire léger (light utility vehicle)
4
+ VL = "VL"
5
+ }
6
+ export declare const VEHICLE_TYPE_LABELS: Record<VehicleType, string>;
@@ -0,0 +1,13 @@
1
+ // Vehicle type enumeration for parking area schedules
2
+ // Defines the types of vehicles allowed to book specific time slots
3
+ export var VehicleType;
4
+ (function (VehicleType) {
5
+ VehicleType["PL"] = "PL";
6
+ VehicleType["VUL"] = "VUL";
7
+ VehicleType["VL"] = "VL"; // Véhicule léger (light vehicle)
8
+ })(VehicleType || (VehicleType = {}));
9
+ export const VEHICLE_TYPE_LABELS = {
10
+ [VehicleType.PL]: 'Poids lourd (PL)',
11
+ [VehicleType.VUL]: 'Véhicule utilitaire léger (VUL)',
12
+ [VehicleType.VL]: 'Véhicule léger (VL)'
13
+ };
@@ -1,5 +1,6 @@
1
1
  import { z } from './zod.js';
2
2
  import { ParkingAreaScheduleType } from './enums/parkingAreaScheduleType.js';
3
+ import { VehicleType } from './enums/vehicleType.js';
3
4
  /**
4
5
  * A point in 2D space using percentage-based coordinates (0-100)
5
6
  * relative to the site plan image dimensions
@@ -84,7 +85,12 @@ export declare const parkingAreaWithSchedulesSchema: z.ZodObject<{
84
85
  assembly: ParkingAreaScheduleType.ASSEMBLY;
85
86
  dismantling: ParkingAreaScheduleType.DISMANTLING;
86
87
  }>;
87
- company_role: z.ZodNullable<z.ZodString>;
88
+ company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
89
+ vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
90
+ PL: VehicleType.PL;
91
+ VUL: VehicleType.VUL;
92
+ VL: VehicleType.VL;
93
+ }>>>;
88
94
  }, z.core.$strip>>>;
89
95
  }, z.core.$strip>;
90
96
  export declare const getParkingAreasByEventIdParamsSchema: z.ZodObject<{
@@ -327,7 +333,12 @@ export declare const getParkingAreaDetailResponseSchema: z.ZodObject<{
327
333
  assembly: ParkingAreaScheduleType.ASSEMBLY;
328
334
  dismantling: ParkingAreaScheduleType.DISMANTLING;
329
335
  }>;
330
- company_role: z.ZodNullable<z.ZodString>;
336
+ company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
337
+ vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
338
+ PL: VehicleType.PL;
339
+ VUL: VehicleType.VUL;
340
+ VL: VehicleType.VL;
341
+ }>>>;
331
342
  }, z.core.$strip>>>;
332
343
  }, z.core.$strip>;
333
344
  }, z.core.$strip>;
@@ -342,7 +353,12 @@ export declare const parkingAreaScheduleSchema: z.ZodObject<{
342
353
  assembly: ParkingAreaScheduleType.ASSEMBLY;
343
354
  dismantling: ParkingAreaScheduleType.DISMANTLING;
344
355
  }>;
345
- company_role: z.ZodNullable<z.ZodString>;
356
+ company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
357
+ vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
358
+ PL: VehicleType.PL;
359
+ VUL: VehicleType.VUL;
360
+ VL: VehicleType.VL;
361
+ }>>>;
346
362
  created_at: z.ZodString;
347
363
  updated_at: z.ZodString;
348
364
  created_by: z.ZodNullable<z.ZodString>;
@@ -359,7 +375,12 @@ export declare const upsertParkingAreaScheduleItemSchema: z.ZodObject<{
359
375
  assembly: ParkingAreaScheduleType.ASSEMBLY;
360
376
  dismantling: ParkingAreaScheduleType.DISMANTLING;
361
377
  }>;
362
- company_role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
378
+ company_roles: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
379
+ vehicle_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
380
+ PL: VehicleType.PL;
381
+ VUL: VehicleType.VUL;
382
+ VL: VehicleType.VL;
383
+ }>>>>;
363
384
  }, z.core.$strip>;
364
385
  export declare const deleteParkingAreaScheduleItemSchema: z.ZodObject<{
365
386
  id: z.ZodNumber;
@@ -376,7 +397,12 @@ export declare const upsertParkingAreaSchedulesBodySchema: z.ZodObject<{
376
397
  assembly: ParkingAreaScheduleType.ASSEMBLY;
377
398
  dismantling: ParkingAreaScheduleType.DISMANTLING;
378
399
  }>;
379
- company_role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
400
+ company_roles: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
401
+ vehicle_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
402
+ PL: VehicleType.PL;
403
+ VUL: VehicleType.VUL;
404
+ VL: VehicleType.VL;
405
+ }>>>>;
380
406
  }, z.core.$strip>>>;
381
407
  delete: z.ZodOptional<z.ZodArray<z.ZodObject<{
382
408
  id: z.ZodNumber;
@@ -396,7 +422,12 @@ export declare const upsertParkingAreaSchedulesDataSchema: z.ZodObject<{
396
422
  assembly: ParkingAreaScheduleType.ASSEMBLY;
397
423
  dismantling: ParkingAreaScheduleType.DISMANTLING;
398
424
  }>;
399
- company_role: z.ZodNullable<z.ZodString>;
425
+ company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
426
+ vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
427
+ PL: VehicleType.PL;
428
+ VUL: VehicleType.VUL;
429
+ VL: VehicleType.VL;
430
+ }>>>;
400
431
  created_at: z.ZodString;
401
432
  updated_at: z.ZodString;
402
433
  created_by: z.ZodNullable<z.ZodString>;
@@ -422,7 +453,12 @@ export declare const upsertParkingAreaSchedulesDataSchema: z.ZodObject<{
422
453
  assembly: ParkingAreaScheduleType.ASSEMBLY;
423
454
  dismantling: ParkingAreaScheduleType.DISMANTLING;
424
455
  }>;
425
- company_role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
456
+ company_roles: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
457
+ vehicle_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
458
+ PL: VehicleType.PL;
459
+ VUL: VehicleType.VUL;
460
+ VL: VehicleType.VL;
461
+ }>>>>;
426
462
  }, z.core.$strip>, z.ZodObject<{
427
463
  id: z.ZodNumber;
428
464
  }, z.core.$strip>]>;
@@ -445,7 +481,12 @@ export declare const upsertParkingAreaSchedulesResponseSchema: z.ZodObject<{
445
481
  assembly: ParkingAreaScheduleType.ASSEMBLY;
446
482
  dismantling: ParkingAreaScheduleType.DISMANTLING;
447
483
  }>;
448
- company_role: z.ZodNullable<z.ZodString>;
484
+ company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
485
+ vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
486
+ PL: VehicleType.PL;
487
+ VUL: VehicleType.VUL;
488
+ VL: VehicleType.VL;
489
+ }>>>;
449
490
  created_at: z.ZodString;
450
491
  updated_at: z.ZodString;
451
492
  created_by: z.ZodNullable<z.ZodString>;
@@ -471,7 +512,12 @@ export declare const upsertParkingAreaSchedulesResponseSchema: z.ZodObject<{
471
512
  assembly: ParkingAreaScheduleType.ASSEMBLY;
472
513
  dismantling: ParkingAreaScheduleType.DISMANTLING;
473
514
  }>;
474
- company_role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
515
+ company_roles: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
516
+ vehicle_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
517
+ PL: VehicleType.PL;
518
+ VUL: VehicleType.VUL;
519
+ VL: VehicleType.VL;
520
+ }>>>>;
475
521
  }, z.core.$strip>, z.ZodObject<{
476
522
  id: z.ZodNumber;
477
523
  }, z.core.$strip>]>;
@@ -519,7 +565,12 @@ export declare const availableParkingAreaTimeSlotSchema: z.ZodObject<{
519
565
  assembly: "assembly";
520
566
  dismantling: "dismantling";
521
567
  }>;
522
- company_role: z.ZodNullable<z.ZodString>;
568
+ company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
569
+ vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
570
+ PL: VehicleType.PL;
571
+ VUL: VehicleType.VUL;
572
+ VL: VehicleType.VL;
573
+ }>>>;
523
574
  max_capacity: z.ZodNumber;
524
575
  current_bookings: z.ZodNumber;
525
576
  confirmed_bookings: z.ZodNumber;
@@ -544,7 +595,12 @@ export declare const availableParkingAreaSlotsResponseSchema: z.ZodObject<{
544
595
  assembly: "assembly";
545
596
  dismantling: "dismantling";
546
597
  }>;
547
- company_role: z.ZodNullable<z.ZodString>;
598
+ company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
599
+ vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
600
+ PL: VehicleType.PL;
601
+ VUL: VehicleType.VUL;
602
+ VL: VehicleType.VL;
603
+ }>>>;
548
604
  max_capacity: z.ZodNumber;
549
605
  current_bookings: z.ZodNumber;
550
606
  confirmed_bookings: z.ZodNumber;
@@ -2,6 +2,7 @@
2
2
  import { z } from './zod.js';
3
3
  import { createSuccessResponseSchema, createMessageDataResponseSchema } from './common.js';
4
4
  import { ParkingAreaScheduleType } from './enums/parkingAreaScheduleType.js';
5
+ import { VehicleType } from './enums/vehicleType.js';
5
6
  // ------------------------------
6
7
  // Geometry Schemas
7
8
  // ------------------------------
@@ -146,7 +147,10 @@ export const parkingAreaWithSchedulesSchema = parkingAreaItemSchema
146
147
  ParkingAreaScheduleType.ASSEMBLY,
147
148
  ParkingAreaScheduleType.DISMANTLING
148
149
  ]),
149
- company_role: z.string().nullable()
150
+ company_roles: z.array(z.string()).nullable(),
151
+ vehicle_types: z
152
+ .array(z.enum([VehicleType.PL, VehicleType.VUL, VehicleType.VL]))
153
+ .nullable()
150
154
  }))
151
155
  .optional()
152
156
  .openapi({
@@ -484,9 +488,19 @@ export const parkingAreaScheduleSchema = z
484
488
  description: 'Type of schedule',
485
489
  example: ParkingAreaScheduleType.ASSEMBLY
486
490
  }),
487
- company_role: z.string().nullable().openapi({
488
- description: 'Company role allowed for this schedule',
489
- example: 'exhibitor'
491
+ company_roles: z
492
+ .array(z.string())
493
+ .nullable()
494
+ .openapi({
495
+ description: 'Company roles allowed for this schedule (empty or null = all allowed)',
496
+ example: ['exhibitor', 'contractor']
497
+ }),
498
+ vehicle_types: z
499
+ .array(z.enum([VehicleType.PL, VehicleType.VUL, VehicleType.VL]))
500
+ .nullable()
501
+ .openapi({
502
+ description: 'Vehicle types allowed for this schedule (empty or null = all allowed)',
503
+ example: [VehicleType.PL, VehicleType.VUL]
490
504
  }),
491
505
  created_at: z.string().openapi({
492
506
  description: 'Timestamp when schedule was created',
@@ -552,9 +566,21 @@ export const upsertParkingAreaScheduleItemSchema = z
552
566
  description: 'Type of schedule',
553
567
  example: ParkingAreaScheduleType.ASSEMBLY
554
568
  }),
555
- company_role: z.string().nullable().optional().openapi({
556
- description: 'Company role allowed for this schedule',
557
- example: 'exhibitor'
569
+ company_roles: z
570
+ .array(z.string())
571
+ .nullable()
572
+ .optional()
573
+ .openapi({
574
+ description: 'Company roles allowed for this schedule (empty or null = all allowed)',
575
+ example: ['exhibitor', 'contractor']
576
+ }),
577
+ vehicle_types: z
578
+ .array(z.enum([VehicleType.PL, VehicleType.VUL, VehicleType.VL]))
579
+ .nullable()
580
+ .optional()
581
+ .openapi({
582
+ description: 'Vehicle types allowed for this schedule (empty or null = all allowed)',
583
+ example: [VehicleType.PL, VehicleType.VUL]
558
584
  })
559
585
  })
560
586
  .openapi('UpsertParkingAreaScheduleItem');
@@ -729,9 +755,19 @@ export const availableParkingAreaTimeSlotSchema = z
729
755
  description: 'Type of schedule',
730
756
  example: 'assembly'
731
757
  }),
732
- company_role: z.string().nullable().openapi({
733
- description: 'Company role allowed for this schedule',
734
- example: 'exhibitor'
758
+ company_roles: z
759
+ .array(z.string())
760
+ .nullable()
761
+ .openapi({
762
+ description: 'Company roles allowed for this schedule',
763
+ example: ['exhibitor', 'contractor']
764
+ }),
765
+ vehicle_types: z
766
+ .array(z.enum([VehicleType.PL, VehicleType.VUL, VehicleType.VL]))
767
+ .nullable()
768
+ .openapi({
769
+ description: 'Vehicle types allowed for this schedule',
770
+ example: [VehicleType.PL, VehicleType.VUL]
735
771
  }),
736
772
  max_capacity: z.number().openapi({
737
773
  description: 'Maximum booking capacity for this slot',
@@ -343,6 +343,17 @@ export declare const confirmBookingResponseSchema: z.ZodObject<{
343
343
  confirmed_by: z.ZodNullable<z.ZodString>;
344
344
  }, z.core.$strip>;
345
345
  }, z.core.$strip>;
346
+ export declare const confirmAccessDataSchema: z.ZodObject<{
347
+ bookingId: z.ZodCoercedNumber<unknown>;
348
+ }, z.core.$strip>;
349
+ export declare const confirmAccessResponseSchema: z.ZodObject<{
350
+ success: z.ZodBoolean;
351
+ message: z.ZodString;
352
+ data: z.ZodObject<{
353
+ booking_id: z.ZodNumber;
354
+ scanned_at: z.ZodString;
355
+ }, z.core.$strip>;
356
+ }, z.core.$strip>;
346
357
  export declare const refuseBookingParamsSchema: z.ZodObject<{
347
358
  bookingId: z.ZodCoercedNumber<unknown>;
348
359
  }, z.core.$strip>;
@@ -368,82 +379,6 @@ export declare const refuseBookingResponseSchema: z.ZodObject<{
368
379
  refused_by: z.ZodNullable<z.ZodString>;
369
380
  }, z.core.$strip>;
370
381
  }, z.core.$strip>;
371
- export declare const updatePhaseBookingBodySchema: z.ZodObject<{
372
- company: z.ZodOptional<z.ZodObject<{
373
- hall: z.ZodString;
374
- stand_number: z.ZodString;
375
- company_name: z.ZodString;
376
- business: z.ZodString;
377
- departure_city: z.ZodString;
378
- contact_name: z.ZodString;
379
- email: z.ZodEmail;
380
- phone: z.ZodString;
381
- driver_name: z.ZodString;
382
- driver_phone: z.ZodString;
383
- transport_company: z.ZodString;
384
- }, z.core.$strip>>;
385
- vehicle: z.ZodOptional<z.ZodObject<{
386
- vehicle_type: z.ZodString;
387
- unloading_method: z.ZodString;
388
- license_plate: z.ZodString;
389
- trailer_registration: z.ZodOptional<z.ZodString>;
390
- }, z.core.$strip>>;
391
- access_token: z.ZodString;
392
- }, z.core.$strip>;
393
- export declare const updatePhaseBookingDataSchema: z.ZodObject<{
394
- booking_id: z.ZodNumber;
395
- qr_token: z.ZodString;
396
- company: z.ZodNullable<z.ZodObject<{
397
- hall: z.ZodString;
398
- stand_number: z.ZodString;
399
- company_name: z.ZodString;
400
- business: z.ZodString;
401
- departure_city: z.ZodString;
402
- contact_name: z.ZodString;
403
- email: z.ZodEmail;
404
- phone: z.ZodString;
405
- driver_name: z.ZodString;
406
- driver_phone: z.ZodString;
407
- transport_company: z.ZodString;
408
- }, z.core.$strip>>;
409
- vehicle: z.ZodNullable<z.ZodObject<{
410
- vehicle_type: z.ZodString;
411
- unloading_method: z.ZodString;
412
- license_plate: z.ZodString;
413
- trailer_registration: z.ZodOptional<z.ZodString>;
414
- }, z.core.$strip>>;
415
- updated_at: z.ZodString;
416
- updated_by: z.ZodNullable<z.ZodString>;
417
- }, z.core.$strip>;
418
- export declare const updatePhaseBookingResponseSchema: z.ZodObject<{
419
- success: z.ZodBoolean;
420
- message: z.ZodString;
421
- data: z.ZodObject<{
422
- booking_id: z.ZodNumber;
423
- qr_token: z.ZodString;
424
- company: z.ZodNullable<z.ZodObject<{
425
- hall: z.ZodString;
426
- stand_number: z.ZodString;
427
- company_name: z.ZodString;
428
- business: z.ZodString;
429
- departure_city: z.ZodString;
430
- contact_name: z.ZodString;
431
- email: z.ZodEmail;
432
- phone: z.ZodString;
433
- driver_name: z.ZodString;
434
- driver_phone: z.ZodString;
435
- transport_company: z.ZodString;
436
- }, z.core.$strip>>;
437
- vehicle: z.ZodNullable<z.ZodObject<{
438
- vehicle_type: z.ZodString;
439
- unloading_method: z.ZodString;
440
- license_plate: z.ZodString;
441
- trailer_registration: z.ZodOptional<z.ZodString>;
442
- }, z.core.$strip>>;
443
- updated_at: z.ZodString;
444
- updated_by: z.ZodNullable<z.ZodString>;
445
- }, z.core.$strip>;
446
- }, z.core.$strip>;
447
382
  export declare const createPhaseSlotsBodySchema: z.ZodObject<{
448
383
  event_id: z.ZodNumber;
449
384
  slots: z.ZodArray<z.ZodObject<{
@@ -853,6 +788,7 @@ export declare const getBookingDetailsParamsSchema: z.ZodObject<{
853
788
  }, z.core.$strip>;
854
789
  export declare const bookingDetailsDataSchema: z.ZodObject<{
855
790
  qr_token: z.ZodNullable<z.ZodString>;
791
+ id: z.ZodNumber;
856
792
  booking_id: z.ZodNumber;
857
793
  status: z.ZodString;
858
794
  booking_date: z.ZodString;
@@ -901,6 +837,7 @@ export declare const getBookingDetailsResponseSchema: z.ZodObject<{
901
837
  success: z.ZodBoolean;
902
838
  data: z.ZodObject<{
903
839
  qr_token: z.ZodNullable<z.ZodString>;
840
+ id: z.ZodNumber;
904
841
  booking_id: z.ZodNumber;
905
842
  status: z.ZodString;
906
843
  booking_date: z.ZodString;
@@ -956,6 +893,7 @@ export declare const getBookingDetailsByTokenResponseSchema: z.ZodObject<{
956
893
  success: z.ZodBoolean;
957
894
  data: z.ZodObject<{
958
895
  qr_token: z.ZodNullable<z.ZodString>;
896
+ id: z.ZodNumber;
959
897
  booking_id: z.ZodNumber;
960
898
  status: z.ZodString;
961
899
  booking_date: z.ZodString;
@@ -1010,6 +948,7 @@ export declare const getBookingDetailsByQrResponseSchema: z.ZodObject<{
1010
948
  success: z.ZodBoolean;
1011
949
  data: z.ZodObject<{
1012
950
  qr_token: z.ZodNullable<z.ZodString>;
951
+ id: z.ZodNumber;
1013
952
  booking_id: z.ZodNumber;
1014
953
  status: z.ZodString;
1015
954
  booking_date: z.ZodString;
@@ -1057,6 +996,82 @@ export declare const getBookingDetailsByQrResponseSchema: z.ZodObject<{
1057
996
  }, z.core.$strip>;
1058
997
  export type GetBookingDetailsByQrBody = z.infer<typeof getBookingDetailsByQrBodySchema>;
1059
998
  export type GetBookingDetailsByQrResponse = z.infer<typeof getBookingDetailsByQrResponseSchema>;
999
+ export declare const updatePhaseBookingBodySchema: z.ZodObject<{
1000
+ company: z.ZodOptional<z.ZodObject<{
1001
+ hall: z.ZodString;
1002
+ stand_number: z.ZodString;
1003
+ company_name: z.ZodString;
1004
+ business: z.ZodString;
1005
+ departure_city: z.ZodString;
1006
+ contact_name: z.ZodString;
1007
+ email: z.ZodEmail;
1008
+ phone: z.ZodString;
1009
+ driver_name: z.ZodString;
1010
+ driver_phone: z.ZodString;
1011
+ transport_company: z.ZodString;
1012
+ }, z.core.$strip>>;
1013
+ vehicle: z.ZodOptional<z.ZodObject<{
1014
+ vehicle_type: z.ZodString;
1015
+ unloading_method: z.ZodString;
1016
+ license_plate: z.ZodString;
1017
+ trailer_registration: z.ZodOptional<z.ZodString>;
1018
+ }, z.core.$strip>>;
1019
+ access_token: z.ZodString;
1020
+ }, z.core.$strip>;
1021
+ export declare const updatePhaseBookingDataSchema: z.ZodObject<{
1022
+ booking_id: z.ZodNumber;
1023
+ qr_token: z.ZodString;
1024
+ company: z.ZodNullable<z.ZodObject<{
1025
+ hall: z.ZodString;
1026
+ stand_number: z.ZodString;
1027
+ company_name: z.ZodString;
1028
+ business: z.ZodString;
1029
+ departure_city: z.ZodString;
1030
+ contact_name: z.ZodString;
1031
+ email: z.ZodEmail;
1032
+ phone: z.ZodString;
1033
+ driver_name: z.ZodString;
1034
+ driver_phone: z.ZodString;
1035
+ transport_company: z.ZodString;
1036
+ }, z.core.$strip>>;
1037
+ vehicle: z.ZodNullable<z.ZodObject<{
1038
+ vehicle_type: z.ZodString;
1039
+ unloading_method: z.ZodString;
1040
+ license_plate: z.ZodString;
1041
+ trailer_registration: z.ZodOptional<z.ZodString>;
1042
+ }, z.core.$strip>>;
1043
+ updated_at: z.ZodString;
1044
+ updated_by: z.ZodNullable<z.ZodString>;
1045
+ }, z.core.$strip>;
1046
+ export declare const updatePhaseBookingResponseSchema: z.ZodObject<{
1047
+ success: z.ZodBoolean;
1048
+ message: z.ZodString;
1049
+ data: z.ZodObject<{
1050
+ booking_id: z.ZodNumber;
1051
+ qr_token: z.ZodString;
1052
+ company: z.ZodNullable<z.ZodObject<{
1053
+ hall: z.ZodString;
1054
+ stand_number: z.ZodString;
1055
+ company_name: z.ZodString;
1056
+ business: z.ZodString;
1057
+ departure_city: z.ZodString;
1058
+ contact_name: z.ZodString;
1059
+ email: z.ZodEmail;
1060
+ phone: z.ZodString;
1061
+ driver_name: z.ZodString;
1062
+ driver_phone: z.ZodString;
1063
+ transport_company: z.ZodString;
1064
+ }, z.core.$strip>>;
1065
+ vehicle: z.ZodNullable<z.ZodObject<{
1066
+ vehicle_type: z.ZodString;
1067
+ unloading_method: z.ZodString;
1068
+ license_plate: z.ZodString;
1069
+ trailer_registration: z.ZodOptional<z.ZodString>;
1070
+ }, z.core.$strip>>;
1071
+ updated_at: z.ZodString;
1072
+ updated_by: z.ZodNullable<z.ZodString>;
1073
+ }, z.core.$strip>;
1074
+ }, z.core.$strip>;
1060
1075
  export type UpdatePhaseBookingBody = z.infer<typeof updatePhaseBookingBodySchema>;
1061
1076
  export type UpdatePhaseBookingData = z.infer<typeof updatePhaseBookingDataSchema>;
1062
1077
  export type UpdatePhaseBookingResponse = z.infer<typeof updatePhaseBookingResponseSchema>;
@@ -405,6 +405,19 @@ export const confirmBookingResponseSchema = z.object({
405
405
  confirmed_by: z.string().nullable()
406
406
  })
407
407
  });
408
+ export const confirmAccessDataSchema = z.object({
409
+ bookingId: z.coerce.number().int().positive({
410
+ message: 'Booking ID must be a positive integer'
411
+ })
412
+ });
413
+ export const confirmAccessResponseSchema = z.object({
414
+ success: z.boolean(),
415
+ message: z.string(),
416
+ data: z.object({
417
+ booking_id: z.number(),
418
+ scanned_at: z.string()
419
+ })
420
+ });
408
421
  export const refuseBookingParamsSchema = z
409
422
  .object({
410
423
  bookingId: z.coerce
@@ -445,50 +458,6 @@ export const refuseBookingDataSchema = z
445
458
  })
446
459
  .openapi('RefuseBookingData');
447
460
  export const refuseBookingResponseSchema = createMessageDataResponseSchema(refuseBookingDataSchema, 'RefuseBookingResponse', 'Phase booking refused successfully', 'Details of the refused booking');
448
- export const updatePhaseBookingBodySchema = z
449
- .object({
450
- company: companyDetailsSchema.optional().openapi({
451
- description: 'Updated company details'
452
- }),
453
- vehicle: vehicleDetailsSchema.optional().openapi({
454
- description: 'Updated vehicle details'
455
- }),
456
- access_token: z.string().min(1, 'Access token is required').openapi({
457
- description: 'Access pass token for booking verification',
458
- example: 'ACCESS_1a2b3c4d5e6f7g8h_eyJib29raW5nSWQiOjF9'
459
- })
460
- })
461
- .refine(data => data.company !== undefined || data.vehicle !== undefined, {
462
- message: 'At least one field (company or vehicle) must be provided for update'
463
- })
464
- .openapi('UpdatePhaseBookingBody');
465
- export const updatePhaseBookingDataSchema = z
466
- .object({
467
- booking_id: z.number().openapi({
468
- description: 'ID of the updated booking',
469
- example: 1
470
- }),
471
- qr_token: z.string().openapi({
472
- description: 'New regenerated QR token',
473
- example: 'ACCESS_1a2b3c4d5e6f7g8h_eyJib29raW5nSWQiOjF9'
474
- }),
475
- company: companyDetailsSchema.nullable().openapi({
476
- description: 'Updated company details'
477
- }),
478
- vehicle: vehicleDetailsSchema.nullable().openapi({
479
- description: 'Updated vehicle details'
480
- }),
481
- updated_at: z.string().openapi({
482
- description: 'Timestamp when booking was updated',
483
- example: '2025-12-23T10:30:00.000Z'
484
- }),
485
- updated_by: z.string().nullable().openapi({
486
- description: 'ID of the user who updated the booking',
487
- example: 'user-123'
488
- })
489
- })
490
- .openapi('UpdatePhaseBookingData');
491
- export const updatePhaseBookingResponseSchema = createMessageDataResponseSchema(updatePhaseBookingDataSchema, 'UpdatePhaseBookingResponse', 'Phase booking updated successfully', 'Details of the updated booking');
492
461
  // ------------------------------
493
462
  // Create Phase Slots schemas
494
463
  // ------------------------------
@@ -966,6 +935,10 @@ export const bookingDetailsDataSchema = z
966
935
  description: 'QR token for verification',
967
936
  example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
968
937
  }),
938
+ id: z.number().openapi({
939
+ description: 'ID of the booking',
940
+ example: 123
941
+ }),
969
942
  booking_id: z.number().openapi({
970
943
  description: 'ID of the booking',
971
944
  example: 123
@@ -1072,6 +1045,53 @@ export const getBookingDetailsByQrBodySchema = z
1072
1045
  .openapi('GetBookingDetailsByQrBody');
1073
1046
  export const getBookingDetailsByQrResponseSchema = createSuccessResponseSchema(bookingDetailsDataSchema, 'GetBookingDetailsByQrResponse', 'Booking details retrieved by QR token');
1074
1047
  // ------------------------------
1048
+ // Update Phase Booking schemas
1049
+ // ------------------------------
1050
+ export const updatePhaseBookingBodySchema = z
1051
+ .object({
1052
+ company: companyDetailsSchema.optional().openapi({
1053
+ description: 'Updated company details'
1054
+ }),
1055
+ vehicle: vehicleDetailsSchema.optional().openapi({
1056
+ description: 'Updated vehicle details'
1057
+ }),
1058
+ access_token: z.string().min(1, 'Access token is required').openapi({
1059
+ description: 'Access pass token for booking verification',
1060
+ example: 'ACCESS_1a2b3c4d5e6f7g8h_eyJib29raW5nSWQiOjF9'
1061
+ })
1062
+ })
1063
+ .refine(data => data.company !== undefined || data.vehicle !== undefined, {
1064
+ message: 'At least one field (company or vehicle) must be provided for update'
1065
+ })
1066
+ .openapi('UpdatePhaseBookingBody');
1067
+ export const updatePhaseBookingDataSchema = z
1068
+ .object({
1069
+ booking_id: z.number().openapi({
1070
+ description: 'ID of the updated booking',
1071
+ example: 1
1072
+ }),
1073
+ qr_token: z.string().openapi({
1074
+ description: 'New regenerated QR token',
1075
+ example: 'ACCESS_1a2b3c4d5e6f7g8h_eyJib29raW5nSWQiOjF9'
1076
+ }),
1077
+ company: companyDetailsSchema.nullable().openapi({
1078
+ description: 'Updated company details'
1079
+ }),
1080
+ vehicle: vehicleDetailsSchema.nullable().openapi({
1081
+ description: 'Updated vehicle details'
1082
+ }),
1083
+ updated_at: z.string().openapi({
1084
+ description: 'Timestamp when booking was updated',
1085
+ example: '2025-12-23T10:30:00.000Z'
1086
+ }),
1087
+ updated_by: z.string().nullable().openapi({
1088
+ description: 'ID of the user who updated the booking',
1089
+ example: 'user-123'
1090
+ })
1091
+ })
1092
+ .openapi('UpdatePhaseBookingData');
1093
+ export const updatePhaseBookingResponseSchema = createMessageDataResponseSchema(updatePhaseBookingDataSchema, 'UpdatePhaseBookingResponse', 'Phase booking updated successfully', 'Details of the updated booking');
1094
+ // ------------------------------
1075
1095
  // Booking with nested relations schema for QR generation
1076
1096
  // ------------------------------
1077
1097
  export const bookingWithRelationsSchema = z
package/package.json CHANGED
@@ -1,75 +1,79 @@
1
- {
2
- "name": "@venulog/phasing-engine-schemas",
3
- "version": "0.4.1",
4
- "description": "Shared schemas and types for Phasing Engine API",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- },
13
- "./auth": {
14
- "types": "./dist/auth.d.ts",
15
- "import": "./dist/auth.js"
16
- },
17
- "./common": {
18
- "types": "./dist/common.d.ts",
19
- "import": "./dist/common.js"
20
- },
21
- "./pagination": {
22
- "types": "./dist/pagination.d.ts",
23
- "import": "./dist/pagination.js"
24
- },
25
- "./phaseBooking": {
26
- "types": "./dist/phaseBooking.d.ts",
27
- "import": "./dist/phaseBooking.js"
28
- },
29
- "./phaseSlot": {
30
- "types": "./dist/phaseSlot.d.ts",
31
- "import": "./dist/phaseSlot.js"
32
- },
33
- "./event": {
34
- "types": "./dist/event.d.ts",
35
- "import": "./dist/event.js"
36
- },
37
- "./parkingArea": {
38
- "types": "./dist/parkingArea.d.ts",
39
- "import": "./dist/parkingArea.js"
40
- },
41
- "./enums": {
42
- "types": "./dist/enums/index.d.ts",
43
- "import": "./dist/enums/index.js"
44
- }
45
- },
46
- "files": [
47
- "dist"
48
- ],
49
- "scripts": {
50
- "build": "npm run clean && tsc",
51
- "dev": "tsc --watch",
52
- "clean": "rm -rf dist",
53
- "prepublishOnly": "npm run build"
54
- },
55
- "keywords": [
56
- "schemas",
57
- "validation",
58
- "types",
59
- "zod",
60
- "phasing-engine"
61
- ],
62
- "license": "MIT",
63
- "dependencies": {
64
- "@asteasolutions/zod-to-openapi": "^8.1.0",
65
- "zod": "^4.1.13"
66
- },
67
- "devDependencies": {
68
- "typescript": "^5.6.3"
69
- },
70
- "repository": {
71
- "type": "git",
72
- "url": "git+https://github.com/manaty/phasing_engine.git",
73
- "directory": "packages/phasing-schemas"
74
- }
75
- }
1
+ {
2
+ "name": "@venulog/phasing-engine-schemas",
3
+ "version": "0.4.3",
4
+ "description": "Shared schemas and types for Phasing Engine API",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./auth": {
14
+ "types": "./dist/auth.d.ts",
15
+ "import": "./dist/auth.js"
16
+ },
17
+ "./common": {
18
+ "types": "./dist/common.d.ts",
19
+ "import": "./dist/common.js"
20
+ },
21
+ "./pagination": {
22
+ "types": "./dist/pagination.d.ts",
23
+ "import": "./dist/pagination.js"
24
+ },
25
+ "./phaseBooking": {
26
+ "types": "./dist/phaseBooking.d.ts",
27
+ "import": "./dist/phaseBooking.js"
28
+ },
29
+ "./phaseSlot": {
30
+ "types": "./dist/phaseSlot.d.ts",
31
+ "import": "./dist/phaseSlot.js"
32
+ },
33
+ "./event": {
34
+ "types": "./dist/event.d.ts",
35
+ "import": "./dist/event.js"
36
+ },
37
+ "./parkingArea": {
38
+ "types": "./dist/parkingArea.d.ts",
39
+ "import": "./dist/parkingArea.js"
40
+ },
41
+ "./enums": {
42
+ "types": "./dist/enums/index.d.ts",
43
+ "import": "./dist/enums/index.js"
44
+ },
45
+ "./accessToken": {
46
+ "types": "./dist/accessToken.d.ts",
47
+ "import": "./dist/accessToken.js"
48
+ }
49
+ },
50
+ "files": [
51
+ "dist"
52
+ ],
53
+ "scripts": {
54
+ "build": "npm run clean && tsc",
55
+ "dev": "tsc --watch",
56
+ "clean": "rm -rf dist",
57
+ "prepublishOnly": "npm run build"
58
+ },
59
+ "keywords": [
60
+ "schemas",
61
+ "validation",
62
+ "types",
63
+ "zod",
64
+ "phasing-engine"
65
+ ],
66
+ "license": "MIT",
67
+ "dependencies": {
68
+ "@asteasolutions/zod-to-openapi": "^8.1.0",
69
+ "zod": "^4.1.13"
70
+ },
71
+ "devDependencies": {
72
+ "typescript": "^5.6.3"
73
+ },
74
+ "repository": {
75
+ "type": "git",
76
+ "url": "git+https://github.com/manaty/phasing_engine.git",
77
+ "directory": "packages/phasing-schemas"
78
+ }
79
+ }