Shopvento UI - v0.2.0
    Preparing search index...

    Function useBookingData

    • Load event variants, windows, settings and locations; abort obsolete requests and expose reload state.

      Parameters

      • client: {
            checkVoucher: (
                code: string,
                signal?: AbortSignal,
            ) => Promise<VoucherCheck>;
            getEvent: (id: number, signal?: AbortSignal) => Promise<ShopTasting[]>;
            getSettings: (signal?: AbortSignal) => Promise<ShopSettings>;
            getTasting: (id: number, signal?: AbortSignal) => Promise<ShopTasting[]>;
            listEvents: (signal?: AbortSignal) => Promise<ShopTasting[]>;
            listLocations: (
                signal?: AbortSignal,
            ) => Promise<{ locations: ShopFranchiseLocationResponse[]; total: number }>;
            listLocationTimewindows: (
                locationId: number,
                __namedParameters?: {
                    endDate?: string;
                    signal?: AbortSignal;
                    startDate?: string;
                },
            ) => Promise<{ timewindows: Timewindow[]; total: number }>;
            listTastings: (signal?: AbortSignal) => Promise<ShopTasting[]>;
            listTimewindows: (
                id: number,
                signal?: AbortSignal,
                locationId?: number,
            ) => Promise<{ timewindows: Timewindow[]; total: number }>;
            submit: (body: ShopBookingRequest) => Promise<ShopBookingResponse>;
            submitGuest: (
                body: ShopGuestBookingRequest,
            ) => Promise<ShopBookingResponse>;
        }

        Stable client instance used for API requests.

        • checkVoucher: (code: string, signal?: AbortSignal) => Promise<VoucherCheck>

          Check a public voucher code; final redemption happens atomically at booking.

        • getEvent: (id: number, signal?: AbortSignal) => Promise<ShopTasting[]>

          Filter the public list by event identifier; there is no public detail endpoint.

        • getSettings: (signal?: AbortSignal) => Promise<ShopSettings>

          Read public installation settings. Optional signal cancels the request.

        • getTasting: (id: number, signal?: AbortSignal) => Promise<ShopTasting[]>

          Use getEvent. Removed in 1.0.

        • listEvents: (signal?: AbortSignal) => Promise<ShopTasting[]>

          List public event variants. Optional signal cancels the request.

        • listLocations: (
              signal?: AbortSignal,
          ) => Promise<{ locations: ShopFranchiseLocationResponse[]; total: number }>

          List public event locations. Optional signal cancels the request.

        • listLocationTimewindows: (
              locationId: number,
              __namedParameters?: {
                  endDate?: string;
                  signal?: AbortSignal;
                  startDate?: string;
              },
          ) => Promise<{ timewindows: Timewindow[]; total: number }>

          Discover timewindows across all events at one location.

        • listTastings: (signal?: AbortSignal) => Promise<ShopTasting[]>

          Use listEvents. Removed in 1.0.

        • listTimewindows: (
              id: number,
              signal?: AbortSignal,
              locationId?: number,
          ) => Promise<{ timewindows: Timewindow[]; total: number }>

          List slots for one event. Date defaults to today in Europe/Berlin; optional location filters availability.

        • submit: (body: ShopBookingRequest) => Promise<ShopBookingResponse>

          Submit an authenticated booking request. In useSubmitBooking, pass guest, challenge token and consent explicitly for guest submissions; consent defaults to false.

        • submitGuest: (body: ShopGuestBookingRequest) => Promise<ShopBookingResponse>

          Submit guest contact, seats, live challenge token and current consent.

      • eventId: number

        Public event identifier used to select variants and availability.

      • OptionallocationId: number

        Positive installation location identifier used to filter availability.

      Returns {
          data:
              | {
                  locations: ShopFranchiseLocationResponse[];
                  settings: ShopSettings;
                  variants: ShopTasting[];
                  windows: Timewindow[];
              }
              | null;
          error: string
          | null;
          loading: boolean;
          reload: () => void;
      }

      • data:
            | {
                locations: ShopFranchiseLocationResponse[];
                settings: ShopSettings;
                variants: ShopTasting[];
                windows: Timewindow[];
            }
            | null

        Loaded authoritative data, or null while unavailable.

      • error: string | null

        Customer-visible error, or null.

      • loading: boolean

        Whether the read is pending.

      • reload: () => void

        Reload the resource from its authoritative API.