@wix/bookings 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +2 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/bookings-services-v2-service.http.d.ts +21 -0
- package/build/cjs/src/bookings-services-v2-service.http.js +175 -0
- package/build/cjs/src/bookings-services-v2-service.http.js.map +1 -0
- package/build/cjs/src/bookings-services-v2-service.public.d.ts +5 -0
- package/build/cjs/src/bookings-services-v2-service.public.js +25 -0
- package/build/cjs/src/bookings-services-v2-service.public.js.map +1 -0
- package/build/cjs/src/bookings-services-v2-service.types.d.ts +958 -0
- package/build/cjs/src/bookings-services-v2-service.types.js +64 -0
- package/build/cjs/src/bookings-services-v2-service.types.js.map +1 -0
- package/build/cjs/src/bookings-services-v2-service.universal.d.ts +1034 -0
- package/build/cjs/src/bookings-services-v2-service.universal.js +272 -0
- package/build/cjs/src/bookings-services-v2-service.universal.js.map +1 -0
- package/build/cjs/src/bookings-v2-booking.http.d.ts +22 -1
- package/build/cjs/src/bookings-v2-booking.http.js +60 -1
- package/build/cjs/src/bookings-v2-booking.http.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking.public.d.ts +3 -2
- package/build/cjs/src/bookings-v2-booking.public.js +7 -1
- package/build/cjs/src/bookings-v2-booking.public.js.map +1 -1
- package/build/cjs/src/bookings-v2-booking.types.d.ts +1 -1
- package/build/cjs/src/bookings-v2-booking.universal.d.ts +32 -1
- package/build/cjs/src/bookings-v2-booking.universal.js +76 -1
- package/build/cjs/src/bookings-v2-booking.universal.js.map +1 -1
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/es/index.js.map +1 -1
- package/build/es/src/bookings-services-v2-service.http.d.ts +21 -0
- package/build/es/src/bookings-services-v2-service.http.js +170 -0
- package/build/es/src/bookings-services-v2-service.http.js.map +1 -0
- package/build/es/src/bookings-services-v2-service.public.d.ts +5 -0
- package/build/es/src/bookings-services-v2-service.public.js +13 -0
- package/build/es/src/bookings-services-v2-service.public.js.map +1 -0
- package/build/es/src/bookings-services-v2-service.types.d.ts +958 -0
- package/build/es/src/bookings-services-v2-service.types.js +61 -0
- package/build/es/src/bookings-services-v2-service.types.js.map +1 -0
- package/build/es/src/bookings-services-v2-service.universal.d.ts +1034 -0
- package/build/es/src/bookings-services-v2-service.universal.js +248 -0
- package/build/es/src/bookings-services-v2-service.universal.js.map +1 -0
- package/build/es/src/bookings-v2-booking.http.d.ts +22 -1
- package/build/es/src/bookings-v2-booking.http.js +58 -0
- package/build/es/src/bookings-v2-booking.http.js.map +1 -1
- package/build/es/src/bookings-v2-booking.public.d.ts +3 -2
- package/build/es/src/bookings-v2-booking.public.js +6 -1
- package/build/es/src/bookings-v2-booking.public.js.map +1 -1
- package/build/es/src/bookings-v2-booking.types.d.ts +1 -1
- package/build/es/src/bookings-v2-booking.universal.d.ts +32 -1
- package/build/es/src/bookings-v2-booking.universal.js +74 -0
- package/build/es/src/bookings-v2-booking.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.queryServices = exports.getService = exports.InvalidSlugError = exports.Event = exports.Status = exports.SortOrder = exports.LocationType = exports.RateType = exports.ServiceType = exports.__debug = void 0;
|
|
32
|
+
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
|
+
const ambassadorWixBookingsServicesV2Service = __importStar(require("./bookings-services-v2-service.http"));
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
|
|
36
|
+
let __verbose = false;
|
|
37
|
+
function __log(...args) {
|
|
38
|
+
__verbose && console.log(...args);
|
|
39
|
+
}
|
|
40
|
+
function __inspect(obj) {
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
exports.__debug = {
|
|
44
|
+
verboseLogging: {
|
|
45
|
+
on: () => (__verbose = true),
|
|
46
|
+
off: () => (__verbose = false),
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
const _toVeloEntity = '$';
|
|
50
|
+
const _fromVeloEntity = '$';
|
|
51
|
+
var ServiceType;
|
|
52
|
+
(function (ServiceType) {
|
|
53
|
+
ServiceType["UNKNOWN_SERVICE_TYPE"] = "UNKNOWN_SERVICE_TYPE";
|
|
54
|
+
/** The service is an appointment. */
|
|
55
|
+
ServiceType["APPOINTMENT"] = "APPOINTMENT";
|
|
56
|
+
/** The service is a class. */
|
|
57
|
+
ServiceType["CLASS"] = "CLASS";
|
|
58
|
+
/** The service is a course. */
|
|
59
|
+
ServiceType["COURSE"] = "COURSE";
|
|
60
|
+
})(ServiceType = exports.ServiceType || (exports.ServiceType = {}));
|
|
61
|
+
var RateType;
|
|
62
|
+
(function (RateType) {
|
|
63
|
+
RateType["UNKNOWN_RATE_TYPE"] = "UNKNOWN_RATE_TYPE";
|
|
64
|
+
/** The service has a fixed price. */
|
|
65
|
+
RateType["FIXED"] = "FIXED";
|
|
66
|
+
/** The service has a custom price, expressed as a price description. */
|
|
67
|
+
RateType["CUSTOM"] = "CUSTOM";
|
|
68
|
+
/** This service is offered with a set of different prices based on different terms. */
|
|
69
|
+
RateType["VARIED"] = "VARIED";
|
|
70
|
+
/** This service is offered free of charge. */
|
|
71
|
+
RateType["NO_FEE"] = "NO_FEE";
|
|
72
|
+
})(RateType = exports.RateType || (exports.RateType = {}));
|
|
73
|
+
var LocationType;
|
|
74
|
+
(function (LocationType) {
|
|
75
|
+
LocationType["UNKNOWN_LOCATION_TYPE"] = "UNKNOWN_LOCATION_TYPE";
|
|
76
|
+
/** The location is unique to this service and isn't defined as one of the business locations. */
|
|
77
|
+
LocationType["CUSTOM"] = "CUSTOM";
|
|
78
|
+
/** The location is one of the business locations available using the Business Info [Locations API](https://dev.wix.com/api/rest/business-info/locations). */
|
|
79
|
+
LocationType["BUSINESS"] = "BUSINESS";
|
|
80
|
+
/** The location can be determined by the customer and is not set up beforehand. This is applicable to services of type `APPOINTMENT` only. */
|
|
81
|
+
LocationType["CUSTOMER"] = "CUSTOMER";
|
|
82
|
+
})(LocationType = exports.LocationType || (exports.LocationType = {}));
|
|
83
|
+
var SortOrder;
|
|
84
|
+
(function (SortOrder) {
|
|
85
|
+
SortOrder["ASC"] = "ASC";
|
|
86
|
+
SortOrder["DESC"] = "DESC";
|
|
87
|
+
})(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
|
|
88
|
+
var Status;
|
|
89
|
+
(function (Status) {
|
|
90
|
+
/** Default status. */
|
|
91
|
+
Status["CREATED"] = "CREATED";
|
|
92
|
+
/** Category is deleted. */
|
|
93
|
+
Status["DELETED"] = "DELETED";
|
|
94
|
+
})(Status = exports.Status || (exports.Status = {}));
|
|
95
|
+
var Event;
|
|
96
|
+
(function (Event) {
|
|
97
|
+
Event["Updated"] = "Updated";
|
|
98
|
+
Event["Deleted"] = "Deleted";
|
|
99
|
+
Event["Created"] = "Created";
|
|
100
|
+
})(Event = exports.Event || (exports.Event = {}));
|
|
101
|
+
var InvalidSlugError;
|
|
102
|
+
(function (InvalidSlugError) {
|
|
103
|
+
InvalidSlugError["UNKNOWN_SLUG_ERROR"] = "UNKNOWN_SLUG_ERROR";
|
|
104
|
+
/** The provided slug name exceeds the maximum amount of characters for slug. */
|
|
105
|
+
InvalidSlugError["SLUG_IS_TOO_LONG"] = "SLUG_IS_TOO_LONG";
|
|
106
|
+
/** The provided slug name contains illegal characters. */
|
|
107
|
+
InvalidSlugError["SLUG_CONTAIN_ILLEGAL_CHARACTERS"] = "SLUG_CONTAIN_ILLEGAL_CHARACTERS";
|
|
108
|
+
/** The provided slug name already exists for the same or another service. */
|
|
109
|
+
InvalidSlugError["SLUG_ALREADY_EXISTS"] = "SLUG_ALREADY_EXISTS";
|
|
110
|
+
})(InvalidSlugError = exports.InvalidSlugError || (exports.InvalidSlugError = {}));
|
|
111
|
+
const _businessLocationOptions = { address: 'wix.common.Address' };
|
|
112
|
+
const _customLocationOptions = { address: 'wix.common.Address' };
|
|
113
|
+
const _getServiceRequest = {};
|
|
114
|
+
const _getServiceResponse = { service: '_service' };
|
|
115
|
+
const _location = {
|
|
116
|
+
address: 'wix.common.Address',
|
|
117
|
+
business: '_businessLocationOptions',
|
|
118
|
+
custom: '_customLocationOptions',
|
|
119
|
+
};
|
|
120
|
+
const _media = {
|
|
121
|
+
items: '_mediaItem',
|
|
122
|
+
mainMedia: '_mediaItem',
|
|
123
|
+
coverMedia: '_mediaItem',
|
|
124
|
+
};
|
|
125
|
+
const _mediaItem = { image: 'wix.common.Image' };
|
|
126
|
+
const _queryServicesRequest = {};
|
|
127
|
+
const _queryServicesResponse = { services: '_service' };
|
|
128
|
+
const _service = { media: '_media', locations: '_location', urls: '_uRLs' };
|
|
129
|
+
const _uRLs = {
|
|
130
|
+
servicePage: 'wix.common.PageUrlV2',
|
|
131
|
+
bookingPage: 'wix.common.PageUrlV2',
|
|
132
|
+
calendarPage: 'wix.common.PageUrlV2',
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Get a Service by id.
|
|
136
|
+
* @param serviceId - Id of the Service to retrieve
|
|
137
|
+
* @public
|
|
138
|
+
* @documentationMaturity preview
|
|
139
|
+
* @requiredField serviceId
|
|
140
|
+
* @returns The retrieved Service
|
|
141
|
+
*/
|
|
142
|
+
function getService(serviceId) {
|
|
143
|
+
var _a, _b, _c;
|
|
144
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
145
|
+
const requestTransformation = { serviceId: '$[0]' };
|
|
146
|
+
const responseTransformation = '$.service';
|
|
147
|
+
// @ts-ignore
|
|
148
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
149
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
150
|
+
rootSchema: _getServiceRequest,
|
|
151
|
+
depSchemas: {},
|
|
152
|
+
fqdnTransformation: {
|
|
153
|
+
paths: [],
|
|
154
|
+
transformation: _fromVeloEntity,
|
|
155
|
+
},
|
|
156
|
+
customTransformation: requestTransformation,
|
|
157
|
+
});
|
|
158
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
159
|
+
rootSchema: _getServiceResponse,
|
|
160
|
+
depSchemas: {
|
|
161
|
+
_businessLocationOptions,
|
|
162
|
+
_customLocationOptions,
|
|
163
|
+
_location,
|
|
164
|
+
_media,
|
|
165
|
+
_mediaItem,
|
|
166
|
+
_service,
|
|
167
|
+
_uRLs,
|
|
168
|
+
},
|
|
169
|
+
fqdnTransformation: {
|
|
170
|
+
paths: [...['service']],
|
|
171
|
+
transformation: _toVeloEntity,
|
|
172
|
+
},
|
|
173
|
+
customTransformation: responseTransformation,
|
|
174
|
+
});
|
|
175
|
+
const payload = toAmbassadorRequest([serviceId]);
|
|
176
|
+
const reqOpts = ambassadorWixBookingsServicesV2Service.getService(payload);
|
|
177
|
+
__log(`"GetService" sending request with: ${__inspect(reqOpts)}`);
|
|
178
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
179
|
+
try {
|
|
180
|
+
const result = yield httpClient.request(reqOpts);
|
|
181
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
182
|
+
return fromJSON(result.data);
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
186
|
+
'serviceId',
|
|
187
|
+
]);
|
|
188
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
189
|
+
throw transformedError;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
exports.getService = getService;
|
|
194
|
+
/**
|
|
195
|
+
* <!--ONLY:REST-->
|
|
196
|
+
* Query Services using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) with [Cursor paging](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_cursor-paging) only.
|
|
197
|
+
* Retrieves a list of services according to the provided filters and paging.
|
|
198
|
+
*
|
|
199
|
+
* To retrieve all services use an empty query:
|
|
200
|
+
* ```javascript
|
|
201
|
+
* {
|
|
202
|
+
* "query": {}
|
|
203
|
+
* }
|
|
204
|
+
* ```
|
|
205
|
+
* >**Notes:**
|
|
206
|
+
* > + Use UTC when specifying filters with dates.
|
|
207
|
+
* > - Only 1 use at a time of each filter once in the same query is supported. If a filter is defined more than once in a query, only the first occurrence is taken.
|
|
208
|
+
* <!--END:ONLY:REST-->
|
|
209
|
+
* @public
|
|
210
|
+
* @documentationMaturity preview
|
|
211
|
+
*/
|
|
212
|
+
function queryServices() {
|
|
213
|
+
const requestTransformation = { '*': '$[1]', query: '$[0]' };
|
|
214
|
+
const responseTransformation = {
|
|
215
|
+
items: '$.services',
|
|
216
|
+
pagingMetadata: '$.pagingMetadata',
|
|
217
|
+
};
|
|
218
|
+
// @ts-ignore
|
|
219
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
220
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
221
|
+
rootSchema: _queryServicesRequest,
|
|
222
|
+
depSchemas: {},
|
|
223
|
+
fqdnTransformation: {
|
|
224
|
+
paths: [],
|
|
225
|
+
transformation: _fromVeloEntity,
|
|
226
|
+
},
|
|
227
|
+
customTransformation: requestTransformation,
|
|
228
|
+
});
|
|
229
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
230
|
+
rootSchema: _queryServicesResponse,
|
|
231
|
+
depSchemas: {
|
|
232
|
+
_businessLocationOptions,
|
|
233
|
+
_customLocationOptions,
|
|
234
|
+
_location,
|
|
235
|
+
_media,
|
|
236
|
+
_mediaItem,
|
|
237
|
+
_service,
|
|
238
|
+
_uRLs,
|
|
239
|
+
},
|
|
240
|
+
fqdnTransformation: {
|
|
241
|
+
paths: [...['Array#services']],
|
|
242
|
+
transformation: _toVeloEntity,
|
|
243
|
+
},
|
|
244
|
+
customTransformation: responseTransformation,
|
|
245
|
+
});
|
|
246
|
+
return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
|
|
247
|
+
func: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
var _a, _b, _c;
|
|
249
|
+
const reqOpts = ambassadorWixBookingsServicesV2Service.queryServices(payload);
|
|
250
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
251
|
+
try {
|
|
252
|
+
const result = yield httpClient.request(reqOpts);
|
|
253
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
catch (err) {
|
|
257
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
258
|
+
throw err;
|
|
259
|
+
}
|
|
260
|
+
}),
|
|
261
|
+
requestTransformer: (...args) => toAmbassadorRequest(args),
|
|
262
|
+
responseTransformer: ({ data }) => fromJSON(data),
|
|
263
|
+
errorTransformer: (err) => {
|
|
264
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation);
|
|
265
|
+
throw transformedError;
|
|
266
|
+
},
|
|
267
|
+
pagingMethod: 'CURSOR',
|
|
268
|
+
transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
|
|
269
|
+
})({ cursorWithEmptyFilterAndSort: true });
|
|
270
|
+
}
|
|
271
|
+
exports.queryServices = queryServices;
|
|
272
|
+
//# sourceMappingURL=bookings-services-v2-service.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-services-v2-service.universal.js","sourceRoot":"","sources":["../../../src/bookings-services-v2-service.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAIiC;AAEjC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qBAAqB,CAAC,CAAC;YAEpE,MAAM,gBAAgB,CAAC;QACzB,CAAC;QACD,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,IAAA,4CAAqC,EAAC,aAAa,CAAC;KAC1E,CAAC,CAAC,EAAE,4BAA4B,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC;AAlED,sCAkEC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
-
import { CancelBookingRequest, CancelBookingResponse, ConfirmBookingRequest, ConfirmBookingResponse, CreateBookingRequest, CreateBookingResponse, DeclineBookingRequest, DeclineBookingResponse, RescheduleBookingRequest, RescheduleBookingResponse, UpdateNumberOfParticipantsRequest, UpdateNumberOfParticipantsResponse } from './bookings-v2-booking.types';
|
|
2
|
+
import { CancelBookingRequest, CancelBookingResponse, ConfirmBookingRequest, ConfirmBookingResponse, CreateBookingRequest, CreateBookingResponse, DeclineBookingRequest, DeclineBookingResponse, RescheduleBookingRequest, RescheduleBookingResponse, UpdateNumberOfParticipantsRequest, UpdateNumberOfParticipantsResponse, ConfirmOrDeclineBookingRequest, ConfirmOrDeclineBookingResponse } from './bookings-v2-booking.types';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a booking.
|
|
5
5
|
*
|
|
@@ -160,3 +160,24 @@ export declare function bookingsCancelBooking(payload: CancelBookingRequest): Re
|
|
|
160
160
|
* call returns an `INVALID_SERVICE_CHOICES` error.
|
|
161
161
|
*/
|
|
162
162
|
export declare function bookingsUpdateNumberOfParticipants(payload: UpdateNumberOfParticipantsRequest): RequestOptionsFactory<UpdateNumberOfParticipantsResponse>;
|
|
163
|
+
/**
|
|
164
|
+
* The table below explains how the new booking status is set. It takes into account the following parameters:
|
|
165
|
+
* 1. `skipBusinessConfirmation` as set on the `Booking` entity on creation
|
|
166
|
+
* 2. `doubleBooking` - which indicates if this booking might cause over-booking. See details below.
|
|
167
|
+
* 3. `payment`, which is `true` if the `paymentStatus` that is passed is either `PAID` or `PARTIALLY_PAID`.
|
|
168
|
+
* | | doubleBooking=false, payment = false | doubleBooking=false, payment = true | doubleBooking=true, payment = false | doubleBooking=true, payment = true |
|
|
169
|
+
* |-------------------------------- |-------------------------------------- |------------------------------------- |------------------------------------- |------------------------------------ |
|
|
170
|
+
* | skipBusinessConfirmation=true | CONFIRMED | CONFIRMED | declined | CONFIRMED |
|
|
171
|
+
* | skipBusinessConfirmation=false | CONFIRMED/PENDING * | CONFIRMED/PENDING * | declined | CONFIRMED/PENDING * |
|
|
172
|
+
* * depends if the service policy is defined with isBusinessApprovalRequired=true
|
|
173
|
+
*
|
|
174
|
+
* How `doubleBooking` is calculated:
|
|
175
|
+
* 1. If `skipAvailabilityValidation` that is set on the booking is `true`, the booking will never be considered as doubleBooking.
|
|
176
|
+
* 2. If `skipAvailabilityValidation` is false:
|
|
177
|
+
* 1. For class and course bookings, the bookings is considered as **NOT** double booking if the session/schedule
|
|
178
|
+
* capacity, minus number of `CONFIRMED` bookings to the same session/schedule is bigger than the number of participants
|
|
179
|
+
* on the booking, as set in `totalParticipants`/`participantsChoices`
|
|
180
|
+
* 2. For appointment bookings, the booking is considered as **NOT** double booking if there are no
|
|
181
|
+
* overlapping bookings of the same staff member and the same service
|
|
182
|
+
*/
|
|
183
|
+
export declare function confirmOrDeclineBooking(payload: ConfirmOrDeclineBookingRequest): RequestOptionsFactory<ConfirmOrDeclineBookingResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bookingsUpdateNumberOfParticipants = exports.bookingsCancelBooking = exports.bookingsDeclineBooking = exports.bookingsConfirmBooking = exports.rescheduleBooking = exports.createBooking = void 0;
|
|
3
|
+
exports.confirmOrDeclineBooking = exports.bookingsUpdateNumberOfParticipants = exports.bookingsCancelBooking = exports.bookingsDeclineBooking = exports.bookingsConfirmBooking = exports.rescheduleBooking = exports.createBooking = void 0;
|
|
4
4
|
const ambassador_1 = require("@wix/metro-runtime/ambassador");
|
|
5
5
|
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
6
6
|
const _address = { geocode: '_addressLocation' };
|
|
@@ -19,6 +19,8 @@ const _cancelBookingRequest = {};
|
|
|
19
19
|
const _cancelBookingResponse = { booking: '_booking' };
|
|
20
20
|
const _confirmBookingRequest = {};
|
|
21
21
|
const _confirmBookingResponse = { booking: '_booking' };
|
|
22
|
+
const _confirmOrDeclineBookingRequest = {};
|
|
23
|
+
const _confirmOrDeclineBookingResponse = { booking: '_booking' };
|
|
22
24
|
const _contactDetails = { fullAddress: '_address' };
|
|
23
25
|
const _createBookingRequest = { booking: '_booking' };
|
|
24
26
|
const _createBookingResponse = { booking: '_booking' };
|
|
@@ -28,6 +30,17 @@ const _rescheduleBookingRequest = {};
|
|
|
28
30
|
const _rescheduleBookingResponse = { booking: '_booking' };
|
|
29
31
|
const _updateNumberOfParticipantsRequest = {};
|
|
30
32
|
const _updateNumberOfParticipantsResponse = { booking: '_booking' };
|
|
33
|
+
function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
|
|
34
|
+
const domainToMappings = {
|
|
35
|
+
'www.wixapis.com': [
|
|
36
|
+
{
|
|
37
|
+
srcPath: '/_api/bookings-confirmator/v2/bookings/confirmation',
|
|
38
|
+
destPath: '/v2/bookings/confirmation',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
return (0, metro_runtime_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
43
|
+
}
|
|
31
44
|
function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
|
|
32
45
|
const domainToMappings = {
|
|
33
46
|
_: [
|
|
@@ -368,4 +381,50 @@ function bookingsUpdateNumberOfParticipants(payload) {
|
|
|
368
381
|
return __bookingsUpdateNumberOfParticipants;
|
|
369
382
|
}
|
|
370
383
|
exports.bookingsUpdateNumberOfParticipants = bookingsUpdateNumberOfParticipants;
|
|
384
|
+
/**
|
|
385
|
+
* The table below explains how the new booking status is set. It takes into account the following parameters:
|
|
386
|
+
* 1. `skipBusinessConfirmation` as set on the `Booking` entity on creation
|
|
387
|
+
* 2. `doubleBooking` - which indicates if this booking might cause over-booking. See details below.
|
|
388
|
+
* 3. `payment`, which is `true` if the `paymentStatus` that is passed is either `PAID` or `PARTIALLY_PAID`.
|
|
389
|
+
* | | doubleBooking=false, payment = false | doubleBooking=false, payment = true | doubleBooking=true, payment = false | doubleBooking=true, payment = true |
|
|
390
|
+
* |-------------------------------- |-------------------------------------- |------------------------------------- |------------------------------------- |------------------------------------ |
|
|
391
|
+
* | skipBusinessConfirmation=true | CONFIRMED | CONFIRMED | declined | CONFIRMED |
|
|
392
|
+
* | skipBusinessConfirmation=false | CONFIRMED/PENDING * | CONFIRMED/PENDING * | declined | CONFIRMED/PENDING * |
|
|
393
|
+
* * depends if the service policy is defined with isBusinessApprovalRequired=true
|
|
394
|
+
*
|
|
395
|
+
* How `doubleBooking` is calculated:
|
|
396
|
+
* 1. If `skipAvailabilityValidation` that is set on the booking is `true`, the booking will never be considered as doubleBooking.
|
|
397
|
+
* 2. If `skipAvailabilityValidation` is false:
|
|
398
|
+
* 1. For class and course bookings, the bookings is considered as **NOT** double booking if the session/schedule
|
|
399
|
+
* capacity, minus number of `CONFIRMED` bookings to the same session/schedule is bigger than the number of participants
|
|
400
|
+
* on the booking, as set in `totalParticipants`/`participantsChoices`
|
|
401
|
+
* 2. For appointment bookings, the booking is considered as **NOT** double booking if there are no
|
|
402
|
+
* overlapping bookings of the same staff member and the same service
|
|
403
|
+
*/
|
|
404
|
+
function confirmOrDeclineBooking(payload) {
|
|
405
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_confirmOrDeclineBookingRequest, {});
|
|
406
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_confirmOrDeclineBookingResponse, {
|
|
407
|
+
_address,
|
|
408
|
+
_addressLocation,
|
|
409
|
+
_booking,
|
|
410
|
+
_contactDetails,
|
|
411
|
+
});
|
|
412
|
+
function __confirmOrDeclineBooking({ host }) {
|
|
413
|
+
const serializedData = toReq(payload);
|
|
414
|
+
const metadata = {
|
|
415
|
+
method: 'POST',
|
|
416
|
+
url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
|
|
417
|
+
protoPath: '/v2/bookings/confirmation/{booking_id}:confirmOrDecline',
|
|
418
|
+
data: serializedData,
|
|
419
|
+
host,
|
|
420
|
+
}),
|
|
421
|
+
data: serializedData,
|
|
422
|
+
transformResponse: fromRes,
|
|
423
|
+
};
|
|
424
|
+
return metadata;
|
|
425
|
+
}
|
|
426
|
+
__confirmOrDeclineBooking.fromReq = fromReq;
|
|
427
|
+
return __confirmOrDeclineBooking;
|
|
428
|
+
}
|
|
429
|
+
exports.confirmOrDeclineBooking = confirmOrDeclineBooking;
|
|
371
430
|
//# sourceMappingURL=bookings-v2-booking.http.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings-v2-booking.http.js","sourceRoot":"","sources":["../../../src/bookings-v2-booking.http.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,sDAAgD;
|
|
1
|
+
{"version":3,"file":"bookings-v2-booking.http.js","sourceRoot":"","sources":["../../../src/bookings-v2-booking.http.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,sDAAgD;AAoBhD,MAAM,QAAQ,GAAG,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACjD,MAAM,gBAAgB,GAAG;IACvB,QAAQ,EAAE,6BAA6B;IACvC,SAAS,EAAE,6BAA6B;CACzC,CAAC;AACF,MAAM,QAAQ,GAAG;IACf,WAAW,EAAE,2BAA2B;IACxC,SAAS,EAAE,2BAA2B;IACtC,OAAO,EAAE,2BAA2B;IACpC,WAAW,EAAE,2BAA2B;IACxC,cAAc,EAAE,iBAAiB;CAClC,CAAC;AACF,MAAM,qBAAqB,GAAG,EA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iCC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
-
import { Booking, V2Slot, CancelBookingOptions, ConfirmBookingOptions, CreateBookingOptions, DeclineBookingOptions, RescheduleBookingOptions, UpdateNumberOfParticipantsOptions } from './bookings-v2-booking.universal';
|
|
2
|
+
import { Booking, V2Slot, CancelBookingOptions, ConfirmBookingOptions, ConfirmOrDeclineBookingOptions, CreateBookingOptions, DeclineBookingOptions, RescheduleBookingOptions, UpdateNumberOfParticipantsOptions } from './bookings-v2-booking.universal';
|
|
3
3
|
export declare function createBooking(httpClient: HttpClient): (booking: Booking, options?: CreateBookingOptions | undefined) => Promise<import("./bookings-v2-booking.universal").CreateBookingResponse>;
|
|
4
4
|
export declare function rescheduleBooking(httpClient: HttpClient): (bookingId: string, slot: V2Slot, options?: RescheduleBookingOptions | undefined) => Promise<import("./bookings-v2-booking.universal").RescheduleBookingResponse>;
|
|
5
5
|
export declare function confirmBooking(httpClient: HttpClient): (bookingId: string, revision: string | null, options?: ConfirmBookingOptions | undefined) => Promise<import("./bookings-v2-booking.universal").ConfirmBookingResponse>;
|
|
6
6
|
export declare function declineBooking(httpClient: HttpClient): (bookingId: string, revision: string | null, options?: DeclineBookingOptions | undefined) => Promise<import("./bookings-v2-booking.universal").DeclineBookingResponse>;
|
|
7
7
|
export declare function cancelBooking(httpClient: HttpClient): (bookingId: string, options?: CancelBookingOptions | undefined) => Promise<import("./bookings-v2-booking.universal").CancelBookingResponse>;
|
|
8
8
|
export declare function updateNumberOfParticipants(httpClient: HttpClient): (bookingId: string, options?: UpdateNumberOfParticipantsOptions | undefined) => Promise<import("./bookings-v2-booking.universal").UpdateNumberOfParticipantsResponse>;
|
|
9
|
+
export declare function confirmOrDeclineBooking(httpClient: HttpClient): (bookingId: string, options?: ConfirmOrDeclineBookingOptions | undefined) => Promise<import("./bookings-v2-booking.universal").ConfirmOrDeclineBookingResponse>;
|
|
9
10
|
export { LocationType, ValueType, BookingStatus, PaymentStatus, SelectedPaymentOption, Platform, Actor, IdentificationDataIdentityType, LocationLocationType, SortOrder, IdentityType, } from './bookings-v2-booking.universal';
|
|
10
|
-
export { Booking, BookingParticipantsInfoOneOf, BookedEntity, BookedEntityItemOneOf, BookedSlot, BookedResource, Location, BookedSchedule, ContactDetails, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, CustomFormField, BookingSource, ParticipantNotification, CommonIdentificationData, CommonIdentificationDataIdOneOf, FlowControlSettings, ExtendedFields, ParticipantChoices, ServiceChoices, ServiceChoice, ServiceChoiceChoiceOneOf, BookingChanged, CreateBookingRequest, CreateBookingFlowControlSettings, CreateBookingResponse, UpdateBookingRequest, UpdateBookingResponse, LegacyCreateBookingRequest, LegacyCreateBookingResponse, BulkUpdateBookingRequest, MaskedBooking, BulkUpdateBookingResponse, ItemMetadata, ApplicationError, BulkActionMetadata, BulkCreateBookingRequest, CreateBookingInfo, BulkCreateBookingResponse, BulkBookingResult, RescheduleBookingRequest, RescheduleBookingRequestParticipantsInfoOneOf, V2Slot, SlotSlotResource, SlotLocation, RescheduleBookingRequestFlowControlSettings, RescheduleBookingResponse, BulkRescheduleBookingRequest, BulkRescheduleBookingRequestBooking, SlotBookings, BulkRescheduleBookingResponse, BulkUpdateBookedScheduleRequest, BookingDetails, BulkUpdateBookedScheduleResponse, QueryBookingsRequest, QueryV2, QueryV2PagingMethodOneOf, Sorting, Paging, CursorPaging, QueryBookingsResponse, PagingMetadataV2, Cursors, ConfirmRequest, ConfirmResponse, ConfirmBookingRequest, ConfirmBookingResponse, PartySizeRequest, PartySizeRequestPartySizeForOneOf, PartySizeResponse, ConsistentQueryBookingsRequest, ConsistentQueryBookingsResponse, SetBookingSessionIdRequest, SetBookingSessionIdResponse, UpdateExtendedFieldsRequest, UpdateExtendedFieldsResponse, DeclineBookingRequest, DeclineBookingResponse, BookingDeclined, IdentificationData, IdentificationDataIdOneOf, CancelBookingRequest, CancelBookingRequestFlowControlSettings, CancelBookingResponse, BookingCanceled, UpdateNumberOfParticipantsRequest, UpdateNumberOfParticipantsRequestParticipantsInfoOneOf, UpdateNumberOfParticipantsResponse, CalculateAllowedActionsRequest, CalculateAllowedActionsResponse, AllowedActions, BulkCalculateAllowedActionsRequest, BulkCalculateAllowedActionsResponse, BulkCalculateAllowedActionsResult, GetSlotAvailabilityRequest, GetSlotAvailabilityResponse, SlotAvailability, WaitingList, BookingPolicyViolations, BookingPolicySettings, GetScheduleAvailabilityRequest, GetScheduleAvailabilityResponse, ScheduleAvailability, ConfirmOrDeclineRequest, ConfirmOrDeclineResponse, ConfirmOrDeclineBookingRequest, ConfirmOrDeclineBookingResponse, BookingAlreadySetPayload, V2CreateBookingRequest, V2CreateBookingRequestBookableItemOneOf, V2CreateBookingRequestParticipantsInfoOneOf, Slot, SlotResource, CreateBookingRequestFlowControlSettings, V2CreateBookingResponse, V2CancelBookingRequest, V2CancelBookingRequestFlowControlSettings, V2CancelBookingResponse, V2RescheduleBookingRequest, V2RescheduleBookingRequestParticipantsInfoOneOf, V2RescheduleBookingRequestFlowControlSettings, V2RescheduleBookingResponse, V2ConfirmBookingRequest, V2ConfirmBookingResponse, V2DeclineBookingRequest, V2DeclineBookingResponse, V2UpdateNumberOfParticipantsRequest, V2UpdateNumberOfParticipantsRequestParticipantsInfoOneOf, V2UpdateNumberOfParticipantsResponse, CreateBookingOptions, RescheduleBookingOptions, ConfirmBookingOptions, DeclineBookingOptions, CancelBookingOptions, UpdateNumberOfParticipantsOptions, } from './bookings-v2-booking.universal';
|
|
11
|
+
export { Booking, BookingParticipantsInfoOneOf, BookedEntity, BookedEntityItemOneOf, BookedSlot, BookedResource, Location, BookedSchedule, ContactDetails, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, CustomFormField, BookingSource, ParticipantNotification, CommonIdentificationData, CommonIdentificationDataIdOneOf, FlowControlSettings, ExtendedFields, ParticipantChoices, ServiceChoices, ServiceChoice, ServiceChoiceChoiceOneOf, BookingChanged, CreateBookingRequest, CreateBookingFlowControlSettings, CreateBookingResponse, UpdateBookingRequest, UpdateBookingResponse, LegacyCreateBookingRequest, LegacyCreateBookingResponse, BulkUpdateBookingRequest, MaskedBooking, BulkUpdateBookingResponse, ItemMetadata, ApplicationError, BulkActionMetadata, BulkCreateBookingRequest, CreateBookingInfo, BulkCreateBookingResponse, BulkBookingResult, RescheduleBookingRequest, RescheduleBookingRequestParticipantsInfoOneOf, V2Slot, SlotSlotResource, SlotLocation, RescheduleBookingRequestFlowControlSettings, RescheduleBookingResponse, BulkRescheduleBookingRequest, BulkRescheduleBookingRequestBooking, SlotBookings, BulkRescheduleBookingResponse, BulkUpdateBookedScheduleRequest, BookingDetails, BulkUpdateBookedScheduleResponse, QueryBookingsRequest, QueryV2, QueryV2PagingMethodOneOf, Sorting, Paging, CursorPaging, QueryBookingsResponse, PagingMetadataV2, Cursors, ConfirmRequest, ConfirmResponse, ConfirmBookingRequest, ConfirmBookingResponse, PartySizeRequest, PartySizeRequestPartySizeForOneOf, PartySizeResponse, ConsistentQueryBookingsRequest, ConsistentQueryBookingsResponse, SetBookingSessionIdRequest, SetBookingSessionIdResponse, UpdateExtendedFieldsRequest, UpdateExtendedFieldsResponse, DeclineBookingRequest, DeclineBookingResponse, BookingDeclined, IdentificationData, IdentificationDataIdOneOf, CancelBookingRequest, CancelBookingRequestFlowControlSettings, CancelBookingResponse, BookingCanceled, UpdateNumberOfParticipantsRequest, UpdateNumberOfParticipantsRequestParticipantsInfoOneOf, UpdateNumberOfParticipantsResponse, CalculateAllowedActionsRequest, CalculateAllowedActionsResponse, AllowedActions, BulkCalculateAllowedActionsRequest, BulkCalculateAllowedActionsResponse, BulkCalculateAllowedActionsResult, GetSlotAvailabilityRequest, GetSlotAvailabilityResponse, SlotAvailability, WaitingList, BookingPolicyViolations, BookingPolicySettings, GetScheduleAvailabilityRequest, GetScheduleAvailabilityResponse, ScheduleAvailability, ConfirmOrDeclineRequest, ConfirmOrDeclineResponse, ConfirmOrDeclineBookingRequest, ConfirmOrDeclineBookingResponse, BookingAlreadySetPayload, V2CreateBookingRequest, V2CreateBookingRequestBookableItemOneOf, V2CreateBookingRequestParticipantsInfoOneOf, Slot, SlotResource, CreateBookingRequestFlowControlSettings, V2CreateBookingResponse, V2CancelBookingRequest, V2CancelBookingRequestFlowControlSettings, V2CancelBookingResponse, V2RescheduleBookingRequest, V2RescheduleBookingRequestParticipantsInfoOneOf, V2RescheduleBookingRequestFlowControlSettings, V2RescheduleBookingResponse, V2ConfirmBookingRequest, V2ConfirmBookingResponse, V2DeclineBookingRequest, V2DeclineBookingResponse, V2UpdateNumberOfParticipantsRequest, V2UpdateNumberOfParticipantsRequestParticipantsInfoOneOf, V2UpdateNumberOfParticipantsResponse, CreateBookingOptions, RescheduleBookingOptions, ConfirmBookingOptions, DeclineBookingOptions, CancelBookingOptions, UpdateNumberOfParticipantsOptions, ConfirmOrDeclineBookingOptions, } from './bookings-v2-booking.universal';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdentityType = exports.SortOrder = exports.LocationLocationType = exports.IdentificationDataIdentityType = exports.Actor = exports.Platform = exports.SelectedPaymentOption = exports.PaymentStatus = exports.BookingStatus = exports.ValueType = exports.LocationType = exports.updateNumberOfParticipants = exports.cancelBooking = exports.declineBooking = exports.confirmBooking = exports.rescheduleBooking = exports.createBooking = void 0;
|
|
3
|
+
exports.IdentityType = exports.SortOrder = exports.LocationLocationType = exports.IdentificationDataIdentityType = exports.Actor = exports.Platform = exports.SelectedPaymentOption = exports.PaymentStatus = exports.BookingStatus = exports.ValueType = exports.LocationType = exports.confirmOrDeclineBooking = exports.updateNumberOfParticipants = exports.cancelBooking = exports.declineBooking = exports.confirmBooking = exports.rescheduleBooking = exports.createBooking = void 0;
|
|
4
4
|
const bookings_v2_booking_universal_1 = require("./bookings-v2-booking.universal");
|
|
5
5
|
function createBooking(httpClient) {
|
|
6
6
|
return (booking, options) => (0, bookings_v2_booking_universal_1.createBooking)(booking, options,
|
|
@@ -38,6 +38,12 @@ function updateNumberOfParticipants(httpClient) {
|
|
|
38
38
|
{ httpClient });
|
|
39
39
|
}
|
|
40
40
|
exports.updateNumberOfParticipants = updateNumberOfParticipants;
|
|
41
|
+
function confirmOrDeclineBooking(httpClient) {
|
|
42
|
+
return (bookingId, options) => (0, bookings_v2_booking_universal_1.confirmOrDeclineBooking)(bookingId, options,
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
{ httpClient });
|
|
45
|
+
}
|
|
46
|
+
exports.confirmOrDeclineBooking = confirmOrDeclineBooking;
|
|
41
47
|
var bookings_v2_booking_universal_2 = require("./bookings-v2-booking.universal");
|
|
42
48
|
Object.defineProperty(exports, "LocationType", { enumerable: true, get: function () { return bookings_v2_booking_universal_2.LocationType; } });
|
|
43
49
|
Object.defineProperty(exports, "ValueType", { enumerable: true, get: function () { return bookings_v2_booking_universal_2.ValueType; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings-v2-booking.public.js","sourceRoot":"","sources":["../../../src/bookings-v2-booking.public.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"bookings-v2-booking.public.js","sourceRoot":"","sources":["../../../src/bookings-v2-booking.public.ts"],"names":[],"mappings":";;;AACA,mFAiByC;AAEzC,SAAgB,aAAa,CAAC,UAAsB;IAClD,OAAO,CAAC,OAAgB,EAAE,OAA8B,EAAE,EAAE,CAC1D,IAAA,6CAAsB,EACpB,OAAO,EACP,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,sCAQC;AAED,SAAgB,iBAAiB,CAAC,UAAsB;IACtD,OAAO,CACL,SAAiB,EACjB,IAAY,EACZ,OAAkC,EAClC,EAAE,CACF,IAAA,iDAA0B,EACxB,SAAS,EACT,IAAI,EACJ,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CAC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,KAAK,OAAA;AACL,+IAAA,8BAA8B,OAAA;AAC9B,qIAAA,oBAAoB,OAAA;AACpB,0HAAA,SAAS,OAAA;AACT,6HAAA,YAAY,OAAA"}
|
|
@@ -1252,7 +1252,7 @@ export interface ConfirmOrDeclineResponse {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
export interface ConfirmOrDeclineBookingRequest {
|
|
1254
1254
|
/** ID of the booking to be confirmed or declined. */
|
|
1255
|
-
bookingId
|
|
1255
|
+
bookingId: string;
|
|
1256
1256
|
/** Will be passed to bookings.update to indicate the payment status. */
|
|
1257
1257
|
paymentStatus?: PaymentStatus;
|
|
1258
1258
|
/** Contact's ID. */
|
|
@@ -1254,7 +1254,7 @@ export interface ConfirmOrDeclineResponse {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
export interface ConfirmOrDeclineBookingRequest {
|
|
1256
1256
|
/** ID of the booking to be confirmed or declined. */
|
|
1257
|
-
bookingId
|
|
1257
|
+
bookingId: string;
|
|
1258
1258
|
/** Will be passed to bookings.update to indicate the payment status. */
|
|
1259
1259
|
paymentStatus?: PaymentStatus;
|
|
1260
1260
|
/** Contact's ID. */
|
|
@@ -1911,3 +1911,34 @@ export interface UpdateNumberOfParticipantsOptions {
|
|
|
1911
1911
|
*/
|
|
1912
1912
|
participantsChoices?: ParticipantChoices;
|
|
1913
1913
|
}
|
|
1914
|
+
/**
|
|
1915
|
+
* The table below explains how the new booking status is set. It takes into account the following parameters:
|
|
1916
|
+
* 1. `skipBusinessConfirmation` as set on the `Booking` entity on creation
|
|
1917
|
+
* 2. `doubleBooking` - which indicates if this booking might cause over-booking. See details below.
|
|
1918
|
+
* 3. `payment`, which is `true` if the `paymentStatus` that is passed is either `PAID` or `PARTIALLY_PAID`.
|
|
1919
|
+
* | | doubleBooking=false, payment = false | doubleBooking=false, payment = true | doubleBooking=true, payment = false | doubleBooking=true, payment = true |
|
|
1920
|
+
* |-------------------------------- |-------------------------------------- |------------------------------------- |------------------------------------- |------------------------------------ |
|
|
1921
|
+
* | skipBusinessConfirmation=true | CONFIRMED | CONFIRMED | declined | CONFIRMED |
|
|
1922
|
+
* | skipBusinessConfirmation=false | CONFIRMED/PENDING * | CONFIRMED/PENDING * | declined | CONFIRMED/PENDING * |
|
|
1923
|
+
* * depends if the service policy is defined with isBusinessApprovalRequired=true
|
|
1924
|
+
*
|
|
1925
|
+
* How `doubleBooking` is calculated:
|
|
1926
|
+
* 1. If `skipAvailabilityValidation` that is set on the booking is `true`, the booking will never be considered as doubleBooking.
|
|
1927
|
+
* 2. If `skipAvailabilityValidation` is false:
|
|
1928
|
+
* 1. For class and course bookings, the bookings is considered as **NOT** double booking if the session/schedule
|
|
1929
|
+
* capacity, minus number of `CONFIRMED` bookings to the same session/schedule is bigger than the number of participants
|
|
1930
|
+
* on the booking, as set in `totalParticipants`/`participantsChoices`
|
|
1931
|
+
* 2. For appointment bookings, the booking is considered as **NOT** double booking if there are no
|
|
1932
|
+
* overlapping bookings of the same staff member and the same service
|
|
1933
|
+
* @param bookingId - ID of the booking to be confirmed or declined.
|
|
1934
|
+
* @public
|
|
1935
|
+
* @documentationMaturity preview
|
|
1936
|
+
* @requiredField bookingId
|
|
1937
|
+
*/
|
|
1938
|
+
export declare function confirmOrDeclineBooking(bookingId: string, options?: ConfirmOrDeclineBookingOptions): Promise<ConfirmOrDeclineBookingResponse>;
|
|
1939
|
+
export interface ConfirmOrDeclineBookingOptions {
|
|
1940
|
+
/** Will be passed to bookings.update to indicate the payment status. */
|
|
1941
|
+
paymentStatus?: PaymentStatus;
|
|
1942
|
+
/** Contact's ID. */
|
|
1943
|
+
contactId?: string | null;
|
|
1944
|
+
}
|