@wix/auto_sdk_bookings_pricing 1.0.30 → 1.0.32

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +1 -1
  2. package/build/cjs/index.js +12 -3
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +141 -105
  5. package/build/cjs/index.typings.js +12 -3
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +102 -96
  8. package/build/cjs/meta.js +12 -3
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +1 -1
  11. package/build/es/index.mjs +12 -3
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +141 -105
  14. package/build/es/index.typings.mjs +12 -3
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +102 -96
  17. package/build/es/meta.mjs +12 -3
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +1 -1
  20. package/build/internal/cjs/index.js +12 -3
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +141 -105
  23. package/build/internal/cjs/index.typings.js +12 -3
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +102 -96
  26. package/build/internal/cjs/meta.js +12 -3
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +1 -1
  29. package/build/internal/es/index.mjs +12 -3
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +141 -105
  32. package/build/internal/es/index.typings.mjs +12 -3
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +102 -96
  35. package/build/internal/es/meta.mjs +12 -3
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -193,16 +193,19 @@ interface CalculatePriceRequest {
193
193
  /** An entity representing a scheduled appointment, class session, or course. */
194
194
  interface Booking extends BookingParticipantsInfoOneOf {
195
195
  /**
196
- * Total number of participants. Available only when the relevant service
197
- * doesn't have _variants and options_
198
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
196
+ * Total number of participants.
197
+ * When creating a booking, use this field only if the relevant service has fixed pricing and doesn't offer variants and options ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
199
198
  * @min 1
200
199
  */
201
200
  totalParticipants?: number;
202
201
  /**
203
- * Information about the booked service choices and participants.
204
- * Available only when the booking includes multiple _service variants_
202
+ * Information about the booked service choices and participant count for each choice.
203
+ * When creating a booking, use this field only if the booking includes multiple service variants
205
204
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
205
+ *
206
+ * For example, use this for a spa package booking that includes different service levels:
207
+ * - 2 participants chose "Standard Package".
208
+ * - 1 participant chose "VIP Package".
206
209
  */
207
210
  participantsChoices?: ParticipantChoices;
208
211
  /**
@@ -212,15 +215,24 @@ interface Booking extends BookingParticipantsInfoOneOf {
212
215
  */
213
216
  id?: string | null;
214
217
  /**
215
- * An object describing the *slot*
216
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings-and-time-slots/time-slots/availability-calendar/query-availability))
217
- * or *schedule*
218
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction))
219
- * that was booked.
218
+ * An object describing the bookable entity - either a specific time slot or a recurring schedule.
219
+ *
220
+ * The structure depends on the type of service being booked:
221
+ *
222
+ * *For appointment services:** Use `slot` to book a specific time slot with a
223
+ * service provider. Appointments are typically one-time sessions at a specific date and time.
224
+ *
225
+ * *For class services:** Use `slot` to book a specific class session. Classes
226
+ * are individual sessions that can have multiple participants.
227
+ *
228
+ * *For course services:** Use `schedule` to book an entire course consisting of
229
+ * multiple sessions over time. Courses are recurring, multi-session offerings.
230
+ *
231
+ * Choose the appropriate field based on your service type and booking requirements.
220
232
  */
221
233
  bookedEntity?: BookedEntity;
222
234
  /**
223
- * Contact details of the site visitor or *member*
235
+ * Contact details of the site visitor or member
224
236
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/members/members/introduction) | [REST](https://dev.wix.com/docs/rest/crm/members-contacts/members/members/introduction))
225
237
  * making the booking.
226
238
  */
@@ -235,20 +247,27 @@ interface Booking extends BookingParticipantsInfoOneOf {
235
247
  */
236
248
  status?: BookingStatusWithLiterals;
237
249
  /**
238
- * The payment status of the booking corresponds to the `paymentStatus` of the
239
- * related *eCommerce order*
240
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup)| [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)),
241
- * if one exists. All payment statuses are supported for every booking `status`.
250
+ * The payment status of the booking. This field automatically syncs with the
251
+ * `paymentStatus` of the corresponding eCommerce order
252
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup)| [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction))
253
+ * when customers use Wix eCommerce checkout.
254
+ *
255
+ * ## Integration patterns
256
+ *
257
+ * *When using Wix eCommerce checkout:** Wix Bookings automatically syncs the payment status based on the eCommerce order's payment status.
258
+ * Do not manually update this field.
259
+ *
260
+ * *When using custom payment flows:** You can manually update the payment status with Confirm Booking or Decline Booking ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings-writer-v2/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)) to reflect the customer's payment state.
261
+ *
262
+ * *For membership/pricing plan payments:** Wix Bookings automatically manages the payment status when customers pay with an active pricing plan ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/introduction)) subscription.
263
+ *
264
+ * All payment statuses are supported for every booking `status`.
242
265
  */
243
266
  paymentStatus?: PaymentStatusWithLiterals;
244
267
  /**
245
- * Payment option selected by the customer. If the customer hasn't completed their
246
- * checkout, they may still change the payment method. Must be one of the payment
247
- * options offered by the service ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)),
248
- * unless `skipSelectedPaymentOptionValidation` is `true`.
249
- * When undefined during an *eCommerce checkout*
250
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)),
251
- * Wix Bookings uses the service's default payment option
268
+ * Payment option selected by the customer. If the customer hasn't completed their checkout, they may still change the payment method. Must be one of the payment options offered by the service ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)), unless `skipSelectedPaymentOptionValidation` is `true`.
269
+ *
270
+ * When undefined during an eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)), Wix Bookings uses the service's default payment option
252
271
  */
253
272
  selectedPaymentOption?: SelectedPaymentOptionWithLiterals;
254
273
  /**
@@ -259,10 +278,8 @@ interface Booking extends BookingParticipantsInfoOneOf {
259
278
  /** External user ID that you can provide. */
260
279
  externalUserId?: string | null;
261
280
  /**
262
- * Revision number to be used when updating, rescheduling, or cancelling the
263
- * booking. Increments by 1 each time the booking is updated, rescheduled, or
264
- * canceled. To prevent conflicting changes, the current revision must be
265
- * specified when updating the booking.
281
+ * Revision number to be used when updating, rescheduling, or cancelling the booking.
282
+ * Increments by 1 each time the booking is updated, rescheduled, or canceled. To prevent conflicting changes, the current revision must be specified when updating the booking.
266
283
  */
267
284
  revision?: string | null;
268
285
  /**
@@ -303,37 +320,48 @@ interface Booking extends BookingParticipantsInfoOneOf {
303
320
  /** @oneof */
304
321
  interface BookingParticipantsInfoOneOf {
305
322
  /**
306
- * Total number of participants. Available only when the relevant service
307
- * doesn't have _variants and options_
308
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
323
+ * Total number of participants.
324
+ * When creating a booking, use this field only if the relevant service has fixed pricing and doesn't offer variants and options ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
309
325
  * @min 1
310
326
  */
311
327
  totalParticipants?: number;
312
328
  /**
313
- * Information about the booked service choices and participants.
314
- * Available only when the booking includes multiple _service variants_
329
+ * Information about the booked service choices and participant count for each choice.
330
+ * When creating a booking, use this field only if the booking includes multiple service variants
315
331
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
332
+ *
333
+ * For example, use this for a spa package booking that includes different service levels:
334
+ * - 2 participants chose "Standard Package".
335
+ * - 1 participant chose "VIP Package".
316
336
  */
317
337
  participantsChoices?: ParticipantChoices;
318
338
  }
319
339
  interface BookedEntity extends BookedEntityItemOneOf {
320
340
  /**
321
- * Booked *slot*
341
+ * Booked slot
322
342
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings-and-time-slots/time-slots/availability-calendar/query-availability)).
323
- * Available only for appointment-based services and classes.
324
- * For appointment-based services, a new session is created, while for classes,
325
- * the booking is automatically linked to the existing session.
343
+ *
344
+ * Specify `slot` when creating bookings for:
345
+ * - **Appointment-based services:** Individual sessions with service providers (consultations, treatments).
346
+ * Wix Bookings creates a new session when the booking is confirmed.
347
+ * - **Class services:** Group sessions at specific times (fitness classes, workshops).
348
+ * Wix Bookings links the booking to an existing scheduled session.
349
+ *
350
+ * For course services, specify `schedule` instead of `slot`.
326
351
  */
327
352
  slot?: BookedSlot;
328
353
  /**
329
- * Booked *schedule*
354
+ * Booked schedule
330
355
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction)).
331
- * Available only for course bookings.
356
+ *
357
+ * Specify `schedule` when creating bookings for:
358
+ * - **Course services:** Multi-session offerings spanning weeks or months (educational courses, training programs).
359
+ * Wix Bookings enrolls participants in all sessions defined by the course schedule.
332
360
  */
333
361
  schedule?: BookedSchedule;
334
362
  /**
335
363
  * Session title at the time of booking. If there is no pre-existing session,
336
- * for example for appointment-based services, `title` is set to the service name.
364
+ * for example for appointment-based services, Wix Bookings sets `title` to the service name.
337
365
  * @readonly
338
366
  * @maxLength 6000
339
367
  */
@@ -350,17 +378,25 @@ interface BookedEntity extends BookedEntityItemOneOf {
350
378
  /** @oneof */
351
379
  interface BookedEntityItemOneOf {
352
380
  /**
353
- * Booked *slot*
381
+ * Booked slot
354
382
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings-and-time-slots/time-slots/availability-calendar/query-availability)).
355
- * Available only for appointment-based services and classes.
356
- * For appointment-based services, a new session is created, while for classes,
357
- * the booking is automatically linked to the existing session.
383
+ *
384
+ * Specify `slot` when creating bookings for:
385
+ * - **Appointment-based services:** Individual sessions with service providers (consultations, treatments).
386
+ * Wix Bookings creates a new session when the booking is confirmed.
387
+ * - **Class services:** Group sessions at specific times (fitness classes, workshops).
388
+ * Wix Bookings links the booking to an existing scheduled session.
389
+ *
390
+ * For course services, specify `schedule` instead of `slot`.
358
391
  */
359
392
  slot?: BookedSlot;
360
393
  /**
361
- * Booked *schedule*
394
+ * Booked schedule
362
395
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction)).
363
- * Available only for course bookings.
396
+ *
397
+ * Specify `schedule` when creating bookings for:
398
+ * - **Course services:** Multi-session offerings spanning weeks or months (educational courses, training programs).
399
+ * Wix Bookings enrolls participants in all sessions defined by the course schedule.
364
400
  */
365
401
  schedule?: BookedSchedule;
366
402
  }
@@ -372,35 +408,25 @@ interface BookedSlot {
372
408
  /** Schedule ID. */
373
409
  scheduleId?: string;
374
410
  /**
375
- * ID of the corresponding *event*
411
+ * ID of the corresponding event
376
412
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction)).
377
413
  * Available for both appointment and class bookings, not available for course bookings.
378
- * For appointment-based services, Wix Bookings automatically populates `eventId`
379
- * when the booking `status` changes to `CONFIRMED`. For class bookings, it's
380
- * automatically populated upon booking creation.
414
+ * For appointment-based services, Wix Bookings automatically populates `eventId` when the booking `status` changes to `CONFIRMED`.
415
+ * For class bookings, Wix Bookings automatically populates `eventId` upon booking creation.
381
416
  * @minLength 36
382
417
  * @maxLength 250
383
418
  */
384
419
  eventId?: string | null;
385
- /**
386
- * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
387
- * format.
388
- */
420
+ /** The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format. */
389
421
  startDate?: string | null;
390
- /**
391
- * The end time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
392
- * format.
393
- */
422
+ /** The end time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format. */
394
423
  endDate?: string | null;
395
- /** The timezone according to which the slot was shown to the user when booking, and should be shown in the future. */
424
+ /** The time zone according to which the slot was shown to the user when booking, and should be shown in the future. */
396
425
  timezone?: string | null;
397
426
  /**
398
- * Primary *resource*
399
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction))
400
- * for the booking. For example, the *staff member*
401
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction))
402
- * providing the
403
- * service.
427
+ * Primary resource
428
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction)) for the booking.
429
+ * For example, the staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction)) providing the service.
404
430
  */
405
431
  resource?: BookedResource;
406
432
  /** Location where the session takes place. */
@@ -462,10 +488,7 @@ declare enum LocationType {
462
488
  /** @enumType */
463
489
  type LocationTypeWithLiterals = LocationType | 'UNDEFINED' | 'OWNER_BUSINESS' | 'OWNER_CUSTOM' | 'CUSTOM';
464
490
  interface BookedSchedule {
465
- /**
466
- * _Schedule ID_
467
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction)).
468
- */
491
+ /** Schedule ID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/schedules/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction)). */
469
492
  scheduleId?: string;
470
493
  /**
471
494
  * Booked service ID.
@@ -473,26 +496,22 @@ interface BookedSchedule {
473
496
  */
474
497
  serviceId?: string | null;
475
498
  /**
476
- * _Location_
477
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
478
- * where the schedule's sessions take place.
499
+ * Location ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction)) where the schedule's sessions take place.
479
500
  * @readonly
480
501
  */
481
502
  location?: Location;
482
503
  /**
483
- * Timezone in which the slot or session was shown to the customer when they booked.
504
+ * Time zone in which the slot or session was shown to the customer when they booked.
484
505
  * Also used whenever the customer reviews the booking's timing in the future.
485
506
  */
486
507
  timezone?: string | null;
487
508
  /**
488
- * Start time of the first session related to the booking in
489
- * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
509
+ * Start time of the first session related to the booking in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
490
510
  * @readonly
491
511
  */
492
512
  firstSessionStart?: string | null;
493
513
  /**
494
- * End time of the last session related to the booking in
495
- * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
514
+ * End time of the last session related to the booking in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
496
515
  * @readonly
497
516
  */
498
517
  lastSessionEnd?: string | null;
@@ -619,38 +638,26 @@ declare enum ValueType {
619
638
  type ValueTypeWithLiterals = ValueType | 'SHORT_TEXT' | 'LONG_TEXT' | 'CHECK_BOX';
620
639
  /** Booking status. */
621
640
  declare enum BookingStatus {
622
- /**
623
- * The booking was created, but the customer hasn't completed the related
624
- * eCommerce order yet.
625
- */
641
+ /** The booking was created, but the customer hasn't completed the related eCommerce order yet. */
626
642
  CREATED = "CREATED",
627
643
  /**
628
- * The merchant has confirmed the booking and it appears in the
629
- * business calendar. Merchants can set up their *services*
630
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
631
- * to automatically confirm all `PENDING` bookings.
644
+ * The merchant has confirmed the booking and it appears in the business calendar. Merchants can set up their services
645
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) to automatically confirm all `PENDING` bookings.
632
646
  */
633
647
  CONFIRMED = "CONFIRMED",
634
648
  /**
635
- * The customer has canceled the booking. Depending on the relevant service's
636
- * _policy snapshot_
649
+ * The customer has canceled the booking. Depending on the relevant service's policy snapshot
637
650
  * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policy-snapshots/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policy-snapshots/introduction))
638
- * they may have to pay a _cancellation fee_
639
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-fees/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/booking-fees/introduction)).
651
+ * they may have to pay a cancellation fee ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-fees/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/booking-fees/introduction)).
640
652
  */
641
653
  CANCELED = "CANCELED",
642
- /**
643
- * The merchant must manually confirm the booking before it appears
644
- * in the business calendar.
645
- */
654
+ /** The merchant must manually confirm the booking before it appears in the business calendar. */
646
655
  PENDING = "PENDING",
647
656
  /** The merchant has declined the booking before the customer was charged. */
648
657
  DECLINED = "DECLINED",
649
658
  /**
650
659
  * The booking is on a waitlist.
651
- * Currently, you can't call Register to Waitlist
652
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/waitlist/register-to-waitlist))
653
- * for course or appointment bookings, even though this is supported in live sites.
660
+ * Currently, you can't call Register to Waitlist ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/waitlist/register-to-waitlist)) for course or appointment bookings, even though this is supported in live sites.
654
661
  * You can call Register to Waitlist only for class session bookings.
655
662
  */
656
663
  WAITING_LIST = "WAITING_LIST"
@@ -772,8 +779,7 @@ interface ParticipantChoices {
772
779
  }
773
780
  interface ServiceChoices {
774
781
  /**
775
- * Number of participants for this _variant_
776
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
782
+ * Number of participants for this variant ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
777
783
  * @min 1
778
784
  */
779
785
  numberOfParticipants?: number | null;
package/build/cjs/meta.js CHANGED
@@ -72,7 +72,10 @@ function previewPrice(payload) {
72
72
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
73
73
  {
74
74
  transformFn: import_float.transformSDKFloatToRESTFloat,
75
- paths: [{ path: "bookingLineItems.pricePerParticipant" }]
75
+ paths: [
76
+ { path: "bookingLineItems.pricePerParticipant" },
77
+ { path: "bookingLineItems.serviceChoices.pricePerParticipant" }
78
+ ]
76
79
  }
77
80
  ]);
78
81
  const metadata = {
@@ -92,7 +95,10 @@ function previewPrice(payload) {
92
95
  paths: [
93
96
  { path: "priceInfo.calculatedPrice" },
94
97
  { path: "priceInfo.deposit" },
95
- { path: "priceInfo.bookingLineItems.pricePerParticipant" }
98
+ { path: "priceInfo.bookingLineItems.pricePerParticipant" },
99
+ {
100
+ path: "priceInfo.bookingLineItems.serviceChoices.pricePerParticipant"
101
+ }
96
102
  ]
97
103
  }
98
104
  ])
@@ -139,7 +145,10 @@ function calculatePrice(payload) {
139
145
  paths: [
140
146
  { path: "priceInfo.calculatedPrice" },
141
147
  { path: "priceInfo.deposit" },
142
- { path: "priceInfo.bookingLineItems.pricePerParticipant" }
148
+ { path: "priceInfo.bookingLineItems.pricePerParticipant" },
149
+ {
150
+ path: "priceInfo.bookingLineItems.serviceChoices.pricePerParticipant"
151
+ }
143
152
  ]
144
153
  }
145
154
  ])
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/bookings-v2-price-info-pricing.http.ts","../../src/bookings-v2-price-info-pricing.meta.ts"],"sourcesContent":["export * from './src/bookings-v2-price-info-pricing.meta.js';\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressBookingsPricingBookingsPricingServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n _: [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/bookings/v2/pricing/v2/pricing',\n destPath: '/v2/pricing',\n },\n {\n srcPath: '/bookings/v2/pricing',\n destPath: '/v2/pricing',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_bookings_pricing';\n\n/**\n * Previews the base price for a set of line items belonging to the same\n * service, before a booking is created. During the booking flow, additional\n * taxes and fees may be added to the base price.\n *\n *\n * ## Response\n *\n * The response includes each line item's individual preview price and the\n * total of all line item preview prices. Note that the final price upon\n * booking creation may differ from the preview price.\n *\n * ## Errors\n *\n * _Preview Price_ fails if:\n *\n * - You specify line items that belong to different *services*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).\n * - The site is using the *Bookings Pricing Integration SPI*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).\n *\n * ## When to call Calculate Price instead\n *\n * To retrieve the price of an existing booking, call *Calculate Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price)).\n */\nexport function previewPrice(payload: object): RequestOptionsFactory<any> {\n function __previewPrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [{ path: 'bookingLineItems.pricePerParticipant' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/preview',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __previewPrice;\n}\n\n/**\n * Calculates the base price of a booking.\n *\n *\n * The returned price serves as the foundation for charging the customer. During the\n * _eCommerce checkout_\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),\n * additional taxes and fees may be added to this base price.\n *\n * ## Price calculation method\n *\n * By default, Wix Bookings calculates a booking's price based on the relevant\n * `serviceOptionsAndVariants.variants.values.price`\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).\n * You must then specify either `booking.bookedEntity.slot.serviceId` or\n * `booking.bookedEntity.schedule.scheduleId`.\n *\n * If the business uses the *Wix Bookings Pricing Integration service plugin*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),\n * the returned `priceInfo` object reflects values received from the SPI implementor in\n * _Calculate Price_\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).\n * In this case, it suffices to specify `booking.bookedEntity`.\n *\n * ## When to call Preview Price instead\n *\n * To estimate the price for multiple booking line items before the booking exists,\n * call *Preview Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price)).\n */\nexport function calculatePrice(payload: object): RequestOptionsFactory<any> {\n function __calculatePrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'booking.createdDate' },\n { path: 'booking.startDate' },\n { path: 'booking.endDate' },\n { path: 'booking.updatedDate' },\n { path: 'booking.canceledDate' },\n ],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'booking.contactDetails.fullAddress.geocode.latitude' },\n { path: 'booking.contactDetails.fullAddress.geocode.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/calculate',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __calculatePrice;\n}\n","import * as ambassadorWixBookingsV2PriceInfo from './bookings-v2-price-info-pricing.http.js';\nimport * as ambassadorWixBookingsV2PriceInfoTypes from './bookings-v2-price-info-pricing.types.js';\nimport * as ambassadorWixBookingsV2PriceInfoUniversalTypes from './bookings-v2-price-info-pricing.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function previewPrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.previewPrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/preview',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function calculatePrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/calculate',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":"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","names":["calculatePrice","previewPrice","import_float","payload","previewPrice","calculatePrice"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/bookings-v2-price-info-pricing.http.ts","../../src/bookings-v2-price-info-pricing.meta.ts"],"sourcesContent":["export * from './src/bookings-v2-price-info-pricing.meta.js';\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressBookingsPricingBookingsPricingServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n _: [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/bookings/v2/pricing/v2/pricing',\n destPath: '/v2/pricing',\n },\n {\n srcPath: '/bookings/v2/pricing',\n destPath: '/v2/pricing',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_bookings_pricing';\n\n/**\n * Previews the base price for a set of line items belonging to the same\n * service, before a booking is created. During the booking flow, additional\n * taxes and fees may be added to the base price.\n *\n *\n * ## Response\n *\n * The response includes each line item's individual preview price and the\n * total of all line item preview prices. Note that the final price upon\n * booking creation may differ from the preview price.\n *\n * ## Errors\n *\n * _Preview Price_ fails if:\n *\n * - You specify line items that belong to different *services*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).\n * - The site is using the *Bookings Pricing Integration SPI*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).\n *\n * ## When to call Calculate Price instead\n *\n * To retrieve the price of an existing booking, call *Calculate Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price)).\n */\nexport function previewPrice(payload: object): RequestOptionsFactory<any> {\n function __previewPrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'bookingLineItems.pricePerParticipant' },\n { path: 'bookingLineItems.serviceChoices.pricePerParticipant' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/preview',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n {\n path: 'priceInfo.bookingLineItems.serviceChoices.pricePerParticipant',\n },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __previewPrice;\n}\n\n/**\n * Calculates the base price of a booking.\n *\n *\n * The returned price serves as the foundation for charging the customer. During the\n * _eCommerce checkout_\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),\n * additional taxes and fees may be added to this base price.\n *\n * ## Price calculation method\n *\n * By default, Wix Bookings calculates a booking's price based on the relevant\n * `serviceOptionsAndVariants.variants.values.price`\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).\n * You must then specify either `booking.bookedEntity.slot.serviceId` or\n * `booking.bookedEntity.schedule.scheduleId`.\n *\n * If the business uses the *Wix Bookings Pricing Integration service plugin*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),\n * the returned `priceInfo` object reflects values received from the SPI implementor in\n * _Calculate Price_\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).\n * In this case, it suffices to specify `booking.bookedEntity`.\n *\n * ## When to call Preview Price instead\n *\n * To estimate the price for multiple booking line items before the booking exists,\n * call *Preview Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price)).\n */\nexport function calculatePrice(payload: object): RequestOptionsFactory<any> {\n function __calculatePrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'booking.createdDate' },\n { path: 'booking.startDate' },\n { path: 'booking.endDate' },\n { path: 'booking.updatedDate' },\n { path: 'booking.canceledDate' },\n ],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'booking.contactDetails.fullAddress.geocode.latitude' },\n { path: 'booking.contactDetails.fullAddress.geocode.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/calculate',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n {\n path: 'priceInfo.bookingLineItems.serviceChoices.pricePerParticipant',\n },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __calculatePrice;\n}\n","import * as ambassadorWixBookingsV2PriceInfo from './bookings-v2-price-info-pricing.http.js';\nimport * as ambassadorWixBookingsV2PriceInfoTypes from './bookings-v2-price-info-pricing.types.js';\nimport * as ambassadorWixBookingsV2PriceInfoUniversalTypes from './bookings-v2-price-info-pricing.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function previewPrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.previewPrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/preview',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function calculatePrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/calculate',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,oBAAAC;AAAA;AAAA;;;ACAA,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AA4Bd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,qBAAiB,uCAAe,SAAS;AAAA,MAC7C;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,uCAAuC;AAAA,UAC/C,EAAE,MAAM,sDAAsD;AAAA,QAChE;AAAA,MACF;AAAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,MACN,mBAAmB,CAACC,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,4BAA4B;AAAA,YACpC,EAAE,MAAM,oBAAoB;AAAA,YAC5B,EAAE,MAAM,iDAAiD;AAAA,YACzD;AAAA,cACE,MAAM;AAAA,YACR;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAgCO,SAAS,eAAe,SAA6C;AAC1E,WAAS,iBAAiB,EAAE,KAAK,GAAQ;AACvC,UAAM,qBAAiB,uCAAe,SAAS;AAAA,MAC7C;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,sBAAsB;AAAA,UAC9B,EAAE,MAAM,oBAAoB;AAAA,UAC5B,EAAE,MAAM,kBAAkB;AAAA,UAC1B,EAAE,MAAM,sBAAsB;AAAA,UAC9B,EAAE,MAAM,uBAAuB;AAAA,QACjC;AAAA,MACF;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,sDAAsD;AAAA,UAC9D,EAAE,MAAM,uDAAuD;AAAA,QACjE;AAAA,MACF;AAAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,MACN,mBAAmB,CAACA,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,4BAA4B;AAAA,YACpC,EAAE,MAAM,oBAAoB;AAAA,YAC5B,EAAE,MAAM,iDAAiD;AAAA,YACzD;AAAA,cACE,MAAM;AAAA,YACR;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACrLO,SAASC,gBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6B,aAAa,OAAO;AAEvD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,kBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6B,eAAe,OAAO;AAEzD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["calculatePrice","previewPrice","import_float","payload","previewPrice","calculatePrice"]}
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
2
  import { BookingLineItem, PreviewPriceResponse, PreviewPriceApplicationErrors, Booking, CalculatePriceResponse, CalculatePriceApplicationErrors } from './index.typings.mjs';
3
- export { Actor, Address, AddressLocation, AddressStreetOneOf, BookedAddOn, BookedEntity, BookedEntityItemOneOf, BookedResource, BookedSchedule, BookedSlot, BookingParticipantsInfoOneOf, BookingSource, BookingStatus, CalculatePriceRequest, ContactDetails, CustomFormField, Duration, ExtendedFields, FlowControlSettings, IdentificationData, IdentificationDataIdOneOf, IdentityType, Location, LocationType, MultiServiceBookingInfo, MultiServiceBookingType, ParticipantChoices, ParticipantNotification, PaymentStatus, Platform, PreviewPriceRequest, PriceDescriptionInfo, PriceInfo, PriceInfoTotalPriceOneOf, SelectedPaymentOption, ServiceChoice, ServiceChoiceChoiceOneOf, ServiceChoices, StreetAddress, Subdivision, ValueType } from './index.typings.mjs';
3
+ export { Actor, Address, AddressLocation, AddressStreetOneOf, BookedAddOn, BookedEntity, BookedEntityItemOneOf, BookedResource, BookedSchedule, BookedSlot, BookingParticipantsInfoOneOf, BookingSource, BookingStatus, CalculatePriceRequest, ContactDetails, CustomFormField, Duration, ExtendedFields, FlowControlSettings, IdentificationData, IdentificationDataIdOneOf, IdentityType, Location, LocationType, MultiServiceBookingInfo, MultiServiceBookingType, ParticipantChoices, ParticipantNotification, PaymentStatus, Platform, PreviewPriceRequest, PriceDescriptionInfo, PriceInfo, PriceInfoTotalPriceOneOf, PricingServiceChoices, SelectedPaymentOption, ServiceChoice, ServiceChoiceChoiceOneOf, ServiceChoices, StreetAddress, Subdivision, ValueType } from './index.typings.mjs';
4
4
 
5
5
  type PriceInfoNonNullablePaths = `calculatedPrice` | `priceDescription` | `priceDescriptionInfo.original` | `bookingLineItems`;
6
6
  declare function previewPrice$1(httpClient: HttpClient): PreviewPriceSignature;
@@ -52,7 +52,10 @@ function previewPrice(payload) {
52
52
  const serializedData = transformPaths(payload, [
53
53
  {
54
54
  transformFn: transformSDKFloatToRESTFloat,
55
- paths: [{ path: "bookingLineItems.pricePerParticipant" }]
55
+ paths: [
56
+ { path: "bookingLineItems.pricePerParticipant" },
57
+ { path: "bookingLineItems.serviceChoices.pricePerParticipant" }
58
+ ]
56
59
  }
57
60
  ]);
58
61
  const metadata = {
@@ -72,7 +75,10 @@ function previewPrice(payload) {
72
75
  paths: [
73
76
  { path: "priceInfo.calculatedPrice" },
74
77
  { path: "priceInfo.deposit" },
75
- { path: "priceInfo.bookingLineItems.pricePerParticipant" }
78
+ { path: "priceInfo.bookingLineItems.pricePerParticipant" },
79
+ {
80
+ path: "priceInfo.bookingLineItems.serviceChoices.pricePerParticipant"
81
+ }
76
82
  ]
77
83
  }
78
84
  ])
@@ -119,7 +125,10 @@ function calculatePrice(payload) {
119
125
  paths: [
120
126
  { path: "priceInfo.calculatedPrice" },
121
127
  { path: "priceInfo.deposit" },
122
- { path: "priceInfo.bookingLineItems.pricePerParticipant" }
128
+ { path: "priceInfo.bookingLineItems.pricePerParticipant" },
129
+ {
130
+ path: "priceInfo.bookingLineItems.serviceChoices.pricePerParticipant"
131
+ }
123
132
  ]
124
133
  }
125
134
  ])