@tebuto/react-booking-widget 1.1.1 → 1.3.0

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/types.d.ts CHANGED
@@ -124,6 +124,7 @@ type ClaimResponse = {
124
124
  isAvailable: boolean;
125
125
  requirePhoneNumber: boolean;
126
126
  requireAddress: boolean;
127
+ requireBirthdate: boolean;
127
128
  };
128
129
  /** Payment configuration */
129
130
  type PaymentConfiguration = {
@@ -142,6 +143,7 @@ type ClientInfo = {
142
143
  city: string;
143
144
  zip: string;
144
145
  };
146
+ birthdate?: string;
145
147
  notes?: string;
146
148
  };
147
149
  /** Booking request payload */
@@ -197,6 +199,7 @@ type TebutoConfig = {
197
199
  };
198
200
  type TebutoContextValue = TebutoConfig & {
199
201
  buildUrl: (path: string) => string;
202
+ fingerprint: string;
200
203
  };
201
204
  type TebutoProviderProps = {
202
205
  therapistUUID: string;
@@ -344,8 +347,7 @@ type UseClaimSlotReturn = ClaimState & {
344
347
  */
345
348
  declare function useClaimSlot(): UseClaimSlotReturn;
346
349
 
347
- type BookingState = {
348
- booking: BookingResponse | null;
350
+ type BookingRequestState = {
349
351
  isLoading: boolean;
350
352
  error: Error | null;
351
353
  isSuccess: boolean;
@@ -355,44 +357,33 @@ type BookAppointmentParams = {
355
357
  client: ClientInfo;
356
358
  locationSelection?: AppointmentLocation;
357
359
  };
358
- type UseBookAppointmentReturn = BookingState & {
359
- /** Book the appointment */
360
- book: (params: BookAppointmentParams) => Promise<BookingResponse | null>;
361
- /** Reset the booking state */
360
+ type UseBookAppointmentReturn = BookingRequestState & {
361
+ /** Submit booking request - returns true on success */
362
+ book: (params: BookAppointmentParams) => Promise<boolean>;
363
+ /** Reset the state */
362
364
  reset: () => void;
363
- /** Download the calendar file (.ics) */
364
- downloadCalendar: () => void;
365
365
  };
366
366
  /**
367
- * useBookAppointment - Complete the booking process
367
+ * useBookAppointment - Submit a public booking request
368
368
  *
369
- * Submits the booking with client information and handles
370
- * the response including calendar download.
369
+ * Submits a booking request with client information. For public bookings,
370
+ * the client will receive a confirmation email to verify the appointment.
371
371
  *
372
372
  * @example
373
373
  * ```tsx
374
- * const { book, booking, isLoading, isSuccess, downloadCalendar, reset } = useBookAppointment()
374
+ * const { book, isLoading, isSuccess, error, reset } = useBookAppointment()
375
375
  *
376
376
  * const handleSubmit = async (clientInfo: ClientInfo) => {
377
- * const result = await book({
377
+ * const success = await book({
378
378
  * slot: claimedSlot,
379
379
  * client: clientInfo,
380
380
  * locationSelection: selectedLocation
381
381
  * })
382
382
  *
383
- * if (result) {
383
+ * if (success) {
384
384
  * setStep('confirmation')
385
385
  * }
386
386
  * }
387
- *
388
- * if (isSuccess) {
389
- * return (
390
- * <SuccessMessage>
391
- * <button onClick={downloadCalendar}>Add to Calendar</button>
392
- * <button onClick={reset}>Book Another</button>
393
- * </SuccessMessage>
394
- * )
395
- * }
396
387
  * ```
397
388
  */
398
389
  declare function useBookAppointment(): UseBookAppointmentReturn;
@@ -401,8 +392,8 @@ type BookingStep = 'loading' | 'date-selection' | 'time-selection' | 'booking-fo
401
392
  type UseBookingFlowOptions = {
402
393
  /** Categories to filter by */
403
394
  categories?: number[];
404
- /** Callback when booking is complete */
405
- onBookingComplete?: (booking: BookingResponse) => void;
395
+ /** Callback when booking request is submitted successfully */
396
+ onBookingComplete?: () => void;
406
397
  /** Callback on any error */
407
398
  onError?: (error: Error) => void;
408
399
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tebuto/react-booking-widget",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "description": "React Component for the Tebuto Booking Widget",
5
5
  "author": "Tebuto GmbH",
6
6
  "homepage": "https://tebuto.de",