@wix/auto_sdk_bookings_bookings 1.0.4 → 1.0.5
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/build/cjs/src/bookings-v2-booking-bookings.context.d.ts +17 -17
- package/build/cjs/src/bookings-v2-booking-bookings.context.js +17 -17
- package/build/cjs/src/bookings-v2-booking-bookings.context.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking-bookings.http.d.ts +116 -116
- package/build/cjs/src/bookings-v2-booking-bookings.http.js +860 -860
- package/build/cjs/src/bookings-v2-booking-bookings.http.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
- package/build/cjs/src/bookings-v2-booking-bookings.meta.js +125 -125
- package/build/cjs/src/bookings-v2-booking-bookings.meta.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking-bookings.public.d.ts +171 -171
- package/build/cjs/src/bookings-v2-booking-bookings.public.js +84 -84
- package/build/cjs/src/bookings-v2-booking-bookings.public.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking-bookings.types.d.ts +1276 -958
- package/build/cjs/src/bookings-v2-booking-bookings.types.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking-bookings.universal.d.ts +2178 -1802
- package/build/cjs/src/bookings-v2-booking-bookings.universal.js +867 -867
- package/build/cjs/src/bookings-v2-booking-bookings.universal.js.map +1 -1
- package/build/es/src/bookings-v2-booking-bookings.context.d.ts +17 -17
- package/build/es/src/bookings-v2-booking-bookings.context.js +16 -16
- package/build/es/src/bookings-v2-booking-bookings.context.js.map +1 -1
- package/build/es/src/bookings-v2-booking-bookings.http.d.ts +116 -116
- package/build/es/src/bookings-v2-booking-bookings.http.js +808 -808
- package/build/es/src/bookings-v2-booking-bookings.http.js.map +1 -1
- package/build/es/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
- package/build/es/src/bookings-v2-booking-bookings.meta.js +103 -103
- package/build/es/src/bookings-v2-booking-bookings.meta.js.map +1 -1
- package/build/es/src/bookings-v2-booking-bookings.public.d.ts +171 -171
- package/build/es/src/bookings-v2-booking-bookings.public.js +65 -65
- package/build/es/src/bookings-v2-booking-bookings.public.js.map +1 -1
- package/build/es/src/bookings-v2-booking-bookings.types.d.ts +1276 -958
- package/build/es/src/bookings-v2-booking-bookings.types.js.map +1 -1
- package/build/es/src/bookings-v2-booking-bookings.universal.d.ts +2178 -1802
- package/build/es/src/bookings-v2-booking-bookings.universal.js +879 -879
- package/build/es/src/bookings-v2-booking-bookings.universal.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-booking-bookings.context.d.ts +17 -17
- package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js +17 -17
- package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-booking-bookings.http.d.ts +116 -116
- package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js +860 -860
- package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
- package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js +125 -125
- package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-booking-bookings.public.d.ts +171 -171
- package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js +84 -84
- package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-booking-bookings.types.d.ts +1276 -958
- package/build/internal/cjs/src/bookings-v2-booking-bookings.types.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.d.ts +2178 -1802
- package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js +867 -867
- package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js.map +1 -1
- package/build/internal/es/src/bookings-v2-booking-bookings.context.d.ts +17 -17
- package/build/internal/es/src/bookings-v2-booking-bookings.context.js +16 -16
- package/build/internal/es/src/bookings-v2-booking-bookings.context.js.map +1 -1
- package/build/internal/es/src/bookings-v2-booking-bookings.http.d.ts +116 -116
- package/build/internal/es/src/bookings-v2-booking-bookings.http.js +808 -808
- package/build/internal/es/src/bookings-v2-booking-bookings.http.js.map +1 -1
- package/build/internal/es/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
- package/build/internal/es/src/bookings-v2-booking-bookings.meta.js +103 -103
- package/build/internal/es/src/bookings-v2-booking-bookings.meta.js.map +1 -1
- package/build/internal/es/src/bookings-v2-booking-bookings.public.d.ts +171 -171
- package/build/internal/es/src/bookings-v2-booking-bookings.public.js +65 -65
- package/build/internal/es/src/bookings-v2-booking-bookings.public.js.map +1 -1
- package/build/internal/es/src/bookings-v2-booking-bookings.types.d.ts +1276 -958
- package/build/internal/es/src/bookings-v2-booking-bookings.types.js.map +1 -1
- package/build/internal/es/src/bookings-v2-booking-bookings.universal.d.ts +2178 -1802
- package/build/internal/es/src/bookings-v2-booking-bookings.universal.js +879 -879
- package/build/internal/es/src/bookings-v2-booking-bookings.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.removeBookingsFromMultiServiceBooking = exports.addBookingsToMultiServiceBooking = exports.getMultiServiceBooking = exports.bulkGetMultiServiceBookingAllowedActions = exports.declineMultiServiceBooking = exports.confirmMultiServiceBooking = exports.markMultiServiceBookingAsPending = exports.cancelMultiServiceBooking = exports.getMultiServiceBookingAvailability = exports.rescheduleMultiServiceBooking = exports.createMultiServiceBooking = exports.bookingsUpdateNumberOfParticipants = exports.bookingsCancelBooking = exports.bookingsDeclineBooking = exports.updateExtendedFields = exports.bookingsConfirmBooking = exports.rescheduleBooking = exports.bulkCreateBooking = exports.createBooking = exports.bulkConfirmOrDeclineBooking = exports.confirmOrDeclineBooking = void 0;
|
|
4
4
|
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
|
|
5
5
|
const float_1 = require("@wix/sdk-runtime/transformations/float");
|
|
6
6
|
const float_2 = require("@wix/sdk-runtime/transformations/float");
|
|
@@ -8,38 +8,7 @@ const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
|
8
8
|
const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
9
9
|
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
10
10
|
const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
|
|
11
|
-
function
|
|
12
|
-
const domainToMappings = {
|
|
13
|
-
'www.wixapis.com': [
|
|
14
|
-
{
|
|
15
|
-
srcPath: '/_api/bookings-confirmator/v2/bookings/confirmation',
|
|
16
|
-
destPath: '/v2/bookings/confirmation',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
srcPath: '/bookings/v2/confirmation',
|
|
20
|
-
destPath: '/v2/confirmation',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
srcPath: '/bookings/v2/bulk/confirmation',
|
|
24
|
-
destPath: '/v2/bulk/confirmation',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
srcPath: '/bookings/v2/bulk/bookings/confirmOrDecline',
|
|
28
|
-
destPath: '/v2/bulk/bookings/confirmOrDecline',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
srcPath: '/_api/bookings-confirmator/v2/bulk/confirmation',
|
|
32
|
-
destPath: '/v2/bulk/confirmation',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
srcPath: '/_api/bookings-confirmator/v2/bulk/bookings/confirmOrDecline',
|
|
36
|
-
destPath: '/v2/bulk/bookings/confirmOrDecline',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
41
|
-
}
|
|
42
|
-
function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
|
|
11
|
+
function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
|
|
43
12
|
const domainToMappings = {
|
|
44
13
|
_: [
|
|
45
14
|
{
|
|
@@ -140,7 +109,7 @@ function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
|
|
|
140
109
|
};
|
|
141
110
|
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
142
111
|
}
|
|
143
|
-
function
|
|
112
|
+
function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
|
|
144
113
|
const domainToMappings = {
|
|
145
114
|
_: [
|
|
146
115
|
{
|
|
@@ -241,93 +210,89 @@ function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
|
|
|
241
210
|
};
|
|
242
211
|
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
243
212
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* See Create Booking for more information.
|
|
250
|
-
*/
|
|
251
|
-
function createMultiServiceBooking(payload) {
|
|
252
|
-
function __createMultiServiceBooking({ host }) {
|
|
253
|
-
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
213
|
+
function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
|
|
214
|
+
const domainToMappings = {
|
|
215
|
+
'www.wixapis.com': [
|
|
254
216
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
{ path: 'bookings.createdDate' },
|
|
258
|
-
{ path: 'bookings.startDate' },
|
|
259
|
-
{ path: 'bookings.endDate' },
|
|
260
|
-
{ path: 'bookings.updatedDate' },
|
|
261
|
-
{ path: 'bookings.canceledDate' },
|
|
262
|
-
],
|
|
217
|
+
srcPath: '/_api/bookings-confirmator/v2/bookings/confirmation',
|
|
218
|
+
destPath: '/v2/bookings/confirmation',
|
|
263
219
|
},
|
|
264
220
|
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
{ path: 'bookings.contactDetails.fullAddress.geocode.latitude' },
|
|
268
|
-
{ path: 'bookings.contactDetails.fullAddress.geocode.longitude' },
|
|
269
|
-
],
|
|
221
|
+
srcPath: '/bookings/v2/confirmation',
|
|
222
|
+
destPath: '/v2/confirmation',
|
|
270
223
|
},
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
291
|
-
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
292
|
-
],
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
296
|
-
paths: [
|
|
297
|
-
{
|
|
298
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
},
|
|
305
|
-
]),
|
|
306
|
-
};
|
|
307
|
-
return metadata;
|
|
308
|
-
}
|
|
309
|
-
return __createMultiServiceBooking;
|
|
224
|
+
{
|
|
225
|
+
srcPath: '/bookings/v2/bulk/confirmation',
|
|
226
|
+
destPath: '/v2/bulk/confirmation',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
srcPath: '/bookings/v2/bulk/bookings/confirmOrDecline',
|
|
230
|
+
destPath: '/v2/bulk/bookings/confirmOrDecline',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
srcPath: '/_api/bookings-confirmator/v2/bulk/confirmation',
|
|
234
|
+
destPath: '/v2/bulk/confirmation',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
srcPath: '/_api/bookings-confirmator/v2/bulk/bookings/confirmOrDecline',
|
|
238
|
+
destPath: '/v2/bulk/bookings/confirmOrDecline',
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
};
|
|
242
|
+
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
310
243
|
}
|
|
311
|
-
|
|
244
|
+
const PACKAGE_NAME = '@wix/auto_sdk_bookings_bookings';
|
|
312
245
|
/**
|
|
313
|
-
*
|
|
246
|
+
* Updates the booking `status` to `CONFIRMED`, `PENDING`, or `DECLINED` based
|
|
247
|
+
* on the `paymentStatus` you provide, double booking conflicts, and whether
|
|
248
|
+
* the service requires business approval.
|
|
314
249
|
*
|
|
250
|
+
* ## eCommerce checkout restriction
|
|
315
251
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
252
|
+
* Call this method only when using a custom checkout page. Don't
|
|
253
|
+
* call it when using a *Wix eCommerce checkout*
|
|
254
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
|
|
255
|
+
* In such cases, Wix automatically updates the booking status based on
|
|
256
|
+
* the `paymentStatus` of the corresponding *Wix eCommerce order*
|
|
257
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
318
258
|
*
|
|
259
|
+
* ## New booking status
|
|
319
260
|
*
|
|
320
|
-
*
|
|
261
|
+
* The booking `status` is set to `DECLINED` if both of the following conditions
|
|
262
|
+
* are met:
|
|
263
|
+
* + You provide `UNDEFINED`, `NOT_PAID`, `REFUNDED`, or `EXEMPT` as payment status.
|
|
264
|
+
* + There is a double booking conflict.
|
|
265
|
+
*
|
|
266
|
+
* If only one or none of these conditions is met, `status` is set to `PENDING`
|
|
267
|
+
* or `CONFIRMED` depending on whether the service requires business approval.
|
|
268
|
+
*
|
|
269
|
+
* ## Double bookings
|
|
270
|
+
*
|
|
271
|
+
* If there is a double booking conflict, but the booking has already been at least
|
|
272
|
+
* partially paid, the method still marks the booking as `PENDING` or `CONFIRMED`.
|
|
273
|
+
* Then, it also sets `doubleBooked` to `true`.
|
|
274
|
+
*
|
|
275
|
+
* ## Admin overwrites
|
|
276
|
+
*
|
|
277
|
+
* There are small but important differences in confirmation behavior if the
|
|
278
|
+
* booking was created with special `flowControlSettings`:
|
|
279
|
+
* + If the booking's `flowControlSettings.skipAvailabilityValidation` was set to
|
|
280
|
+
* `true`, the booking is never declined regardless of double booking conflicts.
|
|
281
|
+
* Instead, it's marked `CONFIRMED` or `PENDING`, depending on whether the
|
|
282
|
+
* service requires business approval.
|
|
283
|
+
* + If the booking's `flowControlSettings.skipBusinessConfirmation` was set to
|
|
284
|
+
* `true`, the booking skips `PENDING` status and is marked `CONFIRMED`
|
|
285
|
+
* immediately.
|
|
321
286
|
*/
|
|
322
|
-
function
|
|
323
|
-
function
|
|
287
|
+
function confirmOrDeclineBooking(payload) {
|
|
288
|
+
function __confirmOrDeclineBooking({ host }) {
|
|
324
289
|
const metadata = {
|
|
325
290
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
326
291
|
method: 'POST',
|
|
327
|
-
methodFqn: 'com.wixpress.bookings.
|
|
292
|
+
methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.ConfirmOrDeclineBooking',
|
|
328
293
|
packageName: PACKAGE_NAME,
|
|
329
|
-
url:
|
|
330
|
-
protoPath: '/v2/
|
|
294
|
+
url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
|
|
295
|
+
protoPath: '/v2/confirmation/{bookingId}:confirmOrDecline',
|
|
331
296
|
data: payload,
|
|
332
297
|
host,
|
|
333
298
|
}),
|
|
@@ -336,67 +301,44 @@ function rescheduleMultiServiceBooking(payload) {
|
|
|
336
301
|
{
|
|
337
302
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
338
303
|
paths: [
|
|
339
|
-
{ path: '
|
|
340
|
-
{ path: '
|
|
341
|
-
{ path: '
|
|
342
|
-
{ path: '
|
|
343
|
-
{ path: '
|
|
304
|
+
{ path: 'booking.createdDate' },
|
|
305
|
+
{ path: 'booking.startDate' },
|
|
306
|
+
{ path: 'booking.endDate' },
|
|
307
|
+
{ path: 'booking.updatedDate' },
|
|
308
|
+
{ path: 'booking.canceledDate' },
|
|
344
309
|
],
|
|
345
310
|
},
|
|
346
311
|
{
|
|
347
312
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
348
313
|
paths: [
|
|
349
|
-
{
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
354
|
-
},
|
|
314
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
315
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
355
316
|
],
|
|
356
317
|
},
|
|
357
318
|
]),
|
|
358
319
|
};
|
|
359
320
|
return metadata;
|
|
360
321
|
}
|
|
361
|
-
return
|
|
322
|
+
return __confirmOrDeclineBooking;
|
|
362
323
|
}
|
|
363
|
-
exports.
|
|
324
|
+
exports.confirmOrDeclineBooking = confirmOrDeclineBooking;
|
|
364
325
|
/**
|
|
365
|
-
*
|
|
326
|
+
* Confirms or declines up to 300 bookings.
|
|
366
327
|
*
|
|
367
328
|
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
329
|
+
* See *Confirm Or Decline Booking*
|
|
330
|
+
* ([SDK](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking))
|
|
331
|
+
* for details about when a booking is confirmed or declined.
|
|
370
332
|
*/
|
|
371
|
-
function
|
|
372
|
-
function
|
|
373
|
-
const metadata = {
|
|
374
|
-
entityFqdn: 'wix.bookings.v2.booking',
|
|
375
|
-
method: 'POST',
|
|
376
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBookingAvailability',
|
|
377
|
-
packageName: PACKAGE_NAME,
|
|
378
|
-
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
379
|
-
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/get_availability',
|
|
380
|
-
data: payload,
|
|
381
|
-
host,
|
|
382
|
-
}),
|
|
383
|
-
data: payload,
|
|
384
|
-
};
|
|
385
|
-
return metadata;
|
|
386
|
-
}
|
|
387
|
-
return __getMultiServiceBookingAvailability;
|
|
388
|
-
}
|
|
389
|
-
exports.getMultiServiceBookingAvailability = getMultiServiceBookingAvailability;
|
|
390
|
-
/** Cancels a multi-service booking and thus all its individual bookings. */
|
|
391
|
-
function cancelMultiServiceBooking(payload) {
|
|
392
|
-
function __cancelMultiServiceBooking({ host }) {
|
|
333
|
+
function bulkConfirmOrDeclineBooking(payload) {
|
|
334
|
+
function __bulkConfirmOrDeclineBooking({ host }) {
|
|
393
335
|
const metadata = {
|
|
394
336
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
395
337
|
method: 'POST',
|
|
396
|
-
methodFqn: 'com.wixpress.bookings.
|
|
338
|
+
methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.BulkConfirmOrDeclineBooking',
|
|
397
339
|
packageName: PACKAGE_NAME,
|
|
398
|
-
url:
|
|
399
|
-
protoPath: '/v2/
|
|
340
|
+
url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
|
|
341
|
+
protoPath: '/v2/bulk/bookings/confirmOrDecline',
|
|
400
342
|
data: payload,
|
|
401
343
|
host,
|
|
402
344
|
}),
|
|
@@ -405,21 +347,21 @@ function cancelMultiServiceBooking(payload) {
|
|
|
405
347
|
{
|
|
406
348
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
407
349
|
paths: [
|
|
408
|
-
{ path: '
|
|
409
|
-
{ path: '
|
|
410
|
-
{ path: '
|
|
411
|
-
{ path: '
|
|
412
|
-
{ path: '
|
|
350
|
+
{ path: 'results.item.createdDate' },
|
|
351
|
+
{ path: 'results.item.startDate' },
|
|
352
|
+
{ path: 'results.item.endDate' },
|
|
353
|
+
{ path: 'results.item.updatedDate' },
|
|
354
|
+
{ path: 'results.item.canceledDate' },
|
|
413
355
|
],
|
|
414
356
|
},
|
|
415
357
|
{
|
|
416
358
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
417
359
|
paths: [
|
|
418
360
|
{
|
|
419
|
-
path: '
|
|
361
|
+
path: 'results.item.contactDetails.fullAddress.geocode.latitude',
|
|
420
362
|
},
|
|
421
363
|
{
|
|
422
|
-
path: '
|
|
364
|
+
path: 'results.item.contactDetails.fullAddress.geocode.longitude',
|
|
423
365
|
},
|
|
424
366
|
],
|
|
425
367
|
},
|
|
@@ -427,275 +369,252 @@ function cancelMultiServiceBooking(payload) {
|
|
|
427
369
|
};
|
|
428
370
|
return metadata;
|
|
429
371
|
}
|
|
430
|
-
return
|
|
372
|
+
return __bulkConfirmOrDeclineBooking;
|
|
431
373
|
}
|
|
432
|
-
exports.
|
|
374
|
+
exports.bulkConfirmOrDeclineBooking = bulkConfirmOrDeclineBooking;
|
|
433
375
|
/**
|
|
434
|
-
*
|
|
376
|
+
* Creates a booking.
|
|
435
377
|
*
|
|
436
378
|
*
|
|
437
|
-
*
|
|
379
|
+
* ## Appointment booking
|
|
438
380
|
*
|
|
439
|
-
*
|
|
381
|
+
* For appointment-based services, specify the relevant `slot` in
|
|
382
|
+
* `bookedEntity.slot`. We recommend specifying the complete
|
|
383
|
+
* `availabilityEntries.slot` returned in *Query Availability*
|
|
384
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
385
|
+
* in your call's request to avoid failed calls due to unavailability.
|
|
440
386
|
*
|
|
441
|
-
*
|
|
442
|
-
*/
|
|
443
|
-
function markMultiServiceBookingAsPending(payload) {
|
|
444
|
-
function __markMultiServiceBookingAsPending({ host }) {
|
|
445
|
-
const metadata = {
|
|
446
|
-
entityFqdn: 'wix.bookings.v2.booking',
|
|
447
|
-
method: 'POST',
|
|
448
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.MarkMultiServiceBookingAsPending',
|
|
449
|
-
packageName: PACKAGE_NAME,
|
|
450
|
-
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
451
|
-
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/mark_as_pending',
|
|
452
|
-
data: payload,
|
|
453
|
-
host,
|
|
454
|
-
}),
|
|
455
|
-
data: payload,
|
|
456
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
457
|
-
{
|
|
458
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
459
|
-
paths: [
|
|
460
|
-
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
461
|
-
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
462
|
-
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
463
|
-
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
464
|
-
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
465
|
-
],
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
469
|
-
paths: [
|
|
470
|
-
{
|
|
471
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
475
|
-
},
|
|
476
|
-
],
|
|
477
|
-
},
|
|
478
|
-
]),
|
|
479
|
-
};
|
|
480
|
-
return metadata;
|
|
481
|
-
}
|
|
482
|
-
return __markMultiServiceBookingAsPending;
|
|
483
|
-
}
|
|
484
|
-
exports.markMultiServiceBookingAsPending = markMultiServiceBookingAsPending;
|
|
485
|
-
/**
|
|
486
|
-
* Updates the status of a multi-service booking to `CONFIRMED`.
|
|
387
|
+
* ## Class session booking
|
|
487
388
|
*
|
|
389
|
+
* For class services, specify the relevant *event ID*
|
|
390
|
+
* ([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))
|
|
391
|
+
* as `bookedEntity.slot.eventId`.
|
|
392
|
+
* We recommend retrieving the event ID from *Query Availability's*
|
|
393
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
394
|
+
* `availabilityEntries.slot.eventId` to avoid failed calls due to unavailability.
|
|
395
|
+
* Specifying an event ID leads to automatic calculations of `slot.startDate`, `slot.endDate`,
|
|
396
|
+
* `slot.timezone`, `slot.resource`, and `slot.location`. All manually specified
|
|
397
|
+
* values are overridden.
|
|
488
398
|
*
|
|
489
|
-
*
|
|
399
|
+
* ## Course booking
|
|
490
400
|
*
|
|
491
|
-
*
|
|
401
|
+
* For course services, specify the course's schedule ID in `bookedEntity.schedule.scheduleId`.
|
|
402
|
+
* We recommend following [this sample flow](https://dev.wix.com/docs/rest/business-solutions/bookings/sample-booking-flows#book-a-course)
|
|
403
|
+
* to minimize failed calls due to unavailability.
|
|
492
404
|
*
|
|
493
|
-
*
|
|
494
|
-
*/
|
|
495
|
-
function confirmMultiServiceBooking(payload) {
|
|
496
|
-
function __confirmMultiServiceBooking({ host }) {
|
|
497
|
-
const metadata = {
|
|
498
|
-
entityFqdn: 'wix.bookings.v2.booking',
|
|
499
|
-
method: 'POST',
|
|
500
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.ConfirmMultiServiceBooking',
|
|
501
|
-
packageName: PACKAGE_NAME,
|
|
502
|
-
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
503
|
-
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/confirm',
|
|
504
|
-
data: payload,
|
|
505
|
-
host,
|
|
506
|
-
}),
|
|
507
|
-
data: payload,
|
|
508
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
509
|
-
{
|
|
510
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
511
|
-
paths: [
|
|
512
|
-
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
513
|
-
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
514
|
-
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
515
|
-
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
516
|
-
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
517
|
-
],
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
521
|
-
paths: [
|
|
522
|
-
{
|
|
523
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
527
|
-
},
|
|
528
|
-
],
|
|
529
|
-
},
|
|
530
|
-
]),
|
|
531
|
-
};
|
|
532
|
-
return metadata;
|
|
533
|
-
}
|
|
534
|
-
return __confirmMultiServiceBooking;
|
|
535
|
-
}
|
|
536
|
-
exports.confirmMultiServiceBooking = confirmMultiServiceBooking;
|
|
537
|
-
/**
|
|
538
|
-
* Updates the status of a multi-service booking to `DECLINED`.
|
|
405
|
+
* ## Related resources
|
|
539
406
|
*
|
|
407
|
+
* Specifying a `resource` triggers an availability check, resulting in a failed
|
|
408
|
+
* call if the resource is unavailable. Omitting a resource allows Wix Bookings
|
|
409
|
+
* to assign a resource belonging to the relevant type randomly when the merchant
|
|
410
|
+
* confirms the booking.
|
|
540
411
|
*
|
|
541
|
-
*
|
|
412
|
+
* ## Participant information
|
|
542
413
|
*
|
|
543
|
-
*
|
|
414
|
+
* You must specify either `participantsChoices` or `totalParticipants`.
|
|
415
|
+
* The call fails if the specified `participantsChoices` aren't among the supported
|
|
416
|
+
* _service options and variants_
|
|
417
|
+
* ([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)).
|
|
544
418
|
*
|
|
545
|
-
*
|
|
419
|
+
* ## Notify customers
|
|
420
|
+
*
|
|
421
|
+
* You can specify a `participantNotification.message` for the customer that's send
|
|
422
|
+
* immediately. Ensure `participantNotification.notifyParticipants` is set to `true`
|
|
423
|
+
* to send the message.
|
|
424
|
+
*
|
|
425
|
+
* If you specify `{"sendSmsReminder": true}`, the customer receives an SMS 24 hours
|
|
426
|
+
* before the session starts. The phone number is taken from `contactDetails.phone`.
|
|
427
|
+
*
|
|
428
|
+
* ## Booking status
|
|
429
|
+
*
|
|
430
|
+
* Bookings default to the `CREATED` status, not affecting the business calendar
|
|
431
|
+
* or resource availability. You can specify a different status when the calling
|
|
432
|
+
* [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
|
|
433
|
+
* has `Manage Bookings` permissions.
|
|
434
|
+
*
|
|
435
|
+
* ## Payment options
|
|
436
|
+
*
|
|
437
|
+
* The specified `selectedPaymentOption` indicates how the customer intends to
|
|
438
|
+
* pay, allowing for later changes to a different method supported by the service.
|
|
439
|
+
*
|
|
440
|
+
* ## Payment status
|
|
441
|
+
*
|
|
442
|
+
* A booking is initially created with `{"paymentStatus": "UNDEFINED"}` regardless
|
|
443
|
+
* of the payment status specified in Create Booking. If a customer uses an
|
|
444
|
+
* _eCommerce checkout_
|
|
445
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)),
|
|
446
|
+
* Wix Bookings automatically syncs the booking's payment status from
|
|
447
|
+
* the corresponding *eCommerce order*
|
|
448
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
449
|
+
*
|
|
450
|
+
* If a booking doesn't have a corresponding eCommerce order, for example, since
|
|
451
|
+
* the customer didn't use the eCommerce checkout, you can update the booking's
|
|
452
|
+
* payment status with *Confirm Or Decline Booking*
|
|
453
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
|
|
454
|
+
*
|
|
455
|
+
* ## Booking form data
|
|
456
|
+
*
|
|
457
|
+
* When customers sign up for a service, they must fill out the booking form.
|
|
458
|
+
* To create a booking with a completed booking form, specify the relevant data in
|
|
459
|
+
* `formSubmission`. Ensure the values of the corresponding fields in
|
|
460
|
+
* `booking.contactDetails` and `formSubmission` are identical. If these values
|
|
461
|
+
* don't match, Create Booking fails. Therefore, we recommend specifying
|
|
462
|
+
* only `booking.contactDetails.contactId` when providing `formSubmission`.
|
|
463
|
+
*
|
|
464
|
+
* ## Admin overwrites
|
|
465
|
+
*
|
|
466
|
+
* There are small but important differences when you specify special
|
|
467
|
+
* `flowControlSettings`:
|
|
468
|
+
*
|
|
469
|
+
* - `{"skipAvailabilityValidation": true}`: The call succeeds
|
|
470
|
+
* regardless of availability. If you don't specify any resource, the call
|
|
471
|
+
* succeeds even if no resource of the relevant type is available.
|
|
472
|
+
* - `{"skipBusinessConfirmation": true}`: Automatically confirms `PENDING`
|
|
473
|
+
* bookings that require manual confirmation.
|
|
474
|
+
* - `{"skipSelectedPaymentOptionValidation": true}`: Allows customers to pay
|
|
475
|
+
* with payment methods that aren't supported for the service.
|
|
476
|
+
*
|
|
477
|
+
* When using special `flowControlSettings`, ensure you have sufficient
|
|
478
|
+
* permissions. If you encounter failed calls due to insufficient permissions,
|
|
479
|
+
* consider the following options:
|
|
480
|
+
*
|
|
481
|
+
* - **App developers** can use a higher
|
|
482
|
+
* [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
|
|
483
|
+
* such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
|
|
484
|
+
* - **Site developers** can utilize
|
|
485
|
+
* [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
|
|
486
|
+
*
|
|
487
|
+
* Granting additional permissions and using elevation permits method calls that
|
|
488
|
+
* would typically fail due to authorization checks. Therefore, you should use
|
|
489
|
+
* them intentionally and securely.
|
|
546
490
|
*/
|
|
547
|
-
function
|
|
548
|
-
function
|
|
491
|
+
function createBooking(payload) {
|
|
492
|
+
function __createBooking({ host }) {
|
|
493
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
494
|
+
{
|
|
495
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
496
|
+
paths: [
|
|
497
|
+
{ path: 'booking.createdDate' },
|
|
498
|
+
{ path: 'booking.startDate' },
|
|
499
|
+
{ path: 'booking.endDate' },
|
|
500
|
+
{ path: 'booking.updatedDate' },
|
|
501
|
+
{ path: 'booking.canceledDate' },
|
|
502
|
+
],
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
506
|
+
paths: [
|
|
507
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
508
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
509
|
+
],
|
|
510
|
+
},
|
|
511
|
+
]);
|
|
549
512
|
const metadata = {
|
|
550
513
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
551
514
|
method: 'POST',
|
|
552
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
515
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CreateBooking',
|
|
553
516
|
packageName: PACKAGE_NAME,
|
|
554
|
-
url:
|
|
555
|
-
protoPath: '/v2/
|
|
556
|
-
data:
|
|
517
|
+
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
518
|
+
protoPath: '/v2/bookings',
|
|
519
|
+
data: serializedData,
|
|
557
520
|
host,
|
|
558
521
|
}),
|
|
559
|
-
data:
|
|
522
|
+
data: serializedData,
|
|
560
523
|
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
561
524
|
{
|
|
562
525
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
563
526
|
paths: [
|
|
564
|
-
{ path: '
|
|
565
|
-
{ path: '
|
|
566
|
-
{ path: '
|
|
567
|
-
{ path: '
|
|
568
|
-
{ path: '
|
|
527
|
+
{ path: 'booking.createdDate' },
|
|
528
|
+
{ path: 'booking.startDate' },
|
|
529
|
+
{ path: 'booking.endDate' },
|
|
530
|
+
{ path: 'booking.updatedDate' },
|
|
531
|
+
{ path: 'booking.canceledDate' },
|
|
569
532
|
],
|
|
570
533
|
},
|
|
571
534
|
{
|
|
572
535
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
573
536
|
paths: [
|
|
574
|
-
{
|
|
575
|
-
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
579
|
-
},
|
|
537
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
538
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
580
539
|
],
|
|
581
540
|
},
|
|
582
541
|
]),
|
|
583
542
|
};
|
|
584
543
|
return metadata;
|
|
585
544
|
}
|
|
586
|
-
return
|
|
587
|
-
}
|
|
588
|
-
exports.declineMultiServiceBooking = declineMultiServiceBooking;
|
|
589
|
-
/** Retrieves the allowed actions for a list of multi-service bookings. */
|
|
590
|
-
function bulkGetMultiServiceBookingAllowedActions(payload) {
|
|
591
|
-
function __bulkGetMultiServiceBookingAllowedActions({ host }) {
|
|
592
|
-
const metadata = {
|
|
593
|
-
entityFqdn: 'wix.bookings.v2.booking',
|
|
594
|
-
method: 'POST',
|
|
595
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.BulkGetMultiServiceBookingAllowedActions',
|
|
596
|
-
packageName: PACKAGE_NAME,
|
|
597
|
-
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
598
|
-
protoPath: '/v2/bulk/multi_service_bookings/get_allowed_actions',
|
|
599
|
-
data: payload,
|
|
600
|
-
host,
|
|
601
|
-
}),
|
|
602
|
-
data: payload,
|
|
603
|
-
};
|
|
604
|
-
return metadata;
|
|
605
|
-
}
|
|
606
|
-
return __bulkGetMultiServiceBookingAllowedActions;
|
|
545
|
+
return __createBooking;
|
|
607
546
|
}
|
|
608
|
-
exports.
|
|
547
|
+
exports.createBooking = createBooking;
|
|
609
548
|
/**
|
|
610
|
-
*
|
|
549
|
+
* Creates up to 8 bookings.
|
|
611
550
|
*
|
|
612
551
|
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
* bookings includes also the bookings for which you don't have permissions.
|
|
617
|
-
*/
|
|
618
|
-
function getMultiServiceBooking(payload) {
|
|
619
|
-
function __getMultiServiceBooking({ host }) {
|
|
620
|
-
const metadata = {
|
|
621
|
-
entityFqdn: 'wix.bookings.v2.booking',
|
|
622
|
-
method: 'GET',
|
|
623
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBooking',
|
|
624
|
-
packageName: PACKAGE_NAME,
|
|
625
|
-
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
626
|
-
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}',
|
|
627
|
-
data: payload,
|
|
628
|
-
host,
|
|
629
|
-
}),
|
|
630
|
-
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
631
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
632
|
-
{
|
|
633
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
634
|
-
paths: [
|
|
635
|
-
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
636
|
-
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
637
|
-
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
638
|
-
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
639
|
-
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
640
|
-
],
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
644
|
-
paths: [
|
|
645
|
-
{
|
|
646
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
650
|
-
},
|
|
651
|
-
],
|
|
652
|
-
},
|
|
653
|
-
]),
|
|
654
|
-
};
|
|
655
|
-
return metadata;
|
|
656
|
-
}
|
|
657
|
-
return __getMultiServiceBooking;
|
|
658
|
-
}
|
|
659
|
-
exports.getMultiServiceBooking = getMultiServiceBooking;
|
|
660
|
-
/**
|
|
661
|
-
* Adds a list of single-service bookings to a multi-service booking.
|
|
552
|
+
* See *Create Booking*
|
|
553
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/create-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/create-booking))
|
|
554
|
+
* for more information.
|
|
662
555
|
*
|
|
556
|
+
* If any of the specified bookings is missing a required field the entire call
|
|
557
|
+
* fails.
|
|
663
558
|
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
559
|
+
* If you specify 1 or more unavailable bookings, the call succeeds
|
|
560
|
+
* while the unavailable bookings aren't created. Instead, they're counted as
|
|
561
|
+
* failures in the returned `bulkActionMetadata`.
|
|
666
562
|
*/
|
|
667
|
-
function
|
|
668
|
-
function
|
|
563
|
+
function bulkCreateBooking(payload) {
|
|
564
|
+
function __bulkCreateBooking({ host }) {
|
|
565
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
566
|
+
{
|
|
567
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
568
|
+
paths: [
|
|
569
|
+
{ path: 'createBookingsInfo.booking.createdDate' },
|
|
570
|
+
{ path: 'createBookingsInfo.booking.startDate' },
|
|
571
|
+
{ path: 'createBookingsInfo.booking.endDate' },
|
|
572
|
+
{ path: 'createBookingsInfo.booking.updatedDate' },
|
|
573
|
+
{ path: 'createBookingsInfo.booking.canceledDate' },
|
|
574
|
+
],
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
578
|
+
paths: [
|
|
579
|
+
{
|
|
580
|
+
path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.latitude',
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.longitude',
|
|
584
|
+
},
|
|
585
|
+
],
|
|
586
|
+
},
|
|
587
|
+
]);
|
|
669
588
|
const metadata = {
|
|
670
589
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
671
590
|
method: 'POST',
|
|
672
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
591
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.BulkCreateBooking',
|
|
673
592
|
packageName: PACKAGE_NAME,
|
|
674
|
-
url:
|
|
675
|
-
protoPath: '/v2/
|
|
676
|
-
data:
|
|
593
|
+
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
594
|
+
protoPath: '/v2/bulk/bookings/create',
|
|
595
|
+
data: serializedData,
|
|
677
596
|
host,
|
|
678
597
|
}),
|
|
679
|
-
data:
|
|
598
|
+
data: serializedData,
|
|
680
599
|
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
681
600
|
{
|
|
682
601
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
683
602
|
paths: [
|
|
684
|
-
{ path: '
|
|
685
|
-
{ path: '
|
|
686
|
-
{ path: '
|
|
687
|
-
{ path: '
|
|
688
|
-
{ path: '
|
|
603
|
+
{ path: 'results.item.createdDate' },
|
|
604
|
+
{ path: 'results.item.startDate' },
|
|
605
|
+
{ path: 'results.item.endDate' },
|
|
606
|
+
{ path: 'results.item.updatedDate' },
|
|
607
|
+
{ path: 'results.item.canceledDate' },
|
|
689
608
|
],
|
|
690
609
|
},
|
|
691
610
|
{
|
|
692
611
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
693
612
|
paths: [
|
|
694
613
|
{
|
|
695
|
-
path: '
|
|
614
|
+
path: 'results.item.contactDetails.fullAddress.geocode.latitude',
|
|
696
615
|
},
|
|
697
616
|
{
|
|
698
|
-
path: '
|
|
617
|
+
path: 'results.item.contactDetails.fullAddress.geocode.longitude',
|
|
699
618
|
},
|
|
700
619
|
],
|
|
701
620
|
},
|
|
@@ -703,30 +622,78 @@ function addBookingsToMultiServiceBooking(payload) {
|
|
|
703
622
|
};
|
|
704
623
|
return metadata;
|
|
705
624
|
}
|
|
706
|
-
return
|
|
625
|
+
return __bulkCreateBooking;
|
|
707
626
|
}
|
|
708
|
-
exports.
|
|
627
|
+
exports.bulkCreateBooking = bulkCreateBooking;
|
|
709
628
|
/**
|
|
710
|
-
*
|
|
711
|
-
*
|
|
629
|
+
* Reschedules an appointment booking to a different slot or a class booking to
|
|
630
|
+
* a different session.
|
|
631
|
+
*
|
|
632
|
+
*
|
|
633
|
+
* ## Course booking limitation
|
|
634
|
+
*
|
|
635
|
+
* You can't reschedule course bookings.
|
|
636
|
+
*
|
|
637
|
+
* ## Appointment sessions
|
|
638
|
+
*
|
|
639
|
+
* For appointments, the old session is removed from the business calendar
|
|
640
|
+
* while a new session is added. We recommend calling *Query Availability*
|
|
641
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
642
|
+
* first and specifying the entire retrieved `slot`.
|
|
643
|
+
*
|
|
644
|
+
* ## Class sessions
|
|
645
|
+
*
|
|
646
|
+
* For classes, the new session must be an existing session belonging to the
|
|
647
|
+
* same class. We recommend retrieving `availabilityEntries.slot.eventId`
|
|
648
|
+
* from *Query Availability*
|
|
649
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
650
|
+
* to avoid failed Reschedule Booking calls due to unavailability. Specify
|
|
651
|
+
* only `slot.eventId` instead of the entire `slot` object.
|
|
652
|
+
*
|
|
653
|
+
* ## Notify customers
|
|
654
|
+
*
|
|
655
|
+
* You can specify a `participantNotification.message` for the customer. To send
|
|
656
|
+
* the message, you must also specify `participantNotification.notifyParticipants`
|
|
657
|
+
* as `true`.
|
|
658
|
+
*
|
|
659
|
+
* ## Admin overwrites
|
|
660
|
+
*
|
|
661
|
+
* There are small but important differences when you specify special
|
|
662
|
+
* `flowControlSettings`:
|
|
712
663
|
*
|
|
664
|
+
* - `{"ignoreReschedulePolicy": true}`: The call succeeds even if the
|
|
665
|
+
* service's `reschedulePolicy` doesn't allow it.
|
|
666
|
+
* - `{"skipAvailabilityValidation": true}`: The call succeeds even if
|
|
667
|
+
* the specified session, slot, or resource isn't available. If you don't
|
|
668
|
+
* specify any resource, the call succeeds even if no resource of the relevant
|
|
669
|
+
* type is available.
|
|
670
|
+
* - `{"skipBusinessConfirmation": true}`: Any `PENDING` booking is
|
|
671
|
+
* automatically confirmed even if the services requires the merchants's
|
|
672
|
+
* manual confirmation.
|
|
673
|
+
*
|
|
674
|
+
* When using special `flowControlSettings`, ensure you have sufficient
|
|
675
|
+
* permissions. If you encounter failed calls due to insufficient permissions,
|
|
676
|
+
* consider the following options:
|
|
713
677
|
*
|
|
714
|
-
*
|
|
715
|
-
*
|
|
716
|
-
*
|
|
678
|
+
* - **App developers** can use a higher
|
|
679
|
+
* [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
|
|
680
|
+
* such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
|
|
681
|
+
* - **Site developers** can utilize
|
|
682
|
+
* [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
|
|
717
683
|
*
|
|
718
|
-
*
|
|
719
|
-
*
|
|
684
|
+
* Granting additional permissions and using elevation permits method calls that
|
|
685
|
+
* would typically fail due to authorization checks. Therefore, you should use
|
|
686
|
+
* them intentionally and securely.
|
|
720
687
|
*/
|
|
721
|
-
function
|
|
722
|
-
function
|
|
688
|
+
function rescheduleBooking(payload) {
|
|
689
|
+
function __rescheduleBooking({ host }) {
|
|
723
690
|
const metadata = {
|
|
724
691
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
725
692
|
method: 'POST',
|
|
726
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
693
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.RescheduleBooking',
|
|
727
694
|
packageName: PACKAGE_NAME,
|
|
728
|
-
url:
|
|
729
|
-
protoPath: '/v2/
|
|
695
|
+
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
696
|
+
protoPath: '/v2/bookings/{bookingId}/reschedule',
|
|
730
697
|
data: payload,
|
|
731
698
|
host,
|
|
732
699
|
}),
|
|
@@ -735,179 +702,95 @@ function removeBookingsFromMultiServiceBooking(payload) {
|
|
|
735
702
|
{
|
|
736
703
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
737
704
|
paths: [
|
|
738
|
-
{ path: '
|
|
739
|
-
{ path: '
|
|
740
|
-
{ path: '
|
|
741
|
-
{ path: '
|
|
742
|
-
{ path: '
|
|
705
|
+
{ path: 'booking.createdDate' },
|
|
706
|
+
{ path: 'booking.startDate' },
|
|
707
|
+
{ path: 'booking.endDate' },
|
|
708
|
+
{ path: 'booking.updatedDate' },
|
|
709
|
+
{ path: 'booking.canceledDate' },
|
|
743
710
|
],
|
|
744
711
|
},
|
|
745
712
|
{
|
|
746
713
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
747
714
|
paths: [
|
|
748
|
-
{
|
|
749
|
-
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
753
|
-
},
|
|
715
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
716
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
754
717
|
],
|
|
755
718
|
},
|
|
756
719
|
]),
|
|
757
720
|
};
|
|
758
721
|
return metadata;
|
|
759
722
|
}
|
|
760
|
-
return
|
|
723
|
+
return __rescheduleBooking;
|
|
761
724
|
}
|
|
762
|
-
exports.
|
|
725
|
+
exports.rescheduleBooking = rescheduleBooking;
|
|
763
726
|
/**
|
|
764
|
-
*
|
|
765
|
-
*
|
|
766
|
-
*
|
|
767
|
-
* ## Appointment booking
|
|
768
|
-
*
|
|
769
|
-
* For appointment-based services, specify the relevant `slot` in
|
|
770
|
-
* `bookedEntity.slot`. We recommend specifying the complete
|
|
771
|
-
* `availabilityEntries.slot` returned in *Query Availability*
|
|
772
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
773
|
-
* in your call's request to avoid failed calls due to unavailability.
|
|
774
|
-
*
|
|
775
|
-
* ## Class session booking
|
|
776
|
-
*
|
|
777
|
-
* For class services, specify the relevant *event ID*
|
|
778
|
-
* ([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))
|
|
779
|
-
* as `bookedEntity.slot.eventId`.
|
|
780
|
-
* We recommend retrieving the event ID from *Query Availability's*
|
|
781
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
782
|
-
* `availabilityEntries.slot.eventId` to avoid failed calls due to unavailability.
|
|
783
|
-
* Specifying an event ID leads to automatic calculations of `slot.startDate`, `slot.endDate`,
|
|
784
|
-
* `slot.timezone`, `slot.resource`, and `slot.location`. All manually specified
|
|
785
|
-
* values are overridden.
|
|
786
|
-
*
|
|
787
|
-
* ## Course booking
|
|
788
|
-
*
|
|
789
|
-
* For course services, specify the course's schedule ID in `bookedEntity.schedule.scheduleId`.
|
|
790
|
-
* We recommend following [this sample flow](https://dev.wix.com/docs/rest/business-solutions/bookings/sample-booking-flows#book-a-course)
|
|
791
|
-
* to minimize failed calls due to unavailability.
|
|
792
|
-
*
|
|
793
|
-
* ## Related resources
|
|
794
|
-
*
|
|
795
|
-
* Specifying a `resource` triggers an availability check, resulting in a failed
|
|
796
|
-
* call if the resource is unavailable. Omitting a resource allows Wix Bookings
|
|
797
|
-
* to assign a resource belonging to the relevant type randomly when the merchant
|
|
798
|
-
* confirms the booking.
|
|
727
|
+
* Updates the booking status to `CONFIRMED` and updates the relevant session's
|
|
728
|
+
* `participants.approvalStatus` to `APPROVED` without checking whether the relevant
|
|
729
|
+
* slot or schedule is still available.
|
|
799
730
|
*
|
|
800
|
-
* ##
|
|
731
|
+
* ## eCommerce checkout restriction
|
|
801
732
|
*
|
|
802
|
-
*
|
|
803
|
-
*
|
|
804
|
-
*
|
|
805
|
-
*
|
|
733
|
+
* Call this method only when using a custom checkout page. Don't
|
|
734
|
+
* call it when using a *Wix eCommerce checkout*
|
|
735
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
|
|
736
|
+
* In such cases, Wix automatically updates the booking status based on
|
|
737
|
+
* the `paymentStatus` of the corresponding *Wix eCommerce order*
|
|
738
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
806
739
|
*
|
|
807
|
-
* ##
|
|
740
|
+
* ## When to call Confirm Or Decline Booking instead
|
|
808
741
|
*
|
|
809
|
-
*
|
|
810
|
-
*
|
|
811
|
-
*
|
|
742
|
+
* Confirm Booking doesn't check whether a slot or schedule is still available. For
|
|
743
|
+
* these checks you can call *Confirm or Decline Booking*
|
|
744
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
|
|
812
745
|
*
|
|
813
|
-
*
|
|
814
|
-
* before the session starts. The phone number is taken from `contactDetails.phone`.
|
|
746
|
+
* ## Original status validation
|
|
815
747
|
*
|
|
816
|
-
*
|
|
748
|
+
* You can only confirm bookings with a status of `PENDING`, `CREATED`, or
|
|
749
|
+
* `WAITING_LIST`.
|
|
817
750
|
*
|
|
818
|
-
*
|
|
819
|
-
* or resource availability. You can specify a different status when the calling
|
|
820
|
-
* [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
|
|
821
|
-
* has `Manage Bookings` permissions.
|
|
751
|
+
* ## Double bookings
|
|
822
752
|
*
|
|
823
|
-
*
|
|
753
|
+
* Confirm Booking doesn't check whether a slot or schedule is still available.
|
|
754
|
+
* You can specify
|
|
824
755
|
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
756
|
+
* ```json
|
|
757
|
+
* {
|
|
758
|
+
* "flowControlSettings": {
|
|
759
|
+
* "checkAvailabilityValidation": true
|
|
760
|
+
* },
|
|
761
|
+
* "doubleBooked": true
|
|
762
|
+
* }
|
|
763
|
+
* ```
|
|
764
|
+
* to forcefully set the booking's `doubleBooked` flag to `true`, regardless of
|
|
765
|
+
* a potential double booking conflict. You must call with `Manage Bookings`
|
|
766
|
+
* permissions to do so. For the default flow control settings
|
|
767
|
+
* `{"checkAvailabilityValidation": false}`, the specified `doubleBooked` value
|
|
768
|
+
* is ignored.
|
|
827
769
|
*
|
|
828
770
|
* ## Payment status
|
|
829
771
|
*
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
* _eCommerce checkout_
|
|
833
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)),
|
|
834
|
-
* Wix Bookings automatically syncs the booking's payment status from
|
|
835
|
-
* the corresponding *eCommerce order*
|
|
836
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
837
|
-
*
|
|
838
|
-
* If a booking doesn't have a corresponding eCommerce order, for example, since
|
|
839
|
-
* the customer didn't use the eCommerce checkout, you can update the booking's
|
|
840
|
-
* payment status with *Confirm Or Decline Booking*
|
|
841
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
|
|
842
|
-
*
|
|
843
|
-
* ## Booking form data
|
|
844
|
-
*
|
|
845
|
-
* When customers sign up for a service, they must fill out the booking form.
|
|
846
|
-
* To create a booking with a completed booking form, specify the relevant data in
|
|
847
|
-
* `formSubmission`. Ensure the values of the corresponding fields in
|
|
848
|
-
* `booking.contactDetails` and `formSubmission` are identical. If these values
|
|
849
|
-
* don't match, Create Booking fails. Therefore, we recommend specifying
|
|
850
|
-
* only `booking.contactDetails.contactId` when providing `formSubmission`.
|
|
851
|
-
*
|
|
852
|
-
* ## Admin overwrites
|
|
853
|
-
*
|
|
854
|
-
* There are small but important differences when you specify special
|
|
855
|
-
* `flowControlSettings`:
|
|
856
|
-
*
|
|
857
|
-
* - `{"skipAvailabilityValidation": true}`: The call succeeds
|
|
858
|
-
* regardless of availability. If you don't specify any resource, the call
|
|
859
|
-
* succeeds even if no resource of the relevant type is available.
|
|
860
|
-
* - `{"skipBusinessConfirmation": true}`: Automatically confirms `PENDING`
|
|
861
|
-
* bookings that require manual confirmation.
|
|
862
|
-
* - `{"skipSelectedPaymentOptionValidation": true}`: Allows customers to pay
|
|
863
|
-
* with payment methods that aren't supported for the service.
|
|
864
|
-
*
|
|
865
|
-
* When using special `flowControlSettings`, ensure you have sufficient
|
|
866
|
-
* permissions. If you encounter failed calls due to insufficient permissions,
|
|
867
|
-
* consider the following options:
|
|
772
|
+
* Also updates the booking's `paymentStatus`, if you specify a new payment
|
|
773
|
+
* status.
|
|
868
774
|
*
|
|
869
|
-
*
|
|
870
|
-
* [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
|
|
871
|
-
* such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
|
|
872
|
-
* - **Site developers** can utilize
|
|
873
|
-
* [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
|
|
775
|
+
* ## Notify customers
|
|
874
776
|
*
|
|
875
|
-
*
|
|
876
|
-
*
|
|
877
|
-
*
|
|
777
|
+
* You can specify a `participantNotification.message` for the customer. To send
|
|
778
|
+
* the message, you must also specify `participantNotification.notifyParticipants`
|
|
779
|
+
* as `true`.
|
|
878
780
|
*/
|
|
879
|
-
function
|
|
880
|
-
function
|
|
881
|
-
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
882
|
-
{
|
|
883
|
-
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
884
|
-
paths: [
|
|
885
|
-
{ path: 'booking.createdDate' },
|
|
886
|
-
{ path: 'booking.startDate' },
|
|
887
|
-
{ path: 'booking.endDate' },
|
|
888
|
-
{ path: 'booking.updatedDate' },
|
|
889
|
-
{ path: 'booking.canceledDate' },
|
|
890
|
-
],
|
|
891
|
-
},
|
|
892
|
-
{
|
|
893
|
-
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
894
|
-
paths: [
|
|
895
|
-
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
896
|
-
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
897
|
-
],
|
|
898
|
-
},
|
|
899
|
-
]);
|
|
781
|
+
function bookingsConfirmBooking(payload) {
|
|
782
|
+
function __bookingsConfirmBooking({ host }) {
|
|
900
783
|
const metadata = {
|
|
901
784
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
902
785
|
method: 'POST',
|
|
903
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.
|
|
786
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.ConfirmBooking',
|
|
904
787
|
packageName: PACKAGE_NAME,
|
|
905
788
|
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
906
|
-
protoPath: '/v2/bookings',
|
|
907
|
-
data:
|
|
789
|
+
protoPath: '/v2/bookings/{bookingId}/confirm',
|
|
790
|
+
data: payload,
|
|
908
791
|
host,
|
|
909
792
|
}),
|
|
910
|
-
data:
|
|
793
|
+
data: payload,
|
|
911
794
|
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
912
795
|
{
|
|
913
796
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
@@ -930,113 +813,126 @@ function createBooking(payload) {
|
|
|
930
813
|
};
|
|
931
814
|
return metadata;
|
|
932
815
|
}
|
|
933
|
-
return
|
|
816
|
+
return __bookingsConfirmBooking;
|
|
934
817
|
}
|
|
935
|
-
exports.
|
|
818
|
+
exports.bookingsConfirmBooking = bookingsConfirmBooking;
|
|
936
819
|
/**
|
|
937
|
-
*
|
|
820
|
+
* Updates the extended fields for a booking.
|
|
821
|
+
*
|
|
822
|
+
*
|
|
823
|
+
* If you specify an extended field `namespace` that doesn't exist yet, it's
|
|
824
|
+
* created.
|
|
825
|
+
*
|
|
826
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/about-backend-extensions#schema-plugin-extensions).
|
|
827
|
+
*/
|
|
828
|
+
function updateExtendedFields(payload) {
|
|
829
|
+
function __updateExtendedFields({ host }) {
|
|
830
|
+
const metadata = {
|
|
831
|
+
entityFqdn: 'wix.bookings.v2.booking',
|
|
832
|
+
method: 'POST',
|
|
833
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateExtendedFields',
|
|
834
|
+
packageName: PACKAGE_NAME,
|
|
835
|
+
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
836
|
+
protoPath: '/v2/bookings/{id}/update_extended_fields',
|
|
837
|
+
data: payload,
|
|
838
|
+
host,
|
|
839
|
+
}),
|
|
840
|
+
data: payload,
|
|
841
|
+
};
|
|
842
|
+
return metadata;
|
|
843
|
+
}
|
|
844
|
+
return __updateExtendedFields;
|
|
845
|
+
}
|
|
846
|
+
exports.updateExtendedFields = updateExtendedFields;
|
|
847
|
+
/**
|
|
848
|
+
* Updates the booking status to `DECLINED` and updates the relevant session's
|
|
849
|
+
* `participants.approvalStatus` to `DECLINED` without checking whether the relevant
|
|
850
|
+
* slot or schedule is still available.
|
|
851
|
+
*
|
|
852
|
+
*
|
|
853
|
+
* ## eCommerce checkout restriction
|
|
854
|
+
*
|
|
855
|
+
* Call this method only when using a custom checkout page. Don't
|
|
856
|
+
* call it when using a *Wix eCommerce checkout*
|
|
857
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
|
|
858
|
+
* In such cases, Wix automatically updates the booking status based on
|
|
859
|
+
* the `paymentStatus` of the corresponding *Wix eCommerce order*
|
|
860
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
938
861
|
*
|
|
862
|
+
* ## When to call Confirm Or Decline Booking instead
|
|
939
863
|
*
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
*
|
|
864
|
+
* The method doesn't check whether a slot or schedule is still available. For
|
|
865
|
+
* these checks you can call *Confirm or Decline Booking*
|
|
866
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
|
|
943
867
|
*
|
|
944
|
-
*
|
|
945
|
-
* fails.
|
|
868
|
+
* ## Original status validation
|
|
946
869
|
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
*
|
|
870
|
+
* You can only decline bookings with a `status` of `PENDING`, `CREATED`, or
|
|
871
|
+
* `WAITING_LIST`.
|
|
872
|
+
*
|
|
873
|
+
* ## Payment status
|
|
874
|
+
*
|
|
875
|
+
* Also updates the booking's `paymentStatus`, if you specify a new payment
|
|
876
|
+
* status.
|
|
877
|
+
*
|
|
878
|
+
* ## Notify customers
|
|
879
|
+
*
|
|
880
|
+
* You can specify a `participantNotification.message` for the customer. To send
|
|
881
|
+
* the message, you must also specify `participantNotification.notifyParticipants`
|
|
882
|
+
* as `true`.
|
|
950
883
|
*/
|
|
951
|
-
function
|
|
952
|
-
function
|
|
953
|
-
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
954
|
-
{
|
|
955
|
-
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
956
|
-
paths: [
|
|
957
|
-
{ path: 'createBookingsInfo.booking.createdDate' },
|
|
958
|
-
{ path: 'createBookingsInfo.booking.startDate' },
|
|
959
|
-
{ path: 'createBookingsInfo.booking.endDate' },
|
|
960
|
-
{ path: 'createBookingsInfo.booking.updatedDate' },
|
|
961
|
-
{ path: 'createBookingsInfo.booking.canceledDate' },
|
|
962
|
-
],
|
|
963
|
-
},
|
|
964
|
-
{
|
|
965
|
-
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
966
|
-
paths: [
|
|
967
|
-
{
|
|
968
|
-
path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.latitude',
|
|
969
|
-
},
|
|
970
|
-
{
|
|
971
|
-
path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.longitude',
|
|
972
|
-
},
|
|
973
|
-
],
|
|
974
|
-
},
|
|
975
|
-
]);
|
|
884
|
+
function bookingsDeclineBooking(payload) {
|
|
885
|
+
function __bookingsDeclineBooking({ host }) {
|
|
976
886
|
const metadata = {
|
|
977
887
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
978
888
|
method: 'POST',
|
|
979
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.
|
|
889
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.DeclineBooking',
|
|
980
890
|
packageName: PACKAGE_NAME,
|
|
981
891
|
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
982
|
-
protoPath: '/v2/
|
|
983
|
-
data:
|
|
892
|
+
protoPath: '/v2/bookings/{bookingId}/decline',
|
|
893
|
+
data: payload,
|
|
984
894
|
host,
|
|
985
895
|
}),
|
|
986
|
-
data:
|
|
896
|
+
data: payload,
|
|
987
897
|
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
988
898
|
{
|
|
989
899
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
990
900
|
paths: [
|
|
991
|
-
{ path: '
|
|
992
|
-
{ path: '
|
|
993
|
-
{ path: '
|
|
994
|
-
{ path: '
|
|
995
|
-
{ path: '
|
|
901
|
+
{ path: 'booking.createdDate' },
|
|
902
|
+
{ path: 'booking.startDate' },
|
|
903
|
+
{ path: 'booking.endDate' },
|
|
904
|
+
{ path: 'booking.updatedDate' },
|
|
905
|
+
{ path: 'booking.canceledDate' },
|
|
996
906
|
],
|
|
997
907
|
},
|
|
998
908
|
{
|
|
999
909
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1000
910
|
paths: [
|
|
1001
|
-
{
|
|
1002
|
-
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
path: 'results.item.contactDetails.fullAddress.geocode.longitude',
|
|
1006
|
-
},
|
|
911
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
912
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
1007
913
|
],
|
|
1008
914
|
},
|
|
1009
915
|
]),
|
|
1010
916
|
};
|
|
1011
917
|
return metadata;
|
|
1012
918
|
}
|
|
1013
|
-
return
|
|
919
|
+
return __bookingsDeclineBooking;
|
|
1014
920
|
}
|
|
1015
|
-
exports.
|
|
921
|
+
exports.bookingsDeclineBooking = bookingsDeclineBooking;
|
|
1016
922
|
/**
|
|
1017
|
-
*
|
|
1018
|
-
* a different session.
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1021
|
-
* ## Course booking limitation
|
|
923
|
+
* Updates the booking status to `CANCELED`.
|
|
1022
924
|
*
|
|
1023
|
-
* You can't reschedule course bookings.
|
|
1024
925
|
*
|
|
1025
|
-
* ##
|
|
926
|
+
* ## Appointments
|
|
1026
927
|
*
|
|
1027
|
-
* For appointments, the
|
|
1028
|
-
*
|
|
1029
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
1030
|
-
* first and specifying the entire retrieved `slot`.
|
|
928
|
+
* For appointments, the corresponding event is removed from the Bookings
|
|
929
|
+
* calendar.
|
|
1031
930
|
*
|
|
1032
|
-
* ## Class
|
|
931
|
+
* ## Class and course bookings
|
|
1033
932
|
*
|
|
1034
|
-
* For
|
|
1035
|
-
*
|
|
1036
|
-
*
|
|
1037
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
|
|
1038
|
-
* to avoid failed Reschedule Booking calls due to unavailability. Specify
|
|
1039
|
-
* only `slot.eventId` instead of the entire `slot` object.
|
|
933
|
+
* For class or course bookings, the relevant participants are removed
|
|
934
|
+
* from the class session or the course. However, the class session or course
|
|
935
|
+
* remain on the business calendar.
|
|
1040
936
|
*
|
|
1041
937
|
* ## Notify customers
|
|
1042
938
|
*
|
|
@@ -1049,15 +945,12 @@ exports.bulkCreateBooking = bulkCreateBooking;
|
|
|
1049
945
|
* There are small but important differences when you specify special
|
|
1050
946
|
* `flowControlSettings`:
|
|
1051
947
|
*
|
|
1052
|
-
* - `{"
|
|
1053
|
-
* service's `
|
|
1054
|
-
* - `{"
|
|
1055
|
-
*
|
|
1056
|
-
*
|
|
1057
|
-
*
|
|
1058
|
-
* - `{"skipBusinessConfirmation": true}`: Any `PENDING` booking is
|
|
1059
|
-
* automatically confirmed even if the services requires the merchants's
|
|
1060
|
-
* manual confirmation.
|
|
948
|
+
* - `{"ignoreCancellationPolicy": true}`: The call succeeds even if the
|
|
949
|
+
* service's `cancellationPolicy` doesn't allow it.
|
|
950
|
+
* - `{"withRefund": true}`: The customer is refunded even if the service's
|
|
951
|
+
* `refundPolicy` doesn't allow it.
|
|
952
|
+
* - `{"waiveCancellationFee": true}`: The customer doesn't have to pay
|
|
953
|
+
* the cancellation fee, even if the service's `cancellationPolicy` requires it.
|
|
1061
954
|
*
|
|
1062
955
|
* When using special `flowControlSettings`, ensure you have sufficient
|
|
1063
956
|
* permissions. If you encounter failed calls due to insufficient permissions,
|
|
@@ -1073,15 +966,15 @@ exports.bulkCreateBooking = bulkCreateBooking;
|
|
|
1073
966
|
* would typically fail due to authorization checks. Therefore, you should use
|
|
1074
967
|
* them intentionally and securely.
|
|
1075
968
|
*/
|
|
1076
|
-
function
|
|
1077
|
-
function
|
|
969
|
+
function bookingsCancelBooking(payload) {
|
|
970
|
+
function __bookingsCancelBooking({ host }) {
|
|
1078
971
|
const metadata = {
|
|
1079
972
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1080
973
|
method: 'POST',
|
|
1081
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.
|
|
974
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CancelBooking',
|
|
1082
975
|
packageName: PACKAGE_NAME,
|
|
1083
976
|
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
1084
|
-
protoPath: '/v2/bookings/{bookingId}/
|
|
977
|
+
protoPath: '/v2/bookings/{bookingId}/cancel',
|
|
1085
978
|
data: payload,
|
|
1086
979
|
host,
|
|
1087
980
|
}),
|
|
@@ -1108,73 +1001,149 @@ function rescheduleBooking(payload) {
|
|
|
1108
1001
|
};
|
|
1109
1002
|
return metadata;
|
|
1110
1003
|
}
|
|
1111
|
-
return
|
|
1004
|
+
return __bookingsCancelBooking;
|
|
1112
1005
|
}
|
|
1113
|
-
exports.
|
|
1006
|
+
exports.bookingsCancelBooking = bookingsCancelBooking;
|
|
1114
1007
|
/**
|
|
1115
|
-
* Updates the
|
|
1116
|
-
*
|
|
1117
|
-
* slot or schedule is still available.
|
|
1118
|
-
*
|
|
1119
|
-
* ## eCommerce checkout restriction
|
|
1120
|
-
*
|
|
1121
|
-
* Call this method only when using a custom checkout page. Don't
|
|
1122
|
-
* call it when using a *Wix eCommerce checkout*
|
|
1123
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
|
|
1124
|
-
* In such cases, Wix automatically updates the booking status based on
|
|
1125
|
-
* the `paymentStatus` of the corresponding *Wix eCommerce order*
|
|
1126
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
1008
|
+
* Updates the number of participants for a class or course booking and changes
|
|
1009
|
+
* the `totalNumberOfParticipants` for the relevant sessions.
|
|
1127
1010
|
*
|
|
1128
|
-
* ## When to call Confirm Or Decline Booking instead
|
|
1129
1011
|
*
|
|
1130
|
-
*
|
|
1131
|
-
* these checks you can call *Confirm or Decline Booking*
|
|
1132
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
|
|
1012
|
+
* ## Appointment limitation
|
|
1133
1013
|
*
|
|
1134
|
-
*
|
|
1014
|
+
* You can't update the number of participants for appointment bookings.
|
|
1135
1015
|
*
|
|
1136
|
-
*
|
|
1137
|
-
* `WAITING_LIST`.
|
|
1016
|
+
* ## Participant information
|
|
1138
1017
|
*
|
|
1139
|
-
*
|
|
1018
|
+
* You must specify either `participantsChoices` or `totalParticipants`.
|
|
1019
|
+
* The call fails if the specified `participantsChoices` aren't among the
|
|
1020
|
+
* supported *service options and variants*
|
|
1021
|
+
* ([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)).
|
|
1022
|
+
*/
|
|
1023
|
+
function bookingsUpdateNumberOfParticipants(payload) {
|
|
1024
|
+
function __bookingsUpdateNumberOfParticipants({ host }) {
|
|
1025
|
+
const metadata = {
|
|
1026
|
+
entityFqdn: 'wix.bookings.v2.booking',
|
|
1027
|
+
method: 'POST',
|
|
1028
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateNumberOfParticipants',
|
|
1029
|
+
packageName: PACKAGE_NAME,
|
|
1030
|
+
url: resolveComWixpressBookingsBookingsV2BookingsUrl({
|
|
1031
|
+
protoPath: '/v2/bookings/{bookingId}/update_number_of_participants',
|
|
1032
|
+
data: payload,
|
|
1033
|
+
host,
|
|
1034
|
+
}),
|
|
1035
|
+
data: payload,
|
|
1036
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
1037
|
+
{
|
|
1038
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1039
|
+
paths: [
|
|
1040
|
+
{ path: 'booking.createdDate' },
|
|
1041
|
+
{ path: 'booking.startDate' },
|
|
1042
|
+
{ path: 'booking.endDate' },
|
|
1043
|
+
{ path: 'booking.updatedDate' },
|
|
1044
|
+
{ path: 'booking.canceledDate' },
|
|
1045
|
+
],
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1049
|
+
paths: [
|
|
1050
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
1051
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
1052
|
+
],
|
|
1053
|
+
},
|
|
1054
|
+
]),
|
|
1055
|
+
};
|
|
1056
|
+
return metadata;
|
|
1057
|
+
}
|
|
1058
|
+
return __bookingsUpdateNumberOfParticipants;
|
|
1059
|
+
}
|
|
1060
|
+
exports.bookingsUpdateNumberOfParticipants = bookingsUpdateNumberOfParticipants;
|
|
1061
|
+
/**
|
|
1062
|
+
* Creates a multi-service booking.
|
|
1140
1063
|
*
|
|
1141
|
-
* Confirm Booking doesn't check whether a slot or schedule is still available.
|
|
1142
|
-
* You can specify
|
|
1143
1064
|
*
|
|
1144
|
-
*
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1065
|
+
* See Create Booking for more information.
|
|
1066
|
+
*/
|
|
1067
|
+
function createMultiServiceBooking(payload) {
|
|
1068
|
+
function __createMultiServiceBooking({ host }) {
|
|
1069
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
1070
|
+
{
|
|
1071
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
1072
|
+
paths: [
|
|
1073
|
+
{ path: 'bookings.createdDate' },
|
|
1074
|
+
{ path: 'bookings.startDate' },
|
|
1075
|
+
{ path: 'bookings.endDate' },
|
|
1076
|
+
{ path: 'bookings.updatedDate' },
|
|
1077
|
+
{ path: 'bookings.canceledDate' },
|
|
1078
|
+
],
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
1082
|
+
paths: [
|
|
1083
|
+
{ path: 'bookings.contactDetails.fullAddress.geocode.latitude' },
|
|
1084
|
+
{ path: 'bookings.contactDetails.fullAddress.geocode.longitude' },
|
|
1085
|
+
],
|
|
1086
|
+
},
|
|
1087
|
+
]);
|
|
1088
|
+
const metadata = {
|
|
1089
|
+
entityFqdn: 'wix.bookings.v2.booking',
|
|
1090
|
+
method: 'POST',
|
|
1091
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CreateMultiServiceBooking',
|
|
1092
|
+
packageName: PACKAGE_NAME,
|
|
1093
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1094
|
+
protoPath: '/v2/multi_service_bookings',
|
|
1095
|
+
data: serializedData,
|
|
1096
|
+
host,
|
|
1097
|
+
}),
|
|
1098
|
+
data: serializedData,
|
|
1099
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
1100
|
+
{
|
|
1101
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1102
|
+
paths: [
|
|
1103
|
+
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
1104
|
+
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
1105
|
+
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
1106
|
+
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
1107
|
+
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
1108
|
+
],
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1112
|
+
paths: [
|
|
1113
|
+
{
|
|
1114
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1118
|
+
},
|
|
1119
|
+
],
|
|
1120
|
+
},
|
|
1121
|
+
]),
|
|
1122
|
+
};
|
|
1123
|
+
return metadata;
|
|
1124
|
+
}
|
|
1125
|
+
return __createMultiServiceBooking;
|
|
1126
|
+
}
|
|
1127
|
+
exports.createMultiServiceBooking = createMultiServiceBooking;
|
|
1128
|
+
/**
|
|
1129
|
+
* Reschedules a multi-service booking.
|
|
1157
1130
|
*
|
|
1158
|
-
* ## Payment status
|
|
1159
1131
|
*
|
|
1160
|
-
*
|
|
1161
|
-
*
|
|
1132
|
+
* The call fails if at least 1 individual booking can't be rescheduled due
|
|
1133
|
+
* the service being unavailable or a rescheduling policy violation.
|
|
1162
1134
|
*
|
|
1163
|
-
* ## Notify customers
|
|
1164
1135
|
*
|
|
1165
|
-
*
|
|
1166
|
-
* the message, you must also specify `participantNotification.notifyParticipants`
|
|
1167
|
-
* as `true`.
|
|
1136
|
+
* See Reschedule Booking for more information.
|
|
1168
1137
|
*/
|
|
1169
|
-
function
|
|
1170
|
-
function
|
|
1138
|
+
function rescheduleMultiServiceBooking(payload) {
|
|
1139
|
+
function __rescheduleMultiServiceBooking({ host }) {
|
|
1171
1140
|
const metadata = {
|
|
1172
1141
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1173
1142
|
method: 'POST',
|
|
1174
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
1143
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RescheduleMultiServiceBooking',
|
|
1175
1144
|
packageName: PACKAGE_NAME,
|
|
1176
|
-
url:
|
|
1177
|
-
protoPath: '/v2/
|
|
1145
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1146
|
+
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/reschedule',
|
|
1178
1147
|
data: payload,
|
|
1179
1148
|
host,
|
|
1180
1149
|
}),
|
|
@@ -1183,45 +1152,47 @@ function bookingsConfirmBooking(payload) {
|
|
|
1183
1152
|
{
|
|
1184
1153
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1185
1154
|
paths: [
|
|
1186
|
-
{ path: 'booking.createdDate' },
|
|
1187
|
-
{ path: 'booking.startDate' },
|
|
1188
|
-
{ path: 'booking.endDate' },
|
|
1189
|
-
{ path: 'booking.updatedDate' },
|
|
1190
|
-
{ path: 'booking.canceledDate' },
|
|
1155
|
+
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
1156
|
+
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
1157
|
+
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
1158
|
+
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
1159
|
+
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
1191
1160
|
],
|
|
1192
1161
|
},
|
|
1193
1162
|
{
|
|
1194
1163
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1195
1164
|
paths: [
|
|
1196
|
-
{
|
|
1197
|
-
|
|
1165
|
+
{
|
|
1166
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1170
|
+
},
|
|
1198
1171
|
],
|
|
1199
1172
|
},
|
|
1200
1173
|
]),
|
|
1201
1174
|
};
|
|
1202
1175
|
return metadata;
|
|
1203
1176
|
}
|
|
1204
|
-
return
|
|
1177
|
+
return __rescheduleMultiServiceBooking;
|
|
1205
1178
|
}
|
|
1206
|
-
exports.
|
|
1179
|
+
exports.rescheduleMultiServiceBooking = rescheduleMultiServiceBooking;
|
|
1207
1180
|
/**
|
|
1208
|
-
*
|
|
1209
|
-
*
|
|
1181
|
+
* Retrieves a multi-service booking's availability.
|
|
1210
1182
|
*
|
|
1211
|
-
* If you specify an extended field `namespace` that doesn't exist yet, it's
|
|
1212
|
-
* created.
|
|
1213
1183
|
*
|
|
1214
|
-
*
|
|
1184
|
+
* Use List Multi Service Availability Time Slots to check availability for a
|
|
1185
|
+
* `SEQUENTIAL_BOOKINGS` multi-service booking.
|
|
1215
1186
|
*/
|
|
1216
|
-
function
|
|
1217
|
-
function
|
|
1187
|
+
function getMultiServiceBookingAvailability(payload) {
|
|
1188
|
+
function __getMultiServiceBookingAvailability({ host }) {
|
|
1218
1189
|
const metadata = {
|
|
1219
1190
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1220
1191
|
method: 'POST',
|
|
1221
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
1192
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBookingAvailability',
|
|
1222
1193
|
packageName: PACKAGE_NAME,
|
|
1223
|
-
url:
|
|
1224
|
-
protoPath: '/v2/
|
|
1194
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1195
|
+
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/get_availability',
|
|
1225
1196
|
data: payload,
|
|
1226
1197
|
host,
|
|
1227
1198
|
}),
|
|
@@ -1229,55 +1200,71 @@ function updateExtendedFields(payload) {
|
|
|
1229
1200
|
};
|
|
1230
1201
|
return metadata;
|
|
1231
1202
|
}
|
|
1232
|
-
return
|
|
1203
|
+
return __getMultiServiceBookingAvailability;
|
|
1233
1204
|
}
|
|
1234
|
-
exports.
|
|
1205
|
+
exports.getMultiServiceBookingAvailability = getMultiServiceBookingAvailability;
|
|
1206
|
+
/** Cancels a multi-service booking and thus all its individual bookings. */
|
|
1207
|
+
function cancelMultiServiceBooking(payload) {
|
|
1208
|
+
function __cancelMultiServiceBooking({ host }) {
|
|
1209
|
+
const metadata = {
|
|
1210
|
+
entityFqdn: 'wix.bookings.v2.booking',
|
|
1211
|
+
method: 'POST',
|
|
1212
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CancelMultiServiceBooking',
|
|
1213
|
+
packageName: PACKAGE_NAME,
|
|
1214
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1215
|
+
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/cancel',
|
|
1216
|
+
data: payload,
|
|
1217
|
+
host,
|
|
1218
|
+
}),
|
|
1219
|
+
data: payload,
|
|
1220
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
1221
|
+
{
|
|
1222
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1223
|
+
paths: [
|
|
1224
|
+
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
1225
|
+
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
1226
|
+
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
1227
|
+
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
1228
|
+
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
1229
|
+
],
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1233
|
+
paths: [
|
|
1234
|
+
{
|
|
1235
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1239
|
+
},
|
|
1240
|
+
],
|
|
1241
|
+
},
|
|
1242
|
+
]),
|
|
1243
|
+
};
|
|
1244
|
+
return metadata;
|
|
1245
|
+
}
|
|
1246
|
+
return __cancelMultiServiceBooking;
|
|
1247
|
+
}
|
|
1248
|
+
exports.cancelMultiServiceBooking = cancelMultiServiceBooking;
|
|
1235
1249
|
/**
|
|
1236
|
-
* Updates the
|
|
1237
|
-
* `participants.approvalStatus` to `DECLINED` without checking whether the relevant
|
|
1238
|
-
* slot or schedule is still available.
|
|
1239
|
-
*
|
|
1240
|
-
*
|
|
1241
|
-
* ## eCommerce checkout restriction
|
|
1242
|
-
*
|
|
1243
|
-
* Call this method only when using a custom checkout page. Don't
|
|
1244
|
-
* call it when using a *Wix eCommerce checkout*
|
|
1245
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
|
|
1246
|
-
* In such cases, Wix automatically updates the booking status based on
|
|
1247
|
-
* the `paymentStatus` of the corresponding *Wix eCommerce order*
|
|
1248
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
1249
|
-
*
|
|
1250
|
-
* ## When to call Confirm Or Decline Booking instead
|
|
1251
|
-
*
|
|
1252
|
-
* The method doesn't check whether a slot or schedule is still available. For
|
|
1253
|
-
* these checks you can call *Confirm or Decline Booking*
|
|
1254
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
|
|
1255
|
-
*
|
|
1256
|
-
* ## Original status validation
|
|
1257
|
-
*
|
|
1258
|
-
* You can only decline bookings with a `status` of `PENDING`, `CREATED`, or
|
|
1259
|
-
* `WAITING_LIST`.
|
|
1250
|
+
* Updates the status of a multi-service booking to `PENDING`.
|
|
1260
1251
|
*
|
|
1261
|
-
* ## Payment status
|
|
1262
1252
|
*
|
|
1263
|
-
* Also updates the
|
|
1264
|
-
* status.
|
|
1253
|
+
* Also updates the status of each of individual bookings within the multi-service booking to `PENDING`.
|
|
1265
1254
|
*
|
|
1266
|
-
*
|
|
1255
|
+
* The call fails if the status for at least a single individual booking can't be updated.
|
|
1267
1256
|
*
|
|
1268
|
-
*
|
|
1269
|
-
* the message, you must also specify `participantNotification.notifyParticipants`
|
|
1270
|
-
* as `true`.
|
|
1257
|
+
* See Mark Booking as Pending for more information.
|
|
1271
1258
|
*/
|
|
1272
|
-
function
|
|
1273
|
-
function
|
|
1259
|
+
function markMultiServiceBookingAsPending(payload) {
|
|
1260
|
+
function __markMultiServiceBookingAsPending({ host }) {
|
|
1274
1261
|
const metadata = {
|
|
1275
1262
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1276
1263
|
method: 'POST',
|
|
1277
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
1264
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.MarkMultiServiceBookingAsPending',
|
|
1278
1265
|
packageName: PACKAGE_NAME,
|
|
1279
|
-
url:
|
|
1280
|
-
protoPath: '/v2/
|
|
1266
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1267
|
+
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/mark_as_pending',
|
|
1281
1268
|
data: payload,
|
|
1282
1269
|
host,
|
|
1283
1270
|
}),
|
|
@@ -1286,83 +1273,50 @@ function bookingsDeclineBooking(payload) {
|
|
|
1286
1273
|
{
|
|
1287
1274
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1288
1275
|
paths: [
|
|
1289
|
-
{ path: 'booking.createdDate' },
|
|
1290
|
-
{ path: 'booking.startDate' },
|
|
1291
|
-
{ path: 'booking.endDate' },
|
|
1292
|
-
{ path: 'booking.updatedDate' },
|
|
1293
|
-
{ path: 'booking.canceledDate' },
|
|
1276
|
+
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
1277
|
+
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
1278
|
+
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
1279
|
+
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
1280
|
+
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
1294
1281
|
],
|
|
1295
1282
|
},
|
|
1296
1283
|
{
|
|
1297
1284
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1298
1285
|
paths: [
|
|
1299
|
-
{
|
|
1300
|
-
|
|
1286
|
+
{
|
|
1287
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1291
|
+
},
|
|
1301
1292
|
],
|
|
1302
1293
|
},
|
|
1303
1294
|
]),
|
|
1304
1295
|
};
|
|
1305
1296
|
return metadata;
|
|
1306
1297
|
}
|
|
1307
|
-
return
|
|
1298
|
+
return __markMultiServiceBookingAsPending;
|
|
1308
1299
|
}
|
|
1309
|
-
exports.
|
|
1300
|
+
exports.markMultiServiceBookingAsPending = markMultiServiceBookingAsPending;
|
|
1310
1301
|
/**
|
|
1311
|
-
* Updates the booking
|
|
1312
|
-
*
|
|
1313
|
-
*
|
|
1314
|
-
* ## Appointments
|
|
1315
|
-
*
|
|
1316
|
-
* For appointments, the corresponding event is removed from the Bookings
|
|
1317
|
-
* calendar.
|
|
1318
|
-
*
|
|
1319
|
-
* ## Class and course bookings
|
|
1320
|
-
*
|
|
1321
|
-
* For class or course bookings, the relevant participants are removed
|
|
1322
|
-
* from the class session or the course. However, the class session or course
|
|
1323
|
-
* remain on the business calendar.
|
|
1324
|
-
*
|
|
1325
|
-
* ## Notify customers
|
|
1326
|
-
*
|
|
1327
|
-
* You can specify a `participantNotification.message` for the customer. To send
|
|
1328
|
-
* the message, you must also specify `participantNotification.notifyParticipants`
|
|
1329
|
-
* as `true`.
|
|
1330
|
-
*
|
|
1331
|
-
* ## Admin overwrites
|
|
1332
|
-
*
|
|
1333
|
-
* There are small but important differences when you specify special
|
|
1334
|
-
* `flowControlSettings`:
|
|
1302
|
+
* Updates the status of a multi-service booking to `CONFIRMED`.
|
|
1335
1303
|
*
|
|
1336
|
-
* - `{"ignoreCancellationPolicy": true}`: The call succeeds even if the
|
|
1337
|
-
* service's `cancellationPolicy` doesn't allow it.
|
|
1338
|
-
* - `{"withRefund": true}`: The customer is refunded even if the service's
|
|
1339
|
-
* `refundPolicy` doesn't allow it.
|
|
1340
|
-
* - `{"waiveCancellationFee": true}`: The customer doesn't have to pay
|
|
1341
|
-
* the cancellation fee, even if the service's `cancellationPolicy` requires it.
|
|
1342
1304
|
*
|
|
1343
|
-
*
|
|
1344
|
-
* permissions. If you encounter failed calls due to insufficient permissions,
|
|
1345
|
-
* consider the following options:
|
|
1305
|
+
* Also updates the status of each of individual bookings within the multi-service booking to `CONFIRMED`.
|
|
1346
1306
|
*
|
|
1347
|
-
*
|
|
1348
|
-
* [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
|
|
1349
|
-
* such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
|
|
1350
|
-
* - **Site developers** can utilize
|
|
1351
|
-
* [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
|
|
1307
|
+
* The call fails if the status for at least a single individual booking can't be updated.
|
|
1352
1308
|
*
|
|
1353
|
-
*
|
|
1354
|
-
* would typically fail due to authorization checks. Therefore, you should use
|
|
1355
|
-
* them intentionally and securely.
|
|
1309
|
+
* See Confirm Booking for more information.
|
|
1356
1310
|
*/
|
|
1357
|
-
function
|
|
1358
|
-
function
|
|
1311
|
+
function confirmMultiServiceBooking(payload) {
|
|
1312
|
+
function __confirmMultiServiceBooking({ host }) {
|
|
1359
1313
|
const metadata = {
|
|
1360
1314
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1361
1315
|
method: 'POST',
|
|
1362
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
1316
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.ConfirmMultiServiceBooking',
|
|
1363
1317
|
packageName: PACKAGE_NAME,
|
|
1364
|
-
url:
|
|
1365
|
-
protoPath: '/v2/
|
|
1318
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1319
|
+
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/confirm',
|
|
1366
1320
|
data: payload,
|
|
1367
1321
|
host,
|
|
1368
1322
|
}),
|
|
@@ -1371,52 +1325,50 @@ function bookingsCancelBooking(payload) {
|
|
|
1371
1325
|
{
|
|
1372
1326
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1373
1327
|
paths: [
|
|
1374
|
-
{ path: 'booking.createdDate' },
|
|
1375
|
-
{ path: 'booking.startDate' },
|
|
1376
|
-
{ path: 'booking.endDate' },
|
|
1377
|
-
{ path: 'booking.updatedDate' },
|
|
1378
|
-
{ path: 'booking.canceledDate' },
|
|
1328
|
+
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
1329
|
+
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
1330
|
+
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
1331
|
+
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
1332
|
+
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
1379
1333
|
],
|
|
1380
1334
|
},
|
|
1381
1335
|
{
|
|
1382
1336
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1383
1337
|
paths: [
|
|
1384
|
-
{
|
|
1385
|
-
|
|
1338
|
+
{
|
|
1339
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1343
|
+
},
|
|
1386
1344
|
],
|
|
1387
1345
|
},
|
|
1388
1346
|
]),
|
|
1389
1347
|
};
|
|
1390
1348
|
return metadata;
|
|
1391
1349
|
}
|
|
1392
|
-
return
|
|
1350
|
+
return __confirmMultiServiceBooking;
|
|
1393
1351
|
}
|
|
1394
|
-
exports.
|
|
1352
|
+
exports.confirmMultiServiceBooking = confirmMultiServiceBooking;
|
|
1395
1353
|
/**
|
|
1396
|
-
* Updates the
|
|
1397
|
-
* the `totalNumberOfParticipants` for the relevant sessions.
|
|
1398
|
-
*
|
|
1354
|
+
* Updates the status of a multi-service booking to `DECLINED`.
|
|
1399
1355
|
*
|
|
1400
|
-
* ## Appointment limitation
|
|
1401
1356
|
*
|
|
1402
|
-
*
|
|
1357
|
+
* Also updates the status of each of individual bookings within the multi-service booking to `DECLINED`.
|
|
1403
1358
|
*
|
|
1404
|
-
*
|
|
1359
|
+
* The call fails if the status for at least a single individual booking can't be updated.
|
|
1405
1360
|
*
|
|
1406
|
-
*
|
|
1407
|
-
* The call fails if the specified `participantsChoices` aren't among the
|
|
1408
|
-
* supported *service options and variants*
|
|
1409
|
-
* ([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)).
|
|
1361
|
+
* See Decline Booking for more information.
|
|
1410
1362
|
*/
|
|
1411
|
-
function
|
|
1412
|
-
function
|
|
1363
|
+
function declineMultiServiceBooking(payload) {
|
|
1364
|
+
function __declineMultiServiceBooking({ host }) {
|
|
1413
1365
|
const metadata = {
|
|
1414
1366
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1415
1367
|
method: 'POST',
|
|
1416
|
-
methodFqn: 'com.wixpress.bookings.bookings.v2.
|
|
1368
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.DeclineMultiServiceBooking',
|
|
1417
1369
|
packageName: PACKAGE_NAME,
|
|
1418
|
-
url:
|
|
1419
|
-
protoPath: '/v2/
|
|
1370
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1371
|
+
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/decline',
|
|
1420
1372
|
data: payload,
|
|
1421
1373
|
host,
|
|
1422
1374
|
}),
|
|
@@ -1425,78 +1377,118 @@ function bookingsUpdateNumberOfParticipants(payload) {
|
|
|
1425
1377
|
{
|
|
1426
1378
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1427
1379
|
paths: [
|
|
1428
|
-
{ path: 'booking.createdDate' },
|
|
1429
|
-
{ path: 'booking.startDate' },
|
|
1430
|
-
{ path: 'booking.endDate' },
|
|
1431
|
-
{ path: 'booking.updatedDate' },
|
|
1432
|
-
{ path: 'booking.canceledDate' },
|
|
1380
|
+
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
1381
|
+
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
1382
|
+
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
1383
|
+
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
1384
|
+
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
1433
1385
|
],
|
|
1434
1386
|
},
|
|
1435
1387
|
{
|
|
1436
1388
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1437
1389
|
paths: [
|
|
1438
|
-
{
|
|
1439
|
-
|
|
1390
|
+
{
|
|
1391
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1395
|
+
},
|
|
1440
1396
|
],
|
|
1441
1397
|
},
|
|
1442
1398
|
]),
|
|
1443
1399
|
};
|
|
1444
1400
|
return metadata;
|
|
1445
1401
|
}
|
|
1446
|
-
return
|
|
1402
|
+
return __declineMultiServiceBooking;
|
|
1447
1403
|
}
|
|
1448
|
-
exports.
|
|
1404
|
+
exports.declineMultiServiceBooking = declineMultiServiceBooking;
|
|
1405
|
+
/** Retrieves the allowed actions for a list of multi-service bookings. */
|
|
1406
|
+
function bulkGetMultiServiceBookingAllowedActions(payload) {
|
|
1407
|
+
function __bulkGetMultiServiceBookingAllowedActions({ host }) {
|
|
1408
|
+
const metadata = {
|
|
1409
|
+
entityFqdn: 'wix.bookings.v2.booking',
|
|
1410
|
+
method: 'POST',
|
|
1411
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.BulkGetMultiServiceBookingAllowedActions',
|
|
1412
|
+
packageName: PACKAGE_NAME,
|
|
1413
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1414
|
+
protoPath: '/v2/bulk/multi_service_bookings/get_allowed_actions',
|
|
1415
|
+
data: payload,
|
|
1416
|
+
host,
|
|
1417
|
+
}),
|
|
1418
|
+
data: payload,
|
|
1419
|
+
};
|
|
1420
|
+
return metadata;
|
|
1421
|
+
}
|
|
1422
|
+
return __bulkGetMultiServiceBookingAllowedActions;
|
|
1423
|
+
}
|
|
1424
|
+
exports.bulkGetMultiServiceBookingAllowedActions = bulkGetMultiServiceBookingAllowedActions;
|
|
1449
1425
|
/**
|
|
1450
|
-
*
|
|
1451
|
-
* on the `paymentStatus` you provide, double booking conflicts, and whether
|
|
1452
|
-
* the service requires business approval.
|
|
1453
|
-
*
|
|
1454
|
-
* ## eCommerce checkout restriction
|
|
1455
|
-
*
|
|
1456
|
-
* Call this method only when using a custom checkout page. Don't
|
|
1457
|
-
* call it when using a *Wix eCommerce checkout*
|
|
1458
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
|
|
1459
|
-
* In such cases, Wix automatically updates the booking status based on
|
|
1460
|
-
* the `paymentStatus` of the corresponding *Wix eCommerce order*
|
|
1461
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
|
|
1462
|
-
*
|
|
1463
|
-
* ## New booking status
|
|
1464
|
-
*
|
|
1465
|
-
* The booking `status` is set to `DECLINED` if both of the following conditions
|
|
1466
|
-
* are met:
|
|
1467
|
-
* + You provide `UNDEFINED`, `NOT_PAID`, `REFUNDED`, or `EXEMPT` as payment status.
|
|
1468
|
-
* + There is a double booking conflict.
|
|
1469
|
-
*
|
|
1470
|
-
* If only one or none of these conditions is met, `status` is set to `PENDING`
|
|
1471
|
-
* or `CONFIRMED` depending on whether the service requires business approval.
|
|
1426
|
+
* Retrieves all single-service bookings belonging to a multi-service booking.
|
|
1472
1427
|
*
|
|
1473
|
-
* ## Double bookings
|
|
1474
1428
|
*
|
|
1475
|
-
* If
|
|
1476
|
-
*
|
|
1477
|
-
*
|
|
1429
|
+
* If you call as an [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
|
|
1430
|
+
* who has permissions to read only part of the bookings,
|
|
1431
|
+
* only the permitted bookings are retrieved. The returned total number of
|
|
1432
|
+
* bookings includes also the bookings for which you don't have permissions.
|
|
1433
|
+
*/
|
|
1434
|
+
function getMultiServiceBooking(payload) {
|
|
1435
|
+
function __getMultiServiceBooking({ host }) {
|
|
1436
|
+
const metadata = {
|
|
1437
|
+
entityFqdn: 'wix.bookings.v2.booking',
|
|
1438
|
+
method: 'GET',
|
|
1439
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBooking',
|
|
1440
|
+
packageName: PACKAGE_NAME,
|
|
1441
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1442
|
+
protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}',
|
|
1443
|
+
data: payload,
|
|
1444
|
+
host,
|
|
1445
|
+
}),
|
|
1446
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
1447
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
1448
|
+
{
|
|
1449
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1450
|
+
paths: [
|
|
1451
|
+
{ path: 'multiServiceBooking.bookings.booking.createdDate' },
|
|
1452
|
+
{ path: 'multiServiceBooking.bookings.booking.startDate' },
|
|
1453
|
+
{ path: 'multiServiceBooking.bookings.booking.endDate' },
|
|
1454
|
+
{ path: 'multiServiceBooking.bookings.booking.updatedDate' },
|
|
1455
|
+
{ path: 'multiServiceBooking.bookings.booking.canceledDate' },
|
|
1456
|
+
],
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1460
|
+
paths: [
|
|
1461
|
+
{
|
|
1462
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1466
|
+
},
|
|
1467
|
+
],
|
|
1468
|
+
},
|
|
1469
|
+
]),
|
|
1470
|
+
};
|
|
1471
|
+
return metadata;
|
|
1472
|
+
}
|
|
1473
|
+
return __getMultiServiceBooking;
|
|
1474
|
+
}
|
|
1475
|
+
exports.getMultiServiceBooking = getMultiServiceBooking;
|
|
1476
|
+
/**
|
|
1477
|
+
* Adds a list of single-service bookings to a multi-service booking.
|
|
1478
1478
|
*
|
|
1479
|
-
* ## Admin overwrites
|
|
1480
1479
|
*
|
|
1481
|
-
*
|
|
1482
|
-
* booking
|
|
1483
|
-
* + If the booking's `flowControlSettings.skipAvailabilityValidation` was set to
|
|
1484
|
-
* `true`, the booking is never declined regardless of double booking conflicts.
|
|
1485
|
-
* Instead, it's marked `CONFIRMED` or `PENDING`, depending on whether the
|
|
1486
|
-
* service requires business approval.
|
|
1487
|
-
* + If the booking's `flowControlSettings.skipBusinessConfirmation` was set to
|
|
1488
|
-
* `true`, the booking skips `PENDING` status and is marked `CONFIRMED`
|
|
1489
|
-
* immediately.
|
|
1480
|
+
* The call fails, if at least 1 of the specified booking is already part of a
|
|
1481
|
+
* multi-service booking.
|
|
1490
1482
|
*/
|
|
1491
|
-
function
|
|
1492
|
-
function
|
|
1483
|
+
function addBookingsToMultiServiceBooking(payload) {
|
|
1484
|
+
function __addBookingsToMultiServiceBooking({ host }) {
|
|
1493
1485
|
const metadata = {
|
|
1494
1486
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1495
1487
|
method: 'POST',
|
|
1496
|
-
methodFqn: 'com.wixpress.bookings.
|
|
1488
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.AddBookingsToMultiServiceBooking',
|
|
1497
1489
|
packageName: PACKAGE_NAME,
|
|
1498
|
-
url:
|
|
1499
|
-
protoPath: '/v2/
|
|
1490
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1491
|
+
protoPath: '/v2/multi_service_bookings/add_bookings_to_multi_service_booking',
|
|
1500
1492
|
data: payload,
|
|
1501
1493
|
host,
|
|
1502
1494
|
}),
|
|
@@ -1505,44 +1497,52 @@ function confirmOrDeclineBooking(payload) {
|
|
|
1505
1497
|
{
|
|
1506
1498
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1507
1499
|
paths: [
|
|
1508
|
-
{ path: 'booking.createdDate' },
|
|
1509
|
-
{ path: 'booking.startDate' },
|
|
1510
|
-
{ path: 'booking.endDate' },
|
|
1511
|
-
{ path: 'booking.updatedDate' },
|
|
1512
|
-
{ path: 'booking.canceledDate' },
|
|
1500
|
+
{ path: 'bookings.booking.createdDate' },
|
|
1501
|
+
{ path: 'bookings.booking.startDate' },
|
|
1502
|
+
{ path: 'bookings.booking.endDate' },
|
|
1503
|
+
{ path: 'bookings.booking.updatedDate' },
|
|
1504
|
+
{ path: 'bookings.booking.canceledDate' },
|
|
1513
1505
|
],
|
|
1514
1506
|
},
|
|
1515
1507
|
{
|
|
1516
1508
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1517
1509
|
paths: [
|
|
1518
|
-
{
|
|
1519
|
-
|
|
1510
|
+
{
|
|
1511
|
+
path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1515
|
+
},
|
|
1520
1516
|
],
|
|
1521
1517
|
},
|
|
1522
1518
|
]),
|
|
1523
1519
|
};
|
|
1524
1520
|
return metadata;
|
|
1525
1521
|
}
|
|
1526
|
-
return
|
|
1522
|
+
return __addBookingsToMultiServiceBooking;
|
|
1527
1523
|
}
|
|
1528
|
-
exports.
|
|
1524
|
+
exports.addBookingsToMultiServiceBooking = addBookingsToMultiServiceBooking;
|
|
1529
1525
|
/**
|
|
1530
|
-
*
|
|
1526
|
+
* Removes single-service bookings from a multi-service booking and returns the
|
|
1527
|
+
* removed bookings.
|
|
1531
1528
|
*
|
|
1532
1529
|
*
|
|
1533
|
-
*
|
|
1534
|
-
*
|
|
1535
|
-
*
|
|
1530
|
+
* If you specify an empty `bookings` array, all single-service bookings for which
|
|
1531
|
+
* the call's [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
|
|
1532
|
+
* has read permissions are removed from the multi-service booking.
|
|
1533
|
+
*
|
|
1534
|
+
* If the call would create a multi-service booking including only 1 single-service
|
|
1535
|
+
* booking, the multi-service booking is also deleted.
|
|
1536
1536
|
*/
|
|
1537
|
-
function
|
|
1538
|
-
function
|
|
1537
|
+
function removeBookingsFromMultiServiceBooking(payload) {
|
|
1538
|
+
function __removeBookingsFromMultiServiceBooking({ host }) {
|
|
1539
1539
|
const metadata = {
|
|
1540
1540
|
entityFqdn: 'wix.bookings.v2.booking',
|
|
1541
1541
|
method: 'POST',
|
|
1542
|
-
methodFqn: 'com.wixpress.bookings.
|
|
1542
|
+
methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RemoveBookingsFromMultiServiceBooking',
|
|
1543
1543
|
packageName: PACKAGE_NAME,
|
|
1544
|
-
url:
|
|
1545
|
-
protoPath: '/v2/
|
|
1544
|
+
url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
|
|
1545
|
+
protoPath: '/v2/multi_service_bookings/remove_bookings_from_multi_service_booking',
|
|
1546
1546
|
data: payload,
|
|
1547
1547
|
host,
|
|
1548
1548
|
}),
|
|
@@ -1551,21 +1551,21 @@ function bulkConfirmOrDeclineBooking(payload) {
|
|
|
1551
1551
|
{
|
|
1552
1552
|
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
1553
1553
|
paths: [
|
|
1554
|
-
{ path: '
|
|
1555
|
-
{ path: '
|
|
1556
|
-
{ path: '
|
|
1557
|
-
{ path: '
|
|
1558
|
-
{ path: '
|
|
1554
|
+
{ path: 'bookings.booking.createdDate' },
|
|
1555
|
+
{ path: 'bookings.booking.startDate' },
|
|
1556
|
+
{ path: 'bookings.booking.endDate' },
|
|
1557
|
+
{ path: 'bookings.booking.updatedDate' },
|
|
1558
|
+
{ path: 'bookings.booking.canceledDate' },
|
|
1559
1559
|
],
|
|
1560
1560
|
},
|
|
1561
1561
|
{
|
|
1562
1562
|
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
1563
1563
|
paths: [
|
|
1564
1564
|
{
|
|
1565
|
-
path: '
|
|
1565
|
+
path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
|
|
1566
1566
|
},
|
|
1567
1567
|
{
|
|
1568
|
-
path: '
|
|
1568
|
+
path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
|
|
1569
1569
|
},
|
|
1570
1570
|
],
|
|
1571
1571
|
},
|
|
@@ -1573,7 +1573,7 @@ function bulkConfirmOrDeclineBooking(payload) {
|
|
|
1573
1573
|
};
|
|
1574
1574
|
return metadata;
|
|
1575
1575
|
}
|
|
1576
|
-
return
|
|
1576
|
+
return __removeBookingsFromMultiServiceBooking;
|
|
1577
1577
|
}
|
|
1578
|
-
exports.
|
|
1578
|
+
exports.removeBookingsFromMultiServiceBooking = removeBookingsFromMultiServiceBooking;
|
|
1579
1579
|
//# sourceMappingURL=bookings-v2-booking-bookings.http.js.map
|