/** * Bulk Create Booking API * Wrapper for the Wix Bookings bulkCreateBooking SDK function. * * Used for the 1-day case of the DAY-range expansion: a single APPOINTMENT * service whose duration is configured as a DAY range, with exactly one * per-day availability slot picked. The 2-8 day case is routed to * createMultiServiceBooking. */ import { type CreateBookingInfo, type BulkCreateBookingResponse, type ParticipantNotification } from '@wix/auto_sdk_bookings_bookings'; import type { FormValues } from '@wix/forms/components'; /** * Options for creating bookings in bulk. * * The SDK accepts `formSubmission` on each `CreateBookingInfo` entry, while * this wrapper accepts one shared payload and applies it to every entry. * We always set `returnFullEntity: true` so the response includes per-booking * entities (with `contactDetails`) for cart wiring. */ export interface BulkCreateBookingOptions { /** Notification settings for participants. Applied to every entry. */ participantNotification?: ParticipantNotification; /** Whether to send SMS reminder. Applied to every entry. */ sendSmsReminder?: boolean | null; /** Form submission data. Applied to every entry. */ formSubmission?: FormValues | null; } /** * Creates 1-8 bookings in a single bulk call. * * Per the SDK contract, `createBookingsInfo` accepts 1-8 bookings. When the * DAY-range routing picks exactly one per-day slot, this wrapper is invoked * with a single-element array. Validation of constraints is delegated to the * SDK; this wrapper only forwards the request and pins * `returnFullEntity: true` so the caller can read * `results[].item.contactDetails` for downstream cart construction. * * @param createBookingsInfo - 1-8 single-service booking specifications * @param options - Optional notification / SMS settings (applied to every entry) * @returns Promise resolving to the bulk-create response * * @example * ```typescript * const response = await bulkCreateBooking( * [{ booking: bookingDay1 }], * { * participantNotification: { notifyParticipants: true }, * sendSmsReminder: true, * formSubmission: formValues, * } * ); * const ids = response.results * ?.map((r) => r.item?._id) * .filter(Boolean); * ``` */ export declare function bulkCreateBooking(createBookingsInfo: CreateBookingInfo[], options?: BulkCreateBookingOptions): Promise;