@pisell/pisellos 2.2.293 → 2.2.294
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/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/dist/solution/UnifiedBookingSales/index.js +20 -18
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/lib/solution/UnifiedBookingSales/index.js +5 -3
- package/package.json +1 -1
|
@@ -130,8 +130,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
130
130
|
*/
|
|
131
131
|
clearSessionStorageOrderSnapshot(): void;
|
|
132
132
|
/**
|
|
133
|
-
* Kiosk
|
|
134
|
-
*
|
|
133
|
+
* H5/Kiosk 不能把已收款订单留在本地等待重试,必须直接等待云端 checkout。
|
|
134
|
+
* 其它平台保持 WebPOS/POS 的本地待同步任务;显式 true 仍可强制使用本地任务。
|
|
135
135
|
*/
|
|
136
136
|
protected shouldUseCheckoutSyncTask(): boolean;
|
|
137
137
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
@@ -43,7 +43,7 @@ import { UnifiedBookingSalesHooks } from "./types";
|
|
|
43
43
|
import { AvailabilityRemoteOccupancyCache } from "./remoteOccupancyCache";
|
|
44
44
|
import { BookingTicket } from "../BookingTicket";
|
|
45
45
|
import { addLocalCalendarDays, captureRuntimeOffsetMinutes, formatLocalDate, formatLocalDateTime, formatLocalTime, localDateTimeToScalar, localDateToScalar, localDateToScalarStart, parseLocalDate, parseLocalDateTime } from "../../modules/ResourcePlanner/localClock";
|
|
46
|
-
import { isCustomerUserPlatform } from "../../utils/platform";
|
|
46
|
+
import { isCustomerUserPlatform, normalizeRuntimePlatform } from "../../utils/platform";
|
|
47
47
|
import { ItemRuleEvaluator } from "../../model/strategy/adapter/itemRule";
|
|
48
48
|
export * from "./types";
|
|
49
49
|
export { AvailabilityError } from "../../modules/ResourcePlanner";
|
|
@@ -1867,15 +1867,17 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1867
1867
|
}
|
|
1868
1868
|
|
|
1869
1869
|
/**
|
|
1870
|
-
* Kiosk
|
|
1871
|
-
*
|
|
1870
|
+
* H5/Kiosk 不能把已收款订单留在本地等待重试,必须直接等待云端 checkout。
|
|
1871
|
+
* 其它平台保持 WebPOS/POS 的本地待同步任务;显式 true 仍可强制使用本地任务。
|
|
1872
1872
|
*/
|
|
1873
1873
|
}, {
|
|
1874
1874
|
key: "shouldUseCheckoutSyncTask",
|
|
1875
1875
|
value: function shouldUseCheckoutSyncTask() {
|
|
1876
|
-
var _this$otherParams15;
|
|
1876
|
+
var _this$otherParams15, _this$otherParams16;
|
|
1877
1877
|
var configured = (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.checkoutSyncTaskEnabled;
|
|
1878
|
-
|
|
1878
|
+
if (configured === true) return true;
|
|
1879
|
+
var platform = normalizeRuntimePlatform((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.platform);
|
|
1880
|
+
return platform !== 'h5' && platform !== 'kiosk';
|
|
1879
1881
|
}
|
|
1880
1882
|
|
|
1881
1883
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
@@ -2029,8 +2031,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2029
2031
|
}, {
|
|
2030
2032
|
key: "isAuthenticatedCustomerUserPlatform",
|
|
2031
2033
|
value: function isAuthenticatedCustomerUserPlatform() {
|
|
2032
|
-
var _this$
|
|
2033
|
-
return isCustomerUserPlatform((_this$
|
|
2034
|
+
var _this$otherParams17;
|
|
2035
|
+
return isCustomerUserPlatform((_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.platform);
|
|
2034
2036
|
}
|
|
2035
2037
|
}, {
|
|
2036
2038
|
key: "resolveDiscountOrderIdentity",
|
|
@@ -2208,13 +2210,13 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2208
2210
|
key: "getOpenData",
|
|
2209
2211
|
value: function () {
|
|
2210
2212
|
var _getOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
2211
|
-
var _this$
|
|
2213
|
+
var _this$otherParams18, _this$otherParams19, _this$store$openData;
|
|
2212
2214
|
var businessCode, channel, target, cachedData;
|
|
2213
2215
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
2214
2216
|
while (1) switch (_context12.prev = _context12.next) {
|
|
2215
2217
|
case 0:
|
|
2216
|
-
businessCode = String(((_this$
|
|
2217
|
-
channel = String(((_this$
|
|
2218
|
+
businessCode = String(((_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.businessCode) || '').trim();
|
|
2219
|
+
channel = String(((_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.channel) || '').trim();
|
|
2218
2220
|
if (!(!businessCode || !channel)) {
|
|
2219
2221
|
_context12.next = 4;
|
|
2220
2222
|
break;
|
|
@@ -2381,7 +2383,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2381
2383
|
key: "resolveProductAllergyRequirement",
|
|
2382
2384
|
value: (function () {
|
|
2383
2385
|
var _resolveProductAllergyRequirement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
|
|
2384
|
-
var _this$
|
|
2386
|
+
var _this$otherParams20, _this$getOrderProduct, _runtimePax$total, _runtimePax$adult, _runtimePax$child, _ref35, _runtimeConfig$servic, _this$otherParams21, _ref36, _ref37, _params$channel, _this$otherParams22, _this$otherParams23, _runtimeConfig$submis;
|
|
2385
2387
|
var productId, strategyConfigs, productVariantId, runtimeConfig, runtimePax, cartItems;
|
|
2386
2388
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
2387
2389
|
while (1) switch (_context16.prev = _context16.next) {
|
|
@@ -2404,7 +2406,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2404
2406
|
return _context16.abrupt("return", null);
|
|
2405
2407
|
case 8:
|
|
2406
2408
|
productVariantId = normalizePositiveInteger(params.productVariantId);
|
|
2407
|
-
runtimeConfig = ((_this$
|
|
2409
|
+
runtimeConfig = ((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.itemRule) || {};
|
|
2408
2410
|
runtimePax = runtimeConfig.pax || {};
|
|
2409
2411
|
cartItems = (((_this$getOrderProduct = this.getOrderProducts) === null || _this$getOrderProduct === void 0 ? void 0 : _this$getOrderProduct.call(this)) || []).map(function (item) {
|
|
2410
2412
|
var _item$product_id, _item$product_variant, _ref34, _item$num;
|
|
@@ -2423,8 +2425,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
2423
2425
|
child: Number((_runtimePax$child = runtimePax.child) !== null && _runtimePax$child !== void 0 ? _runtimePax$child : 0) || 0
|
|
2424
2426
|
},
|
|
2425
2427
|
cartItems: cartItems,
|
|
2426
|
-
serviceType: String((_ref35 = (_runtimeConfig$servic = runtimeConfig.serviceType) !== null && _runtimeConfig$servic !== void 0 ? _runtimeConfig$servic : (_this$
|
|
2427
|
-
channel: String((_ref36 = (_ref37 = (_params$channel = params.channel) !== null && _params$channel !== void 0 ? _params$channel : (_this$
|
|
2428
|
+
serviceType: String((_ref35 = (_runtimeConfig$servic = runtimeConfig.serviceType) !== null && _runtimeConfig$servic !== void 0 ? _runtimeConfig$servic : (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.serviceType) !== null && _ref35 !== void 0 ? _ref35 : ''),
|
|
2429
|
+
channel: String((_ref36 = (_ref37 = (_params$channel = params.channel) !== null && _params$channel !== void 0 ? _params$channel : (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.channel) !== null && _ref37 !== void 0 ? _ref37 : (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.platform) !== null && _ref36 !== void 0 ? _ref36 : ''),
|
|
2428
2430
|
currentProduct: _objectSpread({
|
|
2429
2431
|
product_id: productId
|
|
2430
2432
|
}, productVariantId ? {
|
|
@@ -4466,7 +4468,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4466
4468
|
value: (function () {
|
|
4467
4469
|
var _getProductTimeRanges = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(contextId) {
|
|
4468
4470
|
var _this$otherParams$pla,
|
|
4469
|
-
_this$
|
|
4471
|
+
_this$otherParams24,
|
|
4470
4472
|
_this10 = this;
|
|
4471
4473
|
var request,
|
|
4472
4474
|
_yield$this$ensureAva,
|
|
@@ -4486,7 +4488,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4486
4488
|
context = _yield$this$ensureAva.context;
|
|
4487
4489
|
projectionEntry = _yield$this$ensureAva.projectionEntry;
|
|
4488
4490
|
contextVersion = context.activeVersion;
|
|
4489
|
-
allowOutsideOperatingHoursForRequestedStartTimes = String((_this$otherParams$pla = (_this$
|
|
4491
|
+
allowOutsideOperatingHoursForRequestedStartTimes = String((_this$otherParams$pla = (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform) !== null && _this$otherParams$pla !== void 0 ? _this$otherParams$pla : '').trim().toLowerCase() === 'pos' && Object.values(request.durationStartTimesByProductId || {}).some(function (startTimes) {
|
|
4490
4492
|
return Array.isArray(startTimes) && startTimes.length > 0;
|
|
4491
4493
|
});
|
|
4492
4494
|
return _context40.abrupt("return", getProjectionProductTimeRanges(projectionEntry.projection, _objectSpread(_objectSpread({}, request), allowOutsideOperatingHoursForRequestedStartTimes ? {
|
|
@@ -4636,7 +4638,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4636
4638
|
key: "commitAvailabilitySelection",
|
|
4637
4639
|
value: (function () {
|
|
4638
4640
|
var _commitAvailabilitySelection = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(contextId, params) {
|
|
4639
|
-
var normalizedContextId, _params$bookingCount, _ref51, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, _this$otherParams$pla2, _this$
|
|
4641
|
+
var normalizedContextId, _params$bookingCount, _ref51, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, _this$otherParams$pla2, _this$otherParams25, _ref52, _params$orderProduct$3, _params$orderProduct6, _existingBooking$meta, _ref53, _ref54, _params$orderProduct$4, _params$orderProduct7, _params$orderProduct8, _existingBooking$meta2, _existingBooking$hold, bookingCount, orderProductQuantity, partySize, _yield$this$ensureAva3, context, projectionEntry, refreshed, boundEditingUids, orderProductId, editingLine, _editingLine$product_2, baseProjection, commitWriteGuard, prepareParams, fallbackResources, commitSnapshot, refreshedProjection, _baseProjection$meta$3, latestContext, candidateDurationMinutes, candidateStartTime, allowPosAvailabilityOverride, refreshedRanges, refreshedCandidateBase, product, validation, forced, capacityConflict, revalidationEntry, revalidatedContext, refreshedCandidate, existingBooking, existingBookingUid, booking, transformed, productLineUid, bookingUid, productLineUids, bookingUids, _transformed$product_, _transformed$product_2, _transformed$product_3, _ref55, _transformed$product_4, _this$getTempOrder4, _this$getTempOrder5, _params$salesNotes, _this$getTempOrder6, beforeProductLineUids, beforeBookingUids, products, addedLines, addedBookings, nextContext, result;
|
|
4640
4642
|
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
4641
4643
|
while (1) switch (_context42.prev = _context42.next) {
|
|
4642
4644
|
case 0:
|
|
@@ -4866,7 +4868,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4866
4868
|
this.assertAvailabilityCommitWriteCAS(commitWriteGuard);
|
|
4867
4869
|
candidateDurationMinutes = getCandidateDurationMinutes(params.candidate);
|
|
4868
4870
|
candidateStartTime = getCandidateStartTime(params.candidate);
|
|
4869
|
-
allowPosAvailabilityOverride = String((_this$otherParams$pla2 = (_this$
|
|
4871
|
+
allowPosAvailabilityOverride = String((_this$otherParams$pla2 = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.platform) !== null && _this$otherParams$pla2 !== void 0 ? _this$otherParams$pla2 : '').trim().toLowerCase() === 'pos';
|
|
4870
4872
|
refreshedRanges = getProjectionProductTimeRanges(refreshedProjection, _objectSpread({
|
|
4871
4873
|
productIds: [params.candidate.productId],
|
|
4872
4874
|
dateRange: {
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _adapter.PromotionAdapter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _evaluator.PromotionEvaluator;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "default", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _adapter.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var _evaluator = require("./evaluator");
|
|
43
|
+
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
+
var _examples = require("./examples");
|
|
45
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -130,8 +130,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
130
130
|
*/
|
|
131
131
|
clearSessionStorageOrderSnapshot(): void;
|
|
132
132
|
/**
|
|
133
|
-
* Kiosk
|
|
134
|
-
*
|
|
133
|
+
* H5/Kiosk 不能把已收款订单留在本地等待重试,必须直接等待云端 checkout。
|
|
134
|
+
* 其它平台保持 WebPOS/POS 的本地待同步任务;显式 true 仍可强制使用本地任务。
|
|
135
135
|
*/
|
|
136
136
|
protected shouldUseCheckoutSyncTask(): boolean;
|
|
137
137
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
@@ -1548,12 +1548,14 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
1550
|
/**
|
|
1551
|
-
* Kiosk
|
|
1552
|
-
*
|
|
1551
|
+
* H5/Kiosk 不能把已收款订单留在本地等待重试,必须直接等待云端 checkout。
|
|
1552
|
+
* 其它平台保持 WebPOS/POS 的本地待同步任务;显式 true 仍可强制使用本地任务。
|
|
1553
1553
|
*/
|
|
1554
1554
|
shouldUseCheckoutSyncTask() {
|
|
1555
1555
|
const configured = this.otherParams?.checkoutSyncTaskEnabled;
|
|
1556
|
-
|
|
1556
|
+
if (configured === true) return true;
|
|
1557
|
+
const platform = (0, _platform.normalizeRuntimePlatform)(this.otherParams?.platform);
|
|
1558
|
+
return platform !== 'h5' && platform !== 'kiosk';
|
|
1557
1559
|
}
|
|
1558
1560
|
|
|
1559
1561
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|