@venulog/phasing-engine-schemas 0.12.0-alpha.0 → 0.12.0-alpha.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/parkingArea.d.ts +0 -68
- package/dist/parkingArea.js +0 -136
- package/dist/parkingBooking.d.ts +22 -7
- package/dist/parkingBooking.js +41 -9
- package/package.json +1 -1
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<{
|
|
@@ -442,7 +457,6 @@ export declare const confirmBookingParamsSchema: z.ZodObject<{
|
|
|
442
457
|
export declare const confirmBookingDataSchema: z.ZodObject<{
|
|
443
458
|
id: z.ZodNumber;
|
|
444
459
|
status: z.ZodString;
|
|
445
|
-
parking_area_schedule_id: z.ZodNumber;
|
|
446
460
|
updated_at: z.ZodString;
|
|
447
461
|
updated_by: z.ZodString;
|
|
448
462
|
}, z.core.$strip>;
|
|
@@ -452,7 +466,6 @@ export declare const confirmBookingResponseSchema: z.ZodObject<{
|
|
|
452
466
|
data: z.ZodObject<{
|
|
453
467
|
id: z.ZodNumber;
|
|
454
468
|
status: z.ZodString;
|
|
455
|
-
parking_area_schedule_id: z.ZodNumber;
|
|
456
469
|
updated_at: z.ZodString;
|
|
457
470
|
updated_by: z.ZodString;
|
|
458
471
|
}, z.core.$strip>;
|
|
@@ -463,7 +476,6 @@ export declare const refuseBookingParamsSchema: z.ZodObject<{
|
|
|
463
476
|
export declare const refuseBookingDataSchema: z.ZodObject<{
|
|
464
477
|
id: z.ZodNumber;
|
|
465
478
|
status: z.ZodString;
|
|
466
|
-
parking_area_schedule_id: z.ZodNumber;
|
|
467
479
|
updated_at: z.ZodString;
|
|
468
480
|
updated_by: z.ZodString;
|
|
469
481
|
}, z.core.$strip>;
|
|
@@ -473,7 +485,6 @@ export declare const refuseBookingResponseSchema: z.ZodObject<{
|
|
|
473
485
|
data: z.ZodObject<{
|
|
474
486
|
id: z.ZodNumber;
|
|
475
487
|
status: z.ZodString;
|
|
476
|
-
parking_area_schedule_id: z.ZodNumber;
|
|
477
488
|
updated_at: z.ZodString;
|
|
478
489
|
updated_by: z.ZodString;
|
|
479
490
|
}, z.core.$strip>;
|
|
@@ -513,6 +524,7 @@ export declare const parkingBookingWithRelationsSchema: z.ZodObject<{
|
|
|
513
524
|
slot_key: z.ZodNullable<z.ZodString>;
|
|
514
525
|
entry_scanned_at: z.ZodNullable<z.ZodString>;
|
|
515
526
|
exit_scanned_at: z.ZodNullable<z.ZodString>;
|
|
527
|
+
is_custom_slot: z.ZodBoolean;
|
|
516
528
|
}, z.core.$strip>;
|
|
517
529
|
export declare const getParkingBookingDetailsParamsSchema: z.ZodObject<{
|
|
518
530
|
bookingId: z.ZodCoercedNumber<unknown>;
|
|
@@ -573,6 +585,7 @@ export declare const parkingBookingDetailsDataSchema: z.ZodObject<{
|
|
|
573
585
|
parking_spot: z.ZodString;
|
|
574
586
|
door: z.ZodString;
|
|
575
587
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
588
|
+
is_custom_slot: z.ZodBoolean;
|
|
576
589
|
}, z.core.$strip>;
|
|
577
590
|
export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
|
|
578
591
|
success: z.ZodBoolean;
|
|
@@ -632,6 +645,7 @@ export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
|
|
|
632
645
|
parking_spot: z.ZodString;
|
|
633
646
|
door: z.ZodString;
|
|
634
647
|
parking_schedule_type: z.ZodEnum<typeof ParkingAreaScheduleType>;
|
|
648
|
+
is_custom_slot: z.ZodBoolean;
|
|
635
649
|
}, z.core.$strip>;
|
|
636
650
|
}, z.core.$strip>;
|
|
637
651
|
export declare const getParkingBookingDetailsByTokenBodySchema: z.ZodObject<{
|
|
@@ -760,3 +774,4 @@ export type UpdateBookingTimeParams = z.infer<typeof updateBookingTimeParamsSche
|
|
|
760
774
|
export type UpdateBookingTimeBody = z.infer<typeof updateBookingTimeBodySchema>;
|
|
761
775
|
export type UpdateBookingTimeData = z.infer<typeof updateBookingTimeDataSchema>;
|
|
762
776
|
export type UpdateBookingTimeResponse = z.infer<typeof updateBookingTimeResponseSchema>;
|
|
777
|
+
export type UpdateParkingBookingResponse = z.infer<typeof updateParkingBookingResponseSchema>;
|
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');
|
|
@@ -413,7 +442,6 @@ export const confirmBookingDataSchema = z
|
|
|
413
442
|
.object({
|
|
414
443
|
id: z.number(),
|
|
415
444
|
status: z.string(),
|
|
416
|
-
parking_area_schedule_id: z.number(),
|
|
417
445
|
updated_at: z.string(),
|
|
418
446
|
updated_by: z.string()
|
|
419
447
|
})
|
|
@@ -442,7 +470,6 @@ export const refuseBookingDataSchema = z
|
|
|
442
470
|
.object({
|
|
443
471
|
id: z.number(),
|
|
444
472
|
status: z.string(),
|
|
445
|
-
parking_area_schedule_id: z.number(),
|
|
446
473
|
updated_at: z.string(),
|
|
447
474
|
updated_by: z.string()
|
|
448
475
|
})
|
|
@@ -488,7 +515,8 @@ export const parkingBookingWithRelationsSchema = z
|
|
|
488
515
|
parking_schedule_type: z.enum(ParkingAreaScheduleType),
|
|
489
516
|
slot_key: z.string().nullable(),
|
|
490
517
|
entry_scanned_at: z.string().nullable(),
|
|
491
|
-
exit_scanned_at: z.string().nullable()
|
|
518
|
+
exit_scanned_at: z.string().nullable(),
|
|
519
|
+
is_custom_slot: z.boolean()
|
|
492
520
|
})
|
|
493
521
|
.openapi('ParkingBookingWithRelations');
|
|
494
522
|
// ------------------------------
|
|
@@ -628,6 +656,10 @@ export const parkingBookingDetailsDataSchema = z
|
|
|
628
656
|
parking_schedule_type: z.enum(ParkingAreaScheduleType).openapi({
|
|
629
657
|
description: 'Type of parking area schedule',
|
|
630
658
|
example: 'assembly'
|
|
659
|
+
}),
|
|
660
|
+
is_custom_slot: z.boolean().openapi({
|
|
661
|
+
description: 'Indicates if the booking is for a custom time slot',
|
|
662
|
+
example: false
|
|
631
663
|
})
|
|
632
664
|
})
|
|
633
665
|
.openapi('ParkingBookingDetailsData');
|