@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,248 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { serializer, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
|
|
11
|
+
import * as ambassadorWixBookingsServicesV2Service from './bookings-services-v2-service.http';
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
|
|
14
|
+
let __verbose = false;
|
|
15
|
+
function __log(...args) {
|
|
16
|
+
__verbose && console.log(...args);
|
|
17
|
+
}
|
|
18
|
+
function __inspect(obj) {
|
|
19
|
+
return obj;
|
|
20
|
+
}
|
|
21
|
+
export const __debug = {
|
|
22
|
+
verboseLogging: {
|
|
23
|
+
on: () => (__verbose = true),
|
|
24
|
+
off: () => (__verbose = false),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const _toVeloEntity = '$';
|
|
28
|
+
const _fromVeloEntity = '$';
|
|
29
|
+
export var ServiceType;
|
|
30
|
+
(function (ServiceType) {
|
|
31
|
+
ServiceType["UNKNOWN_SERVICE_TYPE"] = "UNKNOWN_SERVICE_TYPE";
|
|
32
|
+
/** The service is an appointment. */
|
|
33
|
+
ServiceType["APPOINTMENT"] = "APPOINTMENT";
|
|
34
|
+
/** The service is a class. */
|
|
35
|
+
ServiceType["CLASS"] = "CLASS";
|
|
36
|
+
/** The service is a course. */
|
|
37
|
+
ServiceType["COURSE"] = "COURSE";
|
|
38
|
+
})(ServiceType || (ServiceType = {}));
|
|
39
|
+
export var RateType;
|
|
40
|
+
(function (RateType) {
|
|
41
|
+
RateType["UNKNOWN_RATE_TYPE"] = "UNKNOWN_RATE_TYPE";
|
|
42
|
+
/** The service has a fixed price. */
|
|
43
|
+
RateType["FIXED"] = "FIXED";
|
|
44
|
+
/** The service has a custom price, expressed as a price description. */
|
|
45
|
+
RateType["CUSTOM"] = "CUSTOM";
|
|
46
|
+
/** This service is offered with a set of different prices based on different terms. */
|
|
47
|
+
RateType["VARIED"] = "VARIED";
|
|
48
|
+
/** This service is offered free of charge. */
|
|
49
|
+
RateType["NO_FEE"] = "NO_FEE";
|
|
50
|
+
})(RateType || (RateType = {}));
|
|
51
|
+
export var LocationType;
|
|
52
|
+
(function (LocationType) {
|
|
53
|
+
LocationType["UNKNOWN_LOCATION_TYPE"] = "UNKNOWN_LOCATION_TYPE";
|
|
54
|
+
/** The location is unique to this service and isn't defined as one of the business locations. */
|
|
55
|
+
LocationType["CUSTOM"] = "CUSTOM";
|
|
56
|
+
/** The location is one of the business locations available using the Business Info [Locations API](https://dev.wix.com/api/rest/business-info/locations). */
|
|
57
|
+
LocationType["BUSINESS"] = "BUSINESS";
|
|
58
|
+
/** The location can be determined by the customer and is not set up beforehand. This is applicable to services of type `APPOINTMENT` only. */
|
|
59
|
+
LocationType["CUSTOMER"] = "CUSTOMER";
|
|
60
|
+
})(LocationType || (LocationType = {}));
|
|
61
|
+
export var SortOrder;
|
|
62
|
+
(function (SortOrder) {
|
|
63
|
+
SortOrder["ASC"] = "ASC";
|
|
64
|
+
SortOrder["DESC"] = "DESC";
|
|
65
|
+
})(SortOrder || (SortOrder = {}));
|
|
66
|
+
export var Status;
|
|
67
|
+
(function (Status) {
|
|
68
|
+
/** Default status. */
|
|
69
|
+
Status["CREATED"] = "CREATED";
|
|
70
|
+
/** Category is deleted. */
|
|
71
|
+
Status["DELETED"] = "DELETED";
|
|
72
|
+
})(Status || (Status = {}));
|
|
73
|
+
export var Event;
|
|
74
|
+
(function (Event) {
|
|
75
|
+
Event["Updated"] = "Updated";
|
|
76
|
+
Event["Deleted"] = "Deleted";
|
|
77
|
+
Event["Created"] = "Created";
|
|
78
|
+
})(Event || (Event = {}));
|
|
79
|
+
export var InvalidSlugError;
|
|
80
|
+
(function (InvalidSlugError) {
|
|
81
|
+
InvalidSlugError["UNKNOWN_SLUG_ERROR"] = "UNKNOWN_SLUG_ERROR";
|
|
82
|
+
/** The provided slug name exceeds the maximum amount of characters for slug. */
|
|
83
|
+
InvalidSlugError["SLUG_IS_TOO_LONG"] = "SLUG_IS_TOO_LONG";
|
|
84
|
+
/** The provided slug name contains illegal characters. */
|
|
85
|
+
InvalidSlugError["SLUG_CONTAIN_ILLEGAL_CHARACTERS"] = "SLUG_CONTAIN_ILLEGAL_CHARACTERS";
|
|
86
|
+
/** The provided slug name already exists for the same or another service. */
|
|
87
|
+
InvalidSlugError["SLUG_ALREADY_EXISTS"] = "SLUG_ALREADY_EXISTS";
|
|
88
|
+
})(InvalidSlugError || (InvalidSlugError = {}));
|
|
89
|
+
const _businessLocationOptions = { address: 'wix.common.Address' };
|
|
90
|
+
const _customLocationOptions = { address: 'wix.common.Address' };
|
|
91
|
+
const _getServiceRequest = {};
|
|
92
|
+
const _getServiceResponse = { service: '_service' };
|
|
93
|
+
const _location = {
|
|
94
|
+
address: 'wix.common.Address',
|
|
95
|
+
business: '_businessLocationOptions',
|
|
96
|
+
custom: '_customLocationOptions',
|
|
97
|
+
};
|
|
98
|
+
const _media = {
|
|
99
|
+
items: '_mediaItem',
|
|
100
|
+
mainMedia: '_mediaItem',
|
|
101
|
+
coverMedia: '_mediaItem',
|
|
102
|
+
};
|
|
103
|
+
const _mediaItem = { image: 'wix.common.Image' };
|
|
104
|
+
const _queryServicesRequest = {};
|
|
105
|
+
const _queryServicesResponse = { services: '_service' };
|
|
106
|
+
const _service = { media: '_media', locations: '_location', urls: '_uRLs' };
|
|
107
|
+
const _uRLs = {
|
|
108
|
+
servicePage: 'wix.common.PageUrlV2',
|
|
109
|
+
bookingPage: 'wix.common.PageUrlV2',
|
|
110
|
+
calendarPage: 'wix.common.PageUrlV2',
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Get a Service by id.
|
|
114
|
+
* @param serviceId - Id of the Service to retrieve
|
|
115
|
+
* @public
|
|
116
|
+
* @documentationMaturity preview
|
|
117
|
+
* @requiredField serviceId
|
|
118
|
+
* @returns The retrieved Service
|
|
119
|
+
*/
|
|
120
|
+
export function getService(serviceId) {
|
|
121
|
+
var _a, _b, _c;
|
|
122
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
123
|
+
const requestTransformation = { serviceId: '$[0]' };
|
|
124
|
+
const responseTransformation = '$.service';
|
|
125
|
+
// @ts-ignore
|
|
126
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
127
|
+
const { toAmbassadorRequest } = serializer({
|
|
128
|
+
rootSchema: _getServiceRequest,
|
|
129
|
+
depSchemas: {},
|
|
130
|
+
fqdnTransformation: {
|
|
131
|
+
paths: [],
|
|
132
|
+
transformation: _fromVeloEntity,
|
|
133
|
+
},
|
|
134
|
+
customTransformation: requestTransformation,
|
|
135
|
+
});
|
|
136
|
+
const { fromJSON } = serializer({
|
|
137
|
+
rootSchema: _getServiceResponse,
|
|
138
|
+
depSchemas: {
|
|
139
|
+
_businessLocationOptions,
|
|
140
|
+
_customLocationOptions,
|
|
141
|
+
_location,
|
|
142
|
+
_media,
|
|
143
|
+
_mediaItem,
|
|
144
|
+
_service,
|
|
145
|
+
_uRLs,
|
|
146
|
+
},
|
|
147
|
+
fqdnTransformation: {
|
|
148
|
+
paths: [...['service']],
|
|
149
|
+
transformation: _toVeloEntity,
|
|
150
|
+
},
|
|
151
|
+
customTransformation: responseTransformation,
|
|
152
|
+
});
|
|
153
|
+
const payload = toAmbassadorRequest([serviceId]);
|
|
154
|
+
const reqOpts = ambassadorWixBookingsServicesV2Service.getService(payload);
|
|
155
|
+
__log(`"GetService" sending request with: ${__inspect(reqOpts)}`);
|
|
156
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
157
|
+
try {
|
|
158
|
+
const result = yield httpClient.request(reqOpts);
|
|
159
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
160
|
+
return fromJSON(result.data);
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
164
|
+
'serviceId',
|
|
165
|
+
]);
|
|
166
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
167
|
+
throw transformedError;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* <!--ONLY:REST-->
|
|
173
|
+
* 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.
|
|
174
|
+
* Retrieves a list of services according to the provided filters and paging.
|
|
175
|
+
*
|
|
176
|
+
* To retrieve all services use an empty query:
|
|
177
|
+
* ```javascript
|
|
178
|
+
* {
|
|
179
|
+
* "query": {}
|
|
180
|
+
* }
|
|
181
|
+
* ```
|
|
182
|
+
* >**Notes:**
|
|
183
|
+
* > + Use UTC when specifying filters with dates.
|
|
184
|
+
* > - 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.
|
|
185
|
+
* <!--END:ONLY:REST-->
|
|
186
|
+
* @public
|
|
187
|
+
* @documentationMaturity preview
|
|
188
|
+
*/
|
|
189
|
+
export function queryServices() {
|
|
190
|
+
const requestTransformation = { '*': '$[1]', query: '$[0]' };
|
|
191
|
+
const responseTransformation = {
|
|
192
|
+
items: '$.services',
|
|
193
|
+
pagingMetadata: '$.pagingMetadata',
|
|
194
|
+
};
|
|
195
|
+
// @ts-ignore
|
|
196
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
197
|
+
const { toAmbassadorRequest } = serializer({
|
|
198
|
+
rootSchema: _queryServicesRequest,
|
|
199
|
+
depSchemas: {},
|
|
200
|
+
fqdnTransformation: {
|
|
201
|
+
paths: [],
|
|
202
|
+
transformation: _fromVeloEntity,
|
|
203
|
+
},
|
|
204
|
+
customTransformation: requestTransformation,
|
|
205
|
+
});
|
|
206
|
+
const { fromJSON } = serializer({
|
|
207
|
+
rootSchema: _queryServicesResponse,
|
|
208
|
+
depSchemas: {
|
|
209
|
+
_businessLocationOptions,
|
|
210
|
+
_customLocationOptions,
|
|
211
|
+
_location,
|
|
212
|
+
_media,
|
|
213
|
+
_mediaItem,
|
|
214
|
+
_service,
|
|
215
|
+
_uRLs,
|
|
216
|
+
},
|
|
217
|
+
fqdnTransformation: {
|
|
218
|
+
paths: [...['Array#services']],
|
|
219
|
+
transformation: _toVeloEntity,
|
|
220
|
+
},
|
|
221
|
+
customTransformation: responseTransformation,
|
|
222
|
+
});
|
|
223
|
+
return wrapWithQueryBuilder({
|
|
224
|
+
func: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
var _a, _b, _c;
|
|
226
|
+
const reqOpts = ambassadorWixBookingsServicesV2Service.queryServices(payload);
|
|
227
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
228
|
+
try {
|
|
229
|
+
const result = yield httpClient.request(reqOpts);
|
|
230
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
235
|
+
throw err;
|
|
236
|
+
}
|
|
237
|
+
}),
|
|
238
|
+
requestTransformer: (...args) => toAmbassadorRequest(args),
|
|
239
|
+
responseTransformer: ({ data }) => fromJSON(data),
|
|
240
|
+
errorTransformer: (err) => {
|
|
241
|
+
const transformedError = transformError(err, requestTransformation);
|
|
242
|
+
throw transformedError;
|
|
243
|
+
},
|
|
244
|
+
pagingMethod: 'CURSOR',
|
|
245
|
+
transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
|
|
246
|
+
})({ cursorWithEmptyFilterAndSort: true });
|
|
247
|
+
}
|
|
248
|
+
//# 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,OAAO,EACL,UAAU,EACV,cAAc,EACd,qCAAqC,GACtC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,sCAAsC,MAAM,qCAAqC,CAAC;AAC9F,aAAa;AACb,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAwF5B,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,4DAA6C,CAAA;IAC7C,qCAAqC;IACrC,0CAA2B,CAAA;IAC3B,8BAA8B;IAC9B,8BAAe,CAAA;IACf,+BAA+B;IAC/B,gCAAiB,CAAA;AACnB,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB;AA2GD,MAAM,CAAN,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB,mDAAuC,CAAA;IACvC,qCAAqC;IACrC,2BAAe,CAAA;IACf,wEAAwE;IACxE,6BAAiB,CAAA;IACjB,uFAAuF;IACvF,6BAAiB,CAAA;IACjB,8CAA8C;IAC9C,6BAAiB,CAAA;AAC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mBAAmB,CAAC,IAAI,CAAC;QACjE,mBAAmB,EAAE,CAAC,EAAE,IAAI,EAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;QACtD,gBAAgB,EAAE,CAAC,GAAQ,EAAE,EAAE;YAC7B,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;YAEpE,MAAM,gBAAgB,CAAC;QACzB,CAAC;QACD,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,qCAAqC,CAAC,aAAa,CAAC;KAC1E,CAAC,CAAC,EAAE,4BAA4B,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -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>;
|
|
@@ -16,6 +16,8 @@ const _cancelBookingRequest = {};
|
|
|
16
16
|
const _cancelBookingResponse = { booking: '_booking' };
|
|
17
17
|
const _confirmBookingRequest = {};
|
|
18
18
|
const _confirmBookingResponse = { booking: '_booking' };
|
|
19
|
+
const _confirmOrDeclineBookingRequest = {};
|
|
20
|
+
const _confirmOrDeclineBookingResponse = { booking: '_booking' };
|
|
19
21
|
const _contactDetails = { fullAddress: '_address' };
|
|
20
22
|
const _createBookingRequest = { booking: '_booking' };
|
|
21
23
|
const _createBookingResponse = { booking: '_booking' };
|
|
@@ -25,6 +27,17 @@ const _rescheduleBookingRequest = {};
|
|
|
25
27
|
const _rescheduleBookingResponse = { booking: '_booking' };
|
|
26
28
|
const _updateNumberOfParticipantsRequest = {};
|
|
27
29
|
const _updateNumberOfParticipantsResponse = { booking: '_booking' };
|
|
30
|
+
function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
|
|
31
|
+
const domainToMappings = {
|
|
32
|
+
'www.wixapis.com': [
|
|
33
|
+
{
|
|
34
|
+
srcPath: '/_api/bookings-confirmator/v2/bookings/confirmation',
|
|
35
|
+
destPath: '/v2/bookings/confirmation',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
40
|
+
}
|
|
28
41
|
function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
|
|
29
42
|
const domainToMappings = {
|
|
30
43
|
_: [
|
|
@@ -359,4 +372,49 @@ export function bookingsUpdateNumberOfParticipants(payload) {
|
|
|
359
372
|
__bookingsUpdateNumberOfParticipants.fromReq = fromReq;
|
|
360
373
|
return __bookingsUpdateNumberOfParticipants;
|
|
361
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* The table below explains how the new booking status is set. It takes into account the following parameters:
|
|
377
|
+
* 1. `skipBusinessConfirmation` as set on the `Booking` entity on creation
|
|
378
|
+
* 2. `doubleBooking` - which indicates if this booking might cause over-booking. See details below.
|
|
379
|
+
* 3. `payment`, which is `true` if the `paymentStatus` that is passed is either `PAID` or `PARTIALLY_PAID`.
|
|
380
|
+
* | | doubleBooking=false, payment = false | doubleBooking=false, payment = true | doubleBooking=true, payment = false | doubleBooking=true, payment = true |
|
|
381
|
+
* |-------------------------------- |-------------------------------------- |------------------------------------- |------------------------------------- |------------------------------------ |
|
|
382
|
+
* | skipBusinessConfirmation=true | CONFIRMED | CONFIRMED | declined | CONFIRMED |
|
|
383
|
+
* | skipBusinessConfirmation=false | CONFIRMED/PENDING * | CONFIRMED/PENDING * | declined | CONFIRMED/PENDING * |
|
|
384
|
+
* * depends if the service policy is defined with isBusinessApprovalRequired=true
|
|
385
|
+
*
|
|
386
|
+
* How `doubleBooking` is calculated:
|
|
387
|
+
* 1. If `skipAvailabilityValidation` that is set on the booking is `true`, the booking will never be considered as doubleBooking.
|
|
388
|
+
* 2. If `skipAvailabilityValidation` is false:
|
|
389
|
+
* 1. For class and course bookings, the bookings is considered as **NOT** double booking if the session/schedule
|
|
390
|
+
* capacity, minus number of `CONFIRMED` bookings to the same session/schedule is bigger than the number of participants
|
|
391
|
+
* on the booking, as set in `totalParticipants`/`participantsChoices`
|
|
392
|
+
* 2. For appointment bookings, the booking is considered as **NOT** double booking if there are no
|
|
393
|
+
* overlapping bookings of the same staff member and the same service
|
|
394
|
+
*/
|
|
395
|
+
export function confirmOrDeclineBooking(payload) {
|
|
396
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_confirmOrDeclineBookingRequest, {});
|
|
397
|
+
const { fromJSON: fromRes } = serializer(_confirmOrDeclineBookingResponse, {
|
|
398
|
+
_address,
|
|
399
|
+
_addressLocation,
|
|
400
|
+
_booking,
|
|
401
|
+
_contactDetails,
|
|
402
|
+
});
|
|
403
|
+
function __confirmOrDeclineBooking({ host }) {
|
|
404
|
+
const serializedData = toReq(payload);
|
|
405
|
+
const metadata = {
|
|
406
|
+
method: 'POST',
|
|
407
|
+
url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
|
|
408
|
+
protoPath: '/v2/bookings/confirmation/{booking_id}:confirmOrDecline',
|
|
409
|
+
data: serializedData,
|
|
410
|
+
host,
|
|
411
|
+
}),
|
|
412
|
+
data: serializedData,
|
|
413
|
+
transformResponse: fromRes,
|
|
414
|
+
};
|
|
415
|
+
return metadata;
|
|
416
|
+
}
|
|
417
|
+
__confirmOrDeclineBooking.fromReq = fromReq;
|
|
418
|
+
return __confirmOrDeclineBooking;
|
|
419
|
+
}
|
|
362
420
|
//# 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,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"bookings-v2-booking.http.js","sourceRoot":"","sources":["../../../src/bookings-v2-booking.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;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,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACvD,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACxD,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAC3C,MAAM,gCAAgC,GAAG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AAO,oCAAoC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CACrD,+BAA+B,EAC/B,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,gCAAgC,EAAE;QACzE,QAAQ;QACR,gBAAgB;QAChB,QAAQ;QACR,eAAe;KAChB,CAAC,CAAC;IAEH,SAAS,yBAAyB,CAAC,EAAE,IAAI,EAAO;QAC9C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,MAAM,EAAE,MAAa;YACrB,GAAG,EAAE,qDAAqD,CAAC;gBACzD,SAAS,EAAE,yDAAyD;gBACpE,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,yBAAyB,CAAC,OAAO,GAAG,OAAO,CAAC;IAE5C,OAAO,yBAAyB,CAAC;AACnC,CAAC"}
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { createBooking as universalCreateBooking, rescheduleBooking as universalRescheduleBooking, confirmBooking as universalConfirmBooking, declineBooking as universalDeclineBooking, cancelBooking as universalCancelBooking, updateNumberOfParticipants as universalUpdateNumberOfParticipants, } from './bookings-v2-booking.universal';
|
|
1
|
+
import { createBooking as universalCreateBooking, rescheduleBooking as universalRescheduleBooking, confirmBooking as universalConfirmBooking, declineBooking as universalDeclineBooking, cancelBooking as universalCancelBooking, updateNumberOfParticipants as universalUpdateNumberOfParticipants, confirmOrDeclineBooking as universalConfirmOrDeclineBooking, } from './bookings-v2-booking.universal';
|
|
2
2
|
export function createBooking(httpClient) {
|
|
3
3
|
return (booking, options) => universalCreateBooking(booking, options,
|
|
4
4
|
// @ts-ignore
|
|
@@ -29,5 +29,10 @@ export function updateNumberOfParticipants(httpClient) {
|
|
|
29
29
|
// @ts-ignore
|
|
30
30
|
{ httpClient });
|
|
31
31
|
}
|
|
32
|
+
export function confirmOrDeclineBooking(httpClient) {
|
|
33
|
+
return (bookingId, options) => universalConfirmOrDeclineBooking(bookingId, options,
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
{ httpClient });
|
|
36
|
+
}
|
|
32
37
|
export { LocationType, ValueType, BookingStatus, PaymentStatus, SelectedPaymentOption, Platform, Actor, IdentificationDataIdentityType, LocationLocationType, SortOrder, IdentityType, } from './bookings-v2-booking.universal';
|
|
33
38
|
//# sourceMappingURL=bookings-v2-booking.public.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings-v2-booking.public.js","sourceRoot":"","sources":["../../../src/bookings-v2-booking.public.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,IAAI,sBAAsB,EACvC,iBAAiB,IAAI,0BAA0B,EAC/C,cAAc,IAAI,uBAAuB,EACzC,cAAc,IAAI,uBAAuB,EACzC,aAAa,IAAI,sBAAsB,EACvC,0BAA0B,IAAI,mCAAmC,
|
|
1
|
+
{"version":3,"file":"bookings-v2-booking.public.js","sourceRoot":"","sources":["../../../src/bookings-v2-booking.public.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,IAAI,sBAAsB,EACvC,iBAAiB,IAAI,0BAA0B,EAC/C,cAAc,IAAI,uBAAuB,EACzC,cAAc,IAAI,uBAAuB,EACzC,aAAa,IAAI,sBAAsB,EACvC,0BAA0B,IAAI,mCAAmC,EACjE,uBAAuB,IAAI,gCAAgC,GAU5D,MAAM,iCAAiC,CAAC;AAEzC,MAAM,UAAU,aAAa,CAAC,UAAsB;IAClD,OAAO,CAAC,OAAgB,EAAE,OAA8B,EAAE,EAAE,CAC1D,sBAAsB,CACpB,OAAO,EACP,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAAsB;IACtD,OAAO,CACL,SAAiB,EACjB,IAAY,EACZ,OAAkC,EAClC,EAAE,CACF,0BAA0B,CACxB,SAAS,EACT,IAAI,EACJ,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,UAAsB;IACnD,OAAO,CACL,SAAiB,EACjB,QAAuB,EACvB,OAA+B,EAC/B,EAAE,CACF,uBAAuB,CACrB,SAAS,EACT,QAAQ,EACR,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,UAAsB;IACnD,OAAO,CACL,SAAiB,EACjB,QAAuB,EACvB,OAA+B,EAC/B,EAAE,CACF,uBAAuB,CACrB,SAAS,EACT,QAAQ,EACR,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAsB;IAClD,OAAO,CAAC,SAAiB,EAAE,OAA8B,EAAE,EAAE,CAC3D,sBAAsB,CACpB,SAAS,EACT,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,UAAsB;IAC/D,OAAO,CAAC,SAAiB,EAAE,OAA2C,EAAE,EAAE,CACxE,mCAAmC,CACjC,SAAS,EACT,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,UAAsB;IAC5D,OAAO,CAAC,SAAiB,EAAE,OAAwC,EAAE,EAAE,CACrE,gCAAgC,CAC9B,SAAS,EACT,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,KAAK,EACL,8BAA8B,EAC9B,oBAAoB,EACpB,SAAS,EACT,YAAY,GACb,MAAM,iCAAiC,CAAC"}
|
|
@@ -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
|
+
}
|
|
@@ -123,6 +123,8 @@ const _cancelBookingRequest = {};
|
|
|
123
123
|
const _cancelBookingResponse = {};
|
|
124
124
|
const _confirmBookingRequest = {};
|
|
125
125
|
const _confirmBookingResponse = {};
|
|
126
|
+
const _confirmOrDeclineBookingRequest = {};
|
|
127
|
+
const _confirmOrDeclineBookingResponse = {};
|
|
126
128
|
const _createBookingRequest = {};
|
|
127
129
|
const _createBookingResponse = {};
|
|
128
130
|
const _declineBookingRequest = {};
|
|
@@ -639,4 +641,76 @@ export function updateNumberOfParticipants(bookingId, options) {
|
|
|
639
641
|
}
|
|
640
642
|
});
|
|
641
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* The table below explains how the new booking status is set. It takes into account the following parameters:
|
|
646
|
+
* 1. `skipBusinessConfirmation` as set on the `Booking` entity on creation
|
|
647
|
+
* 2. `doubleBooking` - which indicates if this booking might cause over-booking. See details below.
|
|
648
|
+
* 3. `payment`, which is `true` if the `paymentStatus` that is passed is either `PAID` or `PARTIALLY_PAID`.
|
|
649
|
+
* | | doubleBooking=false, payment = false | doubleBooking=false, payment = true | doubleBooking=true, payment = false | doubleBooking=true, payment = true |
|
|
650
|
+
* |-------------------------------- |-------------------------------------- |------------------------------------- |------------------------------------- |------------------------------------ |
|
|
651
|
+
* | skipBusinessConfirmation=true | CONFIRMED | CONFIRMED | declined | CONFIRMED |
|
|
652
|
+
* | skipBusinessConfirmation=false | CONFIRMED/PENDING * | CONFIRMED/PENDING * | declined | CONFIRMED/PENDING * |
|
|
653
|
+
* * depends if the service policy is defined with isBusinessApprovalRequired=true
|
|
654
|
+
*
|
|
655
|
+
* How `doubleBooking` is calculated:
|
|
656
|
+
* 1. If `skipAvailabilityValidation` that is set on the booking is `true`, the booking will never be considered as doubleBooking.
|
|
657
|
+
* 2. If `skipAvailabilityValidation` is false:
|
|
658
|
+
* 1. For class and course bookings, the bookings is considered as **NOT** double booking if the session/schedule
|
|
659
|
+
* capacity, minus number of `CONFIRMED` bookings to the same session/schedule is bigger than the number of participants
|
|
660
|
+
* on the booking, as set in `totalParticipants`/`participantsChoices`
|
|
661
|
+
* 2. For appointment bookings, the booking is considered as **NOT** double booking if there are no
|
|
662
|
+
* overlapping bookings of the same staff member and the same service
|
|
663
|
+
* @param bookingId - ID of the booking to be confirmed or declined.
|
|
664
|
+
* @public
|
|
665
|
+
* @documentationMaturity preview
|
|
666
|
+
* @requiredField bookingId
|
|
667
|
+
*/
|
|
668
|
+
export function confirmOrDeclineBooking(bookingId, options) {
|
|
669
|
+
var _a, _b, _c;
|
|
670
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
671
|
+
const requestTransformation = {
|
|
672
|
+
bookingId: '$[0]',
|
|
673
|
+
paymentStatus: '$[1].paymentStatus',
|
|
674
|
+
contactId: '$[1].contactId',
|
|
675
|
+
};
|
|
676
|
+
const responseTransformation = '$';
|
|
677
|
+
// @ts-ignore
|
|
678
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
679
|
+
const { toAmbassadorRequest } = serializer({
|
|
680
|
+
rootSchema: _confirmOrDeclineBookingRequest,
|
|
681
|
+
depSchemas: {},
|
|
682
|
+
fqdnTransformation: {
|
|
683
|
+
paths: [],
|
|
684
|
+
transformation: _fromVeloEntity,
|
|
685
|
+
},
|
|
686
|
+
customTransformation: requestTransformation,
|
|
687
|
+
});
|
|
688
|
+
const { fromJSON } = serializer({
|
|
689
|
+
rootSchema: _confirmOrDeclineBookingResponse,
|
|
690
|
+
depSchemas: {},
|
|
691
|
+
fqdnTransformation: {
|
|
692
|
+
paths: [...['booking']],
|
|
693
|
+
transformation: _toVeloEntity,
|
|
694
|
+
},
|
|
695
|
+
customTransformation: responseTransformation,
|
|
696
|
+
});
|
|
697
|
+
const payload = toAmbassadorRequest([bookingId, options]);
|
|
698
|
+
const reqOpts = ambassadorWixBookingsV2Booking.confirmOrDeclineBooking(payload);
|
|
699
|
+
__log(`"ConfirmOrDeclineBooking" sending request with: ${__inspect(reqOpts)}`);
|
|
700
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
701
|
+
try {
|
|
702
|
+
const result = yield httpClient.request(reqOpts);
|
|
703
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
704
|
+
return fromJSON(result.data);
|
|
705
|
+
}
|
|
706
|
+
catch (err) {
|
|
707
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
708
|
+
'bookingId',
|
|
709
|
+
'options',
|
|
710
|
+
]);
|
|
711
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
712
|
+
throw transformedError;
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
}
|
|
642
716
|
//# sourceMappingURL=bookings-v2-booking.universal.js.map
|