@pisell/pisellos 2.1.118 → 2.1.120
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/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/model/strategy/adapter/index.d.ts +4 -0
- package/dist/model/strategy/adapter/index.js +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +439 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
- package/dist/model/strategy/adapter/itemRule/examples.d.ts +64 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +315 -0
- package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/dist/model/strategy/adapter/itemRule/index.js +5 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +206 -0
- package/dist/model/strategy/adapter/itemRule/type.js +101 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +271 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +1206 -0
- package/dist/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/dist/model/strategy/adapter/promotion/examples.js +166 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -0
- package/dist/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/dist/model/strategy/adapter/promotion/type.js +209 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -1
- package/dist/model/strategy/engine.d.ts +106 -0
- package/dist/model/strategy/engine.js +611 -0
- package/dist/model/strategy/index.d.ts +2 -93
- package/dist/model/strategy/index.js +6 -549
- package/dist/modules/Cart/types.d.ts +0 -2
- package/dist/modules/Cart/utils/cartProduct.js +25 -56
- package/dist/modules/Discount/types.d.ts +0 -18
- package/dist/modules/OpenData/index.d.ts +23 -0
- package/dist/modules/OpenData/index.js +167 -0
- package/dist/modules/OpenData/types.d.ts +73 -0
- package/dist/modules/OpenData/types.js +1 -0
- package/dist/modules/OpenData/utils.d.ts +2 -0
- package/dist/modules/OpenData/utils.js +75 -0
- package/dist/modules/Order/index.d.ts +58 -1
- package/dist/modules/Order/index.js +780 -29
- package/dist/modules/Order/types.d.ts +144 -12
- package/dist/modules/Order/utils.d.ts +25 -0
- package/dist/modules/Order/utils.js +225 -1
- package/dist/modules/Payment/index.d.ts +1 -2
- package/dist/modules/Payment/index.js +7 -10
- package/dist/modules/Payment/utils.js +0 -3
- package/dist/modules/Payment/walletpass.d.ts +0 -23
- package/dist/modules/Payment/walletpass.js +95 -191
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +2 -1
- package/dist/modules/Quotation/index.d.ts +48 -0
- package/dist/modules/Quotation/index.js +245 -0
- package/dist/modules/Quotation/types.d.ts +42 -0
- package/dist/modules/Quotation/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +5 -9
- package/dist/modules/Rules/index.js +164 -673
- package/dist/modules/Rules/types.d.ts +0 -2
- package/dist/modules/SalesSummary/index.d.ts +63 -0
- package/dist/modules/SalesSummary/index.js +174 -0
- package/dist/modules/SalesSummary/types.d.ts +59 -0
- package/dist/modules/SalesSummary/types.js +1 -0
- package/dist/modules/SalesSummary/utils.d.ts +30 -0
- package/dist/modules/SalesSummary/utils.js +513 -0
- package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
- package/dist/modules/ScanOrderLogger/index.js +161 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.js +95 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
- package/dist/modules/ScanOrderLogger/types.d.ts +46 -0
- package/dist/modules/ScanOrderLogger/types.js +1 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
- package/dist/modules/Summary/types.d.ts +0 -2
- package/dist/modules/Summary/utils.d.ts +3 -9
- package/dist/modules/Summary/utils.js +4 -25
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.js +5 -1
- package/dist/plugins/window.d.ts +0 -2
- package/dist/solution/BookingByStep/index.d.ts +1 -2
- package/dist/solution/BookingByStep/index.js +44 -42
- package/dist/solution/BookingByStep/types.d.ts +3 -1
- package/dist/solution/BookingByStep/types.js +5 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/Checkout/index.js +0 -2
- package/dist/solution/ScanOrder/index.d.ts +90 -0
- package/dist/solution/ScanOrder/index.js +1853 -0
- package/dist/solution/ScanOrder/types.d.ts +210 -0
- package/dist/solution/ScanOrder/types.js +16 -0
- package/dist/solution/ScanOrder/utils.d.ts +93 -0
- package/dist/solution/ScanOrder/utils.js +397 -0
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +7 -23
- package/dist/solution/ShopDiscount/types.d.ts +0 -1
- package/dist/solution/ShopDiscount/types.js +1 -2
- package/dist/solution/ShopDiscount/utils.js +12 -26
- package/dist/solution/VenueBooking/index.d.ts +158 -0
- package/dist/solution/VenueBooking/index.js +2873 -0
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/dist/solution/VenueBooking/types.d.ts +130 -0
- package/dist/solution/VenueBooking/types.js +21 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +102 -0
- package/dist/solution/VenueBooking/utils/resource.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/resource.js +94 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +204 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +256 -0
- package/dist/solution/VenueBooking/utils.d.ts +1 -0
- package/dist/solution/VenueBooking/utils.js +1 -0
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/model/strategy/adapter/index.d.ts +4 -0
- package/lib/model/strategy/adapter/index.js +12 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +338 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
- package/lib/model/strategy/adapter/itemRule/examples.d.ts +64 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +269 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/lib/model/strategy/adapter/itemRule/index.js +58 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +206 -0
- package/lib/model/strategy/adapter/itemRule/type.js +46 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +217 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +844 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/lib/model/strategy/adapter/promotion/examples.js +192 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/lib/model/strategy/adapter/promotion/type.js +51 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -1
- package/lib/model/strategy/engine.d.ts +106 -0
- package/lib/model/strategy/engine.js +450 -0
- package/lib/model/strategy/index.d.ts +2 -93
- package/lib/model/strategy/index.js +6 -381
- package/lib/modules/Cart/types.d.ts +0 -2
- package/lib/modules/Cart/utils/cartProduct.js +12 -39
- package/lib/modules/Discount/types.d.ts +0 -18
- package/lib/modules/OpenData/index.d.ts +23 -0
- package/lib/modules/OpenData/index.js +116 -0
- package/lib/modules/OpenData/types.d.ts +73 -0
- package/lib/modules/OpenData/types.js +17 -0
- package/lib/modules/OpenData/utils.d.ts +2 -0
- package/lib/modules/OpenData/utils.js +111 -0
- package/lib/modules/Order/index.d.ts +58 -1
- package/lib/modules/Order/index.js +423 -1
- package/lib/modules/Order/types.d.ts +144 -12
- package/lib/modules/Order/utils.d.ts +25 -0
- package/lib/modules/Order/utils.js +229 -0
- package/lib/modules/Payment/index.d.ts +1 -2
- package/lib/modules/Payment/index.js +0 -1
- package/lib/modules/Payment/utils.js +0 -3
- package/lib/modules/Payment/walletpass.d.ts +0 -23
- package/lib/modules/Payment/walletpass.js +17 -94
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +2 -1
- package/lib/modules/Quotation/index.d.ts +48 -0
- package/lib/modules/Quotation/index.js +149 -0
- package/lib/modules/Quotation/types.d.ts +42 -0
- package/lib/modules/Quotation/types.js +17 -0
- package/lib/modules/Rules/index.d.ts +5 -9
- package/lib/modules/Rules/index.js +286 -778
- package/lib/modules/Rules/types.d.ts +0 -2
- package/lib/modules/SalesSummary/index.d.ts +63 -0
- package/lib/modules/SalesSummary/index.js +105 -0
- package/lib/modules/SalesSummary/types.d.ts +59 -0
- package/lib/modules/SalesSummary/types.js +17 -0
- package/lib/modules/SalesSummary/utils.d.ts +30 -0
- package/lib/modules/SalesSummary/utils.js +452 -0
- package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
- package/lib/modules/ScanOrderLogger/index.js +135 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.js +82 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
- package/lib/modules/ScanOrderLogger/types.d.ts +46 -0
- package/lib/modules/ScanOrderLogger/types.js +17 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
- package/lib/modules/Summary/types.d.ts +0 -2
- package/lib/modules/Summary/utils.d.ts +3 -9
- package/lib/modules/Summary/utils.js +4 -19
- package/lib/modules/index.d.ts +4 -0
- package/lib/modules/index.js +9 -1
- package/lib/plugins/window.d.ts +0 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -2
- package/lib/solution/BookingByStep/index.js +4 -2
- package/lib/solution/BookingByStep/types.d.ts +3 -1
- package/lib/solution/BookingByStep/types.js +10 -0
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/Checkout/index.js +0 -2
- package/lib/solution/ScanOrder/index.d.ts +90 -0
- package/lib/solution/ScanOrder/index.js +1071 -0
- package/lib/solution/ScanOrder/types.d.ts +210 -0
- package/lib/solution/ScanOrder/types.js +36 -0
- package/lib/solution/ScanOrder/utils.d.ts +93 -0
- package/lib/solution/ScanOrder/utils.js +359 -0
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +8 -22
- package/lib/solution/ShopDiscount/types.d.ts +0 -1
- package/lib/solution/ShopDiscount/utils.js +6 -10
- package/lib/solution/VenueBooking/index.d.ts +158 -0
- package/lib/solution/VenueBooking/index.js +1545 -0
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/lib/solution/VenueBooking/types.d.ts +130 -0
- package/lib/solution/VenueBooking/types.js +44 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +101 -0
- package/lib/solution/VenueBooking/utils/resource.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/resource.js +80 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +209 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +200 -0
- package/lib/solution/VenueBooking/utils.d.ts +1 -0
- package/lib/solution/VenueBooking/utils.js +69 -0
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/package.json +1 -1
|
@@ -22,7 +22,6 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
22
22
|
getCurrentBookingTime(): string | null;
|
|
23
23
|
private filterDiscountListByBookingTime;
|
|
24
24
|
setCustomer(customer: Customer): Promise<void>;
|
|
25
|
-
setOriginTotalAmount(amount: number): void;
|
|
26
25
|
setHolders(holders: {
|
|
27
26
|
form_record_id: number;
|
|
28
27
|
}[]): void;
|
|
@@ -56,8 +56,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
56
56
|
originalDiscountList: [],
|
|
57
57
|
currentBookingTime: "",
|
|
58
58
|
filteredDiscountList: [],
|
|
59
|
-
bookingSubject: void 0
|
|
60
|
-
orderTotalAmount: 0
|
|
59
|
+
bookingSubject: void 0
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
// =========== 生命周期方法 ===========
|
|
@@ -195,9 +194,6 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
195
194
|
);
|
|
196
195
|
}
|
|
197
196
|
}
|
|
198
|
-
setOriginTotalAmount(amount) {
|
|
199
|
-
this.store.orderTotalAmount = amount;
|
|
200
|
-
}
|
|
201
197
|
// 设置holders
|
|
202
198
|
setHolders(holders) {
|
|
203
199
|
this.store.holders = holders;
|
|
@@ -217,7 +213,6 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
217
213
|
{
|
|
218
214
|
productList,
|
|
219
215
|
discountList: this.getDiscountList(),
|
|
220
|
-
orderTotalAmount: this.store.orderTotalAmount || 0,
|
|
221
216
|
holders: this.store.holders || [],
|
|
222
217
|
isFormSubject: ((_a = this.store.bookingSubject) == null ? void 0 : _a.type) === "form"
|
|
223
218
|
},
|
|
@@ -325,7 +320,6 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
325
320
|
productList: this.store.productList || [],
|
|
326
321
|
oldDiscountList: this.getDiscountList(),
|
|
327
322
|
newDiscountList: withScanList,
|
|
328
|
-
orderTotalAmount: this.store.orderTotalAmount || 0,
|
|
329
323
|
holders: this.store.holders || [],
|
|
330
324
|
isFormSubject: ((_b = this.store.bookingSubject) == null ? void 0 : _b.type) === "form"
|
|
331
325
|
}) || {
|
|
@@ -394,7 +388,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
394
388
|
if (item.booking_id) {
|
|
395
389
|
const product = (_a2 = this.hooks) == null ? void 0 : _a2.getProduct(item);
|
|
396
390
|
(item.discount_list || []).forEach((discount) => {
|
|
397
|
-
var _a3, _b, _c, _d, _e
|
|
391
|
+
var _a3, _b, _c, _d, _e;
|
|
398
392
|
if (discount.id && ["good_pass", "discount_card"].includes(discount.type)) {
|
|
399
393
|
const index = editModeDiscountList.findIndex((n) => {
|
|
400
394
|
var _a4;
|
|
@@ -403,12 +397,8 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
403
397
|
if (index !== -1) {
|
|
404
398
|
editModeDiscountList[index] = {
|
|
405
399
|
...editModeDiscountList[index],
|
|
406
|
-
metadata: {
|
|
407
|
-
...discount.metadata || {},
|
|
408
|
-
num: (((_b = (_a3 = editModeDiscountList == null ? void 0 : editModeDiscountList[index]) == null ? void 0 : _a3.metadata) == null ? void 0 : _b.num) || 1) + (((_c = discount.metadata) == null ? void 0 : _c.num) || 1)
|
|
409
|
-
},
|
|
410
400
|
amount: new import_decimal.default(discount.amount || 0).plus(new import_decimal.default(editModeDiscountList[index].amount || 0)).toNumber(),
|
|
411
|
-
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((
|
|
401
|
+
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((_a3 = discount == null ? void 0 : discount.metadata) == null ? void 0 : _a3.product_discount_difference) || 0).plus(new import_decimal.default(editModeDiscountList[index].savedAmount || 0)).toNumber()
|
|
412
402
|
};
|
|
413
403
|
} else {
|
|
414
404
|
if (discount.type && !discount.tag) {
|
|
@@ -416,20 +406,16 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
416
406
|
}
|
|
417
407
|
editModeDiscountList.push({
|
|
418
408
|
...discount,
|
|
419
|
-
metadata: {
|
|
420
|
-
...discount.metadata || {},
|
|
421
|
-
num: ((_e = discount.metadata) == null ? void 0 : _e.num) || 1
|
|
422
|
-
},
|
|
423
409
|
name: discount.name || discount.discount.title.auto,
|
|
424
410
|
isEditMode: true,
|
|
425
411
|
limited_relation_product_data: {},
|
|
426
|
-
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((
|
|
412
|
+
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((_b = discount == null ? void 0 : discount.metadata) == null ? void 0 : _b.product_discount_difference) || 0).toNumber(),
|
|
427
413
|
isAvailable: true,
|
|
428
|
-
id: ((
|
|
429
|
-
format_title: ((
|
|
414
|
+
id: ((_c = discount.discount) == null ? void 0 : _c.resource_id) || discount.id,
|
|
415
|
+
format_title: ((_d = discount.discount) == null ? void 0 : _d.title) || discount.format_title,
|
|
430
416
|
isDisabled: true,
|
|
431
417
|
isSelected: true,
|
|
432
|
-
product_id: ((
|
|
418
|
+
product_id: ((_e = discount.discount) == null ? void 0 : _e.product_id) || discount.product_id
|
|
433
419
|
});
|
|
434
420
|
}
|
|
435
421
|
}
|
|
@@ -546,7 +532,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
546
532
|
}
|
|
547
533
|
await this.core.effects.emit(
|
|
548
534
|
`${this.name}:onLoadDiscountList`,
|
|
549
|
-
|
|
535
|
+
filteredDiscountList
|
|
550
536
|
);
|
|
551
537
|
} catch (error) {
|
|
552
538
|
console.error("[ShopDiscount] 加载准备配置出错:", error);
|
|
@@ -56,18 +56,14 @@ var isAllNormalProduct = (items) => {
|
|
|
56
56
|
};
|
|
57
57
|
var getDiscountAmount = (discount, total, price) => {
|
|
58
58
|
var _a;
|
|
59
|
-
let discountedPrice = 0;
|
|
60
59
|
if (discount.tag === "good_pass") {
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} else {
|
|
67
|
-
discountedPrice = new import_decimal.default(100).minus(discount.par_value || 0).div(100).mul(new import_decimal.default(price)).toNumber();
|
|
68
|
-
}
|
|
60
|
+
return new import_decimal.default(price).minus(new import_decimal.default(price || 0)).toNumber();
|
|
61
|
+
}
|
|
62
|
+
const isFixedAmount = ((_a = discount == null ? void 0 : discount.metadata) == null ? void 0 : _a.discount_card_type) === "fixed_amount";
|
|
63
|
+
if (isFixedAmount) {
|
|
64
|
+
return Math.max(new import_decimal.default(price).minus(new import_decimal.default((discount.amount ?? discount.par_value) || 0)).toNumber(), 0);
|
|
69
65
|
}
|
|
70
|
-
return
|
|
66
|
+
return new import_decimal.default(100).minus(discount.par_value || 0).div(100).mul(new import_decimal.default(price)).toNumber();
|
|
71
67
|
};
|
|
72
68
|
var getDiscountListAmountTotal = (discount) => {
|
|
73
69
|
return discount.reduce((acc, cur) => {
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
|
|
4
|
+
import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
|
|
5
|
+
import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
|
|
6
|
+
import type { ProductData } from '../../modules/Product/types';
|
|
7
|
+
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
8
|
+
import type { StrategyConfig } from '../../model/strategy/type';
|
|
9
|
+
export * from './types';
|
|
10
|
+
interface VenueBookingItemRuleRuntimeConfig {
|
|
11
|
+
strategyConfigs?: StrategyConfig[];
|
|
12
|
+
pax?: Partial<PaxInfo>;
|
|
13
|
+
historicalItems?: CartItemSummary[];
|
|
14
|
+
serviceType?: string;
|
|
15
|
+
submissionIndex?: number;
|
|
16
|
+
custom?: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
19
|
+
protected defaultName: string;
|
|
20
|
+
protected defaultVersion: string;
|
|
21
|
+
isSolution: boolean;
|
|
22
|
+
private initializeOptions;
|
|
23
|
+
private store;
|
|
24
|
+
private otherParams;
|
|
25
|
+
private cacheId;
|
|
26
|
+
private window;
|
|
27
|
+
private request;
|
|
28
|
+
private itemRuleEvaluator;
|
|
29
|
+
private itemRuleConfigs;
|
|
30
|
+
private itemRuleConfigsPromise;
|
|
31
|
+
private itemRulePrefillApplied;
|
|
32
|
+
private itemRuleRuntimeConfig;
|
|
33
|
+
private resourceProductMap;
|
|
34
|
+
private loginEffectDisposers;
|
|
35
|
+
private customerLoginRefreshInFlight;
|
|
36
|
+
private customerLoginRefreshIdInFlight;
|
|
37
|
+
private getLoggerContext;
|
|
38
|
+
private serializeError;
|
|
39
|
+
private addVenueBookingLog;
|
|
40
|
+
private logMethodStart;
|
|
41
|
+
private logMethodSuccess;
|
|
42
|
+
private logMethodError;
|
|
43
|
+
addLog(params: VenueBookingAddLogParams): Promise<void>;
|
|
44
|
+
constructor(name?: string, version?: string);
|
|
45
|
+
private normalizeCustomerId;
|
|
46
|
+
private resolveCustomerIdFromLoginPayload;
|
|
47
|
+
private clearLoginEffectListeners;
|
|
48
|
+
private registerLoginEffect;
|
|
49
|
+
private registerCustomerLoginListeners;
|
|
50
|
+
private refreshOrderMarketingAfterLogin;
|
|
51
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
52
|
+
destroy(): Promise<void>;
|
|
53
|
+
retryInit(): Promise<void>;
|
|
54
|
+
refresh(): Promise<void>;
|
|
55
|
+
getStatus(): import("./types").VenueBookingStatus;
|
|
56
|
+
getEntryContext(): import("./types").VenueBookingEntryContext | null;
|
|
57
|
+
getItemRuleQuantityLimits(): QuantityLimitResult[];
|
|
58
|
+
getCartValidationPassed(): boolean | null;
|
|
59
|
+
getCartValidation(): {
|
|
60
|
+
passed: boolean | null;
|
|
61
|
+
failures: QuantityCheckResult[];
|
|
62
|
+
};
|
|
63
|
+
loadAllProducts(): Promise<{
|
|
64
|
+
venueProducts: ProductData[];
|
|
65
|
+
addonProducts: ProductData[];
|
|
66
|
+
}>;
|
|
67
|
+
loadVenueProducts(): Promise<ProductData[]>;
|
|
68
|
+
loadAddonProducts(): Promise<ProductData[]>;
|
|
69
|
+
getVenueProducts(): ProductData[];
|
|
70
|
+
getAddonProductsList(): ProductData[];
|
|
71
|
+
loadQuotations(params?: {
|
|
72
|
+
channel?: string;
|
|
73
|
+
}): Promise<void>;
|
|
74
|
+
fetchResourceAvailability(params: {
|
|
75
|
+
startDate: string;
|
|
76
|
+
endDate: string;
|
|
77
|
+
}): Promise<void>;
|
|
78
|
+
getDateRangeSummary(params: {
|
|
79
|
+
startDate: string;
|
|
80
|
+
endDate: string;
|
|
81
|
+
}): VenueDateSummaryItem[];
|
|
82
|
+
getTimeSlotGrid(date: string): VenueTimeSlotGrid;
|
|
83
|
+
/**
|
|
84
|
+
* 切换单个时段的选中状态(选中/取消)。
|
|
85
|
+
* 内部自动处理连续时段的合并与拆分,订单是唯一真相源。
|
|
86
|
+
*/
|
|
87
|
+
toggleSlot(slot: VenueSlotSelection): Promise<ScanOrderOrderProduct[]>;
|
|
88
|
+
/**
|
|
89
|
+
* 获取某资源当前选中的所有独立时段(从订单中解析)。
|
|
90
|
+
*/
|
|
91
|
+
getSelectedSlotsForResource(resourceId: number | string): VenueSlotSelection[];
|
|
92
|
+
/**
|
|
93
|
+
* 判断某个时段是否已选中。
|
|
94
|
+
*/
|
|
95
|
+
isSlotSelected(resourceId: number | string, startTime: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* 获取所有已选时段(按资源分组)。
|
|
98
|
+
*/
|
|
99
|
+
getAllSelectedSlots(): Map<number | string, VenueSlotSelection[]>;
|
|
100
|
+
/**
|
|
101
|
+
* 对指定资源的订单商品进行 reconcile:
|
|
102
|
+
* 清除旧商品 → 合并连续时段 → 重新写入。
|
|
103
|
+
*/
|
|
104
|
+
private reconcileOrderForResource;
|
|
105
|
+
setSlotConfig(config: Partial<VenueBookingSlotConfig>): void;
|
|
106
|
+
getSlotConfig(): VenueBookingSlotConfig;
|
|
107
|
+
loadSchedules(): Promise<void>;
|
|
108
|
+
private injectScheduleResolverToQuotation;
|
|
109
|
+
getScheduleListByIds(ids: number[]): import("../../modules/Schedule/types").ScheduleItem[];
|
|
110
|
+
getTempOrder(): import("./types").ScanOrderTempOrder | null;
|
|
111
|
+
updateTempOrderNote(note: string): string;
|
|
112
|
+
updateTempOrderContactsInfo(contactsInfo: any[]): any[];
|
|
113
|
+
private ensureTempOrder;
|
|
114
|
+
onCustomerLogin(params: {
|
|
115
|
+
customerId: number;
|
|
116
|
+
}): Promise<void>;
|
|
117
|
+
private recalculateOrderPricesFromQuotation;
|
|
118
|
+
scanCode(code: string, customerId?: number): Promise<{
|
|
119
|
+
isAvailable: boolean;
|
|
120
|
+
discountList: import("../../modules/Discount").Discount[];
|
|
121
|
+
type: "server" | "clientCalc";
|
|
122
|
+
unavailableReason?: import("../../modules/Rules/types").UnavailableReason | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
/** 获取当前折扣列表(包装 order.getDiscountList) */
|
|
125
|
+
getDiscountList(): import("../../modules/Discount").Discount[];
|
|
126
|
+
/** 勾选/取消勾选某张折扣券,重新计算折扣并持久化 */
|
|
127
|
+
setDiscountSelected(params: {
|
|
128
|
+
discountId: number;
|
|
129
|
+
isSelected: boolean;
|
|
130
|
+
}): Promise<import("../../modules/Discount").Discount[]>;
|
|
131
|
+
addNewOrder(): Promise<import("./types").ScanOrderTempOrder>;
|
|
132
|
+
getOrderProducts(): ScanOrderOrderProduct[];
|
|
133
|
+
getSummary(): Promise<import("./types").ScanOrderSummary>;
|
|
134
|
+
submitOrder<T = any>(): Promise<T>;
|
|
135
|
+
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
136
|
+
updateProductInOrder(params: {
|
|
137
|
+
product_id: number | null;
|
|
138
|
+
product_variant_id: number;
|
|
139
|
+
updates: Partial<ScanOrderOrderProduct>;
|
|
140
|
+
}): Promise<ScanOrderOrderProduct[]>;
|
|
141
|
+
removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
142
|
+
getProductList(): Promise<ProductData[]>;
|
|
143
|
+
private loadOpenDataConfig;
|
|
144
|
+
private loadRuntimeConfigs;
|
|
145
|
+
private fetchItemRuleConfigsByModelIds;
|
|
146
|
+
private buildPrefillProductSourceMap;
|
|
147
|
+
private getItemRuleRuntimeConfig;
|
|
148
|
+
private ensureItemRuleConfigsLoaded;
|
|
149
|
+
private refreshItemRuleQuantityLimits;
|
|
150
|
+
private applyPrefillByItemRule;
|
|
151
|
+
applyItemRulePrefill(): Promise<void>;
|
|
152
|
+
private evaluateCartValidationByItemRule;
|
|
153
|
+
private validateBeforeSubmitByItemRule;
|
|
154
|
+
private refreshCartValidationPassed;
|
|
155
|
+
setItemRuleRuntimeConfig(config?: VenueBookingItemRuleRuntimeConfig): Promise<void>;
|
|
156
|
+
getOtherParams(): Record<string, any>;
|
|
157
|
+
checkOpenDataAvailability(): Promise<OpenDataAvailabilityResult>;
|
|
158
|
+
}
|