@wix/auto_sdk_bookings_bookings 1.0.15 → 1.0.17

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