@pisell/pisellos 2.3.67 → 2.3.69
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/model/strategy/adapter/walletPass/evaluator.js +0 -1
- package/dist/model/strategy/adapter/walletPass/utils.js +0 -2
- package/dist/modules/BaseModule.d.ts +1 -0
- package/dist/modules/BaseModule.js +24 -28
- package/dist/modules/Customer/index.d.ts +4 -0
- package/dist/modules/Customer/index.js +91 -59
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Order/index.d.ts +22 -2
- package/dist/modules/Order/index.js +313 -142
- package/dist/modules/Order/types.d.ts +13 -1
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
- package/dist/modules/Order/utils.js +0 -1
- package/dist/modules/Payment/index.d.ts +4 -0
- package/dist/modules/Payment/index.js +14 -4
- package/dist/modules/Payment/walletpass.js +52 -18
- package/dist/modules/Rules/index.js +46 -31
- package/dist/server/index.js +3 -6
- package/dist/server/modules/order/index.d.ts +1 -0
- package/dist/server/modules/order/index.js +252 -93
- package/dist/server/utils/small-ticket.js +2 -1
- package/dist/solution/BaseSales/index.d.ts +13 -1
- package/dist/solution/BaseSales/index.js +903 -831
- package/dist/solution/BaseSales/utils.js +31 -20
- package/dist/solution/BookingTicket/index.d.ts +7 -1
- package/dist/solution/BookingTicket/index.js +310 -224
- package/dist/solution/ScanOrder/utils.js +31 -20
- package/dist/solution/UnifiedBookingSales/index.d.ts +25 -0
- package/dist/solution/UnifiedBookingSales/index.js +640 -321
- package/dist/solution/UnifiedBookingSales/types.d.ts +7 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -1
- package/lib/model/strategy/adapter/walletPass/utils.js +0 -1
- package/lib/modules/BaseModule.d.ts +1 -0
- package/lib/modules/BaseModule.js +24 -37
- package/lib/modules/Customer/index.d.ts +4 -0
- package/lib/modules/Customer/index.js +11 -0
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Order/index.d.ts +22 -2
- package/lib/modules/Order/index.js +212 -54
- package/lib/modules/Order/types.d.ts +13 -1
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
- package/lib/modules/Order/utils.js +0 -1
- package/lib/modules/Payment/index.d.ts +4 -0
- package/lib/modules/Payment/index.js +7 -0
- package/lib/modules/Payment/walletpass.js +27 -2
- package/lib/modules/Rules/index.js +17 -1
- package/lib/server/index.js +3 -6
- package/lib/server/modules/order/index.d.ts +1 -0
- package/lib/server/modules/order/index.js +66 -2
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BaseSales/index.d.ts +13 -1
- package/lib/solution/BaseSales/index.js +61 -18
- package/lib/solution/BaseSales/utils.js +29 -18
- package/lib/solution/BookingTicket/index.d.ts +7 -1
- package/lib/solution/BookingTicket/index.js +65 -14
- package/lib/solution/ScanOrder/utils.js +29 -18
- package/lib/solution/UnifiedBookingSales/index.d.ts +25 -0
- package/lib/solution/UnifiedBookingSales/index.js +188 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +7 -0
- package/package.json +1 -1
|
@@ -388,35 +388,46 @@ export function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
|
|
|
388
388
|
* 数组元素先按主键排序再序列化,避免顺序差异导致误判为不同行。
|
|
389
389
|
*/
|
|
390
390
|
export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
391
|
-
var
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
391
|
+
var normalizeOptions = function normalizeOptions(options) {
|
|
392
|
+
var optionArr = Array.isArray(options) ? options : [];
|
|
393
|
+
return optionArr.map(function (item) {
|
|
394
|
+
var _ref, _item$add_price;
|
|
395
|
+
return {
|
|
396
|
+
option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
|
|
397
|
+
option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
|
|
398
|
+
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
399
|
+
price: String((_ref = (_item$add_price = item === null || item === void 0 ? void 0 : item.add_price) !== null && _item$add_price !== void 0 ? _item$add_price : item === null || item === void 0 ? void 0 : item.price) !== null && _ref !== void 0 ? _ref : '')
|
|
400
|
+
};
|
|
401
|
+
}).sort(function (p, q) {
|
|
402
|
+
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
403
|
+
return p.option_group_item_id - q.option_group_item_id;
|
|
404
|
+
}
|
|
405
|
+
if (p.option_group_id !== q.option_group_id) {
|
|
406
|
+
return p.option_group_id - q.option_group_id;
|
|
407
|
+
}
|
|
408
|
+
if (p.num !== q.num) return p.num - q.num;
|
|
409
|
+
return p.price.localeCompare(q.price);
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
var normalizedOpts = normalizeOptions(productOptionItem);
|
|
408
413
|
var bundleArr = Array.isArray(productBundle) ? productBundle : [];
|
|
409
414
|
var normalizedBundles = bundleArr.map(function (item) {
|
|
410
|
-
var _ref2, _item$bundle_id;
|
|
415
|
+
var _ref2, _item$bundle_id, _item$bundle_variant_;
|
|
411
416
|
return {
|
|
412
417
|
bundle_id: Number((_ref2 = (_item$bundle_id = item === null || item === void 0 ? void 0 : item.bundle_id) !== null && _item$bundle_id !== void 0 ? _item$bundle_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref2 !== void 0 ? _ref2 : 0) || 0,
|
|
413
418
|
product_id: Number(item === null || item === void 0 ? void 0 : item.product_id) || 0,
|
|
414
|
-
|
|
419
|
+
product_variant_id: Number((_item$bundle_variant_ = item === null || item === void 0 ? void 0 : item.bundle_variant_id) !== null && _item$bundle_variant_ !== void 0 ? _item$bundle_variant_ : item === null || item === void 0 ? void 0 : item.product_variant_id) || 0,
|
|
420
|
+
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
421
|
+
option: normalizeOptions(item === null || item === void 0 ? void 0 : item.option)
|
|
415
422
|
};
|
|
416
423
|
}).sort(function (p, q) {
|
|
417
424
|
if (p.bundle_id !== q.bundle_id) return p.bundle_id - q.bundle_id;
|
|
418
425
|
if (p.product_id !== q.product_id) return p.product_id - q.product_id;
|
|
419
|
-
|
|
426
|
+
if (p.product_variant_id !== q.product_variant_id) {
|
|
427
|
+
return p.product_variant_id - q.product_variant_id;
|
|
428
|
+
}
|
|
429
|
+
if (p.num !== q.num) return p.num - q.num;
|
|
430
|
+
return JSON.stringify(p.option).localeCompare(JSON.stringify(q.option));
|
|
420
431
|
});
|
|
421
432
|
return JSON.stringify([normalizedOpts, normalizedBundles]);
|
|
422
433
|
}
|
|
@@ -63,6 +63,24 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
63
63
|
private openDataTarget;
|
|
64
64
|
private loadOpenDataInFlight;
|
|
65
65
|
private loadOpenDataInFlightTarget;
|
|
66
|
+
protected getSubmitOrderSalesChannel(): string;
|
|
67
|
+
protected isSessionStoragePersistEnabled(): boolean;
|
|
68
|
+
protected shouldUseSessionStorageForSubModule(moduleName?: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* 读取与当前 cacheId 同分桶的 Solution 会话状态。
|
|
71
|
+
* 该状态独立于 otherParams,适合页面皮肤保存短生命周期 UI 状态。
|
|
72
|
+
*/
|
|
73
|
+
getSessionStateValue<T = unknown>(key: string): T | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* 写入与当前 cacheId 同分桶的 Solution 会话状态。
|
|
76
|
+
* value 为 undefined 时删除该 key;存储失败不阻断业务流程。
|
|
77
|
+
*/
|
|
78
|
+
setSessionStateValue(key: string, value: unknown): void;
|
|
79
|
+
/**
|
|
80
|
+
* 清除当前 cacheId 的可恢复订单快照,同时保留 Solution UI sessionState。
|
|
81
|
+
* 用于支付跳转等终态场景,避免浏览器返回时恢复已提交订单。
|
|
82
|
+
*/
|
|
83
|
+
clearSessionStorageOrderSnapshot(): void;
|
|
66
84
|
/**
|
|
67
85
|
* Kiosk 不能把已收款订单留在本地等待重试:默认直接等待云端 checkout。
|
|
68
86
|
* 兼容仍需要 WebPOS 待同步模式的入口可显式传 checkoutSyncTaskEnabled: true。
|
|
@@ -72,6 +90,13 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
72
90
|
protected getDefaultCheckoutSmallTicketDataFlag(): number;
|
|
73
91
|
protected getRegisteredModuleNames(): readonly string[];
|
|
74
92
|
protected createSubModule(moduleName: string): Module | null;
|
|
93
|
+
addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
94
|
+
syncAuthenticatedOrderCustomer(): Promise<boolean>;
|
|
95
|
+
private isAuthenticatedCustomerUserPlatform;
|
|
96
|
+
private resolveDiscountOrderIdentity;
|
|
97
|
+
private resolveDiscountAction;
|
|
98
|
+
private resetCachedCustomerDiscountState;
|
|
99
|
+
private refreshLegacySessionCustomerDiscounts;
|
|
75
100
|
/**
|
|
76
101
|
* Loads OpenData without borrowing BookingTicket. Cache ownership is tied to the exact
|
|
77
102
|
* business/channel target so a reused solution instance cannot leak another entry's menus.
|