@wix/auto_sdk_bookings_bookings 1.0.24 → 1.0.26

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