@pisell/pisellos 2.3.215 → 2.3.217
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/dist/modules/ProductList/index.js +5 -2
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +823 -739
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +3 -0
- package/dist/solution/UnifiedBookingSales/index.js +90 -72
- package/dist/solution/UnifiedBookingSales/types.d.ts +4 -2
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/ProductList/index.js +4 -1
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +39 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +3 -0
- package/lib/solution/UnifiedBookingSales/index.js +24 -9
- package/lib/solution/UnifiedBookingSales/types.d.ts +4 -2
- package/package.json +1 -1
|
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
342
342
|
date: string;
|
|
343
343
|
status: string;
|
|
344
344
|
week: string;
|
|
345
|
-
weekNum: 0 | 2 | 1 |
|
|
345
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
346
346
|
}[]>;
|
|
347
347
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
348
348
|
private getScheduleDataByIds;
|
|
@@ -110,6 +110,9 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
110
110
|
protected getSubModuleHooks(moduleName: string): any;
|
|
111
111
|
private createAvailabilityFacadeError;
|
|
112
112
|
private getAvailabilityScopeDescriptor;
|
|
113
|
+
/** Kiosk keeps its device/channel semantics; only explicit Venue templates opt in. */
|
|
114
|
+
private isVenueKioskPlatform;
|
|
115
|
+
private supportsVenueSelectionSnapshot;
|
|
113
116
|
private usesDurationTimeGrid;
|
|
114
117
|
private getCurrentAvailabilityBusinessDate;
|
|
115
118
|
private getAvailabilityBusinessDateRange;
|
|
@@ -1569,19 +1569,35 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1569
1569
|
value: function getAvailabilityScopeDescriptor() {
|
|
1570
1570
|
var _ref23, _otherParams$business, _otherParams$channel, _otherParams$platform, _otherParams$business2;
|
|
1571
1571
|
var otherParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.otherParams || {};
|
|
1572
|
-
return {
|
|
1572
|
+
return _objectSpread({
|
|
1573
1573
|
cacheId: this.cacheId || '',
|
|
1574
1574
|
businessCode: String((_ref23 = (_otherParams$business = otherParams.businessCode) !== null && _otherParams$business !== void 0 ? _otherParams$business : otherParams.business_code) !== null && _ref23 !== void 0 ? _ref23 : ''),
|
|
1575
1575
|
channel: String((_otherParams$channel = otherParams.channel) !== null && _otherParams$channel !== void 0 ? _otherParams$channel : ''),
|
|
1576
1576
|
platform: String((_otherParams$platform = otherParams.platform) !== null && _otherParams$platform !== void 0 ? _otherParams$platform : ''),
|
|
1577
1577
|
businessTimezone: String((_otherParams$business2 = otherParams.businessTimezone) !== null && _otherParams$business2 !== void 0 ? _otherParams$business2 : '')
|
|
1578
|
-
}
|
|
1578
|
+
}, this.isVenueKioskPlatform(otherParams) ? {
|
|
1579
|
+
venueBookingMode: otherParams.venueBookingMode
|
|
1580
|
+
} : {});
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
/** Kiosk keeps its device/channel semantics; only explicit Venue templates opt in. */
|
|
1584
|
+
}, {
|
|
1585
|
+
key: "isVenueKioskPlatform",
|
|
1586
|
+
value: function isVenueKioskPlatform() {
|
|
1587
|
+
var otherParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.otherParams || {};
|
|
1588
|
+
return normalizeRuntimePlatform(otherParams.platform) === 'kiosk' && (otherParams.venueBookingMode === 'tickets' || otherParams.venueBookingMode === 'party');
|
|
1589
|
+
}
|
|
1590
|
+
}, {
|
|
1591
|
+
key: "supportsVenueSelectionSnapshot",
|
|
1592
|
+
value: function supportsVenueSelectionSnapshot() {
|
|
1593
|
+
var _this$otherParams4;
|
|
1594
|
+
return isCustomerUserPlatform((_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.platform) || this.isVenueKioskPlatform();
|
|
1579
1595
|
}
|
|
1580
1596
|
}, {
|
|
1581
1597
|
key: "usesDurationTimeGrid",
|
|
1582
1598
|
value: function usesDurationTimeGrid(projection) {
|
|
1583
|
-
var _this$otherParams$pla, _this$
|
|
1584
|
-
var platform = String((_this$otherParams$pla = (_this$
|
|
1599
|
+
var _this$otherParams$pla, _this$otherParams5;
|
|
1600
|
+
var platform = String((_this$otherParams$pla = (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.platform) !== null && _this$otherParams$pla !== void 0 ? _this$otherParams$pla : '').trim().toLowerCase();
|
|
1585
1601
|
return (platform === 'pos' || platform === 'kiosk') && (!projection || projection.products.some(function (product) {
|
|
1586
1602
|
return product.kind === 'duration';
|
|
1587
1603
|
}));
|
|
@@ -1637,9 +1653,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1637
1653
|
}, {
|
|
1638
1654
|
key: "normalizeAvailabilityPrepareDescriptor",
|
|
1639
1655
|
value: function normalizeAvailabilityPrepareDescriptor(params) {
|
|
1640
|
-
var _this$
|
|
1656
|
+
var _this$otherParams6;
|
|
1641
1657
|
this.assertAvailabilityPrepareParams(params);
|
|
1642
|
-
var timezone = String(params.timezone || ((_this$
|
|
1658
|
+
var timezone = String(params.timezone || ((_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.businessTimezone) || Intl.DateTimeFormat().resolvedOptions().timeZone || 'Asia/Shanghai');
|
|
1643
1659
|
assertValidAvailabilityTimezone(timezone);
|
|
1644
1660
|
var dateRange = this.normalizeAvailabilityDateRange(params, timezone);
|
|
1645
1661
|
var slotStepMinutes = params.slotStepMinutes || DEFAULT_AVAILABILITY_SLOT_STEP_MINUTES;
|
|
@@ -1799,7 +1815,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1799
1815
|
key: "prepareDirectAddCalendarBooking",
|
|
1800
1816
|
value: (function () {
|
|
1801
1817
|
var _prepareDirectAddCalendarBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(cacheItem) {
|
|
1802
|
-
var _this$
|
|
1818
|
+
var _this$otherParams7,
|
|
1803
1819
|
_cacheItem$_data,
|
|
1804
1820
|
_cacheItem$duration,
|
|
1805
1821
|
_cacheItem$_data2,
|
|
@@ -1839,7 +1855,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1839
1855
|
while (1) switch (_context4.prev = _context4.next) {
|
|
1840
1856
|
case 0:
|
|
1841
1857
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
1842
|
-
if (!(normalizeRuntimePlatform((_this$
|
|
1858
|
+
if (!(normalizeRuntimePlatform((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.platform) !== 'pos' || cacheItem !== null && cacheItem !== void 0 && (_cacheItem$_data = cacheItem._data) !== null && _cacheItem$_data !== void 0 && _cacheItem$_data.calendarManualBooking || (cacheItem === null || cacheItem === void 0 || (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.type) === 'days')) {
|
|
1843
1859
|
_context4.next = 3;
|
|
1844
1860
|
break;
|
|
1845
1861
|
}
|
|
@@ -2029,7 +2045,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2029
2045
|
key: "resolveAvailabilityPrepareDefaults",
|
|
2030
2046
|
value: function () {
|
|
2031
2047
|
var _resolveAvailabilityPrepareDefaults = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
|
|
2032
|
-
var _ref31, _this$otherParams$bus, _this$
|
|
2048
|
+
var _ref31, _this$otherParams$bus, _this$otherParams8, _this$otherParams9, _this$otherParams$cha2, _this$otherParams10, _this$otherParams11, _openData2, _openData3, _openData4;
|
|
2033
2049
|
var needsOperatingHours, needsTimeSlice, businessCode, channel, currentTarget, openData, operatingScheduleIds, configuredTimeSlice;
|
|
2034
2050
|
return _regeneratorRuntime().wrap(function _callee4$(_context5) {
|
|
2035
2051
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -2047,10 +2063,10 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2047
2063
|
}
|
|
2048
2064
|
}));
|
|
2049
2065
|
case 4:
|
|
2050
|
-
businessCode = String((_ref31 = (_this$otherParams$bus = (_this$
|
|
2051
|
-
channel = String((_this$otherParams$cha2 = (_this$
|
|
2066
|
+
businessCode = String((_ref31 = (_this$otherParams$bus = (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.business_code) !== null && _ref31 !== void 0 ? _ref31 : '').trim();
|
|
2067
|
+
channel = String((_this$otherParams$cha2 = (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.channel) !== null && _this$otherParams$cha2 !== void 0 ? _this$otherParams$cha2 : '').trim();
|
|
2052
2068
|
currentTarget = businessCode && channel ? "".concat(businessCode, "+").concat(channel) : null;
|
|
2053
|
-
openData = (!currentTarget || this.openDataTarget === currentTarget) && (this.runtimeOpenDataScope === null || this.runtimeOpenDataScope === this.getRuntimeOpenDataScope()) ? (_this$
|
|
2069
|
+
openData = (!currentTarget || this.openDataTarget === currentTarget) && (this.runtimeOpenDataScope === null || this.runtimeOpenDataScope === this.getRuntimeOpenDataScope()) ? (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.openData : null;
|
|
2054
2070
|
if (!(!openData && this.store.openData)) {
|
|
2055
2071
|
_context5.next = 20;
|
|
2056
2072
|
break;
|
|
@@ -2141,7 +2157,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2141
2157
|
key: "setOtherParams",
|
|
2142
2158
|
value: function () {
|
|
2143
2159
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
2144
|
-
var _this$
|
|
2160
|
+
var _this$otherParams12, _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams17;
|
|
2145
2161
|
var _ref32,
|
|
2146
2162
|
_ref32$cover,
|
|
2147
2163
|
cover,
|
|
@@ -2151,7 +2167,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2151
2167
|
explicitlySetsOpenData,
|
|
2152
2168
|
nextParams,
|
|
2153
2169
|
nextScope,
|
|
2154
|
-
_this$
|
|
2170
|
+
_this$otherParams16,
|
|
2155
2171
|
shouldResetAvailabilityState,
|
|
2156
2172
|
_args6 = arguments;
|
|
2157
2173
|
return _regeneratorRuntime().wrap(function _callee5$(_context6) {
|
|
@@ -2159,8 +2175,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2159
2175
|
case 0:
|
|
2160
2176
|
_ref32 = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {}, _ref32$cover = _ref32.cover, cover = _ref32$cover === void 0 ? false : _ref32$cover;
|
|
2161
2177
|
previousScope = this.getAvailabilityScopeDescriptor(this.otherParams || {});
|
|
2162
|
-
previousCatalogScope = (_this$
|
|
2163
|
-
previousItemRuleConfig = (_this$
|
|
2178
|
+
previousCatalogScope = (_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.catalogScopeKey;
|
|
2179
|
+
previousItemRuleConfig = (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.itemRule;
|
|
2164
2180
|
explicitlySetsOpenData = Object.prototype.hasOwnProperty.call(params, 'openData');
|
|
2165
2181
|
nextParams = cover ? params : _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
2166
2182
|
if (explicitlySetsOpenData || this.getRuntimeOpenDataScope() !== this.getRuntimeOpenDataScope(nextParams)) {
|
|
@@ -2171,7 +2187,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2171
2187
|
cover: cover
|
|
2172
2188
|
});
|
|
2173
2189
|
case 9:
|
|
2174
|
-
if (!(previousCatalogScope !== ((_this$
|
|
2190
|
+
if (!(previousCatalogScope !== ((_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.catalogScopeKey) && (previousCatalogScope || (_this$otherParams15 = this.otherParams) !== null && _this$otherParams15 !== void 0 && _this$otherParams15.catalogScopeKey))) {
|
|
2175
2191
|
_context6.next = 13;
|
|
2176
2192
|
break;
|
|
2177
2193
|
}
|
|
@@ -2181,9 +2197,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2181
2197
|
case 13:
|
|
2182
2198
|
nextScope = this.getAvailabilityScopeDescriptor(this.otherParams || {});
|
|
2183
2199
|
if (explicitlySetsOpenData) {
|
|
2184
|
-
this.openDataTarget = (_this$
|
|
2200
|
+
this.openDataTarget = (_this$otherParams16 = this.otherParams) !== null && _this$otherParams16 !== void 0 && _this$otherParams16.openData && nextScope.businessCode && nextScope.channel ? "".concat(nextScope.businessCode, "+").concat(nextScope.channel) : null;
|
|
2185
2201
|
}
|
|
2186
|
-
shouldResetAvailabilityState = previousScope.cacheId !== nextScope.cacheId || previousScope.businessCode !== nextScope.businessCode || previousScope.channel !== nextScope.channel || previousScope.platform !== nextScope.platform || previousScope.businessTimezone !== nextScope.businessTimezone;
|
|
2202
|
+
shouldResetAvailabilityState = previousScope.cacheId !== nextScope.cacheId || previousScope.businessCode !== nextScope.businessCode || previousScope.channel !== nextScope.channel || previousScope.platform !== nextScope.platform || previousScope.businessTimezone !== nextScope.businessTimezone || previousScope.venueBookingMode !== nextScope.venueBookingMode;
|
|
2187
2203
|
if (!shouldResetAvailabilityState) {
|
|
2188
2204
|
_context6.next = 19;
|
|
2189
2205
|
break;
|
|
@@ -2191,7 +2207,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2191
2207
|
_context6.next = 19;
|
|
2192
2208
|
return this.resetAvailabilityProjectionState('set_other_params_reset');
|
|
2193
2209
|
case 19:
|
|
2194
|
-
if (shouldResetAvailabilityState || explicitlySetsOpenData || previousItemRuleConfig !== ((_this$
|
|
2210
|
+
if (shouldResetAvailabilityState || explicitlySetsOpenData || previousItemRuleConfig !== ((_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.itemRule)) {
|
|
2195
2211
|
this.resetAllergyItemRuleState();
|
|
2196
2212
|
}
|
|
2197
2213
|
case 20:
|
|
@@ -2308,9 +2324,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2308
2324
|
}, {
|
|
2309
2325
|
key: "resolveOrderRememberedTimes",
|
|
2310
2326
|
value: function resolveOrderRememberedTimes(context, projection, ranges, orderSessionId) {
|
|
2311
|
-
var _this$otherParams$pla2, _this$
|
|
2327
|
+
var _this$otherParams$pla2, _this$otherParams18, _context$prepareParam, _extractFixedOffsetMi;
|
|
2312
2328
|
if (ranges === undefined) return undefined;
|
|
2313
|
-
if (String((_this$otherParams$pla2 = (_this$
|
|
2329
|
+
if (String((_this$otherParams$pla2 = (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.platform) !== null && _this$otherParams$pla2 !== void 0 ? _this$otherParams$pla2 : '').trim().toLowerCase() !== 'pos' || (_context$prepareParam = context.prepareParams.editingProductLineUids) !== null && _context$prepareParam !== void 0 && _context$prepareParam.length || !this.usesDurationTimeGrid(projection)) return undefined;
|
|
2314
2330
|
this.assertRememberedOrderSession(orderSessionId);
|
|
2315
2331
|
if (!isRecord(ranges) || !Object.keys(ranges).length) {
|
|
2316
2332
|
throw new AvailabilityError('INVALID_TARGET_FILTER', '记忆时间区间不能为空');
|
|
@@ -2480,8 +2496,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2480
2496
|
}, {
|
|
2481
2497
|
key: "isSessionStoragePersistEnabled",
|
|
2482
2498
|
value: function isSessionStoragePersistEnabled() {
|
|
2483
|
-
var _this$
|
|
2484
|
-
return Boolean(this.cacheId && ((_this$
|
|
2499
|
+
var _this$otherParams19;
|
|
2500
|
+
return Boolean(this.cacheId && ((_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.enableSessionStoragePersist) === true);
|
|
2485
2501
|
}
|
|
2486
2502
|
}, {
|
|
2487
2503
|
key: "shouldUseSessionStorageForSubModule",
|
|
@@ -2548,12 +2564,12 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2548
2564
|
key: "ensureLocalOrderNumbersForCheckout",
|
|
2549
2565
|
value: (function () {
|
|
2550
2566
|
var _ensureLocalOrderNumbersForCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
2551
|
-
var _this$
|
|
2567
|
+
var _this$otherParams20, _this$appPlugin, _this$appPlugin$getAp, _this$appPlugin$getAp2, _idGenerator$getConfi;
|
|
2552
2568
|
var order, tempOrder, biz, idGenerator, useLongNumber;
|
|
2553
2569
|
return _regeneratorRuntime().wrap(function _callee9$(_context10) {
|
|
2554
2570
|
while (1) switch (_context10.prev = _context10.next) {
|
|
2555
2571
|
case 0:
|
|
2556
|
-
if (!(normalizeRuntimePlatform((_this$
|
|
2572
|
+
if (!(normalizeRuntimePlatform((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.platform) !== 'kiosk')) {
|
|
2557
2573
|
_context10.next = 2;
|
|
2558
2574
|
break;
|
|
2559
2575
|
}
|
|
@@ -2656,10 +2672,10 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2656
2672
|
}, {
|
|
2657
2673
|
key: "shouldUseCheckoutSyncTask",
|
|
2658
2674
|
value: function shouldUseCheckoutSyncTask() {
|
|
2659
|
-
var _this$
|
|
2660
|
-
var configured = (_this$
|
|
2675
|
+
var _this$otherParams21, _this$otherParams22;
|
|
2676
|
+
var configured = (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.checkoutSyncTaskEnabled;
|
|
2661
2677
|
if (configured === true) return true;
|
|
2662
|
-
var platform = normalizeRuntimePlatform((_this$
|
|
2678
|
+
var platform = normalizeRuntimePlatform((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.platform);
|
|
2663
2679
|
return !isCustomerUserPlatform(platform) && !isSelfServicePlatform(platform);
|
|
2664
2680
|
}
|
|
2665
2681
|
|
|
@@ -2814,8 +2830,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2814
2830
|
}, {
|
|
2815
2831
|
key: "isAuthenticatedCustomerUserPlatform",
|
|
2816
2832
|
value: function isAuthenticatedCustomerUserPlatform() {
|
|
2817
|
-
var _this$
|
|
2818
|
-
return isCustomerUserPlatform((_this$
|
|
2833
|
+
var _this$otherParams23;
|
|
2834
|
+
return isCustomerUserPlatform((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.platform);
|
|
2819
2835
|
}
|
|
2820
2836
|
}, {
|
|
2821
2837
|
key: "resolveDiscountOrderIdentity",
|
|
@@ -3155,7 +3171,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3155
3171
|
key: "getSalesSettings",
|
|
3156
3172
|
value: (function () {
|
|
3157
3173
|
var _getSalesSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
3158
|
-
var _this$
|
|
3174
|
+
var _this$otherParams24;
|
|
3159
3175
|
var config;
|
|
3160
3176
|
return _regeneratorRuntime().wrap(function _callee19$(_context20) {
|
|
3161
3177
|
while (1) switch (_context20.prev = _context20.next) {
|
|
@@ -3170,7 +3186,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3170
3186
|
}
|
|
3171
3187
|
throw new Error('Sales settings are unavailable without a business context.');
|
|
3172
3188
|
case 5:
|
|
3173
|
-
return _context20.abrupt("return", normalizeSalesSettings(config, (_this$
|
|
3189
|
+
return _context20.abrupt("return", normalizeSalesSettings(config, (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform));
|
|
3174
3190
|
case 6:
|
|
3175
3191
|
case "end":
|
|
3176
3192
|
return _context20.stop();
|
|
@@ -3185,11 +3201,11 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3185
3201
|
}, {
|
|
3186
3202
|
key: "getLoadedSalesSettings",
|
|
3187
3203
|
value: function getLoadedSalesSettings() {
|
|
3188
|
-
var _this$
|
|
3204
|
+
var _this$otherParams25;
|
|
3189
3205
|
if (!this.runtimeOpenDataSnapshot) {
|
|
3190
3206
|
throw new Error('Sales settings are not loaded. Call getSalesSettings before preparing a booking.');
|
|
3191
3207
|
}
|
|
3192
|
-
return normalizeSalesSettings(this.runtimeOpenDataSnapshot, (_this$
|
|
3208
|
+
return normalizeSalesSettings(this.runtimeOpenDataSnapshot, (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.platform);
|
|
3193
3209
|
}
|
|
3194
3210
|
}, {
|
|
3195
3211
|
key: "getProductBookingsForScheduling",
|
|
@@ -3209,8 +3225,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3209
3225
|
}, {
|
|
3210
3226
|
key: "shouldApplyMultipleBookingScheduling",
|
|
3211
3227
|
value: function shouldApplyMultipleBookingScheduling() {
|
|
3212
|
-
var _this$
|
|
3213
|
-
var platform = normalizeRuntimePlatform((_this$
|
|
3228
|
+
var _this$otherParams26;
|
|
3229
|
+
var platform = normalizeRuntimePlatform((_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.platform);
|
|
3214
3230
|
return platform === 'pos' || platform === 'webpos';
|
|
3215
3231
|
}
|
|
3216
3232
|
}, {
|
|
@@ -3413,13 +3429,13 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3413
3429
|
key: "loadPickupTimingOpenData",
|
|
3414
3430
|
value: function () {
|
|
3415
3431
|
var _loadPickupTimingOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(_force) {
|
|
3416
|
-
var _ref38, _this$otherParams$bus2, _this$
|
|
3432
|
+
var _ref38, _this$otherParams$bus2, _this$otherParams27, _this$otherParams28;
|
|
3417
3433
|
var scope, businessCode, config;
|
|
3418
3434
|
return _regeneratorRuntime().wrap(function _callee22$(_context23) {
|
|
3419
3435
|
while (1) switch (_context23.prev = _context23.next) {
|
|
3420
3436
|
case 0:
|
|
3421
3437
|
scope = this.getPickupTimingScope();
|
|
3422
|
-
businessCode = String((_ref38 = (_this$otherParams$bus2 = (_this$
|
|
3438
|
+
businessCode = String((_ref38 = (_this$otherParams$bus2 = (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.businessCode) !== null && _this$otherParams$bus2 !== void 0 ? _this$otherParams$bus2 : (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.business_code) !== null && _ref38 !== void 0 ? _ref38 : '').trim();
|
|
3423
3439
|
_context23.next = 4;
|
|
3424
3440
|
return this.loadOpenData({
|
|
3425
3441
|
businessCode: businessCode,
|
|
@@ -3505,13 +3521,13 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3505
3521
|
key: "validateRequiredProducts",
|
|
3506
3522
|
value: (function () {
|
|
3507
3523
|
var _validateRequiredProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
3508
|
-
var _ref39, _this$otherParams$bus3, _this$
|
|
3524
|
+
var _ref39, _this$otherParams$bus3, _this$otherParams29, _this$otherParams30, _this$otherParams$cha3, _this$otherParams31, _this$otherParams32;
|
|
3509
3525
|
var businessCode, channel, scope, order, runtimeConfig, configs, _response$data2, openData, ids, response, strategyConfigs, cartItems, result, _result$failedChecks$, error;
|
|
3510
3526
|
return _regeneratorRuntime().wrap(function _callee24$(_context25) {
|
|
3511
3527
|
while (1) switch (_context25.prev = _context25.next) {
|
|
3512
3528
|
case 0:
|
|
3513
|
-
businessCode = String((_ref39 = (_this$otherParams$bus3 = (_this$
|
|
3514
|
-
channel = String((_this$otherParams$cha3 = (_this$
|
|
3529
|
+
businessCode = String((_ref39 = (_this$otherParams$bus3 = (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.businessCode) !== null && _this$otherParams$bus3 !== void 0 ? _this$otherParams$bus3 : (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.business_code) !== null && _ref39 !== void 0 ? _ref39 : '').trim();
|
|
3530
|
+
channel = String((_this$otherParams$cha3 = (_this$otherParams31 = this.otherParams) === null || _this$otherParams31 === void 0 ? void 0 : _this$otherParams31.channel) !== null && _this$otherParams$cha3 !== void 0 ? _this$otherParams$cha3 : '').trim();
|
|
3515
3531
|
if (!(businessCode !== 'venue_ticket' || channel !== 'online_ordering')) {
|
|
3516
3532
|
_context25.next = 4;
|
|
3517
3533
|
break;
|
|
@@ -3520,7 +3536,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3520
3536
|
case 4:
|
|
3521
3537
|
scope = this.getPickupTimingScope();
|
|
3522
3538
|
order = this.getTempOrder();
|
|
3523
|
-
runtimeConfig = ((_this$
|
|
3539
|
+
runtimeConfig = ((_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.itemRule) || {};
|
|
3524
3540
|
configs = normalizeItemRuleStrategyConfigs(runtimeConfig.strategyConfigs);
|
|
3525
3541
|
if (configs.length) {
|
|
3526
3542
|
_context25.next = 23;
|
|
@@ -3749,7 +3765,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3749
3765
|
key: "resolveProductAllergyRequirement",
|
|
3750
3766
|
value: (function () {
|
|
3751
3767
|
var _resolveProductAllergyRequirement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
3752
|
-
var _this$
|
|
3768
|
+
var _this$otherParams33, _this$getOrderProduct, _runtimePax$total, _runtimePax$adult, _runtimePax$child, _ref42, _runtimeConfig$servic, _this$otherParams34, _ref43, _ref44, _params$channel, _this$otherParams35, _this$otherParams36, _runtimeConfig$submis;
|
|
3753
3769
|
var productId, strategyConfigs, productVariantId, runtimeConfig, runtimePax, cartItems;
|
|
3754
3770
|
return _regeneratorRuntime().wrap(function _callee28$(_context29) {
|
|
3755
3771
|
while (1) switch (_context29.prev = _context29.next) {
|
|
@@ -3772,7 +3788,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3772
3788
|
return _context29.abrupt("return", null);
|
|
3773
3789
|
case 8:
|
|
3774
3790
|
productVariantId = normalizePositiveInteger(params.productVariantId);
|
|
3775
|
-
runtimeConfig = ((_this$
|
|
3791
|
+
runtimeConfig = ((_this$otherParams33 = this.otherParams) === null || _this$otherParams33 === void 0 ? void 0 : _this$otherParams33.itemRule) || {};
|
|
3776
3792
|
runtimePax = runtimeConfig.pax || {};
|
|
3777
3793
|
cartItems = (((_this$getOrderProduct = this.getOrderProducts) === null || _this$getOrderProduct === void 0 ? void 0 : _this$getOrderProduct.call(this)) || []).map(function (item) {
|
|
3778
3794
|
var _item$product_id, _item$product_variant, _ref41, _item$num;
|
|
@@ -3791,8 +3807,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3791
3807
|
child: Number((_runtimePax$child = runtimePax.child) !== null && _runtimePax$child !== void 0 ? _runtimePax$child : 0) || 0
|
|
3792
3808
|
},
|
|
3793
3809
|
cartItems: cartItems,
|
|
3794
|
-
serviceType: String((_ref42 = (_runtimeConfig$servic = runtimeConfig.serviceType) !== null && _runtimeConfig$servic !== void 0 ? _runtimeConfig$servic : (_this$
|
|
3795
|
-
channel: String((_ref43 = (_ref44 = (_params$channel = params.channel) !== null && _params$channel !== void 0 ? _params$channel : (_this$
|
|
3810
|
+
serviceType: String((_ref42 = (_runtimeConfig$servic = runtimeConfig.serviceType) !== null && _runtimeConfig$servic !== void 0 ? _runtimeConfig$servic : (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.serviceType) !== null && _ref42 !== void 0 ? _ref42 : ''),
|
|
3811
|
+
channel: String((_ref43 = (_ref44 = (_params$channel = params.channel) !== null && _params$channel !== void 0 ? _params$channel : (_this$otherParams35 = this.otherParams) === null || _this$otherParams35 === void 0 ? void 0 : _this$otherParams35.channel) !== null && _ref44 !== void 0 ? _ref44 : (_this$otherParams36 = this.otherParams) === null || _this$otherParams36 === void 0 ? void 0 : _this$otherParams36.platform) !== null && _ref43 !== void 0 ? _ref43 : ''),
|
|
3796
3812
|
currentProduct: _objectSpread({
|
|
3797
3813
|
product_id: productId
|
|
3798
3814
|
}, productVariantId ? {
|
|
@@ -3882,8 +3898,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3882
3898
|
}, {
|
|
3883
3899
|
key: "getPosReceiptAutoPrintPaymentStatuses",
|
|
3884
3900
|
value: function getPosReceiptAutoPrintPaymentStatuses() {
|
|
3885
|
-
var _this$
|
|
3886
|
-
var platform = normalizeRuntimePlatform((_this$
|
|
3901
|
+
var _this$otherParams37, _this$runtimeOpenData;
|
|
3902
|
+
var platform = normalizeRuntimePlatform((_this$otherParams37 = this.otherParams) === null || _this$otherParams37 === void 0 ? void 0 : _this$otherParams37.platform);
|
|
3887
3903
|
if (platform !== 'pos' && platform !== 'webpos') return undefined;
|
|
3888
3904
|
if (!this.isInvoiceOpenDataCacheCurrent() || this.runtimeOpenDataModule !== this.store.openData || this.runtimeOpenDataCore !== this.core) return undefined;
|
|
3889
3905
|
return normalizePosReceiptAutoPrintPaymentStatuses((_this$runtimeOpenData = this.runtimeOpenDataSnapshot) === null || _this$runtimeOpenData === void 0 ? void 0 : _this$runtimeOpenData['documents.pos_receipt_auto_print_payment_statuses']);
|
|
@@ -3891,9 +3907,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3891
3907
|
}, {
|
|
3892
3908
|
key: "isInvoiceOpenDataCacheCurrent",
|
|
3893
3909
|
value: function isInvoiceOpenDataCacheCurrent() {
|
|
3894
|
-
var _this$
|
|
3895
|
-
var businessCode = String(((_this$
|
|
3896
|
-
var channel = String(((_this$
|
|
3910
|
+
var _this$otherParams38, _this$otherParams39;
|
|
3911
|
+
var businessCode = String(((_this$otherParams38 = this.otherParams) === null || _this$otherParams38 === void 0 ? void 0 : _this$otherParams38.businessCode) || '').trim();
|
|
3912
|
+
var channel = String(((_this$otherParams39 = this.otherParams) === null || _this$otherParams39 === void 0 ? void 0 : _this$otherParams39.channel) || '').trim();
|
|
3897
3913
|
if (!businessCode || !channel) return false;
|
|
3898
3914
|
return this.openDataTarget === "".concat(businessCode, "+").concat(channel) && this.runtimeOpenDataScope === this.getRuntimeOpenDataScope();
|
|
3899
3915
|
}
|
|
@@ -4329,10 +4345,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4329
4345
|
}, {
|
|
4330
4346
|
key: "createVenueCatalogSession",
|
|
4331
4347
|
value: function createVenueCatalogSession(params) {
|
|
4332
|
-
var
|
|
4333
|
-
_params$sessionKey,
|
|
4348
|
+
var _params$sessionKey,
|
|
4334
4349
|
_this15 = this;
|
|
4335
|
-
if (!
|
|
4350
|
+
if (!this.supportsVenueSelectionSnapshot()) {
|
|
4336
4351
|
throw venueCatalogError('VENUE_CATALOG_PLATFORM_UNSUPPORTED', 'Venue catalog sessions require a customer platform.');
|
|
4337
4352
|
}
|
|
4338
4353
|
var ids = params.menu_list_ids;
|
|
@@ -4348,6 +4363,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4348
4363
|
var generation = this.runtimeInitializationGeneration;
|
|
4349
4364
|
var core = this.core;
|
|
4350
4365
|
var request = this.request;
|
|
4366
|
+
var venueKioskMode = this.isVenueKioskPlatform() ? this.otherParams.venueBookingMode : undefined;
|
|
4351
4367
|
var entry = {
|
|
4352
4368
|
scope: scope,
|
|
4353
4369
|
generation: generation,
|
|
@@ -4368,7 +4384,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4368
4384
|
if (!_this15.venueCatalogSessions.has(entry)) {
|
|
4369
4385
|
throw venueCatalogError('VENUE_CATALOG_DISPOSED', 'The venue catalog session is closed.');
|
|
4370
4386
|
}
|
|
4371
|
-
if (_this15.runtimeOpenDataDestroyed || _this15.core !== core || _this15.request !== request || generation !== _this15.runtimeInitializationGeneration || scope !== _this15.getRuntimeOpenDataScope()) {
|
|
4387
|
+
if (_this15.runtimeOpenDataDestroyed || _this15.core !== core || _this15.request !== request || generation !== _this15.runtimeInitializationGeneration || scope !== _this15.getRuntimeOpenDataScope() || !_this15.supportsVenueSelectionSnapshot() || venueKioskMode !== (_this15.isVenueKioskPlatform() ? _this15.otherParams.venueBookingMode : undefined)) {
|
|
4372
4388
|
throw venueCatalogError('VENUE_CATALOG_STALE', 'The venue store context changed. Reopen the booking page.');
|
|
4373
4389
|
}
|
|
4374
4390
|
};
|
|
@@ -4412,25 +4428,28 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4412
4428
|
return menus.some(function (menu) {
|
|
4413
4429
|
return productMatchesVenueMenu(product, menu);
|
|
4414
4430
|
});
|
|
4415
|
-
}).map(function (product) {
|
|
4416
|
-
return _this15.getVenueCatalogHydratedProduct(product);
|
|
4417
4431
|
});
|
|
4418
4432
|
if ((_input$product_ids = input.product_ids) !== null && _input$product_ids !== void 0 && _input$product_ids.length) products = products.filter(function (product) {
|
|
4419
4433
|
return input.product_ids.some(function (id) {
|
|
4420
4434
|
return Number(id) === Number(product.id);
|
|
4421
4435
|
});
|
|
4422
4436
|
});
|
|
4437
|
+
// Detail/quote reads must not deep-clone every other member of the pool.
|
|
4438
|
+
// Hydration owns a fresh copy of each selected product, including variants.
|
|
4439
|
+
products = products.map(function (product) {
|
|
4440
|
+
return _this15.getVenueCatalogHydratedProduct(product);
|
|
4441
|
+
});
|
|
4423
4442
|
var user = (_this15$core$getPlugi = (_this15$core = _this15.core).getPlugin) === null || _this15$core$getPlugi === void 0 ? void 0 : _this15$core$getPlugi.call(_this15$core, 'user');
|
|
4424
4443
|
var queryPayload = {
|
|
4425
4444
|
schedule_date: datetime.slice(0, 10),
|
|
4426
4445
|
schedule_datetime: datetime,
|
|
4427
|
-
customer_id: (_ref48 = (_input$customer_id = input.customer_id) !== null && _input$customer_id !== void 0 ? _input$customer_id : (_this15$getTempOrder = _this15.getTempOrder()) === null || _this15$getTempOrder === void 0 ? void 0 : _this15$getTempOrder.customer_id) !== null && _ref48 !== void 0 ? _ref48 : user === null || user === void 0 || (_user$get = user.get) === null || _user$get === void 0 || (_user$get = _user$get.call(user)) === null || _user$get === void 0 ? void 0 : _user$get.id,
|
|
4446
|
+
customer_id: (_ref48 = (_input$customer_id = input.customer_id) !== null && _input$customer_id !== void 0 ? _input$customer_id : (_this15$getTempOrder = _this15.getTempOrder()) === null || _this15$getTempOrder === void 0 ? void 0 : _this15$getTempOrder.customer_id) !== null && _ref48 !== void 0 ? _ref48 : _this15.isVenueKioskPlatform() ? undefined : user === null || user === void 0 || (_user$get = user.get) === null || _user$get === void 0 || (_user$get = _user$get.call(user)) === null || _user$get === void 0 ? void 0 : _user$get.id,
|
|
4428
4447
|
strategy_context: _objectSpread(_objectSpread({}, _this15.getPriceQueryStrategyContext()), input.strategy_context || {})
|
|
4429
4448
|
};
|
|
4430
4449
|
var result = tryResolveClientDataVariants({
|
|
4431
4450
|
core: _this15.core,
|
|
4432
4451
|
otherParams: _this15.otherParams,
|
|
4433
|
-
products:
|
|
4452
|
+
products: products,
|
|
4434
4453
|
queryPayload: queryPayload,
|
|
4435
4454
|
handledByOsServer: false,
|
|
4436
4455
|
scheduleList: _this15.getAvailabilityScheduleCatalog(),
|
|
@@ -7426,12 +7445,12 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7426
7445
|
key: "queryBookingAvailability",
|
|
7427
7446
|
value: (function () {
|
|
7428
7447
|
var _queryBookingAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(contextId, request) {
|
|
7429
|
-
var _this$
|
|
7448
|
+
var _this$otherParams$pla4, _this$otherParams49, _context$prepareParam3;
|
|
7430
7449
|
var customerSelectionSnapshot, _ref67, context, projectionEntry, refreshed, strictAvailability, isPosAvailabilityRequest, rememberedTimeByProductId, queryRequest, result, contextVersion, contextualResult;
|
|
7431
7450
|
return _regeneratorRuntime().wrap(function _callee67$(_context68) {
|
|
7432
7451
|
while (1) switch (_context68.prev = _context68.next) {
|
|
7433
7452
|
case 0:
|
|
7434
|
-
customerSelectionSnapshot = request.target === 'resource' && request.customerSelectionSnapshot === true &&
|
|
7453
|
+
customerSelectionSnapshot = request.target === 'resource' && request.customerSelectionSnapshot === true && this.supportsVenueSelectionSnapshot();
|
|
7435
7454
|
if (!customerSelectionSnapshot) {
|
|
7436
7455
|
_context68.next = 5;
|
|
7437
7456
|
break;
|
|
@@ -7451,7 +7470,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7451
7470
|
refreshed = _ref67.refreshed;
|
|
7452
7471
|
this.assertContextualQueryFreshness(context, request);
|
|
7453
7472
|
strictAvailability = context.prepareParams.strictAvailability === true;
|
|
7454
|
-
isPosAvailabilityRequest = String((_this$otherParams$pla4 = (_this$
|
|
7473
|
+
isPosAvailabilityRequest = String((_this$otherParams$pla4 = (_this$otherParams49 = this.otherParams) === null || _this$otherParams49 === void 0 ? void 0 : _this$otherParams49.platform) !== null && _this$otherParams$pla4 !== void 0 ? _this$otherParams$pla4 : '').trim().toLowerCase() === 'pos';
|
|
7455
7474
|
rememberedTimeByProductId = request.selectionIntent === 'remembered' ? this.resolveOrderRememberedTimes(context, projectionEntry.projection, request.rememberedTimeByProductId, request.orderSessionId) : undefined;
|
|
7456
7475
|
queryRequest = request.target === 'date' || request.target === 'product' ? _objectSpread(_objectSpread({}, request), {}, {
|
|
7457
7476
|
dateRange: request.dateRange || this.getAvailabilityBusinessDateRange(projectionEntry.projection)
|
|
@@ -7586,14 +7605,14 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7586
7605
|
value: function () {
|
|
7587
7606
|
var _removeBookingProductsOutsideStartDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(startDate) {
|
|
7588
7607
|
var _this$getTempOrder5,
|
|
7589
|
-
_this$
|
|
7608
|
+
_this$otherParams50,
|
|
7590
7609
|
_this28 = this;
|
|
7591
7610
|
var products, targetDate, identities;
|
|
7592
7611
|
return _regeneratorRuntime().wrap(function _callee68$(_context69) {
|
|
7593
7612
|
while (1) switch (_context69.prev = _context69.next) {
|
|
7594
7613
|
case 0:
|
|
7595
7614
|
products = ((_this$getTempOrder5 = this.getTempOrder()) === null || _this$getTempOrder5 === void 0 ? void 0 : _this$getTempOrder5.products) || [];
|
|
7596
|
-
if (!(((_this$
|
|
7615
|
+
if (!(((_this$otherParams50 = this.otherParams) === null || _this$otherParams50 === void 0 ? void 0 : _this$otherParams50.enforceSingleBookingStartDate) !== true)) {
|
|
7597
7616
|
_context69.next = 3;
|
|
7598
7617
|
break;
|
|
7599
7618
|
}
|
|
@@ -7635,14 +7654,13 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7635
7654
|
var _this$availabilityCon,
|
|
7636
7655
|
_this29 = this,
|
|
7637
7656
|
_this$otherParams$pla5,
|
|
7638
|
-
_this$
|
|
7639
|
-
_this$otherParams53,
|
|
7657
|
+
_this$otherParams51,
|
|
7640
7658
|
_this$availabilityCon2,
|
|
7641
7659
|
_params$availabilityC3,
|
|
7642
7660
|
_params,
|
|
7643
7661
|
_this$store$order11,
|
|
7644
7662
|
_this$store$order11$e;
|
|
7645
|
-
var normalizedContextId, calendarOrderSessionId, callerGuard, isEditingSelection, isPartyReplacement, isRememberedSelection, isOrderRememberedSelection, customerSelectionSnapshot, strictAvailability, hasCommitGuard, rememberedOrder, getRememberedCommitIdentity, rememberedCommitIdentity, availabilityCommitTargetGuard, guardedCommitPublished, _params$bookingCount, _ref69, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _this$otherParams$pla6, _this$
|
|
7663
|
+
var normalizedContextId, calendarOrderSessionId, callerGuard, isEditingSelection, isPartyReplacement, isRememberedSelection, isOrderRememberedSelection, customerSelectionSnapshot, strictAvailability, hasCommitGuard, rememberedOrder, getRememberedCommitIdentity, rememberedCommitIdentity, availabilityCommitTargetGuard, guardedCommitPublished, _params$bookingCount, _ref69, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _this$otherParams$pla6, _this$otherParams52, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, _this$otherParams$pla7, _this$otherParams53, _params$orderProduct$3, _params$orderProduct6, _existingBooking$hold, _existingBooking$meta, _ref71, _params$orderProduct$4, _params$orderProduct7, _params$orderProduct8, _existingBooking$meta2, _existingBooking$meta3, _existingBooking$hold2, _params$orderProduct9, _transformed$metadata, _nextContext$activeVe, bookingCount, orderProductQuantity, partySize, _ref70, context, projectionEntry, refreshed, boundEditingUids, orderProductId, editingLine, _editingLine$product_2, baseProjection, selectedProduct, commitWriteGuard, prepareParams, fallbackResources, commitSnapshot, refreshedProjection, _baseProjection$meta$3, latestContext, candidateDurationMinutes, candidateStartTime, allowPosAvailabilityOverride, candidateBusinessDate, rememberedTimeByProductId, refreshedRanges, refreshedCandidateBase, product, validation, forced, capacityConflict, revalidationEntry, revalidatedContext, refreshedCandidate, availabilityCommitGuard, existingBooking, existingBookingUid, booking, legacyBooking, legacyResources, selectedResources, resourceKeys, transformed, productLineUid, bookingUid, productLineUids, bookingUids, relatedRetailProducts, _transformed$product_, _transformed$product_2, _transformed$product_3, _ref72, _transformed$product_4, editParams, _this$getTempOrder6, _this$getTempOrder7, _params$salesNotes, _params$salesNotes2, _ref73, beforeProductLineUids, beforeBookingUids, products, addedLines, addedBookings, targetStillCurrent, nextContext, result, emit, release;
|
|
7646
7664
|
return _regeneratorRuntime().wrap(function _callee69$(_context70) {
|
|
7647
7665
|
while (1) switch (_context70.prev = _context70.next) {
|
|
7648
7666
|
case 0:
|
|
@@ -7677,13 +7695,13 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7677
7695
|
case 9:
|
|
7678
7696
|
isRememberedSelection = params.selectionIntent === 'remembered';
|
|
7679
7697
|
isOrderRememberedSelection = isRememberedSelection && params.orderSessionId !== undefined;
|
|
7680
|
-
if (!(isRememberedSelection && (String((_this$otherParams$pla5 = (_this$
|
|
7698
|
+
if (!(isRememberedSelection && (String((_this$otherParams$pla5 = (_this$otherParams51 = this.otherParams) === null || _this$otherParams51 === void 0 ? void 0 : _this$otherParams51.platform) !== null && _this$otherParams$pla5 !== void 0 ? _this$otherParams$pla5 : '').trim().toLowerCase() !== 'pos' || params.mode !== 'add'))) {
|
|
7681
7699
|
_context70.next = 13;
|
|
7682
7700
|
break;
|
|
7683
7701
|
}
|
|
7684
7702
|
throw new AvailabilityError('INVALID_TARGET_FILTER', '记忆时间自动提交仅支持 POS 新增 duration 商品');
|
|
7685
7703
|
case 13:
|
|
7686
|
-
customerSelectionSnapshot = params.customerSelectionSnapshot === true &&
|
|
7704
|
+
customerSelectionSnapshot = params.customerSelectionSnapshot === true && this.supportsVenueSelectionSnapshot();
|
|
7687
7705
|
strictAvailability = ((_this$availabilityCon2 = this.availabilityContextRegistry.get(normalizedContextId)) === null || _this$availabilityCon2 === void 0 ? void 0 : _this$availabilityCon2.prepareParams.strictAvailability) === true;
|
|
7688
7706
|
hasCommitGuard = customerSelectionSnapshot || strictAvailability || isRememberedSelection || isPartyReplacement || Boolean(params.availabilityCommitGuard);
|
|
7689
7707
|
(_params$availabilityC3 = (_params = params).availabilityCommitGuard) === null || _params$availabilityC3 === void 0 || _params$availabilityC3.call(_params);
|
|
@@ -7882,7 +7900,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7882
7900
|
selectedProduct = baseProjection.products.find(function (item) {
|
|
7883
7901
|
return sameAvailabilityId(item.id, params.candidate.productId);
|
|
7884
7902
|
});
|
|
7885
|
-
if (!(isRememberedSelection && (String((_this$otherParams$pla6 = (_this$
|
|
7903
|
+
if (!(isRememberedSelection && (String((_this$otherParams$pla6 = (_this$otherParams52 = this.otherParams) === null || _this$otherParams52 === void 0 ? void 0 : _this$otherParams52.platform) !== null && _this$otherParams$pla6 !== void 0 ? _this$otherParams$pla6 : '').trim().toLowerCase() !== 'pos' || params.mode !== 'add' || (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.kind) !== 'duration'))) {
|
|
7886
7904
|
_context70.next = 82;
|
|
7887
7905
|
break;
|
|
7888
7906
|
}
|
|
@@ -7959,7 +7977,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7959
7977
|
this.assertAvailabilityCommitWriteCAS(commitWriteGuard);
|
|
7960
7978
|
candidateDurationMinutes = getCandidateDurationMinutes(params.candidate);
|
|
7961
7979
|
candidateStartTime = getCandidateStartTime(params.candidate);
|
|
7962
|
-
allowPosAvailabilityOverride = String((_this$otherParams$pla7 = (_this$
|
|
7980
|
+
allowPosAvailabilityOverride = String((_this$otherParams$pla7 = (_this$otherParams53 = this.otherParams) === null || _this$otherParams53 === void 0 ? void 0 : _this$otherParams53.platform) !== null && _this$otherParams$pla7 !== void 0 ? _this$otherParams$pla7 : '').trim().toLowerCase() === 'pos' && !isRememberedSelection && !strictAvailability;
|
|
7963
7981
|
candidateBusinessDate = params.candidate.businessDate || ((selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.kind) === 'duration' && this.usesDurationTimeGrid(refreshedProjection) ? getDurationBusinessDate(refreshedProjection, params.candidate.startAt) : params.candidate.startAt.slice(0, 10));
|
|
7964
7982
|
rememberedTimeByProductId = isOrderRememberedSelection ? this.resolveOrderRememberedTimes(context, refreshedProjection, _defineProperty({}, String(params.candidate.productId), {
|
|
7965
7983
|
startAt: params.candidate.bookingStartAt,
|
|
@@ -59,6 +59,8 @@ export declare enum UnifiedBookingSalesHooks {
|
|
|
59
59
|
}
|
|
60
60
|
export interface UnifiedBookingSalesOtherParams extends Record<string, any> {
|
|
61
61
|
enableSessionStoragePersist?: boolean;
|
|
62
|
+
/** Explicitly opts the real Kiosk host into the Tickets/Party self-service contracts. */
|
|
63
|
+
venueBookingMode?: 'tickets' | 'party';
|
|
62
64
|
}
|
|
63
65
|
export type UnifiedBookingSalesAllergyRequirement = AllergyRequirement;
|
|
64
66
|
export interface UnifiedBookingSalesResolveProductAllergyRequirementParams {
|
|
@@ -151,7 +153,7 @@ export type ContextualAvailabilityQuery = (Omit<Extract<AvailabilityQuery, {
|
|
|
151
153
|
target: 'resource';
|
|
152
154
|
}>, 'selectedRanges'> & {
|
|
153
155
|
selectedRanges: ContextualProductTimeRange[];
|
|
154
|
-
/** PC/H5
|
|
156
|
+
/** PC/H5 and explicitly enabled Venue Kiosk templates retain the already-selected time. */
|
|
155
157
|
customerSelectionSnapshot?: boolean;
|
|
156
158
|
})) & {
|
|
157
159
|
/** Automatic remembered selection must not inherit POS manual exceptions. */
|
|
@@ -223,7 +225,7 @@ export interface UnifiedBookingSalesAddRetailProductParams {
|
|
|
223
225
|
}
|
|
224
226
|
export interface ContextualCommitAvailabilitySelectionParams {
|
|
225
227
|
mode: 'add' | 'edit' | 'replace';
|
|
226
|
-
/** PC/H5
|
|
228
|
+
/** PC/H5 and enabled Venue Kiosk templates write the selected snapshot; checkout is authoritative. */
|
|
227
229
|
customerSelectionSnapshot?: boolean;
|
|
228
230
|
/** Only POS duration add supports automatic remembered-time commits. */
|
|
229
231
|
selectionIntent?: 'remembered' | 'manual';
|