@venulog/phasing-engine-schemas 0.13.0 → 0.13.2

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.
package/dist/index.d.ts CHANGED
@@ -5,7 +5,6 @@ export * from './parkingBooking.js';
5
5
  export * from './parkingArea.js';
6
6
  export * from './parkingAreaLayer.js';
7
7
  export * from './parkingAreaAccess.js';
8
- export * from './eventSitePlanCalibration.js';
9
8
  export * from './event.js';
10
9
  export * from './accessToken.js';
11
10
  export * from './vehiclePosition.js';
package/dist/index.js CHANGED
@@ -6,7 +6,6 @@ export * from './parkingBooking.js';
6
6
  export * from './parkingArea.js';
7
7
  export * from './parkingAreaLayer.js';
8
8
  export * from './parkingAreaAccess.js';
9
- export * from './eventSitePlanCalibration.js';
10
9
  export * from './event.js';
11
10
  export * from './accessToken.js';
12
11
  export * from './vehiclePosition.js';
@@ -592,12 +592,12 @@ export declare const availableTimeSlotV2Schema: z.ZodObject<{
592
592
  parking_spot: z.ZodString;
593
593
  entity_name: z.ZodString;
594
594
  slot_key: z.ZodString;
595
+ vehicle_type: z.ZodString;
595
596
  }, z.core.$strip>;
596
597
  export declare const availableSlotsResponseV2Schema: z.ZodObject<{
597
598
  event_id: z.ZodNumber;
598
599
  event_code: z.ZodString;
599
600
  event_name: z.ZodString;
600
- company_role: z.ZodString;
601
601
  year: z.ZodNumber;
602
602
  month: z.ZodNumber;
603
603
  available_slots: z.ZodArray<z.ZodObject<{
@@ -618,6 +618,42 @@ export declare const availableSlotsResponseV2Schema: z.ZodObject<{
618
618
  parking_spot: z.ZodString;
619
619
  entity_name: z.ZodString;
620
620
  slot_key: z.ZodString;
621
+ vehicle_type: z.ZodString;
622
+ }, z.core.$strip>>;
623
+ total_slots: z.ZodNumber;
624
+ }, z.core.$strip>;
625
+ export declare const getBookingStatisticsQuerySchema: z.ZodObject<{
626
+ event_id: z.ZodNumber;
627
+ year: z.ZodNumber;
628
+ month: z.ZodNumber;
629
+ schedule_type: z.ZodOptional<z.ZodEnum<typeof ParkingAreaScheduleType>>;
630
+ }, z.core.$strip>;
631
+ export declare const bookingStatisticsResponseSchema: z.ZodObject<{
632
+ event_id: z.ZodNumber;
633
+ event_code: z.ZodString;
634
+ event_name: z.ZodString;
635
+ year: z.ZodNumber;
636
+ month: z.ZodNumber;
637
+ schedule_type: z.ZodNullable<z.ZodEnum<typeof ParkingAreaScheduleType>>;
638
+ all_slots: z.ZodArray<z.ZodObject<{
639
+ date: z.ZodString;
640
+ start_time: z.ZodString;
641
+ end_time: z.ZodString;
642
+ duration: z.ZodNumber;
643
+ schedule_type: z.ZodEnum<{
644
+ assembly: "assembly";
645
+ dismantling: "dismantling";
646
+ }>;
647
+ max_capacity: z.ZodNumber;
648
+ current_bookings: z.ZodNumber;
649
+ confirmed_bookings: z.ZodNumber;
650
+ available_capacity: z.ZodNumber;
651
+ is_available: z.ZodBoolean;
652
+ door: z.ZodString;
653
+ parking_spot: z.ZodString;
654
+ entity_name: z.ZodString;
655
+ slot_key: z.ZodString;
656
+ vehicle_type: z.ZodString;
621
657
  }, z.core.$strip>>;
622
658
  total_slots: z.ZodNumber;
623
659
  }, z.core.$strip>;
@@ -696,3 +732,5 @@ export type Translations = z.infer<typeof translationsSchema>;
696
732
  export type GetAvailableSlotsBodyV2 = z.infer<typeof getAvailableSlotsBodyV2Schema>;
697
733
  export type AvailableTimeSlotV2 = z.infer<typeof availableTimeSlotV2Schema>;
698
734
  export type AvailableSlotsResponseV2 = z.infer<typeof availableSlotsResponseV2Schema>;
735
+ export type GetBookingStatisticsQuery = z.infer<typeof getBookingStatisticsQuerySchema>;
736
+ export type BookingStatisticsResponse = z.infer<typeof bookingStatisticsResponseSchema>;
@@ -804,6 +804,10 @@ export const availableTimeSlotV2Schema = z
804
804
  slot_key: z.string().openapi({
805
805
  description: 'Unique identifier for the time slot',
806
806
  example: '12345'
807
+ }),
808
+ vehicle_type: z.string().openapi({
809
+ description: 'Vehicle type for the slot',
810
+ example: 'PL'
807
811
  })
808
812
  })
809
813
  .openapi('AvailableTimeSlotV2');
@@ -821,10 +825,6 @@ export const availableSlotsResponseV2Schema = z
821
825
  description: 'Name of the event',
822
826
  example: 'COEC 2025'
823
827
  }),
824
- company_role: z.string().openapi({
825
- description: 'Company role that was used for filtering (returned for reference)',
826
- example: 'exhibitor'
827
- }),
828
828
  year: z.number().openapi({
829
829
  description: 'Year of the slots',
830
830
  example: 2026
@@ -843,6 +843,64 @@ export const availableSlotsResponseV2Schema = z
843
843
  })
844
844
  .openapi('AvailableSlotsResponseV2');
845
845
  // ------------------------------
846
+ // Booking Statistics V2
847
+ // ------------------------------
848
+ export const getBookingStatisticsQuerySchema = z
849
+ .object({
850
+ event_id: z.number().positive().openapi({
851
+ description: 'The ID of the event',
852
+ example: 1
853
+ }),
854
+ year: z.number().min(2025).openapi({
855
+ description: 'Year for filtering slots (YYYY). Slots before today will be excluded.',
856
+ example: 2026
857
+ }),
858
+ month: z.number().min(1).max(12).openapi({
859
+ description: 'Month for filtering slots (1-12). Slots before today will be excluded.',
860
+ example: 6
861
+ }),
862
+ schedule_type: z.enum(ParkingAreaScheduleType).optional().openapi({
863
+ description: 'Optional filter by schedule type (assembly or dismantling)',
864
+ example: 'assembly'
865
+ })
866
+ })
867
+ .openapi('GetBookingStatisticsQuery');
868
+ export const bookingStatisticsResponseSchema = z
869
+ .object({
870
+ event_id: z.number().openapi({
871
+ description: 'ID of the event',
872
+ example: 1
873
+ }),
874
+ event_code: z.string().openapi({
875
+ description: 'Code of the event',
876
+ example: 'COEC2025'
877
+ }),
878
+ event_name: z.string().openapi({
879
+ description: 'Name of the event',
880
+ example: 'COEC 2025'
881
+ }),
882
+ year: z.number().openapi({
883
+ description: 'Year of the statistics',
884
+ example: 2026
885
+ }),
886
+ month: z.number().openapi({
887
+ description: 'Month of the statistics',
888
+ example: 6
889
+ }),
890
+ schedule_type: z.enum(ParkingAreaScheduleType).nullable().openapi({
891
+ description: 'Schedule type filter applied (null if not filtered)',
892
+ example: 'assembly'
893
+ }),
894
+ all_slots: z.array(availableTimeSlotV2Schema).openapi({
895
+ description: 'All time slots with full booking information, across all companies and vehicle types'
896
+ }),
897
+ total_slots: z.number().openapi({
898
+ description: 'Total number of time slots',
899
+ example: 120
900
+ })
901
+ })
902
+ .openapi('BookingStatisticsResponse');
903
+ // ------------------------------
846
904
  // Company Roles for Parking Area
847
905
  // ------------------------------
848
906
  export const getCompanyRolesByEventIdParamsSchema = z
@@ -132,12 +132,12 @@ export declare const updateAccessDataSchema: z.ZodObject<{
132
132
  updated_at: z.ZodString;
133
133
  event_id: z.ZodNumber;
134
134
  is_active: z.ZodBoolean;
135
- created_by: z.ZodNullable<z.ZodString>;
136
- updated_by: z.ZodNullable<z.ZodString>;
137
135
  geometry: z.ZodNullable<z.ZodObject<{
138
136
  type: z.ZodLiteral<"LineString">;
139
137
  coordinates: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
140
138
  }, z.core.$strip>>;
139
+ created_by: z.ZodNullable<z.ZodString>;
140
+ updated_by: z.ZodNullable<z.ZodString>;
141
141
  width_meters: z.ZodNullable<z.ZodNumber>;
142
142
  height_meters: z.ZodNullable<z.ZodNumber>;
143
143
  linked_parking_areas: z.ZodArray<z.ZodObject<{
@@ -155,12 +155,12 @@ export declare const updateAccessResponseSchema: z.ZodObject<{
155
155
  updated_at: z.ZodString;
156
156
  event_id: z.ZodNumber;
157
157
  is_active: z.ZodBoolean;
158
- created_by: z.ZodNullable<z.ZodString>;
159
- updated_by: z.ZodNullable<z.ZodString>;
160
158
  geometry: z.ZodNullable<z.ZodObject<{
161
159
  type: z.ZodLiteral<"LineString">;
162
160
  coordinates: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
163
161
  }, z.core.$strip>>;
162
+ created_by: z.ZodNullable<z.ZodString>;
163
+ updated_by: z.ZodNullable<z.ZodString>;
164
164
  width_meters: z.ZodNullable<z.ZodNumber>;
165
165
  height_meters: z.ZodNullable<z.ZodNumber>;
166
166
  linked_parking_areas: z.ZodArray<z.ZodObject<{
@@ -263,6 +263,7 @@ export declare const checkSlotAvailabilityResponseSchema: z.ZodObject<{
263
263
  parking_spot: z.ZodString;
264
264
  entity_name: z.ZodString;
265
265
  slot_key: z.ZodString;
266
+ vehicle_type: z.ZodString;
266
267
  }, z.core.$strip>;
267
268
  }, z.core.$strip>;
268
269
  export declare const customSlotSchema: z.ZodObject<{
@@ -400,7 +401,7 @@ export declare const updateParkingBookingBodySchema: z.ZodObject<{
400
401
  export declare const updateParkingBookingDataSchema: z.ZodObject<{
401
402
  booking_id: z.ZodNumber;
402
403
  qr_token: z.ZodString;
403
- company: z.ZodNullable<z.ZodObject<{
404
+ company: z.ZodObject<{
404
405
  hall: z.ZodNullable<z.ZodOptional<z.ZodString>>;
405
406
  stand_number: z.ZodOptional<z.ZodString>;
406
407
  company_name: z.ZodString;
@@ -412,15 +413,16 @@ export declare const updateParkingBookingDataSchema: z.ZodObject<{
412
413
  driver_name: z.ZodString;
413
414
  driver_phone: z.ZodString;
414
415
  transport_company: z.ZodOptional<z.ZodString>;
415
- }, z.core.$strip>>;
416
- vehicle: z.ZodNullable<z.ZodObject<{
416
+ }, z.core.$strip>;
417
+ vehicle: z.ZodObject<{
417
418
  vehicle_type: z.ZodEnum<typeof import("./index.js").VehicleType>;
418
419
  unloading_method: z.ZodOptional<z.ZodEnum<typeof UnloadingType>>;
419
420
  license_plate: z.ZodString;
420
421
  trailer_registration: z.ZodOptional<z.ZodString>;
421
- }, z.core.$strip>>;
422
+ }, z.core.$strip>;
422
423
  updated_at: z.ZodString;
423
424
  updated_by: z.ZodNullable<z.ZodString>;
425
+ status: z.ZodString;
424
426
  }, z.core.$strip>;
425
427
  export declare const updateParkingBookingResponseSchema: z.ZodObject<{
426
428
  success: z.ZodBoolean;
@@ -428,7 +430,7 @@ export declare const updateParkingBookingResponseSchema: z.ZodObject<{
428
430
  data: z.ZodObject<{
429
431
  booking_id: z.ZodNumber;
430
432
  qr_token: z.ZodString;
431
- company: z.ZodNullable<z.ZodObject<{
433
+ company: z.ZodObject<{
432
434
  hall: z.ZodNullable<z.ZodOptional<z.ZodString>>;
433
435
  stand_number: z.ZodOptional<z.ZodString>;
434
436
  company_name: z.ZodString;
@@ -440,15 +442,16 @@ export declare const updateParkingBookingResponseSchema: z.ZodObject<{
440
442
  driver_name: z.ZodString;
441
443
  driver_phone: z.ZodString;
442
444
  transport_company: z.ZodOptional<z.ZodString>;
443
- }, z.core.$strip>>;
444
- vehicle: z.ZodNullable<z.ZodObject<{
445
+ }, z.core.$strip>;
446
+ vehicle: z.ZodObject<{
445
447
  vehicle_type: z.ZodEnum<typeof import("./index.js").VehicleType>;
446
448
  unloading_method: z.ZodOptional<z.ZodEnum<typeof UnloadingType>>;
447
449
  license_plate: z.ZodString;
448
450
  trailer_registration: z.ZodOptional<z.ZodString>;
449
- }, z.core.$strip>>;
451
+ }, z.core.$strip>;
450
452
  updated_at: z.ZodString;
451
453
  updated_by: z.ZodNullable<z.ZodString>;
454
+ status: z.ZodString;
452
455
  }, z.core.$strip>;
453
456
  }, z.core.$strip>;
454
457
  export declare const confirmBookingParamsSchema: z.ZodObject<{
@@ -457,7 +460,6 @@ export declare const confirmBookingParamsSchema: z.ZodObject<{
457
460
  export declare const confirmBookingDataSchema: z.ZodObject<{
458
461
  id: z.ZodNumber;
459
462
  status: z.ZodString;
460
- parking_area_schedule_id: z.ZodNumber;
461
463
  updated_at: z.ZodString;
462
464
  updated_by: z.ZodString;
463
465
  }, z.core.$strip>;
@@ -467,7 +469,6 @@ export declare const confirmBookingResponseSchema: z.ZodObject<{
467
469
  data: z.ZodObject<{
468
470
  id: z.ZodNumber;
469
471
  status: z.ZodString;
470
- parking_area_schedule_id: z.ZodNumber;
471
472
  updated_at: z.ZodString;
472
473
  updated_by: z.ZodString;
473
474
  }, z.core.$strip>;
@@ -478,7 +479,6 @@ export declare const refuseBookingParamsSchema: z.ZodObject<{
478
479
  export declare const refuseBookingDataSchema: z.ZodObject<{
479
480
  id: z.ZodNumber;
480
481
  status: z.ZodString;
481
- parking_area_schedule_id: z.ZodNumber;
482
482
  updated_at: z.ZodString;
483
483
  updated_by: z.ZodString;
484
484
  }, z.core.$strip>;
@@ -488,7 +488,6 @@ export declare const refuseBookingResponseSchema: z.ZodObject<{
488
488
  data: z.ZodObject<{
489
489
  id: z.ZodNumber;
490
490
  status: z.ZodString;
491
- parking_area_schedule_id: z.ZodNumber;
492
491
  updated_at: z.ZodString;
493
492
  updated_by: z.ZodString;
494
493
  }, z.core.$strip>;
@@ -516,6 +515,7 @@ export declare const parkingBookingWithRelationsSchema: z.ZodObject<{
516
515
  banner: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
517
516
  latitude: z.ZodNullable<z.ZodNumber>;
518
517
  longitude: z.ZodNullable<z.ZodNumber>;
518
+ door: z.ZodNullable<z.ZodString>;
519
519
  venues: z.ZodNullable<z.ZodObject<{
520
520
  id: z.ZodNumber;
521
521
  name: z.ZodString;
@@ -523,7 +523,6 @@ export declare const parkingBookingWithRelationsSchema: z.ZodObject<{
523
523
  }, z.core.$strip>>;
524
524
  }, z.core.$strip>;
525
525
  parking_spot: z.ZodString;
526
- door: z.ZodString;
527
526
  parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
528
527
  slot_key: z.ZodNullable<z.ZodString>;
529
528
  entry_scanned_at: z.ZodNullable<z.ZodString>;
@@ -665,12 +664,38 @@ export declare const exportBookingDataSchema: z.ZodObject<{
665
664
  booking_id: z.ZodNumber;
666
665
  event_id: z.ZodNumber;
667
666
  status: z.ZodEnum<typeof BookingStatus>;
668
- company_name: z.ZodString;
669
- vehicle_type: z.ZodString;
670
- scan_entrance: z.ZodNullable<z.ZodString>;
671
- scan_exit: z.ZodNullable<z.ZodString>;
672
- co2_footprint: z.ZodNullable<z.ZodNumber>;
667
+ is_active: z.ZodBoolean;
668
+ created_at: z.ZodString;
669
+ updated_at: z.ZodString;
670
+ created_by: z.ZodNullable<z.ZodString>;
671
+ updated_by: z.ZodNullable<z.ZodString>;
673
672
  booking_date: z.ZodString;
673
+ start_time: z.ZodNullable<z.ZodString>;
674
+ end_time: z.ZodNullable<z.ZodString>;
675
+ company_role: z.ZodNullable<z.ZodString>;
676
+ entry_scanned_at: z.ZodNullable<z.ZodString>;
677
+ exit_scanned_at: z.ZodNullable<z.ZodString>;
678
+ door: z.ZodNullable<z.ZodString>;
679
+ parking_spot: z.ZodNullable<z.ZodString>;
680
+ parking_schedule_type: z.ZodNullable<z.ZodString>;
681
+ slot_key: z.ZodNullable<z.ZodString>;
682
+ is_custom_slot: z.ZodNullable<z.ZodBoolean>;
683
+ company_hall: z.ZodNullable<z.ZodString>;
684
+ company_stand_number: z.ZodNullable<z.ZodString>;
685
+ company_name: z.ZodNullable<z.ZodString>;
686
+ company_exhibitor_name: z.ZodNullable<z.ZodString>;
687
+ company_departure_city: z.ZodNullable<z.ZodString>;
688
+ company_contact_name: z.ZodNullable<z.ZodString>;
689
+ company_email: z.ZodNullable<z.ZodString>;
690
+ company_phone: z.ZodNullable<z.ZodString>;
691
+ company_driver_name: z.ZodNullable<z.ZodString>;
692
+ company_driver_phone: z.ZodNullable<z.ZodString>;
693
+ company_transport_company: z.ZodNullable<z.ZodString>;
694
+ vehicle_type: z.ZodNullable<z.ZodString>;
695
+ vehicle_unloading_method: z.ZodNullable<z.ZodString>;
696
+ vehicle_license_plate: z.ZodNullable<z.ZodString>;
697
+ vehicle_trailer_registration: z.ZodNullable<z.ZodString>;
698
+ co2_footprint: z.ZodNullable<z.ZodNumber>;
674
699
  }, z.core.$strip>;
675
700
  export declare const exportBookingsQuerySchema: z.ZodObject<{
676
701
  event_id: z.ZodCoercedNumber<unknown>;
@@ -681,12 +706,38 @@ export declare const exportBookingsDataSchema: z.ZodObject<{
681
706
  booking_id: z.ZodNumber;
682
707
  event_id: z.ZodNumber;
683
708
  status: z.ZodEnum<typeof BookingStatus>;
684
- company_name: z.ZodString;
685
- vehicle_type: z.ZodString;
686
- scan_entrance: z.ZodNullable<z.ZodString>;
687
- scan_exit: z.ZodNullable<z.ZodString>;
688
- co2_footprint: z.ZodNullable<z.ZodNumber>;
709
+ is_active: z.ZodBoolean;
710
+ created_at: z.ZodString;
711
+ updated_at: z.ZodString;
712
+ created_by: z.ZodNullable<z.ZodString>;
713
+ updated_by: z.ZodNullable<z.ZodString>;
689
714
  booking_date: z.ZodString;
715
+ start_time: z.ZodNullable<z.ZodString>;
716
+ end_time: z.ZodNullable<z.ZodString>;
717
+ company_role: z.ZodNullable<z.ZodString>;
718
+ entry_scanned_at: z.ZodNullable<z.ZodString>;
719
+ exit_scanned_at: z.ZodNullable<z.ZodString>;
720
+ door: z.ZodNullable<z.ZodString>;
721
+ parking_spot: z.ZodNullable<z.ZodString>;
722
+ parking_schedule_type: z.ZodNullable<z.ZodString>;
723
+ slot_key: z.ZodNullable<z.ZodString>;
724
+ is_custom_slot: z.ZodNullable<z.ZodBoolean>;
725
+ company_hall: z.ZodNullable<z.ZodString>;
726
+ company_stand_number: z.ZodNullable<z.ZodString>;
727
+ company_name: z.ZodNullable<z.ZodString>;
728
+ company_exhibitor_name: z.ZodNullable<z.ZodString>;
729
+ company_departure_city: z.ZodNullable<z.ZodString>;
730
+ company_contact_name: z.ZodNullable<z.ZodString>;
731
+ company_email: z.ZodNullable<z.ZodString>;
732
+ company_phone: z.ZodNullable<z.ZodString>;
733
+ company_driver_name: z.ZodNullable<z.ZodString>;
734
+ company_driver_phone: z.ZodNullable<z.ZodString>;
735
+ company_transport_company: z.ZodNullable<z.ZodString>;
736
+ vehicle_type: z.ZodNullable<z.ZodString>;
737
+ vehicle_unloading_method: z.ZodNullable<z.ZodString>;
738
+ vehicle_license_plate: z.ZodNullable<z.ZodString>;
739
+ vehicle_trailer_registration: z.ZodNullable<z.ZodString>;
740
+ co2_footprint: z.ZodNullable<z.ZodNumber>;
690
741
  }, z.core.$strip>>;
691
742
  total_count: z.ZodNumber;
692
743
  filters_applied: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -698,12 +749,38 @@ export declare const exportBookingsResponseSchema: z.ZodObject<{
698
749
  booking_id: z.ZodNumber;
699
750
  event_id: z.ZodNumber;
700
751
  status: z.ZodEnum<typeof BookingStatus>;
701
- company_name: z.ZodString;
702
- vehicle_type: z.ZodString;
703
- scan_entrance: z.ZodNullable<z.ZodString>;
704
- scan_exit: z.ZodNullable<z.ZodString>;
705
- co2_footprint: z.ZodNullable<z.ZodNumber>;
752
+ is_active: z.ZodBoolean;
753
+ created_at: z.ZodString;
754
+ updated_at: z.ZodString;
755
+ created_by: z.ZodNullable<z.ZodString>;
756
+ updated_by: z.ZodNullable<z.ZodString>;
706
757
  booking_date: z.ZodString;
758
+ start_time: z.ZodNullable<z.ZodString>;
759
+ end_time: z.ZodNullable<z.ZodString>;
760
+ company_role: z.ZodNullable<z.ZodString>;
761
+ entry_scanned_at: z.ZodNullable<z.ZodString>;
762
+ exit_scanned_at: z.ZodNullable<z.ZodString>;
763
+ door: z.ZodNullable<z.ZodString>;
764
+ parking_spot: z.ZodNullable<z.ZodString>;
765
+ parking_schedule_type: z.ZodNullable<z.ZodString>;
766
+ slot_key: z.ZodNullable<z.ZodString>;
767
+ is_custom_slot: z.ZodNullable<z.ZodBoolean>;
768
+ company_hall: z.ZodNullable<z.ZodString>;
769
+ company_stand_number: z.ZodNullable<z.ZodString>;
770
+ company_name: z.ZodNullable<z.ZodString>;
771
+ company_exhibitor_name: z.ZodNullable<z.ZodString>;
772
+ company_departure_city: z.ZodNullable<z.ZodString>;
773
+ company_contact_name: z.ZodNullable<z.ZodString>;
774
+ company_email: z.ZodNullable<z.ZodString>;
775
+ company_phone: z.ZodNullable<z.ZodString>;
776
+ company_driver_name: z.ZodNullable<z.ZodString>;
777
+ company_driver_phone: z.ZodNullable<z.ZodString>;
778
+ company_transport_company: z.ZodNullable<z.ZodString>;
779
+ vehicle_type: z.ZodNullable<z.ZodString>;
780
+ vehicle_unloading_method: z.ZodNullable<z.ZodString>;
781
+ vehicle_license_plate: z.ZodNullable<z.ZodString>;
782
+ vehicle_trailer_registration: z.ZodNullable<z.ZodString>;
783
+ co2_footprint: z.ZodNullable<z.ZodNumber>;
707
784
  }, z.core.$strip>>;
708
785
  total_count: z.ZodNumber;
709
786
  filters_applied: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -778,3 +855,4 @@ export type UpdateBookingTimeParams = z.infer<typeof updateBookingTimeParamsSche
778
855
  export type UpdateBookingTimeBody = z.infer<typeof updateBookingTimeBodySchema>;
779
856
  export type UpdateBookingTimeData = z.infer<typeof updateBookingTimeDataSchema>;
780
857
  export type UpdateBookingTimeResponse = z.infer<typeof updateBookingTimeResponseSchema>;
858
+ export type UpdateParkingBookingResponse = z.infer<typeof updateParkingBookingResponseSchema>;
@@ -402,10 +402,10 @@ export const updateParkingBookingDataSchema = z
402
402
  description: 'New regenerated QR token',
403
403
  example: 'ACCESS_1a2b3c4d5e6f7g8h_eyJib29raW5nSWQiOjF9'
404
404
  }),
405
- company: companyDetailsSchema.nullable().openapi({
405
+ company: companyDetailsSchema.openapi({
406
406
  description: 'Updated company details'
407
407
  }),
408
- vehicle: vehicleDetailsSchema.nullable().openapi({
408
+ vehicle: vehicleDetailsSchema.openapi({
409
409
  description: 'Updated vehicle details'
410
410
  }),
411
411
  updated_at: z.string().openapi({
@@ -415,7 +415,8 @@ export const updateParkingBookingDataSchema = z
415
415
  updated_by: z.string().nullable().openapi({
416
416
  description: 'ID of the user who updated the booking',
417
417
  example: 'user-123'
418
- })
418
+ }),
419
+ status: z.string()
419
420
  })
420
421
  .openapi('UpdateParkingBookingData');
421
422
  export const updateParkingBookingResponseSchema = createMessageDataResponseSchema(updateParkingBookingDataSchema, 'UpdateParkingBookingResponse', 'Parking booking updated successfully', 'Details of the updated booking');
@@ -442,7 +443,6 @@ export const confirmBookingDataSchema = z
442
443
  .object({
443
444
  id: z.number(),
444
445
  status: z.string(),
445
- parking_area_schedule_id: z.number(),
446
446
  updated_at: z.string(),
447
447
  updated_by: z.string()
448
448
  })
@@ -471,7 +471,6 @@ export const refuseBookingDataSchema = z
471
471
  .object({
472
472
  id: z.number(),
473
473
  status: z.string(),
474
- parking_area_schedule_id: z.number(),
475
474
  updated_at: z.string(),
476
475
  updated_by: z.string()
477
476
  })
@@ -504,6 +503,7 @@ export const parkingBookingWithRelationsSchema = z
504
503
  banner: z.record(z.string(), z.unknown()).nullable(),
505
504
  latitude: z.number().nullable(),
506
505
  longitude: z.number().nullable(),
506
+ door: z.string().nullable(),
507
507
  venues: z
508
508
  .object({
509
509
  id: z.number(),
@@ -513,7 +513,6 @@ export const parkingBookingWithRelationsSchema = z
513
513
  .nullable()
514
514
  }),
515
515
  parking_spot: z.string(),
516
- door: z.string(),
517
516
  parking_schedule_type: z.enum(ParkingAreaScheduleType),
518
517
  slot_key: z.string().nullable(),
519
518
  entry_scanned_at: z.string().nullable(),
@@ -662,7 +661,7 @@ export const parkingBookingDetailsDataSchema = z
662
661
  is_custom_slot: z.boolean().openapi({
663
662
  description: 'Indicates if the booking is for a custom time slot',
664
663
  example: false
665
- })
664
+ }),
666
665
  })
667
666
  .openapi('ParkingBookingDetailsData');
668
667
  export const getParkingBookingDetailsResponseSchema = createSuccessResponseSchema(parkingBookingDetailsDataSchema, 'GetParkingBookingDetailsResponse', 'Booking details with access pass information');
@@ -700,6 +699,7 @@ export const getParkingBookingDetailsByQrBodySchema = z
700
699
  })
701
700
  })
702
701
  .openapi('GetBookingDetailsByQrBody');
702
+ // ------------------------------
703
703
  // Export All Parking Bookings
704
704
  // ------------------------------
705
705
  export const exportBookingDataSchema = z
@@ -716,29 +716,136 @@ export const exportBookingDataSchema = z
716
716
  description: 'Current booking status',
717
717
  example: 'confirmed'
718
718
  }),
719
- company_name: z.string().openapi({
720
- description: 'Company name from booking details',
721
- example: 'Acme Corp'
719
+ is_active: z.boolean().openapi({
720
+ description: 'Whether the booking is active',
721
+ example: true
722
722
  }),
723
- vehicle_type: z.string().openapi({
724
- description: 'Type of vehicle (PL, VUL, VL)',
725
- example: 'PL'
723
+ created_at: z.string().openapi({
724
+ description: 'Booking creation timestamp',
725
+ example: '2024-12-15T08:00:00.000Z'
726
+ }),
727
+ updated_at: z.string().openapi({
728
+ description: 'Booking last update timestamp',
729
+ example: '2024-12-15T08:30:00.000Z'
730
+ }),
731
+ created_by: z.string().nullable().openapi({
732
+ description: 'User ID who created the booking',
733
+ example: 'uuid-123'
734
+ }),
735
+ updated_by: z.string().nullable().openapi({
736
+ description: 'User ID who last updated the booking',
737
+ example: 'uuid-456'
738
+ }),
739
+ booking_date: z.string().openapi({
740
+ description: 'Date of the booking',
741
+ example: '2024-12-15'
742
+ }),
743
+ start_time: z.string().nullable().openapi({
744
+ description: 'Start time of the booking slot',
745
+ example: '08:00'
726
746
  }),
727
- scan_entrance: z.string().nullable().openapi({
747
+ end_time: z.string().nullable().openapi({
748
+ description: 'End time of the booking slot',
749
+ example: '10:00'
750
+ }),
751
+ company_role: z.string().nullable().openapi({
752
+ description: 'Company role (exhibitor, contractor, etc.)',
753
+ example: 'exhibitor'
754
+ }),
755
+ entry_scanned_at: z.string().nullable().openapi({
728
756
  description: 'Entry scan timestamp',
729
757
  example: '2024-12-15T08:30:00.000Z'
730
758
  }),
731
- scan_exit: z.string().nullable().openapi({
759
+ exit_scanned_at: z.string().nullable().openapi({
732
760
  description: 'Exit scan timestamp',
733
761
  example: '2024-12-15T17:15:00.000Z'
734
762
  }),
763
+ door: z.string().nullable().openapi({
764
+ description: 'Parking door/gate name',
765
+ example: 'North Gate'
766
+ }),
767
+ parking_spot: z.string().nullable().openapi({
768
+ description: 'Parking area/spot name',
769
+ example: 'Main Entrance'
770
+ }),
771
+ parking_schedule_type: z.string().nullable().openapi({
772
+ description: 'Type of parking schedule (assembly/dismantling)',
773
+ example: 'assembly'
774
+ }),
775
+ slot_key: z.string().nullable().openapi({
776
+ description: 'Unique slot key identifier',
777
+ example: 'MainEntrance_2024-12-15_08:00'
778
+ }),
779
+ is_custom_slot: z.boolean().nullable().openapi({
780
+ description: 'Whether the booking uses a custom time slot',
781
+ example: false
782
+ }),
783
+ // Flattened company fields
784
+ company_hall: z.string().nullable().openapi({
785
+ description: 'Hall location',
786
+ example: 'Hall 1'
787
+ }),
788
+ company_stand_number: z.string().nullable().openapi({
789
+ description: 'Stand number',
790
+ example: 'A-123'
791
+ }),
792
+ company_name: z.string().nullable().openapi({
793
+ description: 'Company name',
794
+ example: 'Acme Corp'
795
+ }),
796
+ company_exhibitor_name: z.string().nullable().openapi({
797
+ description: 'Exhibitor name',
798
+ example: 'Technology'
799
+ }),
800
+ company_departure_city: z.string().nullable().openapi({
801
+ description: 'City of departure',
802
+ example: 'Paris'
803
+ }),
804
+ company_contact_name: z.string().nullable().openapi({
805
+ description: 'Contact person name',
806
+ example: 'John Doe'
807
+ }),
808
+ company_email: z.string().nullable().openapi({
809
+ description: 'Contact email',
810
+ example: 'john.doe@acme.com'
811
+ }),
812
+ company_phone: z.string().nullable().openapi({
813
+ description: 'Contact phone number',
814
+ example: '+33 1 23 45 67 89'
815
+ }),
816
+ company_driver_name: z.string().nullable().openapi({
817
+ description: 'Driver name',
818
+ example: 'Jean Martin'
819
+ }),
820
+ company_driver_phone: z.string().nullable().openapi({
821
+ description: 'Driver phone number',
822
+ example: '+33 6 12 34 56 78'
823
+ }),
824
+ company_transport_company: z.string().nullable().openapi({
825
+ description: 'Transport company name',
826
+ example: 'Fast Transport Ltd'
827
+ }),
828
+ // Flattened vehicle fields
829
+ vehicle_type: z.string().nullable().openapi({
830
+ description: 'Type of vehicle (PL, VUL, VL)',
831
+ example: 'PL'
832
+ }),
833
+ vehicle_unloading_method: z.string().nullable().openapi({
834
+ description: 'Unloading method for the vehicle',
835
+ example: 'site'
836
+ }),
837
+ vehicle_license_plate: z.string().nullable().openapi({
838
+ description: 'Vehicle license plate',
839
+ example: 'AB-123-CD'
840
+ }),
841
+ vehicle_trailer_registration: z.string().nullable().openapi({
842
+ description: 'Trailer registration number',
843
+ example: 'TR-456-EF'
844
+ }),
845
+ // Calculated fields
735
846
  co2_footprint: z.number().nullable().openapi({
736
847
  description: 'Estimated CO2 footprint in kg based on vehicle type and duration',
737
848
  example: 12.5
738
- }),
739
- booking_date: z.string().openapi({
740
- description: 'Date of the booking',
741
- example: '2024-12-15'
742
849
  })
743
850
  })
744
851
  .openapi('ExportBookingData');
package/package.json CHANGED
@@ -1,103 +1,99 @@
1
- {
2
- "name": "@venulog/phasing-engine-schemas",
3
- "version": "0.13.0",
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
- "./parkingBooking": {
26
- "types": "./dist/parkingBooking.d.ts",
27
- "import": "./dist/parkingBooking.js"
28
- },
29
- "./event": {
30
- "types": "./dist/event.d.ts",
31
- "import": "./dist/event.js"
32
- },
33
- "./parkingArea": {
34
- "types": "./dist/parkingArea.d.ts",
35
- "import": "./dist/parkingArea.js"
36
- },
37
- "./parkingAreaLayer": {
38
- "types": "./dist/parkingAreaLayer.d.ts",
39
- "import": "./dist/parkingAreaLayer.js"
40
- },
41
- "./parkingAreaAccess": {
42
- "types": "./dist/parkingAreaAccess.d.ts",
43
- "import": "./dist/parkingAreaAccess.js"
44
- },
45
- "./enums": {
46
- "types": "./dist/enums/index.d.ts",
47
- "import": "./dist/enums/index.js"
48
- },
49
- "./accessToken": {
50
- "types": "./dist/accessToken.d.ts",
51
- "import": "./dist/accessToken.js"
52
- },
53
- "./vehiclePosition": {
54
- "types": "./dist/vehiclePosition.d.ts",
55
- "import": "./dist/vehiclePosition.js"
56
- },
57
- "./camera": {
58
- "types": "./dist/camera.d.ts",
59
- "import": "./dist/camera.js"
60
- },
61
- "./simulation": {
62
- "types": "./dist/simulation.d.ts",
63
- "import": "./dist/simulation.js"
64
- },
65
- "./exhibitor": {
66
- "types": "./dist/exhibitor.d.ts",
67
- "import": "./dist/exhibitor.js"
68
- },
69
- "./eventSitePlanCalibration": {
70
- "types": "./dist/eventSitePlanCalibration.d.ts",
71
- "import": "./dist/eventSitePlanCalibration.js"
72
- }
73
- },
74
- "files": [
75
- "dist"
76
- ],
77
- "scripts": {
78
- "build": "npm run clean && tsc",
79
- "dev": "tsc --watch",
80
- "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
81
- "prepublishOnly": "npm run build"
82
- },
83
- "keywords": [
84
- "schemas",
85
- "validation",
86
- "types",
87
- "zod",
88
- "phasing-engine"
89
- ],
90
- "license": "MIT",
91
- "dependencies": {
92
- "@asteasolutions/zod-to-openapi": "^8.1.0",
93
- "zod": "^4.1.13"
94
- },
95
- "devDependencies": {
96
- "typescript": "^5.6.3"
97
- },
98
- "repository": {
99
- "type": "git",
100
- "url": "git+https://github.com/manaty/phasing_engine.git",
101
- "directory": "packages/phasing-schemas"
102
- }
103
- }
1
+ {
2
+ "name": "@venulog/phasing-engine-schemas",
3
+ "version": "0.13.2",
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
+ "./parkingBooking": {
26
+ "types": "./dist/parkingBooking.d.ts",
27
+ "import": "./dist/parkingBooking.js"
28
+ },
29
+ "./event": {
30
+ "types": "./dist/event.d.ts",
31
+ "import": "./dist/event.js"
32
+ },
33
+ "./parkingArea": {
34
+ "types": "./dist/parkingArea.d.ts",
35
+ "import": "./dist/parkingArea.js"
36
+ },
37
+ "./parkingAreaLayer": {
38
+ "types": "./dist/parkingAreaLayer.d.ts",
39
+ "import": "./dist/parkingAreaLayer.js"
40
+ },
41
+ "./parkingAreaAccess": {
42
+ "types": "./dist/parkingAreaAccess.d.ts",
43
+ "import": "./dist/parkingAreaAccess.js"
44
+ },
45
+ "./enums": {
46
+ "types": "./dist/enums/index.d.ts",
47
+ "import": "./dist/enums/index.js"
48
+ },
49
+ "./accessToken": {
50
+ "types": "./dist/accessToken.d.ts",
51
+ "import": "./dist/accessToken.js"
52
+ },
53
+ "./vehiclePosition": {
54
+ "types": "./dist/vehiclePosition.d.ts",
55
+ "import": "./dist/vehiclePosition.js"
56
+ },
57
+ "./camera": {
58
+ "types": "./dist/camera.d.ts",
59
+ "import": "./dist/camera.js"
60
+ },
61
+ "./simulation": {
62
+ "types": "./dist/simulation.d.ts",
63
+ "import": "./dist/simulation.js"
64
+ },
65
+ "./exhibitor": {
66
+ "types": "./dist/exhibitor.d.ts",
67
+ "import": "./dist/exhibitor.js"
68
+ }
69
+ },
70
+ "files": [
71
+ "dist"
72
+ ],
73
+ "scripts": {
74
+ "build": "npm run clean && tsc",
75
+ "dev": "tsc --watch",
76
+ "clean": "rm -rf dist",
77
+ "prepublishOnly": "npm run build"
78
+ },
79
+ "keywords": [
80
+ "schemas",
81
+ "validation",
82
+ "types",
83
+ "zod",
84
+ "phasing-engine"
85
+ ],
86
+ "license": "MIT",
87
+ "dependencies": {
88
+ "@asteasolutions/zod-to-openapi": "^8.1.0",
89
+ "zod": "^4.1.13"
90
+ },
91
+ "devDependencies": {
92
+ "typescript": "^5.6.3"
93
+ },
94
+ "repository": {
95
+ "type": "git",
96
+ "url": "git+https://github.com/manaty/phasing_engine.git",
97
+ "directory": "packages/phasing-schemas"
98
+ }
99
+ }
@@ -1,118 +0,0 @@
1
- import { z } from './zod.js';
2
- export declare const eventSitePlanCalibrationAnchorSchema: z.ZodObject<{
3
- id: z.ZodNumber;
4
- event_id: z.ZodNumber;
5
- name: z.ZodString;
6
- latitude: z.ZodNumber;
7
- longitude: z.ZodNumber;
8
- site_plan_x: z.ZodNumber;
9
- site_plan_y: z.ZodNumber;
10
- is_active: z.ZodBoolean;
11
- created_at: z.ZodString;
12
- updated_at: z.ZodString;
13
- created_by: z.ZodNullable<z.ZodString>;
14
- updated_by: z.ZodNullable<z.ZodString>;
15
- }, z.core.$strip>;
16
- export declare const getEventSitePlanCalibrationsQuerySchema: z.ZodObject<{
17
- eventId: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
18
- }, z.core.$strip>;
19
- export declare const getEventSitePlanCalibrationsDataSchema: z.ZodObject<{
20
- event_id: z.ZodNumber;
21
- anchors: z.ZodArray<z.ZodObject<{
22
- id: z.ZodNumber;
23
- event_id: z.ZodNumber;
24
- name: z.ZodString;
25
- latitude: z.ZodNumber;
26
- longitude: z.ZodNumber;
27
- site_plan_x: z.ZodNumber;
28
- site_plan_y: z.ZodNumber;
29
- is_active: z.ZodBoolean;
30
- created_at: z.ZodString;
31
- updated_at: z.ZodString;
32
- created_by: z.ZodNullable<z.ZodString>;
33
- updated_by: z.ZodNullable<z.ZodString>;
34
- }, z.core.$strip>>;
35
- total_count: z.ZodNumber;
36
- }, z.core.$strip>;
37
- export declare const getEventSitePlanCalibrationsResponseSchema: z.ZodObject<{
38
- success: z.ZodBoolean;
39
- data: z.ZodObject<{
40
- event_id: z.ZodNumber;
41
- anchors: z.ZodArray<z.ZodObject<{
42
- id: z.ZodNumber;
43
- event_id: z.ZodNumber;
44
- name: z.ZodString;
45
- latitude: z.ZodNumber;
46
- longitude: z.ZodNumber;
47
- site_plan_x: z.ZodNumber;
48
- site_plan_y: z.ZodNumber;
49
- is_active: z.ZodBoolean;
50
- created_at: z.ZodString;
51
- updated_at: z.ZodString;
52
- created_by: z.ZodNullable<z.ZodString>;
53
- updated_by: z.ZodNullable<z.ZodString>;
54
- }, z.core.$strip>>;
55
- total_count: z.ZodNumber;
56
- }, z.core.$strip>;
57
- }, z.core.$strip>;
58
- export declare const bulkUpsertEventSitePlanCalibrationsBodySchema: z.ZodObject<{
59
- event_id: z.ZodNumber;
60
- anchors: z.ZodArray<z.ZodObject<{
61
- id: z.ZodOptional<z.ZodNumber>;
62
- name: z.ZodString;
63
- latitude: z.ZodNumber;
64
- longitude: z.ZodNumber;
65
- site_plan_x: z.ZodNumber;
66
- site_plan_y: z.ZodNumber;
67
- }, z.core.$strip>>;
68
- deleted_anchor_ids: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber>>>;
69
- }, z.core.$strip>;
70
- export declare const bulkUpsertEventSitePlanCalibrationsDataSchema: z.ZodObject<{
71
- event_id: z.ZodNumber;
72
- total_upserted: z.ZodNumber;
73
- total_deactivated: z.ZodNumber;
74
- upserted_anchors: z.ZodArray<z.ZodObject<{
75
- id: z.ZodNumber;
76
- event_id: z.ZodNumber;
77
- name: z.ZodString;
78
- latitude: z.ZodNumber;
79
- longitude: z.ZodNumber;
80
- site_plan_x: z.ZodNumber;
81
- site_plan_y: z.ZodNumber;
82
- is_active: z.ZodBoolean;
83
- created_at: z.ZodString;
84
- updated_at: z.ZodString;
85
- created_by: z.ZodNullable<z.ZodString>;
86
- updated_by: z.ZodNullable<z.ZodString>;
87
- }, z.core.$strip>>;
88
- }, z.core.$strip>;
89
- export declare const bulkUpsertEventSitePlanCalibrationsResponseSchema: z.ZodObject<{
90
- success: z.ZodBoolean;
91
- message: z.ZodString;
92
- data: z.ZodObject<{
93
- event_id: z.ZodNumber;
94
- total_upserted: z.ZodNumber;
95
- total_deactivated: z.ZodNumber;
96
- upserted_anchors: z.ZodArray<z.ZodObject<{
97
- id: z.ZodNumber;
98
- event_id: z.ZodNumber;
99
- name: z.ZodString;
100
- latitude: z.ZodNumber;
101
- longitude: z.ZodNumber;
102
- site_plan_x: z.ZodNumber;
103
- site_plan_y: z.ZodNumber;
104
- is_active: z.ZodBoolean;
105
- created_at: z.ZodString;
106
- updated_at: z.ZodString;
107
- created_by: z.ZodNullable<z.ZodString>;
108
- updated_by: z.ZodNullable<z.ZodString>;
109
- }, z.core.$strip>>;
110
- }, z.core.$strip>;
111
- }, z.core.$strip>;
112
- export type EventSitePlanCalibrationAnchor = z.infer<typeof eventSitePlanCalibrationAnchorSchema>;
113
- export type GetEventSitePlanCalibrationsQuery = z.infer<typeof getEventSitePlanCalibrationsQuerySchema>;
114
- export type GetEventSitePlanCalibrationsData = z.infer<typeof getEventSitePlanCalibrationsDataSchema>;
115
- export type GetEventSitePlanCalibrationsResponse = z.infer<typeof getEventSitePlanCalibrationsResponseSchema>;
116
- export type BulkUpsertEventSitePlanCalibrationsBody = z.infer<typeof bulkUpsertEventSitePlanCalibrationsBodySchema>;
117
- export type BulkUpsertEventSitePlanCalibrationsData = z.infer<typeof bulkUpsertEventSitePlanCalibrationsDataSchema>;
118
- export type BulkUpsertEventSitePlanCalibrationsResponse = z.infer<typeof bulkUpsertEventSitePlanCalibrationsResponseSchema>;
@@ -1,148 +0,0 @@
1
- // packages/phasing-schemas/src/eventSitePlanCalibration.ts
2
- import { z } from './zod.js';
3
- import { createSuccessResponseSchema, createMessageDataResponseSchema } from './common.js';
4
- export const eventSitePlanCalibrationAnchorSchema = z
5
- .object({
6
- id: z.number().int().positive().openapi({
7
- description: 'Calibration anchor ID',
8
- example: 12
9
- }),
10
- event_id: z.number().int().positive().openapi({
11
- description: 'Event ID this anchor belongs to',
12
- example: 77
13
- }),
14
- name: z.string().min(1).openapi({
15
- description: 'Readable anchor name (e.g., Gate A)',
16
- example: 'Gate A'
17
- }),
18
- latitude: z.number().min(-90).max(90).openapi({
19
- description: 'Latitude in decimal degrees',
20
- example: 48.86245
21
- }),
22
- longitude: z.number().min(-180).max(180).openapi({
23
- description: 'Longitude in decimal degrees',
24
- example: 2.28791
25
- }),
26
- site_plan_x: z.number().min(0).max(100).openapi({
27
- description: 'Horizontal position on the site plan (0-100%)',
28
- example: 6.25
29
- }),
30
- site_plan_y: z.number().min(0).max(100).openapi({
31
- description: 'Vertical position on the site plan (0-100%)',
32
- example: 52.1
33
- }),
34
- is_active: z.boolean().openapi({
35
- description: 'Whether this anchor is active',
36
- example: true
37
- }),
38
- created_at: z.string().openapi({
39
- description: 'Creation timestamp (ISO 8601)'
40
- }),
41
- updated_at: z.string().openapi({
42
- description: 'Last update timestamp (ISO 8601)'
43
- }),
44
- created_by: z.string().uuid().nullable().openapi({
45
- description: 'User who created the anchor',
46
- example: '550e8400-e29b-41d4-a716-446655440000'
47
- }),
48
- updated_by: z.string().uuid().nullable().openapi({
49
- description: 'User who last updated the anchor',
50
- example: '550e8400-e29b-41d4-a716-446655440000'
51
- })
52
- })
53
- .openapi('EventSitePlanCalibrationAnchor');
54
- export const getEventSitePlanCalibrationsQuerySchema = z
55
- .object({
56
- eventId: z
57
- .string()
58
- .min(1)
59
- .transform(val => parseInt(val, 10))
60
- .refine(val => !isNaN(val) && val > 0, {
61
- message: 'Event ID must be a positive number'
62
- })
63
- .openapi({
64
- description: 'Event ID',
65
- example: '77'
66
- })
67
- })
68
- .openapi('GetEventSitePlanCalibrationsQuery');
69
- export const getEventSitePlanCalibrationsDataSchema = z
70
- .object({
71
- event_id: z.number().int().positive().openapi({
72
- description: 'ID of the event',
73
- example: 77
74
- }),
75
- anchors: z.array(eventSitePlanCalibrationAnchorSchema).openapi({
76
- description: 'List of calibration anchors for the event'
77
- }),
78
- total_count: z.number().int().nonnegative().openapi({
79
- description: 'Total anchors returned',
80
- example: 3
81
- })
82
- })
83
- .openapi('GetEventSitePlanCalibrationsData');
84
- export const getEventSitePlanCalibrationsResponseSchema = createSuccessResponseSchema(getEventSitePlanCalibrationsDataSchema, 'GetEventSitePlanCalibrationsResponse', 'Event site plan calibration anchors');
85
- const calibrationAnchorInputSchema = z.object({
86
- id: z.number().int().positive().optional().openapi({
87
- description: 'Existing anchor ID (omit for new anchors)'
88
- }),
89
- name: z.string().min(1, 'Name is required').max(255).openapi({
90
- description: 'Anchor name',
91
- example: 'Gate A'
92
- }),
93
- latitude: z.number().min(-90).max(90).openapi({
94
- description: 'Latitude in decimal degrees',
95
- example: 48.86245
96
- }),
97
- longitude: z.number().min(-180).max(180).openapi({
98
- description: 'Longitude in decimal degrees',
99
- example: 2.28791
100
- }),
101
- site_plan_x: z.number().min(0).max(100).openapi({
102
- description: 'Horizontal percentage on the site plan',
103
- example: 6.2
104
- }),
105
- site_plan_y: z.number().min(0).max(100).openapi({
106
- description: 'Vertical percentage on the site plan',
107
- example: 52.0
108
- })
109
- });
110
- export const bulkUpsertEventSitePlanCalibrationsBodySchema = z
111
- .object({
112
- event_id: z.number().int().positive().openapi({
113
- description: 'ID of the event',
114
- example: 77
115
- }),
116
- anchors: z.array(calibrationAnchorInputSchema).min(0).openapi({
117
- description: 'Anchors to create or update'
118
- }),
119
- deleted_anchor_ids: z
120
- .array(z.number().int().positive())
121
- .optional()
122
- .default([])
123
- .openapi({
124
- description: 'IDs of anchors to deactivate',
125
- example: [3, 5]
126
- })
127
- })
128
- .openapi('BulkUpsertEventSitePlanCalibrationsBody');
129
- export const bulkUpsertEventSitePlanCalibrationsDataSchema = z
130
- .object({
131
- event_id: z.number().int().positive().openapi({
132
- description: 'Event ID',
133
- example: 77
134
- }),
135
- total_upserted: z.number().int().nonnegative().openapi({
136
- description: 'Anchors created or updated',
137
- example: 2
138
- }),
139
- total_deactivated: z.number().int().nonnegative().openapi({
140
- description: 'Anchors deactivated',
141
- example: 1
142
- }),
143
- upserted_anchors: z.array(eventSitePlanCalibrationAnchorSchema).openapi({
144
- description: 'Details of anchors returned from Supabase'
145
- })
146
- })
147
- .openapi('BulkUpsertEventSitePlanCalibrationsData');
148
- export const bulkUpsertEventSitePlanCalibrationsResponseSchema = createMessageDataResponseSchema(bulkUpsertEventSitePlanCalibrationsDataSchema, 'BulkUpsertEventSitePlanCalibrationsResponse', 'Calibration anchors upserted successfully', 'Details about the upserted calibration anchors');