@pisell/pisellos 3.0.89 → 3.0.91
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/model/index.d.ts +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/strategy/adapter/index.d.ts +7 -0
- package/dist/model/strategy/adapter/index.js +7 -0
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +483 -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 +79 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +382 -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 +225 -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/type.d.ts +28 -0
- package/dist/model/strategy/adapter/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +502 -0
- package/dist/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/dist/model/strategy/adapter/walletPass/example.js +258 -0
- package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/dist/model/strategy/adapter/walletPass/index.js +182 -0
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/dist/model/strategy/adapter/walletPass/locales.js +26 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts +187 -0
- package/dist/model/strategy/adapter/walletPass/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +1104 -0
- package/dist/model/strategy/engine.d.ts +106 -0
- package/dist/model/strategy/engine.js +611 -0
- package/dist/model/strategy/index.d.ts +3 -0
- package/dist/model/strategy/index.js +8 -0
- package/dist/model/strategy/strategy-example.d.ts +5 -0
- package/dist/model/strategy/strategy-example.js +331 -0
- package/dist/model/strategy/type.d.ts +228 -0
- package/dist/model/strategy/type.js +94 -0
- package/dist/modules/Cart/utils/cartProduct.js +1 -0
- package/dist/modules/Discount/index.d.ts +4 -2
- package/dist/modules/Discount/index.js +90 -3
- package/dist/modules/Discount/types.d.ts +6 -0
- package/dist/modules/OpenData/index.d.ts +24 -0
- package/dist/modules/OpenData/index.js +173 -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 +66 -1
- package/dist/modules/Order/index.js +884 -10
- package/dist/modules/Order/types.d.ts +174 -12
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils.d.ts +118 -0
- package/dist/modules/Order/utils.js +586 -2
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +3 -1
- package/dist/modules/ProductList/index.js +19 -11
- package/dist/modules/Quotation/index.d.ts +48 -0
- package/dist/modules/Quotation/index.js +248 -0
- package/dist/modules/Quotation/types.d.ts +42 -0
- package/dist/modules/Quotation/types.js +1 -0
- package/dist/modules/Rules/index.js +17 -18
- package/dist/modules/SalesSummary/index.d.ts +63 -0
- package/dist/modules/SalesSummary/index.js +174 -0
- package/dist/modules/SalesSummary/types.d.ts +60 -0
- package/dist/modules/SalesSummary/types.js +1 -0
- package/dist/modules/SalesSummary/utils.d.ts +30 -0
- package/dist/modules/SalesSummary/utils.js +480 -0
- package/dist/modules/ScanOrderLogger/index.d.ts +23 -0
- package/dist/modules/ScanOrderLogger/index.js +174 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.js +221 -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 +53 -0
- package/dist/modules/ScanOrderLogger/types.js +1 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/utils.d.ts +3 -3
- package/dist/modules/Summary/utils.js +41 -31
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.js +5 -1
- package/dist/solution/BookingByStep/index.d.ts +3 -3
- package/dist/solution/BookingByStep/index.js +2 -1
- package/dist/solution/BookingByStep/types.d.ts +3 -1
- package/dist/solution/BookingByStep/types.js +5 -1
- package/dist/solution/ScanOrder/index.d.ts +158 -0
- package/dist/solution/ScanOrder/index.js +3474 -0
- package/dist/solution/ScanOrder/types.d.ts +306 -0
- package/dist/solution/ScanOrder/types.js +35 -0
- package/dist/solution/ScanOrder/utils.d.ts +172 -0
- package/dist/solution/ScanOrder/utils.js +796 -0
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +23 -18
- package/dist/solution/VenueBooking/index.d.ts +201 -0
- package/dist/solution/VenueBooking/index.js +3472 -0
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/dist/solution/VenueBooking/types.d.ts +154 -0
- package/dist/solution/VenueBooking/types.js +21 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
- package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
- package/dist/solution/VenueBooking/utils/resource.js +131 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +239 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +453 -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/model/index.d.ts +1 -0
- package/lib/model/index.js +23 -0
- package/lib/model/strategy/adapter/index.d.ts +7 -0
- package/lib/model/strategy/adapter/index.js +57 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +377 -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 +79 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +316 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/lib/model/strategy/adapter/itemRule/index.js +60 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +225 -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/type.d.ts +28 -0
- package/lib/model/strategy/adapter/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +424 -0
- package/lib/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/lib/model/strategy/adapter/walletPass/example.js +207 -0
- package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/lib/model/strategy/adapter/walletPass/index.js +142 -0
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/lib/model/strategy/adapter/walletPass/locales.js +54 -0
- package/lib/model/strategy/adapter/walletPass/type.d.ts +187 -0
- package/lib/model/strategy/adapter/walletPass/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +791 -0
- package/lib/model/strategy/engine.d.ts +106 -0
- package/lib/model/strategy/engine.js +450 -0
- package/lib/model/strategy/index.d.ts +3 -0
- package/lib/model/strategy/index.js +38 -0
- package/lib/model/strategy/strategy-example.d.ts +5 -0
- package/lib/model/strategy/strategy-example.js +318 -0
- package/lib/model/strategy/type.d.ts +228 -0
- package/lib/model/strategy/type.js +44 -0
- package/lib/modules/Cart/utils/cartProduct.js +1 -0
- package/lib/modules/Discount/index.d.ts +4 -2
- package/lib/modules/Discount/index.js +60 -2
- package/lib/modules/Discount/types.d.ts +6 -0
- package/lib/modules/OpenData/index.d.ts +24 -0
- package/lib/modules/OpenData/index.js +119 -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 +66 -1
- package/lib/modules/Order/index.js +525 -0
- package/lib/modules/Order/types.d.ts +174 -12
- package/lib/modules/Order/utils.d.ts +118 -0
- package/lib/modules/Order/utils.js +483 -2
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +3 -1
- package/lib/modules/ProductList/index.js +45 -34
- package/lib/modules/Quotation/index.d.ts +48 -0
- package/lib/modules/Quotation/index.js +152 -0
- package/lib/modules/Quotation/types.d.ts +42 -0
- package/lib/modules/Quotation/types.js +17 -0
- package/lib/modules/Rules/index.js +17 -18
- package/lib/modules/SalesSummary/index.d.ts +63 -0
- package/lib/modules/SalesSummary/index.js +105 -0
- package/lib/modules/SalesSummary/types.d.ts +60 -0
- package/lib/modules/SalesSummary/types.js +17 -0
- package/lib/modules/SalesSummary/utils.d.ts +30 -0
- package/lib/modules/SalesSummary/utils.js +420 -0
- package/lib/modules/ScanOrderLogger/index.d.ts +23 -0
- package/lib/modules/ScanOrderLogger/index.js +147 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.js +157 -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 +53 -0
- package/lib/modules/ScanOrderLogger/types.js +17 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/utils.d.ts +3 -3
- package/lib/modules/Summary/utils.js +22 -16
- package/lib/modules/index.d.ts +4 -0
- package/lib/modules/index.js +9 -1
- package/lib/solution/BookingByStep/index.d.ts +3 -3
- package/lib/solution/BookingByStep/index.js +2 -2
- package/lib/solution/BookingByStep/types.d.ts +3 -1
- package/lib/solution/BookingByStep/types.js +10 -0
- package/lib/solution/ScanOrder/index.d.ts +158 -0
- package/lib/solution/ScanOrder/index.js +2135 -0
- package/lib/solution/ScanOrder/types.d.ts +306 -0
- package/lib/solution/ScanOrder/types.js +36 -0
- package/lib/solution/ScanOrder/utils.d.ts +172 -0
- package/lib/solution/ScanOrder/utils.js +658 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +4 -2
- package/lib/solution/VenueBooking/index.d.ts +201 -0
- package/lib/solution/VenueBooking/index.js +1937 -0
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/lib/solution/VenueBooking/types.d.ts +154 -0
- package/lib/solution/VenueBooking/types.js +44 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
- package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
- package/lib/solution/VenueBooking/utils/resource.js +92 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +237 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +339 -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
|
@@ -50,6 +50,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
50
50
|
discountList: Discount[];
|
|
51
51
|
type: "server" | "clientCalc";
|
|
52
52
|
unavailableReason?: UnavailableReason;
|
|
53
|
+
unavailableReasonKey?: string | null;
|
|
53
54
|
}>;
|
|
54
55
|
calcDiscountApplicableProductTotalPrice(discount: Discount): number | undefined;
|
|
55
56
|
private getCustomer;
|
|
@@ -376,7 +376,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
376
376
|
key: "scanCode",
|
|
377
377
|
value: function () {
|
|
378
378
|
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, customerId) {
|
|
379
|
-
var _this$store$discount3, _this$store$bookingSu2, resultDiscountList, rulesModule, withScanList, currentSelectedDiscountList, _ref3, newProductList, newDiscountList, isAvailable, unavailableReason, _this$options$otherPa6;
|
|
379
|
+
var _this$store$discount3, _this$store$bookingSu2, resultDiscountWithReason, resultDiscountList, unavailableReasonKey, rulesModule, withScanList, currentSelectedDiscountList, _ref3, newProductList, newDiscountList, isAvailable, unavailableReason, _this$options$otherPa6;
|
|
380
380
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
381
381
|
while (1) switch (_context5.prev = _context5.next) {
|
|
382
382
|
case 0:
|
|
@@ -389,12 +389,16 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
389
389
|
_context5.next = 6;
|
|
390
390
|
break;
|
|
391
391
|
}
|
|
392
|
-
_context5.t0 =
|
|
392
|
+
_context5.t0 = {
|
|
393
|
+
discountList: [],
|
|
394
|
+
unavailableReasonKey: null
|
|
395
|
+
};
|
|
393
396
|
case 6:
|
|
394
|
-
|
|
397
|
+
resultDiscountWithReason = _context5.t0;
|
|
398
|
+
resultDiscountList = resultDiscountWithReason.discountList, unavailableReasonKey = resultDiscountWithReason.unavailableReasonKey;
|
|
395
399
|
rulesModule = this.store.rules;
|
|
396
400
|
if (rulesModule) {
|
|
397
|
-
_context5.next =
|
|
401
|
+
_context5.next = 11;
|
|
398
402
|
break;
|
|
399
403
|
}
|
|
400
404
|
return _context5.abrupt("return", {
|
|
@@ -404,18 +408,19 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
404
408
|
discountList: this.getDiscountList(),
|
|
405
409
|
unavailableReason: UnavailableReason.Unknown
|
|
406
410
|
});
|
|
407
|
-
case
|
|
411
|
+
case 11:
|
|
408
412
|
if (resultDiscountList.length) {
|
|
409
|
-
_context5.next =
|
|
413
|
+
_context5.next = 13;
|
|
410
414
|
break;
|
|
411
415
|
}
|
|
412
416
|
return _context5.abrupt("return", {
|
|
413
417
|
type: "server",
|
|
414
418
|
isAvailable: false,
|
|
415
419
|
productList: this.store.productList || [],
|
|
416
|
-
discountList: this.getDiscountList()
|
|
420
|
+
discountList: this.getDiscountList(),
|
|
421
|
+
unavailableReasonKey: unavailableReasonKey
|
|
417
422
|
});
|
|
418
|
-
case
|
|
423
|
+
case 13:
|
|
419
424
|
withScanList = resultDiscountList.map(function (item) {
|
|
420
425
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
421
426
|
isScan: true
|
|
@@ -429,7 +434,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
429
434
|
return m.id === n.id;
|
|
430
435
|
});
|
|
431
436
|
}))) {
|
|
432
|
-
_context5.next =
|
|
437
|
+
_context5.next = 17;
|
|
433
438
|
break;
|
|
434
439
|
}
|
|
435
440
|
return _context5.abrupt("return", {
|
|
@@ -438,7 +443,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
438
443
|
productList: this.store.productList || [],
|
|
439
444
|
discountList: this.getDiscountList()
|
|
440
445
|
});
|
|
441
|
-
case
|
|
446
|
+
case 17:
|
|
442
447
|
_ref3 = rulesModule.isDiscountListAvailable({
|
|
443
448
|
productList: this.store.productList || [],
|
|
444
449
|
oldDiscountList: this.getDiscountList(),
|
|
@@ -451,18 +456,18 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
451
456
|
discountList: this.getDiscountList()
|
|
452
457
|
}, newProductList = _ref3.productList, newDiscountList = _ref3.discountList, isAvailable = _ref3.isAvailable, unavailableReason = _ref3.unavailableReason;
|
|
453
458
|
if (!isAvailable) {
|
|
454
|
-
_context5.next =
|
|
459
|
+
_context5.next = 24;
|
|
455
460
|
break;
|
|
456
461
|
}
|
|
457
462
|
this.setDiscountList(newDiscountList || []);
|
|
458
463
|
this.setProductList(newProductList || []);
|
|
459
464
|
if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop')) {
|
|
460
|
-
_context5.next =
|
|
465
|
+
_context5.next = 24;
|
|
461
466
|
break;
|
|
462
467
|
}
|
|
463
|
-
_context5.next =
|
|
468
|
+
_context5.next = 24;
|
|
464
469
|
return this.getCustomerWallet(resultDiscountList[0].customer_id);
|
|
465
|
-
case
|
|
470
|
+
case 24:
|
|
466
471
|
return _context5.abrupt("return", {
|
|
467
472
|
type: "clientCalc",
|
|
468
473
|
isAvailable: isAvailable || false,
|
|
@@ -470,8 +475,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
470
475
|
discountList: newDiscountList || this.getDiscountList(),
|
|
471
476
|
unavailableReason: unavailableReason
|
|
472
477
|
});
|
|
473
|
-
case
|
|
474
|
-
_context5.prev =
|
|
478
|
+
case 27:
|
|
479
|
+
_context5.prev = 27;
|
|
475
480
|
_context5.t1 = _context5["catch"](0);
|
|
476
481
|
console.error('[ShopDiscount] 扫码出错:', _context5.t1);
|
|
477
482
|
return _context5.abrupt("return", {
|
|
@@ -481,11 +486,11 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
481
486
|
discountList: this.getDiscountList(),
|
|
482
487
|
unavailableReason: UnavailableReason.Unknown
|
|
483
488
|
});
|
|
484
|
-
case
|
|
489
|
+
case 31:
|
|
485
490
|
case "end":
|
|
486
491
|
return _context5.stop();
|
|
487
492
|
}
|
|
488
|
-
}, _callee5, this, [[0,
|
|
493
|
+
}, _callee5, this, [[0, 27]]);
|
|
489
494
|
}));
|
|
490
495
|
function scanCode(_x4, _x5) {
|
|
491
496
|
return _scanCode.apply(this, arguments);
|
|
@@ -0,0 +1,201 @@
|
|
|
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 { UpdateProductInOrderParams } from '../../modules/Order/types';
|
|
6
|
+
import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
|
|
7
|
+
import type { ProductData } from '../../modules/Product/types';
|
|
8
|
+
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
9
|
+
import type { StrategyConfig } from '../../model/strategy/type';
|
|
10
|
+
export * from './types';
|
|
11
|
+
interface VenueBookingItemRuleRuntimeConfig {
|
|
12
|
+
strategyConfigs?: StrategyConfig[];
|
|
13
|
+
pax?: Partial<PaxInfo>;
|
|
14
|
+
historicalItems?: CartItemSummary[];
|
|
15
|
+
serviceType?: string;
|
|
16
|
+
submissionIndex?: number;
|
|
17
|
+
custom?: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
20
|
+
protected defaultName: string;
|
|
21
|
+
protected defaultVersion: string;
|
|
22
|
+
isSolution: boolean;
|
|
23
|
+
private initializeOptions;
|
|
24
|
+
private store;
|
|
25
|
+
private otherParams;
|
|
26
|
+
private cacheId;
|
|
27
|
+
private window;
|
|
28
|
+
private request;
|
|
29
|
+
private baseSlotConfig;
|
|
30
|
+
private itemRuleEvaluator;
|
|
31
|
+
private itemRuleConfigs;
|
|
32
|
+
private itemRuleConfigsPromise;
|
|
33
|
+
private itemRulePrefillApplied;
|
|
34
|
+
private itemRuleRuntimeConfig;
|
|
35
|
+
private resourceProductMap;
|
|
36
|
+
private loginEffectDisposers;
|
|
37
|
+
private customerLoginRefreshInFlight;
|
|
38
|
+
private customerLoginRefreshIdInFlight;
|
|
39
|
+
private loadAllProductsInFlight;
|
|
40
|
+
private productsLoaded;
|
|
41
|
+
private loadOpenDataConfigInFlight;
|
|
42
|
+
private static readonly OPEN_DATA_CACHE_TTL;
|
|
43
|
+
private getLoggerContext;
|
|
44
|
+
private safeStringify;
|
|
45
|
+
private pickErrorMessage;
|
|
46
|
+
private serializeError;
|
|
47
|
+
private addVenueBookingLog;
|
|
48
|
+
private logMethodStart;
|
|
49
|
+
private logMethodSuccess;
|
|
50
|
+
private logMethodError;
|
|
51
|
+
addLog(params: VenueBookingAddLogParams): Promise<void>;
|
|
52
|
+
constructor(name?: string, version?: string);
|
|
53
|
+
private normalizeCustomerId;
|
|
54
|
+
private resolveCustomerIdFromLoginPayload;
|
|
55
|
+
private clearLoginEffectListeners;
|
|
56
|
+
private registerLoginEffect;
|
|
57
|
+
private registerCustomerLoginListeners;
|
|
58
|
+
private refreshOrderMarketingAfterLogin;
|
|
59
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
60
|
+
destroy(): Promise<void>;
|
|
61
|
+
retryInit(): Promise<void>;
|
|
62
|
+
refresh(): Promise<void>;
|
|
63
|
+
getStatus(): import("./types").VenueBookingStatus;
|
|
64
|
+
getEntryContext(): import("./types").VenueBookingEntryContext | null;
|
|
65
|
+
getItemRuleQuantityLimits(): QuantityLimitResult[];
|
|
66
|
+
getCartValidationPassed(): boolean | null;
|
|
67
|
+
getCartValidation(): {
|
|
68
|
+
passed: boolean | null;
|
|
69
|
+
failures: QuantityCheckResult[];
|
|
70
|
+
};
|
|
71
|
+
loadAllProducts(): Promise<{
|
|
72
|
+
venueProducts: ProductData[];
|
|
73
|
+
addonProducts: ProductData[];
|
|
74
|
+
}>;
|
|
75
|
+
private _doLoadAllProducts;
|
|
76
|
+
loadVenueProducts(): Promise<ProductData[]>;
|
|
77
|
+
loadAddonProducts(): Promise<ProductData[]>;
|
|
78
|
+
getVenueProducts(): ProductData[];
|
|
79
|
+
getAddonProductsList(): ProductData[];
|
|
80
|
+
loadQuotations(params?: {
|
|
81
|
+
channel?: string;
|
|
82
|
+
}): Promise<void>;
|
|
83
|
+
fetchResourceAvailability(params: {
|
|
84
|
+
startDate: string;
|
|
85
|
+
endDate: string;
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
private getOperatingHoursScheduleIds;
|
|
88
|
+
private resolveSlotConfigForDate;
|
|
89
|
+
private syncOperatingHoursToSlotConfig;
|
|
90
|
+
getDateRangeSummary(params: {
|
|
91
|
+
startDate: string;
|
|
92
|
+
endDate: string;
|
|
93
|
+
}): VenueDateSummaryItem[];
|
|
94
|
+
getTimeSlotGrid(date: string): VenueTimeSlotGrid;
|
|
95
|
+
/**
|
|
96
|
+
* 切换单个时段的选中状态(选中/取消)。
|
|
97
|
+
* 内部自动处理连续时段的合并与拆分,订单是唯一真相源。
|
|
98
|
+
*
|
|
99
|
+
* slot.productId 指定当前操作针对的是该 resourceId 下的哪一个商品。
|
|
100
|
+
* 同一资源下不同 productId 之间互相隔离,不会相互合并。
|
|
101
|
+
*/
|
|
102
|
+
toggleSlot(slot: VenueSlotSelection): Promise<ScanOrderOrderProduct[]>;
|
|
103
|
+
/**
|
|
104
|
+
* 获取某资源当前选中的所有独立时段(从订单中解析)。
|
|
105
|
+
* 不传 productId 时返回该资源下所有商品的选中时段;传了则精确匹配。
|
|
106
|
+
*/
|
|
107
|
+
getSelectedSlotsForResource(resourceId: number | string, productId?: number): VenueSlotSelection[];
|
|
108
|
+
/** getSelectedSlotsForResource 的 (resourceId, productId) 精确版,内部使用。 */
|
|
109
|
+
private getSelectedSlotsForResourceProduct;
|
|
110
|
+
/**
|
|
111
|
+
* 判断某个时段是否已选中。
|
|
112
|
+
* 不传 productId 时:只要该资源下任一商品在 startTime 被选中即返回 true;传了则精确匹配。
|
|
113
|
+
*/
|
|
114
|
+
isSlotSelected(resourceId: number | string, startTime: string, productId?: number): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 判断指定 (resourceId, productId, startTime) 格子是否应因其它已选项而被禁用。
|
|
117
|
+
* 规则:
|
|
118
|
+
* 1) 同一 resourceId 下若已选了另一个 productId 的同 startTime → 禁用
|
|
119
|
+
* 2) 当前 resource 是组合资源:若其任一 child resource 在 startTime 被选中 → 禁用
|
|
120
|
+
* 3) 当前 resource 是某些组合资源的 child:若该组合资源在 startTime 被选中 → 禁用
|
|
121
|
+
* 4) 两个组合资源的 child 集合有交集,且对方在该 startTime 被选中 → 禁用
|
|
122
|
+
*/
|
|
123
|
+
isSlotDisabledBySelection(params: {
|
|
124
|
+
resourceId: number | string;
|
|
125
|
+
productId: number;
|
|
126
|
+
startTime: string;
|
|
127
|
+
}): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* 获取所有已选时段(按资源分组)。每个 slot 上带 productId,便于 UI 做 per-product 判定。
|
|
130
|
+
*/
|
|
131
|
+
getAllSelectedSlots(): Map<number | string, VenueSlotSelection[]>;
|
|
132
|
+
/**
|
|
133
|
+
* 对指定 (resourceId, productId) 的订单商品进行 reconcile:
|
|
134
|
+
* 清除旧商品 → 合并连续时段 → 重新写入。
|
|
135
|
+
* 同一场地下不同商品互不干扰,各自单独 reconcile。
|
|
136
|
+
*/
|
|
137
|
+
private reconcileOrderForResourceProduct;
|
|
138
|
+
/** 给定一个父 rawResource,返回其 combined_resource.resource_ids 对应的子 rawResource 列表。 */
|
|
139
|
+
private getCombinedChildRawResources;
|
|
140
|
+
setSlotConfig(config: Partial<VenueBookingSlotConfig>): void;
|
|
141
|
+
getSlotConfig(): VenueBookingSlotConfig;
|
|
142
|
+
loadSchedules(): Promise<void>;
|
|
143
|
+
private injectScheduleResolverToQuotation;
|
|
144
|
+
getScheduleListByIds(ids: number[]): import("../../modules/Schedule/types").ScheduleItem[];
|
|
145
|
+
getTempOrder(): import("./types").ScanOrderTempOrder | null;
|
|
146
|
+
updateTempOrderNote(note: string): string;
|
|
147
|
+
updateTempOrderContactsInfo(contactsInfo: any[]): any[];
|
|
148
|
+
private ensureTempOrder;
|
|
149
|
+
onCustomerLogin(params: {
|
|
150
|
+
customerId: number;
|
|
151
|
+
}): Promise<void>;
|
|
152
|
+
private recalculateOrderPricesFromQuotation;
|
|
153
|
+
scanCode(code: string, customerId?: number): Promise<{
|
|
154
|
+
isAvailable: boolean;
|
|
155
|
+
discountList: import("../../modules/Discount/types").Discount[];
|
|
156
|
+
type: "server" | "clientCalc";
|
|
157
|
+
unavailableReason?: import("../../modules/Rules/types").UnavailableReason | undefined;
|
|
158
|
+
unavailableReasonKey?: string | null | undefined;
|
|
159
|
+
}>;
|
|
160
|
+
/** 获取当前折扣列表(包装 order.getDiscountList) */
|
|
161
|
+
getDiscountList(): import("../../modules/Discount/types").Discount[];
|
|
162
|
+
/** 勾选/取消勾选某张折扣券,重新计算折扣并持久化 */
|
|
163
|
+
setDiscountSelected(params: {
|
|
164
|
+
discountId: number;
|
|
165
|
+
isSelected: boolean;
|
|
166
|
+
}): Promise<import("../../modules/Discount/types").Discount[]>;
|
|
167
|
+
addNewOrder(): Promise<import("./types").ScanOrderTempOrder>;
|
|
168
|
+
getOrderProducts(): ScanOrderOrderProduct[];
|
|
169
|
+
getSummary(): Promise<import("./types").ScanOrderSummary>;
|
|
170
|
+
submitOrder<T = any>(): Promise<T>;
|
|
171
|
+
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
172
|
+
updateProductInOrder(params: UpdateProductInOrderParams): Promise<ScanOrderOrderProduct[]>;
|
|
173
|
+
removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
174
|
+
getProductList(): Promise<ProductData[]>;
|
|
175
|
+
private loadOpenDataConfig;
|
|
176
|
+
private loadRuntimeConfigs;
|
|
177
|
+
private fetchItemRuleConfigsByModelIds;
|
|
178
|
+
private buildPrefillProductSourceMap;
|
|
179
|
+
private getItemRuleRuntimeConfig;
|
|
180
|
+
private ensureItemRuleConfigsLoaded;
|
|
181
|
+
private refreshItemRuleQuantityLimits;
|
|
182
|
+
private applyPrefillByItemRule;
|
|
183
|
+
applyItemRulePrefill(): Promise<void>;
|
|
184
|
+
private evaluateCartValidationByItemRule;
|
|
185
|
+
private validateBeforeSubmitByItemRule;
|
|
186
|
+
private refreshCartValidationPassed;
|
|
187
|
+
setItemRuleRuntimeConfig(config?: VenueBookingItemRuleRuntimeConfig): Promise<void>;
|
|
188
|
+
getOtherParams(): Record<string, any>;
|
|
189
|
+
private static readonly UI_STATE_KEY_PREFIX;
|
|
190
|
+
private getUIStateBucketKey;
|
|
191
|
+
private readUIStateBucket;
|
|
192
|
+
private writeUIStateBucket;
|
|
193
|
+
setUIState(key: string, value: any): void;
|
|
194
|
+
getUIState<T = any>(key: string): T | undefined;
|
|
195
|
+
deleteUIState(key: string): void;
|
|
196
|
+
setBookingHolder(bookingUid: string, holder: any): void;
|
|
197
|
+
checkOpenDataAvailability(): Promise<OpenDataAvailabilityResult>;
|
|
198
|
+
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
199
|
+
cover?: boolean;
|
|
200
|
+
}): Promise<void>;
|
|
201
|
+
}
|