@venulog/phasing-engine-schemas 0.7.0-alpha.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.
@@ -795,6 +795,54 @@ export declare const getParkingBookingDetailsByQrResponseSchema: z.ZodObject<{
795
795
  updated_at: z.ZodString;
796
796
  }, z.core.$strip>;
797
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>;
798
846
  export type Geometry = z.infer<typeof geometrySchema>;
799
847
  export type ParkingBooking = z.infer<typeof parkingBookingSchema>;
800
848
  export type CompanyDetails = z.infer<typeof companyDetailsSchema>;
@@ -831,3 +879,7 @@ export type GetBookingDetailsByQrData = z.infer<typeof bookingDetailsDataSchema>
831
879
  export type GetBookingDetailsByQrResponse = z.infer<typeof getParkingBookingDetailsByQrResponseSchema>;
832
880
  export type ConfirmBookingData = z.infer<typeof confirmBookingDataSchema>;
833
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>;
@@ -723,3 +723,72 @@ export const getParkingBookingDetailsByQrBodySchema = z
723
723
  })
724
724
  .openapi('GetBookingDetailsByQrBody');
725
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.7.0-alpha.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",