@venulog/phasing-engine-schemas 0.4.3 → 0.5.0-alpha.0

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,3 @@
1
1
  export * from './bookingStatus.js';
2
- export * from './phaseSlotScheduleType.js';
3
2
  export * from './parkingAreaScheduleType.js';
4
3
  export * from './vehicleType.js';
@@ -1,5 +1,4 @@
1
1
  // Enum exports
2
2
  export * from './bookingStatus.js';
3
- export * from './phaseSlotScheduleType.js';
4
3
  export * from './parkingAreaScheduleType.js';
5
4
  export * from './vehicleType.js';
package/dist/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  export * from './common.js';
2
2
  export * from './pagination.js';
3
3
  export * from './auth.js';
4
- export * from './phaseBooking.js';
5
- export * from './phaseSlot.js';
4
+ export * from './parkingBooking.js';
6
5
  export * from './parkingArea.js';
7
6
  export * from './event.js';
8
7
  export * from './accessToken.js';
9
8
  export * from './enums/bookingStatus.js';
10
- export * from './enums/phaseSlotScheduleType.js';
11
9
  export * from './enums/parkingAreaScheduleType.js';
12
10
  export { z } from './zod.js';
package/dist/index.js CHANGED
@@ -2,14 +2,12 @@
2
2
  export * from './common.js';
3
3
  export * from './pagination.js';
4
4
  export * from './auth.js';
5
- export * from './phaseBooking.js';
6
- export * from './phaseSlot.js';
5
+ export * from './parkingBooking.js';
7
6
  export * from './parkingArea.js';
8
7
  export * from './event.js';
9
8
  export * from './accessToken.js';
10
9
  // Enum exports
11
10
  export * from './enums/bookingStatus.js';
12
- export * from './enums/phaseSlotScheduleType.js';
13
11
  export * from './enums/parkingAreaScheduleType.js';
14
12
  // Zod re-export for convenience
15
13
  export { z } from './zod.js';
@@ -550,6 +550,7 @@ export declare const getAvailableParkingAreaSlotsQuerySchema: z.ZodObject<{
550
550
  year: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
551
551
  month: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
552
552
  parking_area_id: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
553
+ company_role: z.ZodString;
553
554
  schedule_type: z.ZodOptional<z.ZodEnum<{
554
555
  assembly: "assembly";
555
556
  dismantling: "dismantling";
@@ -609,6 +610,69 @@ export declare const availableParkingAreaSlotsResponseSchema: z.ZodObject<{
609
610
  }, z.core.$strip>>;
610
611
  total_slots: z.ZodNumber;
611
612
  }, z.core.$strip>;
613
+ export declare const getAvailableSlotsBodySchema: z.ZodObject<{
614
+ event_id: z.ZodNumber;
615
+ year: z.ZodNumber;
616
+ month: z.ZodNumber;
617
+ company_role: z.ZodString;
618
+ schedule_type: z.ZodOptional<z.ZodEnum<{
619
+ assembly: "assembly";
620
+ dismantling: "dismantling";
621
+ }>>;
622
+ }, z.core.$strip>;
623
+ export declare const availableTimeSlotSchema: z.ZodObject<{
624
+ parking_area_schedule_id: z.ZodNumber;
625
+ date: z.ZodString;
626
+ start_time: z.ZodString;
627
+ end_time: z.ZodString;
628
+ duration: z.ZodNumber;
629
+ schedule_type: z.ZodEnum<{
630
+ assembly: "assembly";
631
+ dismantling: "dismantling";
632
+ }>;
633
+ max_capacity: z.ZodNumber;
634
+ current_bookings: z.ZodNumber;
635
+ confirmed_bookings: z.ZodNumber;
636
+ available_capacity: z.ZodNumber;
637
+ is_available: z.ZodBoolean;
638
+ }, z.core.$strip>;
639
+ export declare const availableSlotsResponseSchema: z.ZodObject<{
640
+ event_id: z.ZodNumber;
641
+ event_code: z.ZodString;
642
+ event_name: z.ZodString;
643
+ company_role: z.ZodString;
644
+ year: z.ZodNumber;
645
+ month: z.ZodNumber;
646
+ available_slots: z.ZodArray<z.ZodObject<{
647
+ parking_area_schedule_id: z.ZodNumber;
648
+ date: z.ZodString;
649
+ start_time: z.ZodString;
650
+ end_time: z.ZodString;
651
+ duration: z.ZodNumber;
652
+ schedule_type: z.ZodEnum<{
653
+ assembly: "assembly";
654
+ dismantling: "dismantling";
655
+ }>;
656
+ max_capacity: z.ZodNumber;
657
+ current_bookings: z.ZodNumber;
658
+ confirmed_bookings: z.ZodNumber;
659
+ available_capacity: z.ZodNumber;
660
+ is_available: z.ZodBoolean;
661
+ }, z.core.$strip>>;
662
+ total_slots: z.ZodNumber;
663
+ }, z.core.$strip>;
664
+ export declare const getCompanyRolesByEventIdParamsSchema: z.ZodObject<{
665
+ eventId: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
666
+ scheduleType: z.ZodEnum<{
667
+ assembly: "assembly";
668
+ dismantling: "dismantling";
669
+ }>;
670
+ }, z.core.$strip>;
671
+ export declare const getCompanyRolesByEventIdResponseSchema: z.ZodObject<{
672
+ event_id: z.ZodNumber;
673
+ company_roles: z.ZodArray<z.ZodString>;
674
+ total_count: z.ZodNumber;
675
+ }, z.core.$strip>;
612
676
  export type Point = z.infer<typeof pointSchema>;
613
677
  export type PolygonCoordinates = z.infer<typeof polygonCoordinatesSchema>;
614
678
  export type RectangleGeometry = z.infer<typeof rectangleGeometrySchema>;
@@ -645,3 +709,8 @@ export type UploadSitePlanImageResponse = z.infer<typeof uploadSitePlanImageResp
645
709
  export type GetAvailableParkingAreaSlotsQuery = z.infer<typeof getAvailableParkingAreaSlotsQuerySchema>;
646
710
  export type AvailableParkingAreaTimeSlot = z.infer<typeof availableParkingAreaTimeSlotSchema>;
647
711
  export type AvailableParkingAreaSlotsResponse = z.infer<typeof availableParkingAreaSlotsResponseSchema>;
712
+ export type GetAvailableSlotsBody = z.infer<typeof getAvailableSlotsBodySchema>;
713
+ export type AvailableTimeSlot = z.infer<typeof availableTimeSlotSchema>;
714
+ export type AvailableSlotsResponse = z.infer<typeof availableSlotsResponseSchema>;
715
+ export type GetCompanyRolesByEventIdParams = z.infer<typeof getCompanyRolesByEventIdParamsSchema>;
716
+ export type GetCompanyRolesByEventIdResponse = z.infer<typeof getCompanyRolesByEventIdResponseSchema>;
@@ -723,6 +723,10 @@ export const getAvailableParkingAreaSlotsQuerySchema = z
723
723
  description: 'The ID of the parking area',
724
724
  example: '1'
725
725
  }),
726
+ company_role: z.string().min(1, 'Company role is required').openapi({
727
+ description: 'Company role to filter schedules by',
728
+ example: 'exhibitor'
729
+ }),
726
730
  schedule_type: z.enum(['assembly', 'dismantling']).optional().openapi({
727
731
  description: 'Filter by schedule type',
728
732
  example: 'assembly'
@@ -830,3 +834,152 @@ export const availableParkingAreaSlotsResponseSchema = z
830
834
  })
831
835
  })
832
836
  .openapi('AvailableParkingAreaSlotsResponse');
837
+ // ------------------------------
838
+ // Parking Area Query Schemas
839
+ // ------------------------------
840
+ export const getAvailableSlotsBodySchema = z
841
+ .object({
842
+ event_id: z.number().positive().openapi({
843
+ description: 'The ID of the event',
844
+ example: 1
845
+ }),
846
+ year: z.number().min(2024).openapi({
847
+ description: 'Year for filtering slots (YYYY). Slots before today will be excluded.',
848
+ example: 2026
849
+ }),
850
+ month: z.number().min(1).max(12).openapi({
851
+ description: 'Month for filtering slots (1-12). Slots before today will be excluded.',
852
+ example: 6
853
+ }),
854
+ company_role: z.string().min(1, 'Company role is required').openapi({
855
+ description: 'Company role to filter schedules by',
856
+ example: 'exhibitor'
857
+ }),
858
+ schedule_type: z.enum(['assembly', 'dismantling']).optional().openapi({
859
+ description: 'Filter by schedule type',
860
+ example: 'assembly'
861
+ })
862
+ })
863
+ .openapi('GetAvailableSlotsBody');
864
+ // ------------------------------
865
+ // Parking Area Response Schemas
866
+ // ------------------------------
867
+ export const availableTimeSlotSchema = z
868
+ .object({
869
+ parking_area_schedule_id: z.number().openapi({
870
+ description: 'Parking area schedule ID',
871
+ example: 1
872
+ }),
873
+ date: z.string().openapi({
874
+ description: 'Date of the time slot (YYYY-MM-DD)',
875
+ example: '2026-06-15'
876
+ }),
877
+ start_time: z.string().openapi({
878
+ description: 'Start time of the slot (HH:MM)',
879
+ example: '08:00'
880
+ }),
881
+ end_time: z.string().openapi({
882
+ description: 'End time of the slot (HH:MM)',
883
+ example: '08:30'
884
+ }),
885
+ duration: z.number().openapi({
886
+ description: 'Duration in minutes',
887
+ example: 30
888
+ }),
889
+ schedule_type: z.enum(['assembly', 'dismantling']).openapi({
890
+ description: 'Type of schedule',
891
+ example: 'assembly'
892
+ }),
893
+ max_capacity: z.number().openapi({
894
+ description: 'Maximum booking capacity for this slot',
895
+ example: 5
896
+ }),
897
+ current_bookings: z.number().openapi({
898
+ description: 'Number of current bookings',
899
+ example: 3
900
+ }),
901
+ confirmed_bookings: z.number().openapi({
902
+ description: 'Number of confirmed bookings',
903
+ example: 1
904
+ }),
905
+ available_capacity: z.number().openapi({
906
+ description: 'Remaining available capacity',
907
+ example: 2
908
+ }),
909
+ is_available: z.boolean().openapi({
910
+ description: 'Whether the slot is available for booking',
911
+ example: true
912
+ })
913
+ })
914
+ .openapi('AvailableTimeSlot');
915
+ export const availableSlotsResponseSchema = z
916
+ .object({
917
+ event_id: z.number().openapi({
918
+ description: 'ID of the event',
919
+ example: 1
920
+ }),
921
+ event_code: z.string().openapi({
922
+ description: 'Code of the event',
923
+ example: 'COEC2025'
924
+ }),
925
+ event_name: z.string().openapi({
926
+ description: 'Name of the event',
927
+ example: 'COEC 2025'
928
+ }),
929
+ company_role: z.string().openapi({
930
+ description: 'Company role that was used for filtering (returned for reference)',
931
+ example: 'exhibitor'
932
+ }),
933
+ year: z.number().openapi({
934
+ description: 'Year of the slots',
935
+ example: 2026
936
+ }),
937
+ month: z.number().openapi({
938
+ description: 'Month of the slots',
939
+ example: 6
940
+ }),
941
+ available_slots: z.array(availableTimeSlotSchema).openapi({
942
+ description: 'List of available time slots with capacity information'
943
+ }),
944
+ total_slots: z.number().openapi({
945
+ description: 'Total number of time slots in the period',
946
+ example: 48
947
+ })
948
+ })
949
+ .openapi('AvailableSlotsResponse');
950
+ // ------------------------------
951
+ // Company Roles for Parking Area
952
+ // ------------------------------
953
+ export const getCompanyRolesByEventIdParamsSchema = z
954
+ .object({
955
+ eventId: z
956
+ .string()
957
+ .min(1, 'Event ID is required')
958
+ .transform(val => parseInt(val, 10))
959
+ .refine(val => !isNaN(val) && val > 0, { message: 'Event ID must be positive' })
960
+ .openapi({
961
+ description: 'The ID of the event to get company roles for',
962
+ example: '1'
963
+ }),
964
+ scheduleType: z.enum(['assembly', 'dismantling']).openapi({
965
+ description: 'Type of schedule',
966
+ example: 'assembly'
967
+ })
968
+ })
969
+ .openapi('GetCompanyRolesByEventIdParams');
970
+ export const getCompanyRolesByEventIdResponseSchema = z
971
+ .object({
972
+ event_id: z.number().openapi({
973
+ description: 'ID of the event',
974
+ example: 1
975
+ }),
976
+ company_roles: z.array(z.string()).openapi({
977
+ description: 'List of unique company roles for the event',
978
+ example: ['exhibitor', 'organizer', 'contractor']
979
+ }),
980
+ total_count: z.number().openapi({
981
+ description: 'Total number of unique company roles',
982
+ example: 3
983
+ })
984
+ })
985
+ .openapi('GetCompanyRolesByEventIdResponse');