@venulog/phasing-engine-schemas 0.6.0 → 0.7.0-alpha.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.
@@ -88,7 +88,11 @@ export declare const companyDetailsSchema: z.ZodObject<{
88
88
  transport_company: z.ZodString;
89
89
  }, z.core.$strip>;
90
90
  export declare const vehicleDetailsSchema: z.ZodObject<{
91
- vehicle_type: z.ZodString;
91
+ vehicle_type: z.ZodEnum<{
92
+ PL: "PL";
93
+ VUL: "VUL";
94
+ VL: "VL";
95
+ }>;
92
96
  unloading_method: z.ZodString;
93
97
  license_plate: z.ZodString;
94
98
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -269,7 +273,11 @@ export declare const bookingDetailsDataSchema: z.ZodObject<{
269
273
  transport_company: z.ZodString;
270
274
  }, z.core.$strip>;
271
275
  vehicle: z.ZodObject<{
272
- vehicle_type: z.ZodString;
276
+ vehicle_type: z.ZodEnum<{
277
+ PL: "PL";
278
+ VUL: "VUL";
279
+ VL: "VL";
280
+ }>;
273
281
  unloading_method: z.ZodString;
274
282
  license_plate: z.ZodString;
275
283
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -310,19 +318,17 @@ export declare const createParkingBookingBodySchema: z.ZodObject<{
310
318
  }, z.core.$strip>;
311
319
  company_role: z.ZodString;
312
320
  vehicle: z.ZodObject<{
313
- vehicle_type: z.ZodString;
321
+ vehicle_type: z.ZodEnum<{
322
+ PL: "PL";
323
+ VUL: "VUL";
324
+ VL: "VL";
325
+ }>;
314
326
  unloading_method: z.ZodString;
315
327
  license_plate: z.ZodString;
316
328
  trailer_registration: z.ZodOptional<z.ZodString>;
317
329
  }, z.core.$strip>;
318
- vehicle_type: z.ZodEnum<{
319
- PL: "PL";
320
- VUL: "VUL";
321
- VL: "VL";
322
- }>;
323
330
  booking_date: z.ZodString;
324
331
  start_time: z.ZodString;
325
- end_time: z.ZodString;
326
332
  }, z.core.$strip>;
327
333
  export declare const createParkingBookingDataSchema: z.ZodObject<{
328
334
  id: z.ZodNumber;
@@ -343,12 +349,15 @@ export declare const createParkingBookingDataSchema: z.ZodObject<{
343
349
  transport_company: z.ZodString;
344
350
  }, z.core.$strip>;
345
351
  vehicle: z.ZodObject<{
346
- vehicle_type: z.ZodString;
352
+ vehicle_type: z.ZodEnum<{
353
+ PL: "PL";
354
+ VUL: "VUL";
355
+ VL: "VL";
356
+ }>;
347
357
  unloading_method: z.ZodString;
348
358
  license_plate: z.ZodString;
349
359
  trailer_registration: z.ZodOptional<z.ZodString>;
350
360
  }, z.core.$strip>;
351
- vehicle_type: z.ZodString;
352
361
  booking_date: z.ZodString;
353
362
  start_time: z.ZodString;
354
363
  end_time: z.ZodString;
@@ -377,12 +386,15 @@ export declare const createParkingBookingResponseSchema: z.ZodObject<{
377
386
  transport_company: z.ZodString;
378
387
  }, z.core.$strip>;
379
388
  vehicle: z.ZodObject<{
380
- vehicle_type: z.ZodString;
389
+ vehicle_type: z.ZodEnum<{
390
+ PL: "PL";
391
+ VUL: "VUL";
392
+ VL: "VL";
393
+ }>;
381
394
  unloading_method: z.ZodString;
382
395
  license_plate: z.ZodString;
383
396
  trailer_registration: z.ZodOptional<z.ZodString>;
384
397
  }, z.core.$strip>;
385
- vehicle_type: z.ZodString;
386
398
  booking_date: z.ZodString;
387
399
  start_time: z.ZodString;
388
400
  end_time: z.ZodString;
@@ -405,7 +417,11 @@ export declare const updateParkingBookingBodySchema: z.ZodObject<{
405
417
  transport_company: z.ZodString;
406
418
  }, z.core.$strip>>;
407
419
  vehicle: z.ZodOptional<z.ZodObject<{
408
- vehicle_type: z.ZodString;
420
+ vehicle_type: z.ZodEnum<{
421
+ PL: "PL";
422
+ VUL: "VUL";
423
+ VL: "VL";
424
+ }>;
409
425
  unloading_method: z.ZodString;
410
426
  license_plate: z.ZodString;
411
427
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -429,7 +445,11 @@ export declare const updateParkingBookingDataSchema: z.ZodObject<{
429
445
  transport_company: z.ZodString;
430
446
  }, z.core.$strip>>;
431
447
  vehicle: z.ZodNullable<z.ZodObject<{
432
- vehicle_type: z.ZodString;
448
+ vehicle_type: z.ZodEnum<{
449
+ PL: "PL";
450
+ VUL: "VUL";
451
+ VL: "VL";
452
+ }>;
433
453
  unloading_method: z.ZodString;
434
454
  license_plate: z.ZodString;
435
455
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -457,7 +477,11 @@ export declare const updateParkingBookingResponseSchema: z.ZodObject<{
457
477
  transport_company: z.ZodString;
458
478
  }, z.core.$strip>>;
459
479
  vehicle: z.ZodNullable<z.ZodObject<{
460
- vehicle_type: z.ZodString;
480
+ vehicle_type: z.ZodEnum<{
481
+ PL: "PL";
482
+ VUL: "VUL";
483
+ VL: "VL";
484
+ }>;
461
485
  unloading_method: z.ZodString;
462
486
  license_plate: z.ZodString;
463
487
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -470,6 +494,13 @@ export declare const confirmBookingParamsSchema: z.ZodObject<{
470
494
  bookingId: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
471
495
  }, z.core.$strip>;
472
496
  export declare const confirmBookingDataSchema: z.ZodObject<{
497
+ id: z.ZodNumber;
498
+ status: z.ZodString;
499
+ parking_area_schedule_id: z.ZodNumber;
500
+ updated_at: z.ZodString;
501
+ updated_by: z.ZodString;
502
+ }, z.core.$strip>;
503
+ export declare const confirmBookingResponseSchema: z.ZodObject<{
473
504
  success: z.ZodBoolean;
474
505
  message: z.ZodString;
475
506
  data: z.ZodObject<{
@@ -480,25 +511,17 @@ export declare const confirmBookingDataSchema: z.ZodObject<{
480
511
  updated_by: z.ZodString;
481
512
  }, z.core.$strip>;
482
513
  }, z.core.$strip>;
483
- export declare const confirmBookingResponseSchema: z.ZodObject<{
484
- success: z.ZodBoolean;
485
- message: z.ZodString;
486
- data: z.ZodObject<{
487
- success: z.ZodBoolean;
488
- message: z.ZodString;
489
- data: z.ZodObject<{
490
- id: z.ZodNumber;
491
- status: z.ZodString;
492
- parking_area_schedule_id: z.ZodNumber;
493
- updated_at: z.ZodString;
494
- updated_by: z.ZodString;
495
- }, z.core.$strip>;
496
- }, z.core.$strip>;
497
- }, z.core.$strip>;
498
514
  export declare const refuseBookingParamsSchema: z.ZodObject<{
499
515
  bookingId: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
500
516
  }, z.core.$strip>;
501
517
  export declare const refuseBookingDataSchema: z.ZodObject<{
518
+ id: z.ZodNumber;
519
+ status: z.ZodString;
520
+ parking_area_schedule_id: z.ZodNumber;
521
+ updated_at: z.ZodString;
522
+ updated_by: z.ZodString;
523
+ }, z.core.$strip>;
524
+ export declare const refuseBookingResponseSchema: z.ZodObject<{
502
525
  success: z.ZodBoolean;
503
526
  message: z.ZodString;
504
527
  data: z.ZodObject<{
@@ -509,21 +532,6 @@ export declare const refuseBookingDataSchema: z.ZodObject<{
509
532
  updated_by: z.ZodString;
510
533
  }, z.core.$strip>;
511
534
  }, z.core.$strip>;
512
- export declare const refuseBookingResponseSchema: z.ZodObject<{
513
- success: z.ZodBoolean;
514
- message: z.ZodString;
515
- data: z.ZodObject<{
516
- success: z.ZodBoolean;
517
- message: z.ZodString;
518
- data: z.ZodObject<{
519
- id: z.ZodNumber;
520
- status: z.ZodString;
521
- parking_area_schedule_id: z.ZodNumber;
522
- updated_at: z.ZodString;
523
- updated_by: z.ZodString;
524
- }, z.core.$strip>;
525
- }, z.core.$strip>;
526
- }, z.core.$strip>;
527
535
  export declare const parkingBookingWithRelationsSchema: z.ZodObject<{
528
536
  id: z.ZodNumber;
529
537
  status: z.ZodString;
@@ -583,7 +591,11 @@ export declare const parkingBookingDetailsDataSchema: z.ZodObject<{
583
591
  transport_company: z.ZodString;
584
592
  }, z.core.$strip>;
585
593
  vehicle: z.ZodObject<{
586
- vehicle_type: z.ZodString;
594
+ vehicle_type: z.ZodEnum<{
595
+ PL: "PL";
596
+ VUL: "VUL";
597
+ VL: "VL";
598
+ }>;
587
599
  unloading_method: z.ZodString;
588
600
  license_plate: z.ZodString;
589
601
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -636,7 +648,11 @@ export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
636
648
  transport_company: z.ZodString;
637
649
  }, z.core.$strip>;
638
650
  vehicle: z.ZodObject<{
639
- vehicle_type: z.ZodString;
651
+ vehicle_type: z.ZodEnum<{
652
+ PL: "PL";
653
+ VUL: "VUL";
654
+ VL: "VL";
655
+ }>;
640
656
  unloading_method: z.ZodString;
641
657
  license_plate: z.ZodString;
642
658
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -693,7 +709,11 @@ export declare const getParkingBookingDetailsByTokenResponseSchema: z.ZodObject<
693
709
  transport_company: z.ZodString;
694
710
  }, z.core.$strip>;
695
711
  vehicle: z.ZodObject<{
696
- vehicle_type: z.ZodString;
712
+ vehicle_type: z.ZodEnum<{
713
+ PL: "PL";
714
+ VUL: "VUL";
715
+ VL: "VL";
716
+ }>;
697
717
  unloading_method: z.ZodString;
698
718
  license_plate: z.ZodString;
699
719
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -746,7 +766,11 @@ export declare const getParkingBookingDetailsByQrResponseSchema: z.ZodObject<{
746
766
  transport_company: z.ZodString;
747
767
  }, z.core.$strip>;
748
768
  vehicle: z.ZodObject<{
749
- vehicle_type: z.ZodString;
769
+ vehicle_type: z.ZodEnum<{
770
+ PL: "PL";
771
+ VUL: "VUL";
772
+ VL: "VL";
773
+ }>;
750
774
  unloading_method: z.ZodString;
751
775
  license_plate: z.ZodString;
752
776
  trailer_registration: z.ZodOptional<z.ZodString>;
@@ -771,6 +795,54 @@ export declare const getParkingBookingDetailsByQrResponseSchema: z.ZodObject<{
771
795
  updated_at: z.ZodString;
772
796
  }, z.core.$strip>;
773
797
  }, z.core.$strip>;
798
+ export declare const exportBookingDataSchema: z.ZodObject<{
799
+ booking_id: z.ZodNumber;
800
+ event_id: z.ZodNumber;
801
+ status: z.ZodEnum<typeof BookingStatus>;
802
+ company_name: z.ZodString;
803
+ vehicle_type: z.ZodString;
804
+ scan_entrance: z.ZodNullable<z.ZodString>;
805
+ scan_exit: z.ZodNullable<z.ZodString>;
806
+ co2_footprint: z.ZodNullable<z.ZodNumber>;
807
+ booking_date: z.ZodString;
808
+ }, z.core.$strip>;
809
+ export declare const exportBookingsQuerySchema: z.ZodObject<{
810
+ event_id: z.ZodCoercedNumber<unknown>;
811
+ status: z.ZodOptional<z.ZodEnum<typeof BookingStatus>>;
812
+ }, z.core.$strip>;
813
+ export declare const exportBookingsDataSchema: z.ZodObject<{
814
+ bookings: z.ZodArray<z.ZodObject<{
815
+ booking_id: z.ZodNumber;
816
+ event_id: z.ZodNumber;
817
+ status: z.ZodEnum<typeof BookingStatus>;
818
+ company_name: z.ZodString;
819
+ vehicle_type: z.ZodString;
820
+ scan_entrance: z.ZodNullable<z.ZodString>;
821
+ scan_exit: z.ZodNullable<z.ZodString>;
822
+ co2_footprint: z.ZodNullable<z.ZodNumber>;
823
+ booking_date: z.ZodString;
824
+ }, z.core.$strip>>;
825
+ total_count: z.ZodNumber;
826
+ filters_applied: z.ZodRecord<z.ZodString, z.ZodUnknown>;
827
+ }, z.core.$strip>;
828
+ export declare const exportBookingsResponseSchema: z.ZodObject<{
829
+ success: z.ZodBoolean;
830
+ data: z.ZodObject<{
831
+ bookings: z.ZodArray<z.ZodObject<{
832
+ booking_id: z.ZodNumber;
833
+ event_id: z.ZodNumber;
834
+ status: z.ZodEnum<typeof BookingStatus>;
835
+ company_name: z.ZodString;
836
+ vehicle_type: z.ZodString;
837
+ scan_entrance: z.ZodNullable<z.ZodString>;
838
+ scan_exit: z.ZodNullable<z.ZodString>;
839
+ co2_footprint: z.ZodNullable<z.ZodNumber>;
840
+ booking_date: z.ZodString;
841
+ }, z.core.$strip>>;
842
+ total_count: z.ZodNumber;
843
+ filters_applied: z.ZodRecord<z.ZodString, z.ZodUnknown>;
844
+ }, z.core.$strip>;
845
+ }, z.core.$strip>;
774
846
  export type Geometry = z.infer<typeof geometrySchema>;
775
847
  export type ParkingBooking = z.infer<typeof parkingBookingSchema>;
776
848
  export type CompanyDetails = z.infer<typeof companyDetailsSchema>;
@@ -805,3 +877,9 @@ export type GetBookingDetailsByTokenResponse = z.infer<typeof getParkingBookingD
805
877
  export type GetBookingDetailsByQrBody = z.infer<typeof getParkingBookingDetailsByQrBodySchema>;
806
878
  export type GetBookingDetailsByQrData = z.infer<typeof bookingDetailsDataSchema>;
807
879
  export type GetBookingDetailsByQrResponse = z.infer<typeof getParkingBookingDetailsByQrResponseSchema>;
880
+ export type ConfirmBookingData = z.infer<typeof confirmBookingDataSchema>;
881
+ export type ConfirmBookingDataResponse = z.infer<typeof confirmBookingResponseSchema>;
882
+ export type ExportBookingData = z.infer<typeof exportBookingDataSchema>;
883
+ export type ExportBookingsQuery = z.infer<typeof exportBookingsQuerySchema>;
884
+ export type ExportBookingsData = z.infer<typeof exportBookingsDataSchema>;
885
+ export type ExportBookingsResponse = z.infer<typeof exportBookingsResponseSchema>;
@@ -151,9 +151,9 @@ export const companyDetailsSchema = z
151
151
  .openapi('CompanyDetails');
152
152
  export const vehicleDetailsSchema = z
153
153
  .object({
154
- vehicle_type: z.string().min(1, 'Vehicle type is required').openapi({
155
- description: 'Type of vehicle',
156
- example: 'Truck'
154
+ vehicle_type: z.enum(['PL', 'VUL', 'VL']).openapi({
155
+ description: 'Vehicle type: PL (poids lourd), VUL (véhicule utilitaire léger), VL (véhicule léger)',
156
+ example: 'PL'
157
157
  }),
158
158
  unloading_method: z.string().min(1, 'Unloading method is required').openapi({
159
159
  description: 'Method of unloading',
@@ -406,10 +406,6 @@ export const createParkingBookingBodySchema = z
406
406
  vehicle: vehicleDetailsSchema.openapi({
407
407
  description: 'Vehicle details'
408
408
  }),
409
- vehicle_type: z.enum(['PL', 'VUL', 'VL']).openapi({
410
- description: 'Vehicle type: PL (poids lourd), VUL (véhicule utilitaire léger), VL (véhicule léger)',
411
- example: 'PL'
412
- }),
413
409
  booking_date: z
414
410
  .string()
415
411
  .regex(/^\d{4}-\d{2}-\d{2}$/)
@@ -423,13 +419,6 @@ export const createParkingBookingBodySchema = z
423
419
  .openapi({
424
420
  description: 'Start time (HH:MM)',
425
421
  example: '06:00'
426
- }),
427
- end_time: z
428
- .string()
429
- .regex(/^\d{2}:\d{2}$/)
430
- .openapi({
431
- description: 'End time (HH:MM)',
432
- example: '09:00'
433
422
  })
434
423
  })
435
424
  .openapi('CreateParkingBookingBody');
@@ -446,7 +435,6 @@ export const createParkingBookingDataSchema = z
446
435
  vehicle: vehicleDetailsSchema.openapi({
447
436
  description: 'Vehicle details'
448
437
  }),
449
- vehicle_type: z.string(),
450
438
  booking_date: z.string(),
451
439
  start_time: z.string(),
452
440
  end_time: z.string(),
@@ -523,15 +511,11 @@ export const confirmBookingParamsSchema = z
523
511
  // Response schema
524
512
  export const confirmBookingDataSchema = z
525
513
  .object({
526
- success: z.boolean(),
527
- message: z.string(),
528
- data: z.object({
529
- id: z.number(),
530
- status: z.string(),
531
- parking_area_schedule_id: z.number(),
532
- updated_at: z.string(),
533
- updated_by: z.string()
534
- })
514
+ id: z.number(),
515
+ status: z.string(),
516
+ parking_area_schedule_id: z.number(),
517
+ updated_at: z.string(),
518
+ updated_by: z.string()
535
519
  })
536
520
  .openapi('ConfirmBookingData');
537
521
  export const confirmBookingResponseSchema = createMessageDataResponseSchema(confirmBookingDataSchema, 'ConfirmBookingResponse', 'Parking booking confirmed successfully', 'Details of the confirmed booking');
@@ -556,15 +540,11 @@ export const refuseBookingParamsSchema = z
556
540
  // Response schema
557
541
  export const refuseBookingDataSchema = z
558
542
  .object({
559
- success: z.boolean(),
560
- message: z.string(),
561
- data: z.object({
562
- id: z.number(),
563
- status: z.string(),
564
- parking_area_schedule_id: z.number(),
565
- updated_at: z.string(),
566
- updated_by: z.string()
567
- })
543
+ id: z.number(),
544
+ status: z.string(),
545
+ parking_area_schedule_id: z.number(),
546
+ updated_at: z.string(),
547
+ updated_by: z.string()
568
548
  })
569
549
  .openapi('RefuseBookingData');
570
550
  export const refuseBookingResponseSchema = createMessageDataResponseSchema(refuseBookingDataSchema, 'RefuseBookingResponse', 'Parking booking refused successfully', 'Details of the refused booking');
@@ -743,3 +723,72 @@ export const getParkingBookingDetailsByQrBodySchema = z
743
723
  })
744
724
  .openapi('GetBookingDetailsByQrBody');
745
725
  export const getParkingBookingDetailsByQrResponseSchema = createSuccessResponseSchema(bookingDetailsDataSchema, 'GetBookingDetailsByQrResponse', 'Booking details retrieved by QR token');
726
+ // ------------------------------
727
+ // Export All Parking Bookings
728
+ // ------------------------------
729
+ export const exportBookingDataSchema = z
730
+ .object({
731
+ booking_id: z.number().openapi({
732
+ description: 'Unique booking identifier',
733
+ example: 123
734
+ }),
735
+ event_id: z.number().openapi({
736
+ description: 'Event ID associated with the booking',
737
+ example: 1
738
+ }),
739
+ status: z.enum(BookingStatus).openapi({
740
+ description: 'Current booking status',
741
+ example: 'confirmed'
742
+ }),
743
+ company_name: z.string().openapi({
744
+ description: 'Company name from booking details',
745
+ example: 'Acme Corp'
746
+ }),
747
+ vehicle_type: z.string().openapi({
748
+ description: 'Type of vehicle (PL, VUL, VL)',
749
+ example: 'PL'
750
+ }),
751
+ scan_entrance: z.string().nullable().openapi({
752
+ description: 'Entry scan timestamp',
753
+ example: '2024-12-15T08:30:00.000Z'
754
+ }),
755
+ scan_exit: z.string().nullable().openapi({
756
+ description: 'Exit scan timestamp',
757
+ example: '2024-12-15T17:15:00.000Z'
758
+ }),
759
+ co2_footprint: z.number().nullable().openapi({
760
+ description: 'Estimated CO2 footprint in kg based on vehicle type and duration',
761
+ example: 12.5
762
+ }),
763
+ booking_date: z.string().openapi({
764
+ description: 'Date of the booking',
765
+ example: '2024-12-15'
766
+ })
767
+ })
768
+ .openapi('ExportBookingData');
769
+ export const exportBookingsQuerySchema = z
770
+ .object({
771
+ event_id: z.coerce.number().openapi({
772
+ description: 'ID of the close event',
773
+ example: 1
774
+ }),
775
+ status: z.enum(BookingStatus).optional().openapi({
776
+ description: 'Filter by booking status',
777
+ example: 'confirmed'
778
+ })
779
+ })
780
+ .openapi('ExportBookingsQuery');
781
+ export const exportBookingsDataSchema = z
782
+ .object({
783
+ bookings: z.array(exportBookingDataSchema),
784
+ total_count: z.number().openapi({
785
+ description: 'Total number of bookings',
786
+ example: 150
787
+ }),
788
+ filters_applied: z.record(z.string(), z.unknown()).openapi({
789
+ description: 'Summary of applied filters',
790
+ example: { event_code: 'EVENT2024', status: 'confirmed' }
791
+ })
792
+ })
793
+ .openapi('ExportBookingsData');
794
+ export const exportBookingsResponseSchema = createSuccessResponseSchema(exportBookingsDataSchema, 'ExportBookingsResponse', 'Exported parking bookings data');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venulog/phasing-engine-schemas",
3
- "version": "0.6.0",
3
+ "version": "0.7.0-alpha.1",
4
4
  "description": "Shared schemas and types for Phasing Engine API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",