@venulog/phasing-engine-schemas 0.12.0-alpha.0 → 0.12.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.
- package/dist/parkingArea.d.ts +0 -68
- package/dist/parkingArea.js +0 -136
- package/dist/parkingBooking.d.ts +21 -3
- package/dist/parkingBooking.js +41 -7
- package/package.json +99 -99
package/dist/parkingArea.d.ts
CHANGED
|
@@ -566,70 +566,6 @@ export declare const uploadSitePlanImageResponseSchema: z.ZodObject<{
|
|
|
566
566
|
uploaded_at: z.ZodString;
|
|
567
567
|
}, z.core.$strip>;
|
|
568
568
|
}, z.core.$strip>;
|
|
569
|
-
export declare const getAvailableParkingAreaSlotsQuerySchema: z.ZodObject<{
|
|
570
|
-
event_id: z.ZodNumber;
|
|
571
|
-
year: z.ZodCoercedNumber<unknown>;
|
|
572
|
-
month: z.ZodCoercedNumber<unknown>;
|
|
573
|
-
company_role: z.ZodString;
|
|
574
|
-
schedule_type: z.ZodOptional<z.ZodEnum<{
|
|
575
|
-
assembly: "assembly";
|
|
576
|
-
dismantling: "dismantling";
|
|
577
|
-
}>>;
|
|
578
|
-
}, z.core.$strip>;
|
|
579
|
-
export declare const availableParkingAreaTimeSlotSchema: z.ZodObject<{
|
|
580
|
-
parking_area_schedule_id: z.ZodNumber;
|
|
581
|
-
date: z.ZodString;
|
|
582
|
-
start_time: z.ZodString;
|
|
583
|
-
end_time: z.ZodString;
|
|
584
|
-
duration: z.ZodNumber;
|
|
585
|
-
schedule_type: z.ZodEnum<{
|
|
586
|
-
assembly: "assembly";
|
|
587
|
-
dismantling: "dismantling";
|
|
588
|
-
}>;
|
|
589
|
-
company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
590
|
-
vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
591
|
-
PL: VehicleType.PL;
|
|
592
|
-
VUL: VehicleType.VUL;
|
|
593
|
-
VL: VehicleType.VL;
|
|
594
|
-
}>>>;
|
|
595
|
-
max_capacity: z.ZodNumber;
|
|
596
|
-
current_bookings: z.ZodNumber;
|
|
597
|
-
confirmed_bookings: z.ZodNumber;
|
|
598
|
-
available_capacity: z.ZodNumber;
|
|
599
|
-
is_available: z.ZodBoolean;
|
|
600
|
-
}, z.core.$strip>;
|
|
601
|
-
export declare const availableParkingAreaSlotsResponseSchema: z.ZodObject<{
|
|
602
|
-
event_id: z.ZodNumber;
|
|
603
|
-
event_code: z.ZodString;
|
|
604
|
-
event_name: z.ZodString;
|
|
605
|
-
parking_area_id: z.ZodNumber;
|
|
606
|
-
parking_area_name: z.ZodNullable<z.ZodString>;
|
|
607
|
-
year: z.ZodNumber;
|
|
608
|
-
month: z.ZodNumber;
|
|
609
|
-
available_slots: z.ZodArray<z.ZodObject<{
|
|
610
|
-
parking_area_schedule_id: z.ZodNumber;
|
|
611
|
-
date: z.ZodString;
|
|
612
|
-
start_time: z.ZodString;
|
|
613
|
-
end_time: z.ZodString;
|
|
614
|
-
duration: z.ZodNumber;
|
|
615
|
-
schedule_type: z.ZodEnum<{
|
|
616
|
-
assembly: "assembly";
|
|
617
|
-
dismantling: "dismantling";
|
|
618
|
-
}>;
|
|
619
|
-
company_roles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
620
|
-
vehicle_types: z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
621
|
-
PL: VehicleType.PL;
|
|
622
|
-
VUL: VehicleType.VUL;
|
|
623
|
-
VL: VehicleType.VL;
|
|
624
|
-
}>>>;
|
|
625
|
-
max_capacity: z.ZodNumber;
|
|
626
|
-
current_bookings: z.ZodNumber;
|
|
627
|
-
confirmed_bookings: z.ZodNumber;
|
|
628
|
-
available_capacity: z.ZodNumber;
|
|
629
|
-
is_available: z.ZodBoolean;
|
|
630
|
-
}, z.core.$strip>>;
|
|
631
|
-
total_slots: z.ZodNumber;
|
|
632
|
-
}, z.core.$strip>;
|
|
633
569
|
export declare const getAvailableSlotsBodyV2Schema: z.ZodObject<{
|
|
634
570
|
event_id: z.ZodNumber;
|
|
635
571
|
year: z.ZodNumber;
|
|
@@ -637,7 +573,6 @@ export declare const getAvailableSlotsBodyV2Schema: z.ZodObject<{
|
|
|
637
573
|
company_name: z.ZodString;
|
|
638
574
|
vehicle_type: z.ZodEnum<typeof VehicleType>;
|
|
639
575
|
schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
640
|
-
pm_token: z.ZodOptional<z.ZodString>;
|
|
641
576
|
}, z.core.$strip>;
|
|
642
577
|
export declare const availableTimeSlotV2Schema: z.ZodObject<{
|
|
643
578
|
date: z.ZodString;
|
|
@@ -751,9 +686,6 @@ export type UpsertParkingAreaSchedulesResponse = z.infer<typeof upsertParkingAre
|
|
|
751
686
|
export type UploadSitePlanImageParams = z.infer<typeof uploadSitePlanImageParamsSchema>;
|
|
752
687
|
export type UploadSitePlanImageData = z.infer<typeof uploadSitePlanImageDataSchema>;
|
|
753
688
|
export type UploadSitePlanImageResponse = z.infer<typeof uploadSitePlanImageResponseSchema>;
|
|
754
|
-
export type GetAvailableParkingAreaSlotsQuery = z.infer<typeof getAvailableParkingAreaSlotsQuerySchema>;
|
|
755
|
-
export type AvailableParkingAreaTimeSlot = z.infer<typeof availableParkingAreaTimeSlotSchema>;
|
|
756
|
-
export type AvailableParkingAreaSlotsResponse = z.infer<typeof availableParkingAreaSlotsResponseSchema>;
|
|
757
689
|
export type GetCompanyRolesByEventIdParams = z.infer<typeof getCompanyRolesByEventIdParamsSchema>;
|
|
758
690
|
export type GetCompanyRolesByEventIdResponse = z.infer<typeof getCompanyRolesByEventIdResponseSchema>;
|
|
759
691
|
export type GetCompanyNamesByEventIdParams = z.infer<typeof getCompanyNamesByEventIdParamsSchema>;
|
package/dist/parkingArea.js
CHANGED
|
@@ -717,138 +717,6 @@ export const uploadSitePlanImageDataSchema = z
|
|
|
717
717
|
.openapi('UploadSitePlanImageData');
|
|
718
718
|
export const uploadSitePlanImageResponseSchema = createMessageDataResponseSchema(uploadSitePlanImageDataSchema, 'UploadSitePlanImageResponse', 'Site plan image uploaded successfully', 'Details of the uploaded image');
|
|
719
719
|
// ------------------------------
|
|
720
|
-
// Available Time Slots (Parking Area version)
|
|
721
|
-
// ------------------------------
|
|
722
|
-
export const getAvailableParkingAreaSlotsQuerySchema = z
|
|
723
|
-
.object({
|
|
724
|
-
event_id: z.number().nonnegative().openapi({
|
|
725
|
-
description: 'The ID of the event',
|
|
726
|
-
example: '1'
|
|
727
|
-
}),
|
|
728
|
-
year: z.coerce
|
|
729
|
-
.number()
|
|
730
|
-
.int()
|
|
731
|
-
.refine(y => y >= 1000 && y <= 9999, { message: 'Year must be a 4-digit number' })
|
|
732
|
-
.openapi({
|
|
733
|
-
description: 'Year for filtering slots (YYYY)',
|
|
734
|
-
example: '2026'
|
|
735
|
-
}),
|
|
736
|
-
month: z.coerce.number().int().min(1).max(12).openapi({
|
|
737
|
-
description: 'Month for filtering slots (1-12)',
|
|
738
|
-
example: '6'
|
|
739
|
-
}),
|
|
740
|
-
company_role: z.string().min(1, 'Company role is required').openapi({
|
|
741
|
-
description: 'Company role to filter schedules by',
|
|
742
|
-
example: 'exhibitor'
|
|
743
|
-
}),
|
|
744
|
-
schedule_type: z.enum(['assembly', 'dismantling']).optional().openapi({
|
|
745
|
-
description: 'Filter by schedule type',
|
|
746
|
-
example: 'assembly'
|
|
747
|
-
})
|
|
748
|
-
})
|
|
749
|
-
.openapi('GetAvailableParkingAreaSlotsQuery');
|
|
750
|
-
export const availableParkingAreaTimeSlotSchema = z
|
|
751
|
-
.object({
|
|
752
|
-
parking_area_schedule_id: z.number().openapi({
|
|
753
|
-
description: 'Parking area schedule ID',
|
|
754
|
-
example: 1
|
|
755
|
-
}),
|
|
756
|
-
date: z.string().openapi({
|
|
757
|
-
description: 'Date of the time slot (YYYY-MM-DD)',
|
|
758
|
-
example: '2026-06-15'
|
|
759
|
-
}),
|
|
760
|
-
start_time: z.string().openapi({
|
|
761
|
-
description: 'Start time of the slot (HH:MM)',
|
|
762
|
-
example: '08:00'
|
|
763
|
-
}),
|
|
764
|
-
end_time: z.string().openapi({
|
|
765
|
-
description: 'End time of the slot (HH:MM)',
|
|
766
|
-
example: '08:30'
|
|
767
|
-
}),
|
|
768
|
-
duration: z.number().openapi({
|
|
769
|
-
description: 'Duration in minutes',
|
|
770
|
-
example: 30
|
|
771
|
-
}),
|
|
772
|
-
schedule_type: z.enum(['assembly', 'dismantling']).openapi({
|
|
773
|
-
description: 'Type of schedule',
|
|
774
|
-
example: 'assembly'
|
|
775
|
-
}),
|
|
776
|
-
company_roles: z
|
|
777
|
-
.array(z.string())
|
|
778
|
-
.nullable()
|
|
779
|
-
.openapi({
|
|
780
|
-
description: 'Company roles allowed for this schedule',
|
|
781
|
-
example: ['exhibitor', 'contractor']
|
|
782
|
-
}),
|
|
783
|
-
vehicle_types: z
|
|
784
|
-
.array(z.enum([VehicleType.PL, VehicleType.VUL, VehicleType.VL]))
|
|
785
|
-
.nullable()
|
|
786
|
-
.openapi({
|
|
787
|
-
description: 'Vehicle types allowed for this schedule',
|
|
788
|
-
example: [VehicleType.PL, VehicleType.VUL]
|
|
789
|
-
}),
|
|
790
|
-
max_capacity: z.number().openapi({
|
|
791
|
-
description: 'Maximum booking capacity for this slot',
|
|
792
|
-
example: 5
|
|
793
|
-
}),
|
|
794
|
-
current_bookings: z.number().openapi({
|
|
795
|
-
description: 'Number of current bookings',
|
|
796
|
-
example: 3
|
|
797
|
-
}),
|
|
798
|
-
confirmed_bookings: z.number().openapi({
|
|
799
|
-
description: 'Number of confirmed bookings',
|
|
800
|
-
example: 1
|
|
801
|
-
}),
|
|
802
|
-
available_capacity: z.number().openapi({
|
|
803
|
-
description: 'Remaining available capacity',
|
|
804
|
-
example: 2
|
|
805
|
-
}),
|
|
806
|
-
is_available: z.boolean().openapi({
|
|
807
|
-
description: 'Whether the slot is available for booking',
|
|
808
|
-
example: true
|
|
809
|
-
})
|
|
810
|
-
})
|
|
811
|
-
.openapi('AvailableParkingAreaTimeSlot');
|
|
812
|
-
export const availableParkingAreaSlotsResponseSchema = z
|
|
813
|
-
.object({
|
|
814
|
-
event_id: z.number().openapi({
|
|
815
|
-
description: 'ID of the event',
|
|
816
|
-
example: 1
|
|
817
|
-
}),
|
|
818
|
-
event_code: z.string().openapi({
|
|
819
|
-
description: 'Code of the event',
|
|
820
|
-
example: 'COEC2025'
|
|
821
|
-
}),
|
|
822
|
-
event_name: z.string().openapi({
|
|
823
|
-
description: 'Name of the event',
|
|
824
|
-
example: 'COEC 2025'
|
|
825
|
-
}),
|
|
826
|
-
parking_area_id: z.number().openapi({
|
|
827
|
-
description: 'ID of the parking area',
|
|
828
|
-
example: 1
|
|
829
|
-
}),
|
|
830
|
-
parking_area_name: z.string().nullable().openapi({
|
|
831
|
-
description: 'Name of the parking area',
|
|
832
|
-
example: 'Zone A - Main Entrance'
|
|
833
|
-
}),
|
|
834
|
-
year: z.number().openapi({
|
|
835
|
-
description: 'Year of the slots',
|
|
836
|
-
example: 2026
|
|
837
|
-
}),
|
|
838
|
-
month: z.number().openapi({
|
|
839
|
-
description: 'Month of the slots',
|
|
840
|
-
example: 6
|
|
841
|
-
}),
|
|
842
|
-
available_slots: z.array(availableParkingAreaTimeSlotSchema).openapi({
|
|
843
|
-
description: 'List of available time slots with capacity information'
|
|
844
|
-
}),
|
|
845
|
-
total_slots: z.number().openapi({
|
|
846
|
-
description: 'Total number of time slots in the period',
|
|
847
|
-
example: 48
|
|
848
|
-
})
|
|
849
|
-
})
|
|
850
|
-
.openapi('AvailableParkingAreaSlotsResponse');
|
|
851
|
-
// ------------------------------
|
|
852
720
|
// Available Time Slots V2 (Parking Area version)
|
|
853
721
|
// ------------------------------
|
|
854
722
|
export const getAvailableSlotsBodyV2Schema = z
|
|
@@ -876,10 +744,6 @@ export const getAvailableSlotsBodyV2Schema = z
|
|
|
876
744
|
schedule_type: z.enum(ParkingAreaScheduleType).openapi({
|
|
877
745
|
description: 'Filter by schedule type',
|
|
878
746
|
example: 'assembly'
|
|
879
|
-
}),
|
|
880
|
-
pm_token: z.string().optional().openapi({
|
|
881
|
-
description: 'Optional Planning Manager token for authentication',
|
|
882
|
-
example: 'pm_abcdef123456'
|
|
883
747
|
})
|
|
884
748
|
})
|
|
885
749
|
.openapi('GetAvailableSlotsBodyV2');
|
package/dist/parkingBooking.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export declare const parkingBookingSchema: z.ZodObject<{
|
|
|
95
95
|
door: z.ZodString;
|
|
96
96
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
97
97
|
time_zone: z.ZodString;
|
|
98
|
+
is_custom_slot: z.ZodBoolean;
|
|
98
99
|
}, z.core.$strip>;
|
|
99
100
|
export declare const eventBookingsDataSchema: z.ZodObject<{
|
|
100
101
|
event_id: z.ZodNumber;
|
|
@@ -137,6 +138,7 @@ export declare const eventBookingsDataSchema: z.ZodObject<{
|
|
|
137
138
|
door: z.ZodString;
|
|
138
139
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
139
140
|
time_zone: z.ZodString;
|
|
141
|
+
is_custom_slot: z.ZodBoolean;
|
|
140
142
|
}, z.core.$strip>>;
|
|
141
143
|
total_count: z.ZodNumber;
|
|
142
144
|
}, z.core.$strip>;
|
|
@@ -183,6 +185,7 @@ export declare const eventBookingsResponseSchema: z.ZodObject<{
|
|
|
183
185
|
door: z.ZodString;
|
|
184
186
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
185
187
|
time_zone: z.ZodString;
|
|
188
|
+
is_custom_slot: z.ZodBoolean;
|
|
186
189
|
}, z.core.$strip>>;
|
|
187
190
|
total_count: z.ZodNumber;
|
|
188
191
|
}, z.core.$strip>;
|
|
@@ -239,7 +242,6 @@ export declare const checkSlotAvailabilityBodySchema: z.ZodObject<{
|
|
|
239
242
|
company_name: z.ZodString;
|
|
240
243
|
vehicle_type: z.ZodEnum<typeof import("./index.js").VehicleType>;
|
|
241
244
|
schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
242
|
-
pm_token: z.ZodOptional<z.ZodString>;
|
|
243
245
|
}, z.core.$strip>;
|
|
244
246
|
export declare const checkSlotAvailabilityResponseSchema: z.ZodObject<{
|
|
245
247
|
success: z.ZodBoolean;
|
|
@@ -263,6 +265,12 @@ export declare const checkSlotAvailabilityResponseSchema: z.ZodObject<{
|
|
|
263
265
|
slot_key: z.ZodString;
|
|
264
266
|
}, z.core.$strip>;
|
|
265
267
|
}, z.core.$strip>;
|
|
268
|
+
export declare const customSlotSchema: z.ZodObject<{
|
|
269
|
+
start_time: z.ZodString;
|
|
270
|
+
duration: z.ZodNumber;
|
|
271
|
+
parking_spot: z.ZodString;
|
|
272
|
+
door: z.ZodString;
|
|
273
|
+
}, z.core.$strip>;
|
|
266
274
|
export declare const createParkingBookingBodySchema: z.ZodObject<{
|
|
267
275
|
company: z.ZodObject<{
|
|
268
276
|
hall: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -286,9 +294,14 @@ export declare const createParkingBookingBodySchema: z.ZodObject<{
|
|
|
286
294
|
}, z.core.$strip>;
|
|
287
295
|
booking_date: z.ZodString;
|
|
288
296
|
event_id: z.ZodNumber;
|
|
289
|
-
slot_key: z.ZodString
|
|
297
|
+
slot_key: z.ZodOptional<z.ZodString>;
|
|
290
298
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
291
|
-
|
|
299
|
+
custom_time_slot: z.ZodOptional<z.ZodObject<{
|
|
300
|
+
start_time: z.ZodString;
|
|
301
|
+
duration: z.ZodNumber;
|
|
302
|
+
parking_spot: z.ZodString;
|
|
303
|
+
door: z.ZodString;
|
|
304
|
+
}, z.core.$strip>>;
|
|
292
305
|
}, z.core.$strip>;
|
|
293
306
|
export declare const createParkingBookingDataSchema: z.ZodObject<{
|
|
294
307
|
id: z.ZodNumber;
|
|
@@ -322,6 +335,7 @@ export declare const createParkingBookingDataSchema: z.ZodObject<{
|
|
|
322
335
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
323
336
|
created_at: z.ZodString;
|
|
324
337
|
created_by: z.ZodNullable<z.ZodString>;
|
|
338
|
+
is_custom_slot: z.ZodBoolean;
|
|
325
339
|
}, z.core.$strip>;
|
|
326
340
|
export declare const createParkingBookingResponseSchema: z.ZodObject<{
|
|
327
341
|
success: z.ZodBoolean;
|
|
@@ -358,6 +372,7 @@ export declare const createParkingBookingResponseSchema: z.ZodObject<{
|
|
|
358
372
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
359
373
|
created_at: z.ZodString;
|
|
360
374
|
created_by: z.ZodNullable<z.ZodString>;
|
|
375
|
+
is_custom_slot: z.ZodBoolean;
|
|
361
376
|
}, z.core.$strip>;
|
|
362
377
|
}, z.core.$strip>;
|
|
363
378
|
export declare const updateParkingBookingBodySchema: z.ZodObject<{
|
|
@@ -513,6 +528,7 @@ export declare const parkingBookingWithRelationsSchema: z.ZodObject<{
|
|
|
513
528
|
slot_key: z.ZodNullable<z.ZodString>;
|
|
514
529
|
entry_scanned_at: z.ZodNullable<z.ZodString>;
|
|
515
530
|
exit_scanned_at: z.ZodNullable<z.ZodString>;
|
|
531
|
+
is_custom_slot: z.ZodBoolean;
|
|
516
532
|
}, z.core.$strip>;
|
|
517
533
|
export declare const getParkingBookingDetailsParamsSchema: z.ZodObject<{
|
|
518
534
|
bookingId: z.ZodCoercedNumber<unknown>;
|
|
@@ -573,6 +589,7 @@ export declare const parkingBookingDetailsDataSchema: z.ZodObject<{
|
|
|
573
589
|
parking_spot: z.ZodString;
|
|
574
590
|
door: z.ZodString;
|
|
575
591
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
592
|
+
is_custom_slot: z.ZodBoolean;
|
|
576
593
|
}, z.core.$strip>;
|
|
577
594
|
export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
|
|
578
595
|
success: z.ZodBoolean;
|
|
@@ -632,6 +649,7 @@ export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
|
|
|
632
649
|
parking_spot: z.ZodString;
|
|
633
650
|
door: z.ZodString;
|
|
634
651
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
652
|
+
is_custom_slot: z.ZodBoolean;
|
|
635
653
|
}, z.core.$strip>;
|
|
636
654
|
}, z.core.$strip>;
|
|
637
655
|
export declare const getParkingBookingDetailsByTokenBodySchema: z.ZodObject<{
|
package/dist/parkingBooking.js
CHANGED
|
@@ -171,7 +171,8 @@ export const parkingBookingSchema = z.object({
|
|
|
171
171
|
parking_spot: z.string(),
|
|
172
172
|
door: z.string(),
|
|
173
173
|
parking_schedule_type: z.enum(ParkingAreaScheduleType),
|
|
174
|
-
time_zone: z.string()
|
|
174
|
+
time_zone: z.string(),
|
|
175
|
+
is_custom_slot: z.boolean()
|
|
175
176
|
});
|
|
176
177
|
export const eventBookingsDataSchema = z
|
|
177
178
|
.object({
|
|
@@ -279,6 +280,24 @@ export const checkSlotAvailabilityResponseSchema = createSuccessResponseSchema(a
|
|
|
279
280
|
// ------------------------------
|
|
280
281
|
// Create Parking Booking schemas
|
|
281
282
|
// ------------------------------
|
|
283
|
+
export const customSlotSchema = z.object({
|
|
284
|
+
start_time: z.string().openapi({
|
|
285
|
+
description: 'Custom slot start time (HH:MM)',
|
|
286
|
+
example: '09:30'
|
|
287
|
+
}),
|
|
288
|
+
duration: z.number().int().positive().openapi({
|
|
289
|
+
description: 'Custom slot duration (minutes)',
|
|
290
|
+
example: 60
|
|
291
|
+
}),
|
|
292
|
+
parking_spot: z.string().openapi({
|
|
293
|
+
description: 'Parking area name',
|
|
294
|
+
example: 'Main Entrance'
|
|
295
|
+
}),
|
|
296
|
+
door: z.string().openapi({
|
|
297
|
+
description: 'Parking door name',
|
|
298
|
+
example: 'North Gate'
|
|
299
|
+
})
|
|
300
|
+
});
|
|
282
301
|
// Request schema
|
|
283
302
|
export const createParkingBookingBodySchema = z
|
|
284
303
|
.object({
|
|
@@ -305,7 +324,7 @@ export const createParkingBookingBodySchema = z
|
|
|
305
324
|
description: 'ID of the event for which the booking is made',
|
|
306
325
|
example: 1
|
|
307
326
|
}),
|
|
308
|
-
slot_key: z.string().min(1, 'Slot key is required').openapi({
|
|
327
|
+
slot_key: z.string().min(1, 'Slot key is required').optional().openapi({
|
|
309
328
|
description: 'Unique key identifying the time slot to book',
|
|
310
329
|
example: 'MainEntrance_2025-12-25_06:00'
|
|
311
330
|
}),
|
|
@@ -313,10 +332,19 @@ export const createParkingBookingBodySchema = z
|
|
|
313
332
|
description: 'Type of parking area schedule',
|
|
314
333
|
example: 'assembly'
|
|
315
334
|
}),
|
|
316
|
-
|
|
317
|
-
description: '
|
|
318
|
-
example: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...'
|
|
335
|
+
custom_time_slot: z.optional(customSlotSchema).openapi({
|
|
336
|
+
description: 'Custom time slot details if booking a non-standard slot'
|
|
319
337
|
})
|
|
338
|
+
})
|
|
339
|
+
.check(({ issues, value }) => {
|
|
340
|
+
if (!value.custom_time_slot && !value.slot_key) {
|
|
341
|
+
issues.push({
|
|
342
|
+
path: ['custom_time_slot', 'slot_key'],
|
|
343
|
+
code: 'custom',
|
|
344
|
+
message: 'Either custom_time_slot or slot_key must be provided',
|
|
345
|
+
input: value
|
|
346
|
+
});
|
|
347
|
+
}
|
|
320
348
|
})
|
|
321
349
|
.openapi('CreateParkingBookingBody');
|
|
322
350
|
// Response schema
|
|
@@ -339,7 +367,8 @@ export const createParkingBookingDataSchema = z
|
|
|
339
367
|
parking_spot: z.string(),
|
|
340
368
|
parking_schedule_type: z.enum(ParkingAreaScheduleType),
|
|
341
369
|
created_at: z.string(),
|
|
342
|
-
created_by: z.string().nullable()
|
|
370
|
+
created_by: z.string().nullable(),
|
|
371
|
+
is_custom_slot: z.boolean()
|
|
343
372
|
})
|
|
344
373
|
.openapi('CreateParkingBookingData');
|
|
345
374
|
export const createParkingBookingResponseSchema = createMessageDataResponseSchema(createParkingBookingDataSchema, 'CreateParkingBookingResponse', 'Parking booking created successfully', 'Details of the created booking');
|
|
@@ -488,7 +517,8 @@ export const parkingBookingWithRelationsSchema = z
|
|
|
488
517
|
parking_schedule_type: z.enum(ParkingAreaScheduleType),
|
|
489
518
|
slot_key: z.string().nullable(),
|
|
490
519
|
entry_scanned_at: z.string().nullable(),
|
|
491
|
-
exit_scanned_at: z.string().nullable()
|
|
520
|
+
exit_scanned_at: z.string().nullable(),
|
|
521
|
+
is_custom_slot: z.boolean()
|
|
492
522
|
})
|
|
493
523
|
.openapi('ParkingBookingWithRelations');
|
|
494
524
|
// ------------------------------
|
|
@@ -628,6 +658,10 @@ export const parkingBookingDetailsDataSchema = z
|
|
|
628
658
|
parking_schedule_type: z.enum(ParkingAreaScheduleType).openapi({
|
|
629
659
|
description: 'Type of parking area schedule',
|
|
630
660
|
example: 'assembly'
|
|
661
|
+
}),
|
|
662
|
+
is_custom_slot: z.boolean().openapi({
|
|
663
|
+
description: 'Indicates if the booking is for a custom time slot',
|
|
664
|
+
example: false
|
|
631
665
|
})
|
|
632
666
|
})
|
|
633
667
|
.openapi('ParkingBookingDetailsData');
|
package/package.json
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@venulog/phasing-engine-schemas",
|
|
3
|
-
"version": "0.12.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
|
-
},
|
|
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
|
+
{
|
|
2
|
+
"name": "@venulog/phasing-engine-schemas",
|
|
3
|
+
"version": "0.12.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
|
+
},
|
|
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
|
+
}
|