@venulog/phasing-engine-schemas 0.7.6 → 0.8.1
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 +45 -17
- package/dist/parkingArea.js +100 -27
- package/dist/parkingBooking.d.ts +136 -288
- package/dist/parkingBooking.js +78 -224
- package/package.json +1 -1
package/dist/parkingBooking.js
CHANGED
|
@@ -3,8 +3,9 @@ import { paginationSchema } from './pagination.js';
|
|
|
3
3
|
import { BookingStatus } from './enums/bookingStatus.js';
|
|
4
4
|
import { createSuccessResponseSchema, createMessageDataResponseSchema, documentSchema, vehicleTypeSchema } from './common.js';
|
|
5
5
|
import { z } from './zod.js';
|
|
6
|
-
import {
|
|
6
|
+
import { availableTimeSlotV2Schema, getAvailableSlotsBodyV2Schema } from './parkingArea.js';
|
|
7
7
|
import { UnloadingType } from './enums/unloadingType.js';
|
|
8
|
+
import { ParkingAreaScheduleType } from './enums/parkingAreaScheduleType.js';
|
|
8
9
|
// PostGIS geometry schema (GeoJSON-like structure)
|
|
9
10
|
export const geometrySchema = z
|
|
10
11
|
.object({
|
|
@@ -84,26 +85,6 @@ export const closeEventBodySchema = z
|
|
|
84
85
|
})
|
|
85
86
|
})
|
|
86
87
|
.openapi('CloseEventBody');
|
|
87
|
-
export const parkingBookingSchema = z.object({
|
|
88
|
-
id: z.number(),
|
|
89
|
-
parking_area_schedule_id: z.number(),
|
|
90
|
-
status: z.enum(BookingStatus),
|
|
91
|
-
is_active: z.boolean(),
|
|
92
|
-
created_at: z.string(),
|
|
93
|
-
updated_at: z.string(),
|
|
94
|
-
created_by: z.string().nullable(),
|
|
95
|
-
updated_by: z.string().nullable(),
|
|
96
|
-
booking_date: z.string().nullable(),
|
|
97
|
-
start_time: z.string().nullable(),
|
|
98
|
-
end_time: z.string().nullable(),
|
|
99
|
-
company_role: z.string().nullable(),
|
|
100
|
-
company: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
101
|
-
vehicle: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
102
|
-
entry_scanned_at: z.string().nullable(),
|
|
103
|
-
exit_scanned_at: z.string().nullable(),
|
|
104
|
-
// Include the schedule details
|
|
105
|
-
parking_area_schedule: parkingAreaScheduleSchema.optional()
|
|
106
|
-
});
|
|
107
88
|
export const companyDetailsSchema = z
|
|
108
89
|
.object({
|
|
109
90
|
hall: z.string().optional().nullable().openapi({
|
|
@@ -169,6 +150,27 @@ export const vehicleDetailsSchema = z
|
|
|
169
150
|
})
|
|
170
151
|
})
|
|
171
152
|
.openapi('VehicleDetails');
|
|
153
|
+
export const parkingBookingSchema = z.object({
|
|
154
|
+
id: z.number(),
|
|
155
|
+
parking_area_schedule_id: z.number(),
|
|
156
|
+
status: z.enum(BookingStatus),
|
|
157
|
+
is_active: z.boolean(),
|
|
158
|
+
created_at: z.string(),
|
|
159
|
+
updated_at: z.string(),
|
|
160
|
+
created_by: z.string().nullable(),
|
|
161
|
+
updated_by: z.string().nullable(),
|
|
162
|
+
booking_date: z.string().nullable(),
|
|
163
|
+
start_time: z.string().nullable(),
|
|
164
|
+
end_time: z.string().nullable(),
|
|
165
|
+
company_role: z.string().nullable(),
|
|
166
|
+
company: companyDetailsSchema,
|
|
167
|
+
vehicle: vehicleDetailsSchema,
|
|
168
|
+
entry_scanned_at: z.string().nullable(),
|
|
169
|
+
exit_scanned_at: z.string().nullable(),
|
|
170
|
+
parking_spot: z.string(),
|
|
171
|
+
door: z.string(),
|
|
172
|
+
parking_schedule_type: z.enum(ParkingAreaScheduleType)
|
|
173
|
+
});
|
|
172
174
|
export const eventBookingsDataSchema = z
|
|
173
175
|
.object({
|
|
174
176
|
event_id: z.number(),
|
|
@@ -264,170 +266,20 @@ export const confirmAccessResponseSchema = z.object({
|
|
|
264
266
|
// ------------------------------
|
|
265
267
|
export const checkSlotAvailabilityBodySchema = z
|
|
266
268
|
.object({
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
date: z
|
|
272
|
-
.string()
|
|
273
|
-
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Date must be in YYYY-MM-DD format')
|
|
274
|
-
.openapi({
|
|
275
|
-
description: 'The date to check availability (YYYY-MM-DD)',
|
|
276
|
-
example: '2025-12-15'
|
|
277
|
-
}),
|
|
278
|
-
start_time: z
|
|
279
|
-
.string()
|
|
280
|
-
.regex(/^\d{2}:\d{2}$/, 'Time must be in HH:MM format')
|
|
281
|
-
.openapi({
|
|
282
|
-
description: 'The start time to check availability (HH:MM)',
|
|
283
|
-
example: '08:00'
|
|
284
|
-
}),
|
|
285
|
-
company_role: z.string().min(1, 'Company role is required').openapi({
|
|
286
|
-
description: 'Company role to check availability for',
|
|
287
|
-
example: 'exhibitor'
|
|
269
|
+
...getAvailableSlotsBodyV2Schema.shape,
|
|
270
|
+
slot_key: z.string().min(1, 'Slot key is required').openapi({
|
|
271
|
+
description: 'Unique key identifying the time slot to check',
|
|
272
|
+
example: 'MainEntrance_2025-12-15_08:00'
|
|
288
273
|
})
|
|
289
274
|
})
|
|
290
275
|
.openapi('CheckSlotAvailabilityBody');
|
|
291
|
-
export const
|
|
292
|
-
.object({
|
|
293
|
-
schedule_id: z.number().openapi({
|
|
294
|
-
description: 'ID of the parking area schedule',
|
|
295
|
-
example: 1
|
|
296
|
-
}),
|
|
297
|
-
date: z.string().openapi({
|
|
298
|
-
description: 'Date checked',
|
|
299
|
-
example: '2025-12-15'
|
|
300
|
-
}),
|
|
301
|
-
start_time: z.string().openapi({
|
|
302
|
-
description: 'Time slot checked',
|
|
303
|
-
example: '08:00'
|
|
304
|
-
}),
|
|
305
|
-
is_available: z.boolean().openapi({
|
|
306
|
-
description: 'Whether the slot is available for booking',
|
|
307
|
-
example: true
|
|
308
|
-
}),
|
|
309
|
-
max_capacity: z.number().openapi({
|
|
310
|
-
description: 'Maximum booking capacity',
|
|
311
|
-
example: 5
|
|
312
|
-
}),
|
|
313
|
-
current_bookings: z.number().openapi({
|
|
314
|
-
description: 'Current number of total bookings',
|
|
315
|
-
example: 3
|
|
316
|
-
}),
|
|
317
|
-
confirmed_bookings: z.number().openapi({
|
|
318
|
-
description: 'Current number of confirmed bookings',
|
|
319
|
-
example: 1
|
|
320
|
-
}),
|
|
321
|
-
available_capacity: z.number().openapi({
|
|
322
|
-
description: 'Remaining available capacity',
|
|
323
|
-
example: 2
|
|
324
|
-
})
|
|
325
|
-
})
|
|
326
|
-
.openapi('CheckSlotAvailabilityData');
|
|
327
|
-
export const checkSlotAvailabilityResponseSchema = createSuccessResponseSchema(checkSlotAvailabilityDataSchema, 'CheckSlotAvailabilityResponse', 'Slot availability information with capacity details');
|
|
328
|
-
// ------------------------------
|
|
329
|
-
// QR Code Generation schemas
|
|
330
|
-
// ------------------------------
|
|
331
|
-
export const bookingDetailsDataSchema = z
|
|
332
|
-
.object({
|
|
333
|
-
qr_token: z.string().nullable().openapi({
|
|
334
|
-
description: 'QR token for verification',
|
|
335
|
-
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
336
|
-
}),
|
|
337
|
-
id: z.number().openapi({
|
|
338
|
-
description: 'ID of the booking',
|
|
339
|
-
example: 123
|
|
340
|
-
}),
|
|
341
|
-
booking_id: z.number().openapi({
|
|
342
|
-
description: 'ID of the booking',
|
|
343
|
-
example: 123
|
|
344
|
-
}),
|
|
345
|
-
status: z.string().openapi({
|
|
346
|
-
description: 'Booking status',
|
|
347
|
-
example: 'confirmed'
|
|
348
|
-
}),
|
|
349
|
-
booking_date: z.string().openapi({
|
|
350
|
-
description: 'Date of the booking',
|
|
351
|
-
example: '2025-12-15'
|
|
352
|
-
}),
|
|
353
|
-
start_time: z.string().openapi({
|
|
354
|
-
description: 'Start time of the booking',
|
|
355
|
-
example: '08:00'
|
|
356
|
-
}),
|
|
357
|
-
end_time: z.string().openapi({
|
|
358
|
-
description: 'End time of the booking',
|
|
359
|
-
example: '08:30'
|
|
360
|
-
}),
|
|
361
|
-
company_role: z.string().nullable().openapi({
|
|
362
|
-
description: 'Company role for the booking',
|
|
363
|
-
example: 'exhibitor'
|
|
364
|
-
}),
|
|
365
|
-
company: companyDetailsSchema.openapi({
|
|
366
|
-
description: 'Company details'
|
|
367
|
-
}),
|
|
368
|
-
vehicle: vehicleDetailsSchema.openapi({
|
|
369
|
-
description: 'Vehicle details'
|
|
370
|
-
}),
|
|
371
|
-
event_id: z.number().openapi({
|
|
372
|
-
description: 'ID of the event',
|
|
373
|
-
example: 1
|
|
374
|
-
}),
|
|
375
|
-
event_name: z.string().openapi({
|
|
376
|
-
description: 'Name of the event',
|
|
377
|
-
example: 'Paris Fashion Week 2025'
|
|
378
|
-
}),
|
|
379
|
-
event_code: z.string().openapi({
|
|
380
|
-
description: 'Code of the event',
|
|
381
|
-
example: 'PFW2025'
|
|
382
|
-
}),
|
|
383
|
-
venue_id: z.number().nullable().openapi({
|
|
384
|
-
description: 'ID of the venue',
|
|
385
|
-
example: 1
|
|
386
|
-
}),
|
|
387
|
-
venue_name: z.string().nullable().openapi({
|
|
388
|
-
description: 'Name of the venue',
|
|
389
|
-
example: 'Paris Expo Porte de Versailles'
|
|
390
|
-
}),
|
|
391
|
-
request_type: z.string().openapi({
|
|
392
|
-
description: 'Type of parking area schedule (assembly/dismantling)',
|
|
393
|
-
example: 'assembly'
|
|
394
|
-
}),
|
|
395
|
-
duration: z.number().openapi({
|
|
396
|
-
description: 'Duration of the booking in minutes',
|
|
397
|
-
example: 30
|
|
398
|
-
}),
|
|
399
|
-
parking_area_schedule_id: z.number().openapi({
|
|
400
|
-
description: 'ID of the parking area schedule',
|
|
401
|
-
example: 456
|
|
402
|
-
}),
|
|
403
|
-
banner: documentSchema.nullable().openapi({
|
|
404
|
-
description: 'Event banner document',
|
|
405
|
-
example: {
|
|
406
|
-
url: 'https://example.com/event-banner.jpg',
|
|
407
|
-
name: 'event-banner.jpg',
|
|
408
|
-
type: 'image/jpeg'
|
|
409
|
-
}
|
|
410
|
-
}),
|
|
411
|
-
created_at: z.string().openapi({
|
|
412
|
-
description: 'Timestamp when booking was created',
|
|
413
|
-
example: '2025-12-05T10:30:00.000Z'
|
|
414
|
-
}),
|
|
415
|
-
updated_at: z.string().openapi({
|
|
416
|
-
description: 'Timestamp when booking was last updated',
|
|
417
|
-
example: '2025-12-05T10:30:00.000Z'
|
|
418
|
-
})
|
|
419
|
-
})
|
|
420
|
-
.openapi('BookingDetailsData');
|
|
276
|
+
export const checkSlotAvailabilityResponseSchema = createSuccessResponseSchema(availableTimeSlotV2Schema, 'CheckSlotAvailabilityResponse', 'Slot availability information with capacity details');
|
|
421
277
|
// ------------------------------
|
|
422
278
|
// Create Parking Booking schemas
|
|
423
279
|
// ------------------------------
|
|
424
280
|
// Request schema
|
|
425
281
|
export const createParkingBookingBodySchema = z
|
|
426
282
|
.object({
|
|
427
|
-
parking_area_schedule_id: z.number().int().positive().openapi({
|
|
428
|
-
description: 'ID of the parking area schedule to book',
|
|
429
|
-
example: 1
|
|
430
|
-
}),
|
|
431
283
|
// Company details
|
|
432
284
|
company: companyDetailsSchema.openapi({
|
|
433
285
|
description: 'Company details including stand, contact, and driver info'
|
|
@@ -447,12 +299,17 @@ export const createParkingBookingBodySchema = z
|
|
|
447
299
|
description: 'Booking date (YYYY-MM-DD)',
|
|
448
300
|
example: '2025-12-25'
|
|
449
301
|
}),
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
302
|
+
event_id: z.number().positive().openapi({
|
|
303
|
+
description: 'ID of the event for which the booking is made',
|
|
304
|
+
example: 1
|
|
305
|
+
}),
|
|
306
|
+
slot_key: z.string().min(1, 'Slot key is required').openapi({
|
|
307
|
+
description: 'Unique key identifying the time slot to book',
|
|
308
|
+
example: 'MainEntrance_2025-12-25_06:00'
|
|
309
|
+
}),
|
|
310
|
+
parking_schedule_type: z.enum(ParkingAreaScheduleType).openapi({
|
|
311
|
+
description: 'Type of parking area schedule',
|
|
312
|
+
example: 'assembly'
|
|
456
313
|
})
|
|
457
314
|
})
|
|
458
315
|
.openapi('CreateParkingBookingBody');
|
|
@@ -460,7 +317,6 @@ export const createParkingBookingBodySchema = z
|
|
|
460
317
|
export const createParkingBookingDataSchema = z
|
|
461
318
|
.object({
|
|
462
319
|
id: z.number(),
|
|
463
|
-
parking_area_schedule_id: z.number(),
|
|
464
320
|
status: z.string(),
|
|
465
321
|
company_role: z.string(),
|
|
466
322
|
company: companyDetailsSchema.openapi({
|
|
@@ -472,6 +328,10 @@ export const createParkingBookingDataSchema = z
|
|
|
472
328
|
booking_date: z.string(),
|
|
473
329
|
start_time: z.string(),
|
|
474
330
|
end_time: z.string(),
|
|
331
|
+
event_id: z.number(),
|
|
332
|
+
door: z.string(),
|
|
333
|
+
parking_spot: z.string(),
|
|
334
|
+
parking_schedule_type: z.enum(ParkingAreaScheduleType),
|
|
475
335
|
created_at: z.string(),
|
|
476
336
|
created_by: z.string().nullable()
|
|
477
337
|
})
|
|
@@ -599,27 +459,25 @@ export const parkingBookingWithRelationsSchema = z
|
|
|
599
459
|
is_active: z.boolean(),
|
|
600
460
|
created_at: z.string(),
|
|
601
461
|
updated_at: z.string(),
|
|
602
|
-
|
|
462
|
+
events: z.object({
|
|
603
463
|
id: z.number(),
|
|
604
|
-
|
|
605
|
-
|
|
464
|
+
name: z.string(),
|
|
465
|
+
code: z.string(),
|
|
466
|
+
venue_id: z.number().nullable(),
|
|
467
|
+
banner: z.record(z.string(), z.unknown()).nullable(),
|
|
468
|
+
venues: z
|
|
469
|
+
.object({
|
|
606
470
|
id: z.number(),
|
|
607
|
-
name: z.string()
|
|
608
|
-
events: z.object({
|
|
609
|
-
id: z.number(),
|
|
610
|
-
name: z.string(),
|
|
611
|
-
code: z.string(),
|
|
612
|
-
venue_id: z.number().nullable(),
|
|
613
|
-
banner: z.record(z.string(), z.unknown()).nullable(),
|
|
614
|
-
venues: z
|
|
615
|
-
.object({
|
|
616
|
-
id: z.number(),
|
|
617
|
-
name: z.string()
|
|
618
|
-
})
|
|
619
|
-
.nullable()
|
|
620
|
-
})
|
|
471
|
+
name: z.string()
|
|
621
472
|
})
|
|
622
|
-
|
|
473
|
+
.nullable()
|
|
474
|
+
}),
|
|
475
|
+
parking_spot: z.string(),
|
|
476
|
+
door: z.string(),
|
|
477
|
+
parking_schedule_type: z.enum(ParkingAreaScheduleType),
|
|
478
|
+
slot_key: z.string(),
|
|
479
|
+
entry_scanned_at: z.string().nullable(),
|
|
480
|
+
exit_scanned_at: z.string().nullable()
|
|
623
481
|
})
|
|
624
482
|
.openapi('ParkingBookingWithRelations');
|
|
625
483
|
// ------------------------------
|
|
@@ -700,20 +558,6 @@ export const parkingBookingDetailsDataSchema = z
|
|
|
700
558
|
description: 'Duration of the booking in minutes',
|
|
701
559
|
example: 30
|
|
702
560
|
}),
|
|
703
|
-
parking_area_schedule_id: z.number().openapi({
|
|
704
|
-
description: 'ID of the parking area schedule',
|
|
705
|
-
example: 456
|
|
706
|
-
}),
|
|
707
|
-
parking_area: z.object({
|
|
708
|
-
id: z.number().openapi({
|
|
709
|
-
description: 'ID of parking area',
|
|
710
|
-
example: 30
|
|
711
|
-
}),
|
|
712
|
-
name: z.string().openapi({
|
|
713
|
-
description: 'Name of parking area',
|
|
714
|
-
example: 'Parking Spot X'
|
|
715
|
-
})
|
|
716
|
-
}),
|
|
717
561
|
banner: documentSchema.nullable().openapi({
|
|
718
562
|
description: 'Event banner document',
|
|
719
563
|
example: {
|
|
@@ -737,6 +581,22 @@ export const parkingBookingDetailsDataSchema = z
|
|
|
737
581
|
exit_scanned_at: z.string().nullable().optional().openapi({
|
|
738
582
|
description: 'Timestamp when exit was scanned',
|
|
739
583
|
example: '2025-12-15T08:25:00.000Z'
|
|
584
|
+
}),
|
|
585
|
+
slot_key: z.string().openapi({
|
|
586
|
+
description: 'Unique key identifying the booked time slot',
|
|
587
|
+
example: 'MainEntrance_2025-12-15_08:00'
|
|
588
|
+
}),
|
|
589
|
+
parking_spot: z.string().openapi({
|
|
590
|
+
description: 'Assigned parking spot for the booking',
|
|
591
|
+
example: 'A-12'
|
|
592
|
+
}),
|
|
593
|
+
door: z.string().openapi({
|
|
594
|
+
description: 'Assigned door for the booking',
|
|
595
|
+
example: 'North Gate'
|
|
596
|
+
}),
|
|
597
|
+
parking_schedule_type: z.enum(ParkingAreaScheduleType).openapi({
|
|
598
|
+
description: 'Type of parking area schedule',
|
|
599
|
+
example: 'assembly'
|
|
740
600
|
})
|
|
741
601
|
})
|
|
742
602
|
.openapi('ParkingBookingDetailsData');
|
|
@@ -752,7 +612,6 @@ export const getParkingBookingDetailsByTokenBodySchema = z
|
|
|
752
612
|
})
|
|
753
613
|
})
|
|
754
614
|
.openapi('GetParkingBookingDetailsByTokenBody');
|
|
755
|
-
export const getParkingBookingDetailsByTokenResponseSchema = createSuccessResponseSchema(bookingDetailsDataSchema, 'GetParkingBookingDetailsByTokenResponse', 'Booking details retrieved by access token');
|
|
756
615
|
// ------------------------------
|
|
757
616
|
// Get booking details by QR schemas
|
|
758
617
|
// ------------------------------
|
|
@@ -764,7 +623,6 @@ export const getParkingBookingDetailsByQrBodySchema = z
|
|
|
764
623
|
})
|
|
765
624
|
})
|
|
766
625
|
.openapi('GetBookingDetailsByQrBody');
|
|
767
|
-
export const getParkingBookingDetailsByQrResponseSchema = createSuccessResponseSchema(bookingDetailsDataSchema, 'GetBookingDetailsByQrResponse', 'Booking details retrieved by QR token');
|
|
768
626
|
// ------------------------------
|
|
769
627
|
// Export All Parking Bookings
|
|
770
628
|
// ------------------------------
|
|
@@ -864,9 +722,9 @@ export const updateBookingTimeBodySchema = z
|
|
|
864
722
|
description: 'New start time (HH:MM)',
|
|
865
723
|
example: '10:00'
|
|
866
724
|
}),
|
|
867
|
-
|
|
868
|
-
description: '
|
|
869
|
-
example:
|
|
725
|
+
slot_key: z.string().min(1, 'Slot key is required').openapi({
|
|
726
|
+
description: 'Unique key identifying the new time slot',
|
|
727
|
+
example: 'MainEntrance_2025-12-25_10:00'
|
|
870
728
|
})
|
|
871
729
|
})
|
|
872
730
|
.openapi('UpdateBookingTimeBody');
|
|
@@ -876,10 +734,6 @@ export const updateBookingTimeDataSchema = z
|
|
|
876
734
|
description: 'ID of the updated booking',
|
|
877
735
|
example: 1
|
|
878
736
|
}),
|
|
879
|
-
parking_area_schedule_id: z.number().openapi({
|
|
880
|
-
description: 'New parking area schedule ID',
|
|
881
|
-
example: 5
|
|
882
|
-
}),
|
|
883
737
|
booking_date: z.string().openapi({
|
|
884
738
|
description: 'New booking date',
|
|
885
739
|
example: '2025-12-25'
|