@wix/auto_sdk_bookings_bookings 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/bookings-v2-booking-bookings.context.d.ts +61 -0
  11. package/build/cjs/src/bookings-v2-booking-bookings.context.js +77 -0
  12. package/build/cjs/src/bookings-v2-booking-bookings.context.js.map +1 -0
  13. package/build/cjs/src/bookings-v2-booking-bookings.http.d.ts +507 -0
  14. package/build/cjs/src/bookings-v2-booking-bookings.http.js +1576 -0
  15. package/build/cjs/src/bookings-v2-booking-bookings.http.js.map +1 -0
  16. package/build/cjs/src/bookings-v2-booking-bookings.meta.d.ts +61 -0
  17. package/build/cjs/src/bookings-v2-booking-bookings.meta.js +427 -0
  18. package/build/cjs/src/bookings-v2-booking-bookings.meta.js.map +1 -0
  19. package/build/cjs/src/bookings-v2-booking-bookings.public.d.ts +625 -0
  20. package/build/cjs/src/bookings-v2-booking-bookings.public.js +313 -0
  21. package/build/cjs/src/bookings-v2-booking-bookings.public.js.map +1 -0
  22. package/build/cjs/src/bookings-v2-booking-bookings.types.d.ts +2736 -0
  23. package/build/cjs/src/bookings-v2-booking-bookings.types.js +165 -0
  24. package/build/cjs/src/bookings-v2-booking-bookings.types.js.map +1 -0
  25. package/build/cjs/src/bookings-v2-booking-bookings.universal.d.ts +4014 -0
  26. package/build/cjs/src/bookings-v2-booking-bookings.universal.js +1646 -0
  27. package/build/cjs/src/bookings-v2-booking-bookings.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/bookings-v2-booking-bookings.context.d.ts +61 -0
  39. package/build/es/src/bookings-v2-booking-bookings.context.js +61 -0
  40. package/build/es/src/bookings-v2-booking-bookings.context.js.map +1 -0
  41. package/build/es/src/bookings-v2-booking-bookings.http.d.ts +507 -0
  42. package/build/es/src/bookings-v2-booking-bookings.http.js +1552 -0
  43. package/build/es/src/bookings-v2-booking-bookings.http.js.map +1 -0
  44. package/build/es/src/bookings-v2-booking-bookings.meta.d.ts +61 -0
  45. package/build/es/src/bookings-v2-booking-bookings.meta.js +380 -0
  46. package/build/es/src/bookings-v2-booking-bookings.meta.js.map +1 -0
  47. package/build/es/src/bookings-v2-booking-bookings.public.d.ts +625 -0
  48. package/build/es/src/bookings-v2-booking-bookings.public.js +276 -0
  49. package/build/es/src/bookings-v2-booking-bookings.public.js.map +1 -0
  50. package/build/es/src/bookings-v2-booking-bookings.types.d.ts +2736 -0
  51. package/build/es/src/bookings-v2-booking-bookings.types.js +162 -0
  52. package/build/es/src/bookings-v2-booking-bookings.types.js.map +1 -0
  53. package/build/es/src/bookings-v2-booking-bookings.universal.d.ts +4014 -0
  54. package/build/es/src/bookings-v2-booking-bookings.universal.js +1599 -0
  55. package/build/es/src/bookings-v2-booking-bookings.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.d.ts +61 -0
  66. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js +77 -0
  67. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js.map +1 -0
  68. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.d.ts +507 -0
  69. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js +1576 -0
  70. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js.map +1 -0
  71. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.d.ts +61 -0
  72. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js +427 -0
  73. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js.map +1 -0
  74. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.d.ts +625 -0
  75. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js +313 -0
  76. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js.map +1 -0
  77. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.d.ts +2736 -0
  78. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.js +165 -0
  79. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.js.map +1 -0
  80. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.d.ts +4014 -0
  81. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js +1646 -0
  82. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/bookings-v2-booking-bookings.context.d.ts +61 -0
  93. package/build/internal/es/src/bookings-v2-booking-bookings.context.js +61 -0
  94. package/build/internal/es/src/bookings-v2-booking-bookings.context.js.map +1 -0
  95. package/build/internal/es/src/bookings-v2-booking-bookings.http.d.ts +507 -0
  96. package/build/internal/es/src/bookings-v2-booking-bookings.http.js +1552 -0
  97. package/build/internal/es/src/bookings-v2-booking-bookings.http.js.map +1 -0
  98. package/build/internal/es/src/bookings-v2-booking-bookings.meta.d.ts +61 -0
  99. package/build/internal/es/src/bookings-v2-booking-bookings.meta.js +380 -0
  100. package/build/internal/es/src/bookings-v2-booking-bookings.meta.js.map +1 -0
  101. package/build/internal/es/src/bookings-v2-booking-bookings.public.d.ts +625 -0
  102. package/build/internal/es/src/bookings-v2-booking-bookings.public.js +276 -0
  103. package/build/internal/es/src/bookings-v2-booking-bookings.public.js.map +1 -0
  104. package/build/internal/es/src/bookings-v2-booking-bookings.types.d.ts +2736 -0
  105. package/build/internal/es/src/bookings-v2-booking-bookings.types.js +162 -0
  106. package/build/internal/es/src/bookings-v2-booking-bookings.types.js.map +1 -0
  107. package/build/internal/es/src/bookings-v2-booking-bookings.universal.d.ts +4014 -0
  108. package/build/internal/es/src/bookings-v2-booking-bookings.universal.js +1599 -0
  109. package/build/internal/es/src/bookings-v2-booking-bookings.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,1576 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bulkConfirmOrDeclineBooking = exports.confirmOrDeclineBooking = exports.bookingsUpdateNumberOfParticipants = exports.bookingsCancelBooking = exports.bookingsDeclineBooking = exports.updateExtendedFields = exports.bookingsConfirmBooking = exports.rescheduleBooking = exports.bulkCreateBooking = exports.createBooking = exports.removeBookingsFromMultiServiceBooking = exports.addBookingsToMultiServiceBooking = exports.getMultiServiceBooking = exports.bulkGetMultiServiceBookingAllowedActions = exports.declineMultiServiceBooking = exports.confirmMultiServiceBooking = exports.markMultiServiceBookingAsPending = exports.cancelMultiServiceBooking = exports.getMultiServiceBookingAvailability = exports.rescheduleMultiServiceBooking = exports.createMultiServiceBooking = void 0;
4
+ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
+ const float_1 = require("@wix/sdk-runtime/transformations/float");
6
+ const float_2 = require("@wix/sdk-runtime/transformations/float");
7
+ const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
8
+ const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
9
+ const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
10
+ const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
11
+ function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
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) {
43
+ const domainToMappings = {
44
+ _: [
45
+ {
46
+ srcPath: '/_api/bookings-service/v2/bookings',
47
+ destPath: '/v2/bookings',
48
+ },
49
+ {
50
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
51
+ destPath: '/v2/bulk/bookings',
52
+ },
53
+ {
54
+ srcPath: '/_api/bookings-service/v2/multi_service_bookings',
55
+ destPath: '/v2/multi_service_bookings',
56
+ },
57
+ {
58
+ srcPath: '/_api/bookings-service/v2/bulk/multi_service_bookings',
59
+ destPath: '/v2/bulk/multi_service_bookings',
60
+ },
61
+ ],
62
+ 'manage._base_domain_': [
63
+ {
64
+ srcPath: '/_api/bookings-service/v2/bookings',
65
+ destPath: '/v2/bookings',
66
+ },
67
+ {
68
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
69
+ destPath: '/v2/bulk/bookings',
70
+ },
71
+ {
72
+ srcPath: '/_api/bookings-service/v2/multi_service_bookings',
73
+ destPath: '/v2/multi_service_bookings',
74
+ },
75
+ {
76
+ srcPath: '/_api/bookings-service/v2/bulk/multi_service_bookings',
77
+ destPath: '/v2/bulk/multi_service_bookings',
78
+ },
79
+ ],
80
+ 'www.wixapis.com': [
81
+ {
82
+ srcPath: '/_api/bookings-service/v2/bookings',
83
+ destPath: '/v2/bookings',
84
+ },
85
+ {
86
+ srcPath: '/bookings/v2/bookings',
87
+ destPath: '/v2/bookings',
88
+ },
89
+ {
90
+ srcPath: '/bookings/v2/bulk/bookings',
91
+ destPath: '/v2/bulk/bookings',
92
+ },
93
+ ],
94
+ 'www._base_domain_': [
95
+ {
96
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
97
+ destPath: '/v2/bulk/bookings',
98
+ },
99
+ {
100
+ srcPath: '/_api/bookings-service/v2/bookings',
101
+ destPath: '/v2/bookings',
102
+ },
103
+ ],
104
+ 'bo._base_domain_': [
105
+ {
106
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
107
+ destPath: '/v2/bulk/bookings',
108
+ },
109
+ {
110
+ srcPath: '/_api/bookings-service/v2/bookings',
111
+ destPath: '/v2/bookings',
112
+ },
113
+ ],
114
+ 'wixbo.ai': [
115
+ {
116
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
117
+ destPath: '/v2/bulk/bookings',
118
+ },
119
+ {
120
+ srcPath: '/_api/bookings-service/v2/bookings',
121
+ destPath: '/v2/bookings',
122
+ },
123
+ ],
124
+ 'wix-bo.com': [
125
+ {
126
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
127
+ destPath: '/v2/bulk/bookings',
128
+ },
129
+ {
130
+ srcPath: '/_api/bookings-service/v2/bookings',
131
+ destPath: '/v2/bookings',
132
+ },
133
+ ],
134
+ '*.dev.wix-code.com': [
135
+ {
136
+ srcPath: '/_api/bookings-service',
137
+ destPath: '/v2/bookings',
138
+ },
139
+ ],
140
+ };
141
+ return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
142
+ }
143
+ function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
144
+ const domainToMappings = {
145
+ _: [
146
+ {
147
+ srcPath: '/_api/bookings-service/v2/bookings',
148
+ destPath: '/v2/bookings',
149
+ },
150
+ {
151
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
152
+ destPath: '/v2/bulk/bookings',
153
+ },
154
+ {
155
+ srcPath: '/_api/bookings-service/v2/multi_service_bookings',
156
+ destPath: '/v2/multi_service_bookings',
157
+ },
158
+ {
159
+ srcPath: '/_api/bookings-service/v2/bulk/multi_service_bookings',
160
+ destPath: '/v2/bulk/multi_service_bookings',
161
+ },
162
+ ],
163
+ 'manage._base_domain_': [
164
+ {
165
+ srcPath: '/_api/bookings-service/v2/bookings',
166
+ destPath: '/v2/bookings',
167
+ },
168
+ {
169
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
170
+ destPath: '/v2/bulk/bookings',
171
+ },
172
+ {
173
+ srcPath: '/_api/bookings-service/v2/multi_service_bookings',
174
+ destPath: '/v2/multi_service_bookings',
175
+ },
176
+ {
177
+ srcPath: '/_api/bookings-service/v2/bulk/multi_service_bookings',
178
+ destPath: '/v2/bulk/multi_service_bookings',
179
+ },
180
+ ],
181
+ 'www.wixapis.com': [
182
+ {
183
+ srcPath: '/_api/bookings-service/v2/bookings',
184
+ destPath: '/v2/bookings',
185
+ },
186
+ {
187
+ srcPath: '/bookings/v2/bookings',
188
+ destPath: '/v2/bookings',
189
+ },
190
+ {
191
+ srcPath: '/bookings/v2/bulk/bookings',
192
+ destPath: '/v2/bulk/bookings',
193
+ },
194
+ ],
195
+ 'www._base_domain_': [
196
+ {
197
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
198
+ destPath: '/v2/bulk/bookings',
199
+ },
200
+ {
201
+ srcPath: '/_api/bookings-service/v2/bookings',
202
+ destPath: '/v2/bookings',
203
+ },
204
+ ],
205
+ 'bo._base_domain_': [
206
+ {
207
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
208
+ destPath: '/v2/bulk/bookings',
209
+ },
210
+ {
211
+ srcPath: '/_api/bookings-service/v2/bookings',
212
+ destPath: '/v2/bookings',
213
+ },
214
+ ],
215
+ 'wixbo.ai': [
216
+ {
217
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
218
+ destPath: '/v2/bulk/bookings',
219
+ },
220
+ {
221
+ srcPath: '/_api/bookings-service/v2/bookings',
222
+ destPath: '/v2/bookings',
223
+ },
224
+ ],
225
+ 'wix-bo.com': [
226
+ {
227
+ srcPath: '/_api/bookings-service/v2/bulk/bookings',
228
+ destPath: '/v2/bulk/bookings',
229
+ },
230
+ {
231
+ srcPath: '/_api/bookings-service/v2/bookings',
232
+ destPath: '/v2/bookings',
233
+ },
234
+ ],
235
+ '*.dev.wix-code.com': [
236
+ {
237
+ srcPath: '/_api/bookings-service',
238
+ destPath: '/v2/bookings',
239
+ },
240
+ ],
241
+ };
242
+ return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
243
+ }
244
+ const PACKAGE_NAME = '@wix/auto_sdk_bookings_bookings';
245
+ /**
246
+ * Creates a multi-service booking.
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, [
254
+ {
255
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
256
+ paths: [
257
+ { path: 'bookings.createdDate' },
258
+ { path: 'bookings.startDate' },
259
+ { path: 'bookings.endDate' },
260
+ { path: 'bookings.updatedDate' },
261
+ { path: 'bookings.canceledDate' },
262
+ ],
263
+ },
264
+ {
265
+ transformFn: float_1.transformSDKFloatToRESTFloat,
266
+ paths: [
267
+ { path: 'bookings.contactDetails.fullAddress.geocode.latitude' },
268
+ { path: 'bookings.contactDetails.fullAddress.geocode.longitude' },
269
+ ],
270
+ },
271
+ ]);
272
+ const metadata = {
273
+ entityFqdn: 'wix.bookings.v2.booking',
274
+ method: 'POST',
275
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CreateMultiServiceBooking',
276
+ packageName: PACKAGE_NAME,
277
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
278
+ protoPath: '/v2/multi_service_bookings',
279
+ data: serializedData,
280
+ host,
281
+ }),
282
+ data: serializedData,
283
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
284
+ {
285
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
286
+ paths: [
287
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
288
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
289
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
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;
310
+ }
311
+ exports.createMultiServiceBooking = createMultiServiceBooking;
312
+ /**
313
+ * Reschedules a multi-service booking.
314
+ *
315
+ *
316
+ * The call fails if at least 1 individual booking can't be rescheduled due
317
+ * the service being unavailable or a rescheduling policy violation.
318
+ *
319
+ *
320
+ * See Reschedule Booking for more information.
321
+ */
322
+ function rescheduleMultiServiceBooking(payload) {
323
+ function __rescheduleMultiServiceBooking({ host }) {
324
+ const metadata = {
325
+ entityFqdn: 'wix.bookings.v2.booking',
326
+ method: 'POST',
327
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RescheduleMultiServiceBooking',
328
+ packageName: PACKAGE_NAME,
329
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
330
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/reschedule',
331
+ data: payload,
332
+ host,
333
+ }),
334
+ data: payload,
335
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
336
+ {
337
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
338
+ paths: [
339
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
340
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
341
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
342
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
343
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
344
+ ],
345
+ },
346
+ {
347
+ transformFn: float_2.transformRESTFloatToSDKFloat,
348
+ paths: [
349
+ {
350
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
351
+ },
352
+ {
353
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
354
+ },
355
+ ],
356
+ },
357
+ ]),
358
+ };
359
+ return metadata;
360
+ }
361
+ return __rescheduleMultiServiceBooking;
362
+ }
363
+ exports.rescheduleMultiServiceBooking = rescheduleMultiServiceBooking;
364
+ /**
365
+ * Retrieves a multi-service booking's availability.
366
+ *
367
+ *
368
+ * Use List Multi Service Availability Time Slots to check availability for a
369
+ * `SEQUENTIAL_BOOKINGS` multi-service booking.
370
+ */
371
+ function getMultiServiceBookingAvailability(payload) {
372
+ function __getMultiServiceBookingAvailability({ host }) {
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 }) {
393
+ const metadata = {
394
+ entityFqdn: 'wix.bookings.v2.booking',
395
+ method: 'POST',
396
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CancelMultiServiceBooking',
397
+ packageName: PACKAGE_NAME,
398
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
399
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/cancel',
400
+ data: payload,
401
+ host,
402
+ }),
403
+ data: payload,
404
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
405
+ {
406
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
407
+ paths: [
408
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
409
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
410
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
411
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
412
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
413
+ ],
414
+ },
415
+ {
416
+ transformFn: float_2.transformRESTFloatToSDKFloat,
417
+ paths: [
418
+ {
419
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
420
+ },
421
+ {
422
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
423
+ },
424
+ ],
425
+ },
426
+ ]),
427
+ };
428
+ return metadata;
429
+ }
430
+ return __cancelMultiServiceBooking;
431
+ }
432
+ exports.cancelMultiServiceBooking = cancelMultiServiceBooking;
433
+ /**
434
+ * Updates the status of a multi-service booking to `PENDING`.
435
+ *
436
+ *
437
+ * Also updates the status of each of individual bookings within the multi-service booking to `PENDING`.
438
+ *
439
+ * The call fails if the status for at least a single individual booking can't be updated.
440
+ *
441
+ * See Mark Booking as Pending for more information.
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`.
487
+ *
488
+ *
489
+ * Also updates the status of each of individual bookings within the multi-service booking to `CONFIRMED`.
490
+ *
491
+ * The call fails if the status for at least a single individual booking can't be updated.
492
+ *
493
+ * See Confirm Booking for more information.
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`.
539
+ *
540
+ *
541
+ * Also updates the status of each of individual bookings within the multi-service booking to `DECLINED`.
542
+ *
543
+ * The call fails if the status for at least a single individual booking can't be updated.
544
+ *
545
+ * See Decline Booking for more information.
546
+ */
547
+ function declineMultiServiceBooking(payload) {
548
+ function __declineMultiServiceBooking({ host }) {
549
+ const metadata = {
550
+ entityFqdn: 'wix.bookings.v2.booking',
551
+ method: 'POST',
552
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.DeclineMultiServiceBooking',
553
+ packageName: PACKAGE_NAME,
554
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
555
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/decline',
556
+ data: payload,
557
+ host,
558
+ }),
559
+ data: payload,
560
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
561
+ {
562
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
563
+ paths: [
564
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
565
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
566
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
567
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
568
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
569
+ ],
570
+ },
571
+ {
572
+ transformFn: float_2.transformRESTFloatToSDKFloat,
573
+ paths: [
574
+ {
575
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
576
+ },
577
+ {
578
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
579
+ },
580
+ ],
581
+ },
582
+ ]),
583
+ };
584
+ return metadata;
585
+ }
586
+ return __declineMultiServiceBooking;
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;
607
+ }
608
+ exports.bulkGetMultiServiceBookingAllowedActions = bulkGetMultiServiceBookingAllowedActions;
609
+ /**
610
+ * Retrieves all single-service bookings belonging to a multi-service booking.
611
+ *
612
+ *
613
+ * If you call as an [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
614
+ * who has permissions to read only part of the bookings,
615
+ * only the permitted bookings are retrieved. The returned total number of
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.
662
+ *
663
+ *
664
+ * The call fails, if at least 1 of the specified booking is already part of a
665
+ * multi-service booking.
666
+ */
667
+ function addBookingsToMultiServiceBooking(payload) {
668
+ function __addBookingsToMultiServiceBooking({ host }) {
669
+ const metadata = {
670
+ entityFqdn: 'wix.bookings.v2.booking',
671
+ method: 'POST',
672
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.AddBookingsToMultiServiceBooking',
673
+ packageName: PACKAGE_NAME,
674
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
675
+ protoPath: '/v2/multi_service_bookings/add_bookings_to_multi_service_booking',
676
+ data: payload,
677
+ host,
678
+ }),
679
+ data: payload,
680
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
681
+ {
682
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
683
+ paths: [
684
+ { path: 'bookings.booking.createdDate' },
685
+ { path: 'bookings.booking.startDate' },
686
+ { path: 'bookings.booking.endDate' },
687
+ { path: 'bookings.booking.updatedDate' },
688
+ { path: 'bookings.booking.canceledDate' },
689
+ ],
690
+ },
691
+ {
692
+ transformFn: float_2.transformRESTFloatToSDKFloat,
693
+ paths: [
694
+ {
695
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
696
+ },
697
+ {
698
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
699
+ },
700
+ ],
701
+ },
702
+ ]),
703
+ };
704
+ return metadata;
705
+ }
706
+ return __addBookingsToMultiServiceBooking;
707
+ }
708
+ exports.addBookingsToMultiServiceBooking = addBookingsToMultiServiceBooking;
709
+ /**
710
+ * Removes single-service bookings from a multi-service booking and returns the
711
+ * removed bookings.
712
+ *
713
+ *
714
+ * If you specify an empty `bookings` array, all single-service bookings for which
715
+ * the call's [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
716
+ * has read permissions are removed from the multi-service booking.
717
+ *
718
+ * If the call would create a multi-service booking including only 1 single-service
719
+ * booking, the multi-service booking is also deleted.
720
+ */
721
+ function removeBookingsFromMultiServiceBooking(payload) {
722
+ function __removeBookingsFromMultiServiceBooking({ host }) {
723
+ const metadata = {
724
+ entityFqdn: 'wix.bookings.v2.booking',
725
+ method: 'POST',
726
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RemoveBookingsFromMultiServiceBooking',
727
+ packageName: PACKAGE_NAME,
728
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
729
+ protoPath: '/v2/multi_service_bookings/remove_bookings_from_multi_service_booking',
730
+ data: payload,
731
+ host,
732
+ }),
733
+ data: payload,
734
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
735
+ {
736
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
737
+ paths: [
738
+ { path: 'bookings.booking.createdDate' },
739
+ { path: 'bookings.booking.startDate' },
740
+ { path: 'bookings.booking.endDate' },
741
+ { path: 'bookings.booking.updatedDate' },
742
+ { path: 'bookings.booking.canceledDate' },
743
+ ],
744
+ },
745
+ {
746
+ transformFn: float_2.transformRESTFloatToSDKFloat,
747
+ paths: [
748
+ {
749
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
750
+ },
751
+ {
752
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
753
+ },
754
+ ],
755
+ },
756
+ ]),
757
+ };
758
+ return metadata;
759
+ }
760
+ return __removeBookingsFromMultiServiceBooking;
761
+ }
762
+ exports.removeBookingsFromMultiServiceBooking = removeBookingsFromMultiServiceBooking;
763
+ /**
764
+ * Creates a booking.
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.
799
+ *
800
+ * ## Participant information
801
+ *
802
+ * You must specify either `participantsChoices` or `totalParticipants`.
803
+ * The call fails if the specified `participantsChoices` aren't among the supported
804
+ * service options and variants
805
+ * ([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)).
806
+ *
807
+ * ## Notify customers
808
+ *
809
+ * You can specify a `participantNotification.message` for the customer that's send
810
+ * immediately. Ensure `participantNotification.notifyParticipants` is set to `true`
811
+ * to send the message.
812
+ *
813
+ * If you specify `{"sendSmsReminder": true}`, the customer receives an SMS 24 hours
814
+ * before the session starts. The phone number is taken from `contactDetails.phone`.
815
+ *
816
+ * ## Booking status
817
+ *
818
+ * Bookings default to the `CREATED` status, not affecting the business calendar
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.
822
+ *
823
+ * ## Payment options
824
+ *
825
+ * The specified `selectedPaymentOption` indicates how the customer intends to
826
+ * pay, allowing for later changes to a different method supported by the service.
827
+ *
828
+ * ## Payment status
829
+ *
830
+ * A booking is initially created with `{"paymentStatus": "UNDEFINED"}` regardless
831
+ * of the payment status specified in Create Booking. If a customer uses an eCommerce
832
+ * checkout ([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)),
833
+ * Wix Bookings automatically syncs the booking's payment status from
834
+ * the corresponding eCommerce order ([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)).
835
+ *
836
+ * If a booking doesn't have a corresponding eCommerce order, for example, since
837
+ * the customer didn't use the eCommerce checkout, you can update the booking's
838
+ * payment status with Confirm Or Decline Booking
839
+ * ([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)).
840
+ *
841
+ * ## Booking form data
842
+ *
843
+ * When customers sign up for a service, they must fill out the booking form.
844
+ * To create a booking with a completed booking form, specify the relevant data in
845
+ * `formSubmission`. Ensure the values of the corresponding fields in
846
+ * `booking.contactDetails` and `formSubmission` are identical. If these values
847
+ * don't match, Create Booking fails. Therefore, we recommend specifying
848
+ * only `booking.contactDetails.contactId` when providing `formSubmission`.
849
+ *
850
+ * ## Admin overwrites
851
+ *
852
+ * There are small but important differences when you specify special
853
+ * `flowControlSettings`:
854
+ *
855
+ * - `{"skipAvailabilityValidation": true}`: The call succeeds
856
+ * regardless of availability. If you don't specify any resource, the call
857
+ * succeeds even if no resource of the relevant type is available.
858
+ * - `{"skipBusinessConfirmation": true}`: Automatically confirms `PENDING`
859
+ * bookings that require manual confirmation.
860
+ * - `{"skipSelectedPaymentOptionValidation": true}`: Allows customers to pay
861
+ * with payment methods that aren't supported for the service.
862
+ *
863
+ * When using special `flowControlSettings`, ensure you have sufficient
864
+ * permissions. If you encounter failed calls due to insufficient permissions,
865
+ * consider the following options:
866
+ *
867
+ * - **App developers** can use a higher
868
+ * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
869
+ * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
870
+ * - **Site developers** can utilize
871
+ * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
872
+ *
873
+ * Granting additional permissions and using elevation permits method calls that
874
+ * would typically fail due to authorization checks. Therefore, you should use
875
+ * them intentionally and securely.
876
+ */
877
+ function createBooking(payload) {
878
+ function __createBooking({ host }) {
879
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
880
+ {
881
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
882
+ paths: [
883
+ { path: 'booking.createdDate' },
884
+ { path: 'booking.startDate' },
885
+ { path: 'booking.endDate' },
886
+ { path: 'booking.updatedDate' },
887
+ { path: 'booking.canceledDate' },
888
+ ],
889
+ },
890
+ {
891
+ transformFn: float_1.transformSDKFloatToRESTFloat,
892
+ paths: [
893
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
894
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
895
+ ],
896
+ },
897
+ ]);
898
+ const metadata = {
899
+ entityFqdn: 'wix.bookings.v2.booking',
900
+ method: 'POST',
901
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CreateBooking',
902
+ packageName: PACKAGE_NAME,
903
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
904
+ protoPath: '/v2/bookings',
905
+ data: serializedData,
906
+ host,
907
+ }),
908
+ data: serializedData,
909
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
910
+ {
911
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
912
+ paths: [
913
+ { path: 'booking.createdDate' },
914
+ { path: 'booking.startDate' },
915
+ { path: 'booking.endDate' },
916
+ { path: 'booking.updatedDate' },
917
+ { path: 'booking.canceledDate' },
918
+ ],
919
+ },
920
+ {
921
+ transformFn: float_2.transformRESTFloatToSDKFloat,
922
+ paths: [
923
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
924
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
925
+ ],
926
+ },
927
+ ]),
928
+ };
929
+ return metadata;
930
+ }
931
+ return __createBooking;
932
+ }
933
+ exports.createBooking = createBooking;
934
+ /**
935
+ * Creates up to 8 bookings.
936
+ *
937
+ *
938
+ * See Create Booking ([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))
939
+ * for more information.
940
+ *
941
+ * If any of the specified bookings is missing a required field the entire call
942
+ * fails.
943
+ *
944
+ * If you specify 1 or more unavailable bookings, the call succeeds
945
+ * while the unavailable bookings aren't created. Instead, they're counted as
946
+ * failures in the returned `bulkActionMetadata`.
947
+ */
948
+ function bulkCreateBooking(payload) {
949
+ function __bulkCreateBooking({ host }) {
950
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
951
+ {
952
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
953
+ paths: [
954
+ { path: 'createBookingsInfo.booking.createdDate' },
955
+ { path: 'createBookingsInfo.booking.startDate' },
956
+ { path: 'createBookingsInfo.booking.endDate' },
957
+ { path: 'createBookingsInfo.booking.updatedDate' },
958
+ { path: 'createBookingsInfo.booking.canceledDate' },
959
+ ],
960
+ },
961
+ {
962
+ transformFn: float_1.transformSDKFloatToRESTFloat,
963
+ paths: [
964
+ {
965
+ path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.latitude',
966
+ },
967
+ {
968
+ path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.longitude',
969
+ },
970
+ ],
971
+ },
972
+ ]);
973
+ const metadata = {
974
+ entityFqdn: 'wix.bookings.v2.booking',
975
+ method: 'POST',
976
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.BulkCreateBooking',
977
+ packageName: PACKAGE_NAME,
978
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
979
+ protoPath: '/v2/bulk/bookings/create',
980
+ data: serializedData,
981
+ host,
982
+ }),
983
+ data: serializedData,
984
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
985
+ {
986
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
987
+ paths: [
988
+ { path: 'results.item.createdDate' },
989
+ { path: 'results.item.startDate' },
990
+ { path: 'results.item.endDate' },
991
+ { path: 'results.item.updatedDate' },
992
+ { path: 'results.item.canceledDate' },
993
+ ],
994
+ },
995
+ {
996
+ transformFn: float_2.transformRESTFloatToSDKFloat,
997
+ paths: [
998
+ {
999
+ path: 'results.item.contactDetails.fullAddress.geocode.latitude',
1000
+ },
1001
+ {
1002
+ path: 'results.item.contactDetails.fullAddress.geocode.longitude',
1003
+ },
1004
+ ],
1005
+ },
1006
+ ]),
1007
+ };
1008
+ return metadata;
1009
+ }
1010
+ return __bulkCreateBooking;
1011
+ }
1012
+ exports.bulkCreateBooking = bulkCreateBooking;
1013
+ /**
1014
+ * Reschedules an appointment booking to a different slot or a class booking to
1015
+ * a different session.
1016
+ *
1017
+ *
1018
+ * ## Course booking limitation
1019
+ *
1020
+ * You can't reschedule course bookings.
1021
+ *
1022
+ * ## Appointment sessions
1023
+ *
1024
+ * For appointments, the old session is removed from the business calendar
1025
+ * while a new session is added. We recommend calling Query Availability
1026
+ * ([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))
1027
+ * first and specifying the entire retrieved `slot`.
1028
+ *
1029
+ * ## Class sessions
1030
+ *
1031
+ * For classes, the new session must be an existing session belonging to the
1032
+ * same class. We recommend retrieving `availabilityEntries.slot.eventId`
1033
+ * from Query Availability
1034
+ * ([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))
1035
+ * to avoid failed Reschedule Booking calls due to unavailability. Specify
1036
+ * only `slot.eventId` instead of the entire `slot` object.
1037
+ *
1038
+ * ## Notify customers
1039
+ *
1040
+ * You can specify a `participantNotification.message` for the customer. To send
1041
+ * the message, you must also specify `participantNotification.notifyParticipants`
1042
+ * as `true`.
1043
+ *
1044
+ * ## Admin overwrites
1045
+ *
1046
+ * There are small but important differences when you specify special
1047
+ * `flowControlSettings`:
1048
+ *
1049
+ * - `{"ignoreReschedulePolicy": true}`: The call succeeds even if the
1050
+ * service's `reschedulePolicy` doesn't allow it.
1051
+ * - `{"skipAvailabilityValidation": true}`: The call succeeds even if
1052
+ * the specified session, slot, or resource isn't available. If you don't
1053
+ * specify any resource, the call succeeds even if no resource of the relevant
1054
+ * type is available.
1055
+ * - `{"skipBusinessConfirmation": true}`: Any `PENDING` booking is
1056
+ * automatically confirmed even if the services requires the merchants's
1057
+ * manual confirmation.
1058
+ *
1059
+ * When using special `flowControlSettings`, ensure you have sufficient
1060
+ * permissions. If you encounter failed calls due to insufficient permissions,
1061
+ * consider the following options:
1062
+ *
1063
+ * - **App developers** can use a higher
1064
+ * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
1065
+ * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
1066
+ * - **Site developers** can utilize
1067
+ * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
1068
+ *
1069
+ * Granting additional permissions and using elevation permits method calls that
1070
+ * would typically fail due to authorization checks. Therefore, you should use
1071
+ * them intentionally and securely.
1072
+ */
1073
+ function rescheduleBooking(payload) {
1074
+ function __rescheduleBooking({ host }) {
1075
+ const metadata = {
1076
+ entityFqdn: 'wix.bookings.v2.booking',
1077
+ method: 'POST',
1078
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.RescheduleBooking',
1079
+ packageName: PACKAGE_NAME,
1080
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1081
+ protoPath: '/v2/bookings/{bookingId}/reschedule',
1082
+ data: payload,
1083
+ host,
1084
+ }),
1085
+ data: payload,
1086
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1087
+ {
1088
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1089
+ paths: [
1090
+ { path: 'booking.createdDate' },
1091
+ { path: 'booking.startDate' },
1092
+ { path: 'booking.endDate' },
1093
+ { path: 'booking.updatedDate' },
1094
+ { path: 'booking.canceledDate' },
1095
+ ],
1096
+ },
1097
+ {
1098
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1099
+ paths: [
1100
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1101
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1102
+ ],
1103
+ },
1104
+ ]),
1105
+ };
1106
+ return metadata;
1107
+ }
1108
+ return __rescheduleBooking;
1109
+ }
1110
+ exports.rescheduleBooking = rescheduleBooking;
1111
+ /**
1112
+ * Updates the booking status to `CONFIRMED` and updates the relevant session's
1113
+ * `participants.approvalStatus` to `APPROVED` without checking whether the relevant
1114
+ * slot or schedule is still available.
1115
+ *
1116
+ * ## eCommerce checkout restriction
1117
+ *
1118
+ * Call this method only when using a custom checkout page. Don't
1119
+ * call it when using a Wix eCommerce checkout
1120
+ * ([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)).
1121
+ * In such cases, Wix automatically updates the booking status based on
1122
+ * the `paymentStatus` of the corresponding Wix eCommerce order
1123
+ * ([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)).
1124
+ *
1125
+ * ## When to call Confirm Or Decline Booking instead
1126
+ *
1127
+ * Confirm Booking doesn't check whether a slot or schedule is still available. For
1128
+ * these checks you can call Confirm or Decline Booking
1129
+ * ([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)).
1130
+ *
1131
+ * ## Original status validation
1132
+ *
1133
+ * You can only confirm bookings with a status of `PENDING`, `CREATED`, or
1134
+ * `WAITING_LIST`.
1135
+ *
1136
+ * ## Double bookings
1137
+ *
1138
+ * Confirm Booking doesn't check whether a slot or schedule is still available.
1139
+ * You can specify
1140
+ *
1141
+ * ```json
1142
+ * {
1143
+ * "flowControlSettings": {
1144
+ * "checkAvailabilityValidation": true
1145
+ * },
1146
+ * "doubleBooked": true
1147
+ * }
1148
+ * ```
1149
+ * to forcefully set the booking's `doubleBooked` flag to `true`, regardless of
1150
+ * a potential double booking conflict. You must call with `Manage Bookings`
1151
+ * permissions to do so. For the default flow control settings
1152
+ * `{"checkAvailabilityValidation": false}`, the specified `doubleBooked` value
1153
+ * is ignored.
1154
+ *
1155
+ * ## Payment status
1156
+ *
1157
+ * Also updates the booking's `paymentStatus`, if you specify a new payment
1158
+ * status.
1159
+ *
1160
+ * ## Notify customers
1161
+ *
1162
+ * You can specify a `participantNotification.message` for the customer. To send
1163
+ * the message, you must also specify `participantNotification.notifyParticipants`
1164
+ * as `true`.
1165
+ */
1166
+ function bookingsConfirmBooking(payload) {
1167
+ function __bookingsConfirmBooking({ host }) {
1168
+ const metadata = {
1169
+ entityFqdn: 'wix.bookings.v2.booking',
1170
+ method: 'POST',
1171
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.ConfirmBooking',
1172
+ packageName: PACKAGE_NAME,
1173
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1174
+ protoPath: '/v2/bookings/{bookingId}/confirm',
1175
+ data: payload,
1176
+ host,
1177
+ }),
1178
+ data: payload,
1179
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1180
+ {
1181
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1182
+ paths: [
1183
+ { path: 'booking.createdDate' },
1184
+ { path: 'booking.startDate' },
1185
+ { path: 'booking.endDate' },
1186
+ { path: 'booking.updatedDate' },
1187
+ { path: 'booking.canceledDate' },
1188
+ ],
1189
+ },
1190
+ {
1191
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1192
+ paths: [
1193
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1194
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1195
+ ],
1196
+ },
1197
+ ]),
1198
+ };
1199
+ return metadata;
1200
+ }
1201
+ return __bookingsConfirmBooking;
1202
+ }
1203
+ exports.bookingsConfirmBooking = bookingsConfirmBooking;
1204
+ /**
1205
+ * Updates the extended fields for a booking.
1206
+ *
1207
+ *
1208
+ * If you specify an extended field `namespace` that doesn't exist yet, it's
1209
+ * created.
1210
+ *
1211
+ * Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/about-backend-extensions#schema-plugin-extensions).
1212
+ */
1213
+ function updateExtendedFields(payload) {
1214
+ function __updateExtendedFields({ host }) {
1215
+ const metadata = {
1216
+ entityFqdn: 'wix.bookings.v2.booking',
1217
+ method: 'POST',
1218
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateExtendedFields',
1219
+ packageName: PACKAGE_NAME,
1220
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1221
+ protoPath: '/v2/bookings/{id}/update_extended_fields',
1222
+ data: payload,
1223
+ host,
1224
+ }),
1225
+ data: payload,
1226
+ };
1227
+ return metadata;
1228
+ }
1229
+ return __updateExtendedFields;
1230
+ }
1231
+ exports.updateExtendedFields = updateExtendedFields;
1232
+ /**
1233
+ * Updates the booking status to `DECLINED` and updates the relevant session's
1234
+ * `participants.approvalStatus` to `DECLINED` without checking whether the relevant
1235
+ * slot or schedule is still available.
1236
+ *
1237
+ *
1238
+ * ## eCommerce checkout restriction
1239
+ *
1240
+ * Call this method only when using a custom checkout page. Don't
1241
+ * call it when using a Wix eCommerce checkout
1242
+ * ([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)).
1243
+ * In such cases, Wix automatically updates the booking status based on
1244
+ * the `paymentStatus` of the corresponding Wix eCommerce order
1245
+ * ([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)).
1246
+ *
1247
+ * ## When to call Confirm Or Decline Booking instead
1248
+ *
1249
+ * The method doesn't check whether a slot or schedule is still available. For
1250
+ * these checks you can call Confirm or Decline Booking
1251
+ * ([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)).
1252
+ *
1253
+ * ## Original status validation
1254
+ *
1255
+ * You can only decline bookings with a `status` of `PENDING`, `CREATED`, or
1256
+ * `WAITING_LIST`.
1257
+ *
1258
+ * ## Payment status
1259
+ *
1260
+ * Also updates the booking's `paymentStatus`, if you specify a new payment
1261
+ * status.
1262
+ *
1263
+ * ## Notify customers
1264
+ *
1265
+ * You can specify a `participantNotification.message` for the customer. To send
1266
+ * the message, you must also specify `participantNotification.notifyParticipants`
1267
+ * as `true`.
1268
+ */
1269
+ function bookingsDeclineBooking(payload) {
1270
+ function __bookingsDeclineBooking({ host }) {
1271
+ const metadata = {
1272
+ entityFqdn: 'wix.bookings.v2.booking',
1273
+ method: 'POST',
1274
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.DeclineBooking',
1275
+ packageName: PACKAGE_NAME,
1276
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1277
+ protoPath: '/v2/bookings/{bookingId}/decline',
1278
+ data: payload,
1279
+ host,
1280
+ }),
1281
+ data: payload,
1282
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1283
+ {
1284
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1285
+ paths: [
1286
+ { path: 'booking.createdDate' },
1287
+ { path: 'booking.startDate' },
1288
+ { path: 'booking.endDate' },
1289
+ { path: 'booking.updatedDate' },
1290
+ { path: 'booking.canceledDate' },
1291
+ ],
1292
+ },
1293
+ {
1294
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1295
+ paths: [
1296
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1297
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1298
+ ],
1299
+ },
1300
+ ]),
1301
+ };
1302
+ return metadata;
1303
+ }
1304
+ return __bookingsDeclineBooking;
1305
+ }
1306
+ exports.bookingsDeclineBooking = bookingsDeclineBooking;
1307
+ /**
1308
+ * Updates the booking status to `CANCELED`.
1309
+ *
1310
+ *
1311
+ * ## Appointments
1312
+ *
1313
+ * For appointments, the corresponding event is removed from the Bookings
1314
+ * calendar.
1315
+ *
1316
+ * ## Class and course bookings
1317
+ *
1318
+ * For class or course bookings, the relevant participants are removed
1319
+ * from the class session or the course. However, the class session or course
1320
+ * remain on the business calendar.
1321
+ *
1322
+ * ## Notify customers
1323
+ *
1324
+ * You can specify a `participantNotification.message` for the customer. To send
1325
+ * the message, you must also specify `participantNotification.notifyParticipants`
1326
+ * as `true`.
1327
+ *
1328
+ * ## Admin overwrites
1329
+ *
1330
+ * There are small but important differences when you specify special
1331
+ * `flowControlSettings`:
1332
+ *
1333
+ * - `{"ignoreCancellationPolicy": true}`: The call succeeds even if the
1334
+ * service's `cancellationPolicy` doesn't allow it.
1335
+ * - `{"withRefund": true}`: The customer is refunded even if the service's
1336
+ * `refundPolicy` doesn't allow it.
1337
+ * - `{"waiveCancellationFee": true}`: The customer doesn't have to pay
1338
+ * the cancellation fee, even if the service's `cancellationPolicy` requires it.
1339
+ *
1340
+ * When using special `flowControlSettings`, ensure you have sufficient
1341
+ * permissions. If you encounter failed calls due to insufficient permissions,
1342
+ * consider the following options:
1343
+ *
1344
+ * - **App developers** can use a higher
1345
+ * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
1346
+ * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
1347
+ * - **Site developers** can utilize
1348
+ * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
1349
+ *
1350
+ * Granting additional permissions and using elevation permits method calls that
1351
+ * would typically fail due to authorization checks. Therefore, you should use
1352
+ * them intentionally and securely.
1353
+ */
1354
+ function bookingsCancelBooking(payload) {
1355
+ function __bookingsCancelBooking({ host }) {
1356
+ const metadata = {
1357
+ entityFqdn: 'wix.bookings.v2.booking',
1358
+ method: 'POST',
1359
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CancelBooking',
1360
+ packageName: PACKAGE_NAME,
1361
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1362
+ protoPath: '/v2/bookings/{bookingId}/cancel',
1363
+ data: payload,
1364
+ host,
1365
+ }),
1366
+ data: payload,
1367
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1368
+ {
1369
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1370
+ paths: [
1371
+ { path: 'booking.createdDate' },
1372
+ { path: 'booking.startDate' },
1373
+ { path: 'booking.endDate' },
1374
+ { path: 'booking.updatedDate' },
1375
+ { path: 'booking.canceledDate' },
1376
+ ],
1377
+ },
1378
+ {
1379
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1380
+ paths: [
1381
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1382
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1383
+ ],
1384
+ },
1385
+ ]),
1386
+ };
1387
+ return metadata;
1388
+ }
1389
+ return __bookingsCancelBooking;
1390
+ }
1391
+ exports.bookingsCancelBooking = bookingsCancelBooking;
1392
+ /**
1393
+ * Updates the number of participants for a class or course booking and changes
1394
+ * the `totalNumberOfParticipants` for the relevant sessions.
1395
+ *
1396
+ *
1397
+ * ## Appointment limitation
1398
+ *
1399
+ * You can't update the number of participants for appointment bookings.
1400
+ *
1401
+ * ## Participant information
1402
+ *
1403
+ * You must specify either `participantsChoices` or `totalParticipants`.
1404
+ * The call fails if the specified `participantsChoices` aren't among the
1405
+ * supported service options and variants
1406
+ * ([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)).
1407
+ */
1408
+ function bookingsUpdateNumberOfParticipants(payload) {
1409
+ function __bookingsUpdateNumberOfParticipants({ host }) {
1410
+ const metadata = {
1411
+ entityFqdn: 'wix.bookings.v2.booking',
1412
+ method: 'POST',
1413
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateNumberOfParticipants',
1414
+ packageName: PACKAGE_NAME,
1415
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1416
+ protoPath: '/v2/bookings/{bookingId}/update_number_of_participants',
1417
+ data: payload,
1418
+ host,
1419
+ }),
1420
+ data: payload,
1421
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1422
+ {
1423
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1424
+ paths: [
1425
+ { path: 'booking.createdDate' },
1426
+ { path: 'booking.startDate' },
1427
+ { path: 'booking.endDate' },
1428
+ { path: 'booking.updatedDate' },
1429
+ { path: 'booking.canceledDate' },
1430
+ ],
1431
+ },
1432
+ {
1433
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1434
+ paths: [
1435
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1436
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1437
+ ],
1438
+ },
1439
+ ]),
1440
+ };
1441
+ return metadata;
1442
+ }
1443
+ return __bookingsUpdateNumberOfParticipants;
1444
+ }
1445
+ exports.bookingsUpdateNumberOfParticipants = bookingsUpdateNumberOfParticipants;
1446
+ /**
1447
+ * Updates the booking `status` to `CONFIRMED`, `PENDING`, or `DECLINED` based
1448
+ * on the `paymentStatus` you provide, double booking conflicts, and whether
1449
+ * the service requires business approval.
1450
+ *
1451
+ * ## eCommerce checkout restriction
1452
+ *
1453
+ * Call this method only when using a custom checkout page. Don't
1454
+ * call it when using a Wix eCommerce checkout
1455
+ * ([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)).
1456
+ * In such cases, Wix automatically updates the booking status based on
1457
+ * the `paymentStatus` of the corresponding Wix eCommerce order
1458
+ * ([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)).
1459
+ *
1460
+ * ## New booking status
1461
+ *
1462
+ * The booking `status` is set to `DECLINED` if both of the following conditions
1463
+ * are met:
1464
+ * + You provide `UNDEFINED`, `NOT_PAID`, `REFUNDED`, or `EXEMPT` as payment status.
1465
+ * + There is a double booking conflict.
1466
+ *
1467
+ * If only one or none of these conditions is met, `status` is set to `PENDING`
1468
+ * or `CONFIRMED` depending on whether the service requires business approval.
1469
+ *
1470
+ * ## Double bookings
1471
+ *
1472
+ * If there is a double booking conflict, but the booking has already been at least
1473
+ * partially paid, the method still marks the booking as `PENDING` or `CONFIRMED`.
1474
+ * Then, it also sets `doubleBooked` to `true`.
1475
+ *
1476
+ * ## Admin overwrites
1477
+ *
1478
+ * There are small but important differences in confirmation behavior if the
1479
+ * booking was created with special `flowControlSettings`:
1480
+ * + If the booking's `flowControlSettings.skipAvailabilityValidation` was set to
1481
+ * `true`, the booking is never declined regardless of double booking conflicts.
1482
+ * Instead, it's marked `CONFIRMED` or `PENDING`, depending on whether the
1483
+ * service requires business approval.
1484
+ * + If the booking's `flowControlSettings.skipBusinessConfirmation` was set to
1485
+ * `true`, the booking skips `PENDING` status and is marked `CONFIRMED`
1486
+ * immediately.
1487
+ */
1488
+ function confirmOrDeclineBooking(payload) {
1489
+ function __confirmOrDeclineBooking({ host }) {
1490
+ const metadata = {
1491
+ entityFqdn: 'wix.bookings.v2.booking',
1492
+ method: 'POST',
1493
+ methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.ConfirmOrDeclineBooking',
1494
+ packageName: PACKAGE_NAME,
1495
+ url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
1496
+ protoPath: '/v2/confirmation/{bookingId}:confirmOrDecline',
1497
+ data: payload,
1498
+ host,
1499
+ }),
1500
+ data: payload,
1501
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1502
+ {
1503
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1504
+ paths: [
1505
+ { path: 'booking.createdDate' },
1506
+ { path: 'booking.startDate' },
1507
+ { path: 'booking.endDate' },
1508
+ { path: 'booking.updatedDate' },
1509
+ { path: 'booking.canceledDate' },
1510
+ ],
1511
+ },
1512
+ {
1513
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1514
+ paths: [
1515
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1516
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1517
+ ],
1518
+ },
1519
+ ]),
1520
+ };
1521
+ return metadata;
1522
+ }
1523
+ return __confirmOrDeclineBooking;
1524
+ }
1525
+ exports.confirmOrDeclineBooking = confirmOrDeclineBooking;
1526
+ /**
1527
+ * Confirms or declines up to 300 bookings.
1528
+ *
1529
+ *
1530
+ * See Confirm Or Decline Booking
1531
+ * ([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))
1532
+ * for details about when a booking is confirmed or declined.
1533
+ */
1534
+ function bulkConfirmOrDeclineBooking(payload) {
1535
+ function __bulkConfirmOrDeclineBooking({ host }) {
1536
+ const metadata = {
1537
+ entityFqdn: 'wix.bookings.v2.booking',
1538
+ method: 'POST',
1539
+ methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.BulkConfirmOrDeclineBooking',
1540
+ packageName: PACKAGE_NAME,
1541
+ url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
1542
+ protoPath: '/v2/bulk/bookings/confirmOrDecline',
1543
+ data: payload,
1544
+ host,
1545
+ }),
1546
+ data: payload,
1547
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1548
+ {
1549
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1550
+ paths: [
1551
+ { path: 'results.item.createdDate' },
1552
+ { path: 'results.item.startDate' },
1553
+ { path: 'results.item.endDate' },
1554
+ { path: 'results.item.updatedDate' },
1555
+ { path: 'results.item.canceledDate' },
1556
+ ],
1557
+ },
1558
+ {
1559
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1560
+ paths: [
1561
+ {
1562
+ path: 'results.item.contactDetails.fullAddress.geocode.latitude',
1563
+ },
1564
+ {
1565
+ path: 'results.item.contactDetails.fullAddress.geocode.longitude',
1566
+ },
1567
+ ],
1568
+ },
1569
+ ]),
1570
+ };
1571
+ return metadata;
1572
+ }
1573
+ return __bulkConfirmOrDeclineBooking;
1574
+ }
1575
+ exports.bulkConfirmOrDeclineBooking = bulkConfirmOrDeclineBooking;
1576
+ //# sourceMappingURL=bookings-v2-booking-bookings.http.js.map