@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
|
@@ -37,35 +37,46 @@ export function createEmptySummary() {
|
|
|
37
37
|
* 数组元素先按主键排序再序列化,避免顺序差异导致误判为不同行。
|
|
38
38
|
*/
|
|
39
39
|
export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
var normalizeOptions = function normalizeOptions(options) {
|
|
41
|
+
var optionArr = Array.isArray(options) ? options : [];
|
|
42
|
+
return optionArr.map(function (item) {
|
|
43
|
+
var _ref, _item$add_price;
|
|
44
|
+
return {
|
|
45
|
+
option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
|
|
46
|
+
option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
|
|
47
|
+
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
48
|
+
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 : '')
|
|
49
|
+
};
|
|
50
|
+
}).sort(function (p, q) {
|
|
51
|
+
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
52
|
+
return p.option_group_item_id - q.option_group_item_id;
|
|
53
|
+
}
|
|
54
|
+
if (p.option_group_id !== q.option_group_id) {
|
|
55
|
+
return p.option_group_id - q.option_group_id;
|
|
56
|
+
}
|
|
57
|
+
if (p.num !== q.num) return p.num - q.num;
|
|
58
|
+
return p.price.localeCompare(q.price);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var normalizedOpts = normalizeOptions(productOptionItem);
|
|
57
62
|
var bundleArr = Array.isArray(productBundle) ? productBundle : [];
|
|
58
63
|
var normalizedBundles = bundleArr.map(function (item) {
|
|
59
|
-
var _ref2, _item$bundle_id;
|
|
64
|
+
var _ref2, _item$bundle_id, _item$bundle_variant_;
|
|
60
65
|
return {
|
|
61
66
|
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,
|
|
62
67
|
product_id: Number(item === null || item === void 0 ? void 0 : item.product_id) || 0,
|
|
63
|
-
|
|
68
|
+
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,
|
|
69
|
+
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
70
|
+
option: normalizeOptions(item === null || item === void 0 ? void 0 : item.option)
|
|
64
71
|
};
|
|
65
72
|
}).sort(function (p, q) {
|
|
66
73
|
if (p.bundle_id !== q.bundle_id) return p.bundle_id - q.bundle_id;
|
|
67
74
|
if (p.product_id !== q.product_id) return p.product_id - q.product_id;
|
|
68
|
-
|
|
75
|
+
if (p.product_variant_id !== q.product_variant_id) {
|
|
76
|
+
return p.product_variant_id - q.product_variant_id;
|
|
77
|
+
}
|
|
78
|
+
if (p.num !== q.num) return p.num - q.num;
|
|
79
|
+
return JSON.stringify(p.option).localeCompare(JSON.stringify(q.option));
|
|
69
80
|
});
|
|
70
81
|
return JSON.stringify([normalizedOpts, normalizedBundles]);
|
|
71
82
|
}
|
|
@@ -29,6 +29,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
29
29
|
private addTimeProductsCatalog;
|
|
30
30
|
private orderCustomerDiscountRefreshInFlight;
|
|
31
31
|
private orderCustomerDiscountRefreshCustomerId;
|
|
32
|
+
private orderCustomerPromotionRefreshInFlight;
|
|
32
33
|
private loadOpenDataConfigInFlight;
|
|
33
34
|
/**
|
|
34
35
|
* 在 BaseSales 默认模块清单(products/order/salesSummary/schedule)基础上追加 customer + bookingContext。
|
|
@@ -63,6 +64,8 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
63
64
|
scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
|
|
64
65
|
private hydrateOrderCustomerFromScanDiscounts;
|
|
65
66
|
private getDiscountCustomerId;
|
|
67
|
+
resolveCustomerById(customerId: string | number): Promise<ICustomer | null>;
|
|
68
|
+
/** 兼容既有优惠码扫码逻辑。 */
|
|
66
69
|
private resolveCustomerByDiscountCustomerId;
|
|
67
70
|
private findCustomerById;
|
|
68
71
|
private normalizeCustomer;
|
|
@@ -282,7 +285,10 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
282
285
|
restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
283
286
|
/** 内部:基于 OrderModule 当前状态构造一份 OrderCustomerChangePayload。 */
|
|
284
287
|
private buildOrderCustomerPayload;
|
|
285
|
-
|
|
288
|
+
protected refreshDiscountConfigAfterOrderCustomerChange(customerId: number | null): Promise<void>;
|
|
289
|
+
protected waitForOrderCustomerPromotionRefresh(): Promise<void>;
|
|
290
|
+
protected prepareProductPriceQueryContext(customerId?: number | string): Promise<void>;
|
|
291
|
+
protected preferAuthoritativeProductQueryPrice(): boolean;
|
|
286
292
|
/**
|
|
287
293
|
* 获取客户分页信息
|
|
288
294
|
* @returns 分页信息
|