@pisell/pisellos 0.10.43 → 0.10.45

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.
Files changed (118) hide show
  1. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  2. package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
  3. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  4. package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
  5. package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
  6. package/dist/model/strategy/adapter/itemRule/type.js +19 -1
  7. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  8. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  9. package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -2
  10. package/dist/modules/Customer/index.js +2 -1
  11. package/dist/modules/Discount/availability.d.ts +7 -0
  12. package/dist/modules/Discount/availability.js +49 -0
  13. package/dist/modules/Discount/index.d.ts +1 -3
  14. package/dist/modules/Discount/index.js +12 -151
  15. package/dist/modules/Discount/types.d.ts +6 -0
  16. package/dist/modules/Order/index.d.ts +41 -9
  17. package/dist/modules/Order/index.js +1457 -872
  18. package/dist/modules/Order/salesNotes.d.ts +31 -0
  19. package/dist/modules/Order/salesNotes.js +492 -0
  20. package/dist/modules/Order/types.d.ts +105 -8
  21. package/dist/modules/Order/types.js +6 -1
  22. package/dist/modules/Order/utils.d.ts +4 -2
  23. package/dist/modules/Order/utils.js +224 -79
  24. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
  25. package/dist/modules/Payment/cashRecommendationAlgorithm.js +17 -367
  26. package/dist/modules/Product/index.d.ts +1 -1
  27. package/dist/modules/ProductList/index.d.ts +2 -1
  28. package/dist/modules/ProductList/index.js +100 -20
  29. package/dist/modules/ProductList/types.d.ts +10 -0
  30. package/dist/modules/Rules/index.js +50 -16
  31. package/dist/server/index.d.ts +7 -0
  32. package/dist/server/index.js +45 -3
  33. package/dist/server/modules/order/index.js +6 -0
  34. package/dist/server/modules/order/types.d.ts +9 -0
  35. package/dist/server/utils/small-ticket.d.ts +1 -0
  36. package/dist/server/utils/small-ticket.js +142 -14
  37. package/dist/solution/BaseSales/index.d.ts +15 -1
  38. package/dist/solution/BaseSales/index.js +1240 -877
  39. package/dist/solution/BaseSales/types.d.ts +2 -2
  40. package/dist/solution/BookingByStep/index.d.ts +1 -1
  41. package/dist/solution/BookingTicket/index.d.ts +1 -0
  42. package/dist/solution/BookingTicket/index.js +37 -16
  43. package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
  44. package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
  45. package/dist/solution/RegisterAndLogin/config.js +95 -40
  46. package/dist/solution/RegisterAndLogin/index.js +4 -1
  47. package/dist/solution/ScanOrder/index.d.ts +1 -0
  48. package/dist/solution/ScanOrder/index.js +31 -27
  49. package/dist/solution/ScanOrder/utils.d.ts +1 -0
  50. package/dist/solution/ScanOrder/utils.js +2 -0
  51. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  52. package/dist/solution/ShopDiscount/index.js +59 -22
  53. package/dist/solution/ShopDiscount/utils.d.ts +4 -2
  54. package/dist/solution/ShopDiscount/utils.js +40 -21
  55. package/dist/solution/UnifiedBookingSales/index.d.ts +15 -2
  56. package/dist/solution/UnifiedBookingSales/index.js +777 -510
  57. package/dist/solution/UnifiedBookingSales/types.d.ts +14 -1
  58. package/dist/solution/VenueBooking/index.d.ts +1 -0
  59. package/dist/solution/VenueBooking/index.js +8 -4
  60. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  61. package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
  62. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  63. package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
  64. package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
  65. package/lib/model/strategy/adapter/itemRule/type.js +19 -1
  66. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  67. package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -0
  68. package/lib/modules/Customer/index.js +1 -0
  69. package/lib/modules/Discount/availability.d.ts +7 -0
  70. package/lib/modules/Discount/availability.js +43 -0
  71. package/lib/modules/Discount/index.d.ts +1 -3
  72. package/lib/modules/Discount/index.js +10 -131
  73. package/lib/modules/Discount/types.d.ts +6 -0
  74. package/lib/modules/Order/index.d.ts +41 -9
  75. package/lib/modules/Order/index.js +456 -69
  76. package/lib/modules/Order/salesNotes.d.ts +31 -0
  77. package/lib/modules/Order/salesNotes.js +382 -0
  78. package/lib/modules/Order/types.d.ts +105 -8
  79. package/lib/modules/Order/types.js +5 -1
  80. package/lib/modules/Order/utils.d.ts +4 -2
  81. package/lib/modules/Order/utils.js +134 -3
  82. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
  83. package/lib/modules/Payment/cashRecommendationAlgorithm.js +9 -354
  84. package/lib/modules/Product/index.d.ts +1 -1
  85. package/lib/modules/ProductList/index.d.ts +2 -1
  86. package/lib/modules/ProductList/index.js +47 -2
  87. package/lib/modules/ProductList/types.d.ts +10 -0
  88. package/lib/modules/Rules/index.js +42 -5
  89. package/lib/server/index.d.ts +7 -0
  90. package/lib/server/index.js +39 -3
  91. package/lib/server/modules/order/index.js +6 -0
  92. package/lib/server/modules/order/types.d.ts +9 -0
  93. package/lib/server/utils/small-ticket.d.ts +1 -0
  94. package/lib/server/utils/small-ticket.js +136 -12
  95. package/lib/solution/BaseSales/index.d.ts +15 -1
  96. package/lib/solution/BaseSales/index.js +192 -22
  97. package/lib/solution/BaseSales/types.d.ts +2 -2
  98. package/lib/solution/BookingByStep/index.d.ts +1 -1
  99. package/lib/solution/BookingTicket/index.d.ts +1 -0
  100. package/lib/solution/BookingTicket/index.js +23 -5
  101. package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
  102. package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
  103. package/lib/solution/RegisterAndLogin/config.js +49 -8
  104. package/lib/solution/RegisterAndLogin/index.js +4 -1
  105. package/lib/solution/ScanOrder/index.d.ts +1 -0
  106. package/lib/solution/ScanOrder/index.js +5 -1
  107. package/lib/solution/ScanOrder/utils.d.ts +1 -0
  108. package/lib/solution/ScanOrder/utils.js +1 -0
  109. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  110. package/lib/solution/ShopDiscount/index.js +29 -3
  111. package/lib/solution/ShopDiscount/utils.d.ts +4 -2
  112. package/lib/solution/ShopDiscount/utils.js +39 -23
  113. package/lib/solution/UnifiedBookingSales/index.d.ts +15 -2
  114. package/lib/solution/UnifiedBookingSales/index.js +125 -1
  115. package/lib/solution/UnifiedBookingSales/types.d.ts +14 -1
  116. package/lib/solution/VenueBooking/index.d.ts +1 -0
  117. package/lib/solution/VenueBooking/index.js +5 -1
  118. package/package.json +1 -1
@@ -2023,7 +2023,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2023
2023
  }, {
2024
2024
  key: "getItemRuleRuntimeConfig",
2025
2025
  value: function getItemRuleRuntimeConfig() {
2026
- return this.itemRuleRuntimeConfig || {};
2026
+ var _ref7, _runtimeConfig$channe, _runtimeConfig$custom, _this$otherParams13;
2027
+ var runtimeConfig = this.itemRuleRuntimeConfig || {};
2028
+ return _objectSpread(_objectSpread({}, runtimeConfig), {}, {
2029
+ channel: (_ref7 = (_runtimeConfig$channe = runtimeConfig.channel) !== null && _runtimeConfig$channe !== void 0 ? _runtimeConfig$channe : (_runtimeConfig$custom = runtimeConfig.custom) === null || _runtimeConfig$custom === void 0 ? void 0 : _runtimeConfig$custom.channel) !== null && _ref7 !== void 0 ? _ref7 : (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.channel
2030
+ });
2027
2031
  }
2028
2032
  }, {
2029
2033
  key: "ensureItemRuleConfigsLoaded",
@@ -2510,14 +2514,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2510
2514
  }, {
2511
2515
  key: "normalizeResourceState",
2512
2516
  value: function normalizeResourceState(detail, resourceSelectType, hasOrderId) {
2513
- var _detail$form_record, _this$otherParams13, _detail$resource_capa, _detail$resource_capa2;
2517
+ var _detail$form_record, _this$otherParams14, _detail$resource_capa, _detail$resource_capa2;
2514
2518
  var currentOrderId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.order_id);
2515
2519
  var lastOrderId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.last_order_id);
2516
2520
  var relationId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.form_record_id);
2517
2521
  var tableFormId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.form_id);
2518
2522
  var formRecord = (_detail$form_record = detail === null || detail === void 0 ? void 0 : detail.form_record) !== null && _detail$form_record !== void 0 ? _detail$form_record : null;
2519
2523
  // 是否允许加餐
2520
- var allowSnack = ((_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 || (_this$otherParams13 = _this$otherParams13.dineInConfig) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13['sale.allow_add_items']) || false;
2524
+ var allowSnack = ((_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 || (_this$otherParams14 = _this$otherParams14.dineInConfig) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14['sale.allow_add_items']) || false;
2521
2525
  // 开启同桌验证 - 本期没有这个配置,默认关掉
2522
2526
  var deskmateValid = false;
2523
2527
  var isExclusive = resourceSelectType === 'single';
@@ -2600,7 +2604,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2600
2604
  key: "fetchResourceOccupyDetailsByResourceId",
2601
2605
  value: function () {
2602
2606
  var _fetchResourceOccupyDetailsByResourceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(resourceId) {
2603
- var _this$otherParams14, _this$otherParams14$g, _response$data$occupy, _response$data;
2607
+ var _this$otherParams15, _this$otherParams15$g, _response$data$occupy, _response$data;
2604
2608
  var formRecordId, shopId, response;
2605
2609
  return _regeneratorRuntime().wrap(function _callee36$(_context36) {
2606
2610
  while (1) switch (_context36.prev = _context36.next) {
@@ -2612,7 +2616,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2612
2616
  }
2613
2617
  throw new Error("[ScanOrder] \u975E\u6CD5\u684C\u53F0 resourceId: ".concat(resourceId));
2614
2618
  case 3:
2615
- shopId = (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 || (_this$otherParams14$g = _this$otherParams14.getStateData) === null || _this$otherParams14$g === void 0 ? void 0 : _this$otherParams14$g.call(_this$otherParams14, 'shop_id');
2619
+ shopId = (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 || (_this$otherParams15$g = _this$otherParams15.getStateData) === null || _this$otherParams15$g === void 0 ? void 0 : _this$otherParams15$g.call(_this$otherParams15, 'shop_id');
2616
2620
  if (shopId) {
2617
2621
  _context36.next = 6;
2618
2622
  break;
@@ -2706,18 +2710,18 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2706
2710
  var hasOrderId,
2707
2711
  normalizedResourceId,
2708
2712
  _this$otherParams$bus,
2709
- _this$otherParams15,
2710
- _this$otherParams$cha,
2711
2713
  _this$otherParams16,
2714
+ _this$otherParams$cha,
2712
2715
  _this$otherParams17,
2713
- _this$otherParams17$g,
2716
+ _this$otherParams18,
2717
+ _this$otherParams18$g,
2714
2718
  _occupyDetails$,
2715
2719
  _occupyDetail$form_re,
2716
2720
  _occupyDetail$form_re2,
2717
2721
  _this$store$order6,
2718
2722
  _this$store$order7,
2719
2723
  _this$store$order7$ge,
2720
- _this$otherParams18,
2724
+ _this$otherParams19,
2721
2725
  _this$store$resource3,
2722
2726
  _this$store$resource4,
2723
2727
  businessCode,
@@ -2771,11 +2775,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2771
2775
  resourceId: normalizedResourceId
2772
2776
  });
2773
2777
  _context37.prev = 3;
2774
- businessCode = String((_this$otherParams$bus = (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : '').trim();
2775
- channel = String((_this$otherParams$cha = (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.channel) !== null && _this$otherParams$cha !== void 0 ? _this$otherParams$cha : '').trim();
2778
+ businessCode = String((_this$otherParams$bus = (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : '').trim();
2779
+ channel = String((_this$otherParams$cha = (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.channel) !== null && _this$otherParams$cha !== void 0 ? _this$otherParams$cha : '').trim();
2776
2780
  openDataTarget = businessCode && channel ? "".concat(businessCode, "+").concat(channel) : 'dine_in+scan_to_order';
2777
2781
  _context37.next = 9;
2778
- return (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 || (_this$otherParams17$g = _this$otherParams17.getOpenData) === null || _this$otherParams17$g === void 0 ? void 0 : _this$otherParams17$g.call(_this$otherParams17, {
2782
+ return (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 || (_this$otherParams18$g = _this$otherParams18.getOpenData) === null || _this$otherParams18$g === void 0 ? void 0 : _this$otherParams18$g.call(_this$otherParams18, {
2779
2783
  scope: 'board',
2780
2784
  target: openDataTarget,
2781
2785
  section_code: ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow']
@@ -3004,7 +3008,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3004
3008
  }, []) : []; // pax 由 setEntryPaxNumber 负责写入 itemRuleRuntimeConfig.pax
3005
3009
  _context37.next = 84;
3006
3010
  return this.setItemRuleRuntimeConfig({
3007
- serviceType: (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.businessCode,
3011
+ serviceType: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.businessCode,
3008
3012
  submissionIndex: isAdditionalOrderMode ? 1 : 0,
3009
3013
  historicalItems: historicalItems
3010
3014
  });
@@ -3130,14 +3134,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3130
3134
  key: "getProductList",
3131
3135
  value: function () {
3132
3136
  var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3133
- var _this$otherParams19;
3137
+ var _this$otherParams20;
3134
3138
  var associatedMenus, menu_list_ids, res, productList, formattedRes;
3135
3139
  return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3136
3140
  while (1) switch (_context40.prev = _context40.next) {
3137
3141
  case 0:
3138
3142
  this.logMethodStart('getProductList');
3139
3143
  // 可以直接通过配置里的 menu 读取
3140
- associatedMenus = (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 || (_this$otherParams19 = _this$otherParams19.dineInConfig) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19['menu.associated_menus'];
3144
+ associatedMenus = (_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 || (_this$otherParams20 = _this$otherParams20.dineInConfig) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20['menu.associated_menus'];
3141
3145
  menu_list_ids = associatedMenus.map(function (n) {
3142
3146
  return Number(n.value);
3143
3147
  }) || [];
@@ -3196,14 +3200,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3196
3200
  key: "setOtherParams",
3197
3201
  value: function () {
3198
3202
  var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(params) {
3199
- var _ref8,
3200
- _ref8$cover,
3203
+ var _ref9,
3204
+ _ref9$cover,
3201
3205
  cover,
3202
3206
  _args41 = arguments;
3203
3207
  return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3204
3208
  while (1) switch (_context41.prev = _context41.next) {
3205
3209
  case 0:
3206
- _ref8 = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : {}, _ref8$cover = _ref8.cover, cover = _ref8$cover === void 0 ? false : _ref8$cover;
3210
+ _ref9 = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : {}, _ref9$cover = _ref9.cover, cover = _ref9$cover === void 0 ? false : _ref9$cover;
3207
3211
  if (cover) {
3208
3212
  this.otherParams = params;
3209
3213
  } else {
@@ -3354,7 +3358,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3354
3358
  key: "syncAdditionalOrderFromResource",
3355
3359
  value: function () {
3356
3360
  var _syncAdditionalOrderFromResource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(resourceId) {
3357
- var _ref9, _ref10, _ref11, _this$store$resource5, _this$store$resource6, _occupyDetails$2, _this$store$resource7, _this$otherParams20, _this$store$order8;
3361
+ var _ref10, _ref11, _ref12, _this$store$resource5, _this$store$resource6, _occupyDetails$2, _this$store$resource7, _this$otherParams21, _this$store$order8;
3358
3362
  var tempOrder, normalizedResourceId, _result, occupyDetails, occupyDetail, resourceSelectType, allowAddItems, result;
3359
3363
  return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3360
3364
  while (1) switch (_context43.prev = _context43.next) {
@@ -3366,7 +3370,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3366
3370
  throw new Error('order 模块未初始化');
3367
3371
  case 2:
3368
3372
  tempOrder = this.store.order.ensureTempOrder();
3369
- normalizedResourceId = String((_ref9 = (_ref10 = (_ref11 = resourceId !== null && resourceId !== void 0 ? resourceId : tempOrder.resource_id) !== null && _ref11 !== void 0 ? _ref11 : (_this$store$resource5 = this.store.resource) === null || _this$store$resource5 === void 0 ? void 0 : _this$store$resource5.relationId) !== null && _ref10 !== void 0 ? _ref10 : (_this$store$resource6 = this.store.resource) === null || _this$store$resource6 === void 0 ? void 0 : _this$store$resource6.relation_id) !== null && _ref9 !== void 0 ? _ref9 : '').trim();
3373
+ normalizedResourceId = String((_ref10 = (_ref11 = (_ref12 = resourceId !== null && resourceId !== void 0 ? resourceId : tempOrder.resource_id) !== null && _ref12 !== void 0 ? _ref12 : (_this$store$resource5 = this.store.resource) === null || _this$store$resource5 === void 0 ? void 0 : _this$store$resource5.relationId) !== null && _ref11 !== void 0 ? _ref11 : (_this$store$resource6 = this.store.resource) === null || _this$store$resource6 === void 0 ? void 0 : _this$store$resource6.relation_id) !== null && _ref10 !== void 0 ? _ref10 : '').trim();
3370
3374
  this.logMethodStart('syncAdditionalOrderFromResource', {
3371
3375
  resourceId: normalizedResourceId
3372
3376
  });
@@ -3387,7 +3391,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3387
3391
  occupyDetails = _context43.sent;
3388
3392
  occupyDetail = (_occupyDetails$2 = occupyDetails[0]) !== null && _occupyDetails$2 !== void 0 ? _occupyDetails$2 : null;
3389
3393
  resourceSelectType = ((_this$store$resource7 = this.store.resource) === null || _this$store$resource7 === void 0 ? void 0 : _this$store$resource7.resourceSelectType) || this.resolveResourceSelectType(toPositiveString(occupyDetail === null || occupyDetail === void 0 ? void 0 : occupyDetail.form_id));
3390
- allowAddItems = toBoolean((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 || (_this$otherParams20 = _this$otherParams20.dineInConfig) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20['sale.allow_add_items']);
3394
+ allowAddItems = toBoolean((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 || (_this$otherParams21 = _this$otherParams21.dineInConfig) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21['sale.allow_add_items']);
3391
3395
  result = this.resolveAdditionalOrderFromOccupyDetail(occupyDetail, resourceSelectType, allowAddItems);
3392
3396
  if (!(!result.matched || !result.order_id)) {
3393
3397
  _context43.next = 19;
@@ -3445,9 +3449,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3445
3449
  }, {
3446
3450
  key: "checkAllowAddItems",
3447
3451
  value: function checkAllowAddItems() {
3448
- var _this$otherParams21;
3452
+ var _this$otherParams22;
3449
3453
  this.logMethodStart('checkAllowAddItems');
3450
- var dineInConfig = ((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.dineInConfig) || {};
3454
+ var dineInConfig = ((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.dineInConfig) || {};
3451
3455
  var result = {
3452
3456
  enabled: toBoolean(dineInConfig['sale.allow_add_items'])
3453
3457
  };
@@ -3460,9 +3464,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3460
3464
  }, {
3461
3465
  key: "getFulfillmentModes",
3462
3466
  value: function getFulfillmentModes() {
3463
- var _this$otherParams22;
3467
+ var _this$otherParams23;
3464
3468
  this.logMethodStart('getFulfillmentModes');
3465
- var dineInConfig = ((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.dineInConfig) || {};
3469
+ var dineInConfig = ((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.dineInConfig) || {};
3466
3470
  var result = {
3467
3471
  enablePickup: Boolean(dineInConfig['fulfillment.enable_pickup']),
3468
3472
  enableTableService: Boolean(dineInConfig['fulfillment.enable_table_service'])
@@ -3476,9 +3480,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3476
3480
  }, {
3477
3481
  key: "checkManualPickupRef",
3478
3482
  value: function checkManualPickupRef() {
3479
- var _this$otherParams23;
3483
+ var _this$otherParams24;
3480
3484
  this.logMethodStart('checkManualPickupRef');
3481
- var dineInConfig = ((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.dineInConfig) || {};
3485
+ var dineInConfig = ((_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.dineInConfig) || {};
3482
3486
  var refMode = dineInConfig['fulfillment.fulfillment_ref_mode'];
3483
3487
  var manualInputType = dineInConfig['fulfillment.manual_input_type'];
3484
3488
  var enabled = refMode === 'manual_input';
@@ -78,6 +78,7 @@ export declare function buildItemRuleBusinessData(params: {
78
78
  pax?: Partial<PaxInfo>;
79
79
  historicalItems?: CartItemSummary[];
80
80
  serviceType?: string;
81
+ channel?: string;
81
82
  submissionIndex?: number;
82
83
  custom?: Record<string, any>;
83
84
  };
@@ -309,6 +309,7 @@ export function aggregateItemRuleLimit(matchedLimits) {
309
309
  };
310
310
  }
311
311
  export function buildItemRuleBusinessData(params) {
312
+ var _runtimeConfig$channe, _runtimeConfig$custom;
312
313
  var tempOrder = params.tempOrder,
313
314
  runtimeConfig = params.runtimeConfig,
314
315
  itemRuleConfigs = params.itemRuleConfigs;
@@ -345,6 +346,7 @@ export function buildItemRuleBusinessData(params) {
345
346
  cartItems: cartItems,
346
347
  historicalItems: historicalItems,
347
348
  serviceType: runtimeConfig.serviceType || 'dine-in',
349
+ channel: (_runtimeConfig$channe = runtimeConfig.channel) !== null && _runtimeConfig$channe !== void 0 ? _runtimeConfig$channe : (_runtimeConfig$custom = runtimeConfig.custom) === null || _runtimeConfig$custom === void 0 ? void 0 : _runtimeConfig$custom.channel,
348
350
  submissionIndex: typeof runtimeConfig.submissionIndex === 'number' ? toNonNegativeInt(runtimeConfig.submissionIndex) : tempOrder.order_id ? 1 : 0,
349
351
  custom: runtimeConfig.custom || {},
350
352
  strategyConfigs: itemRuleConfigs
@@ -43,6 +43,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
43
43
  batchSearchByProductIds(productIds: number[]): Promise<Discount[]>;
44
44
  scanCode(code: string, customerId?: number): Promise<{
45
45
  isAvailable: boolean;
46
+ isAccepted?: boolean;
46
47
  productList: Record<string, any>[];
47
48
  discountList: Discount[];
48
49
  type: "server" | "clientCalc";
@@ -30,6 +30,7 @@ import { RulesModule } from "../../modules/Rules";
30
30
  import { isEntitlementPass } from "../../modules/Discount/entitlementPass";
31
31
  import { filterDiscountListByBookingTime as _filterDiscountListByBookingTime, isAllNormalProduct } from "./utils";
32
32
  import { UnavailableReason } from "../../modules/Rules/types";
33
+ import { getDiscountLifecycleReason } from "../../modules/Discount/availability";
33
34
  import Decimal from 'decimal.js';
34
35
  import { isBoolean } from 'lodash-es';
35
36
  export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
@@ -441,7 +442,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
441
442
  key: "scanCode",
442
443
  value: function () {
443
444
  var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(code, customerId) {
444
- var _this$store$discount4, _this$store$bookingSu2, resultDiscountWithReason, resultDiscountList, unavailableReasonKey, rulesModule, withScanList, currentSelectedDiscountList, _ref2, newProductList, newDiscountList, isAvailable, unavailableReason, _this$options$otherPa6;
445
+ var _this$store$discount4, _this$store$bookingSu2, resultDiscountWithReason, resultDiscountList, unavailableReasonKey, rulesModule, withScanList, currentSelectedDiscountList, _ref2, newProductList, newDiscountList, evaluatedDiscountList, isAvailable, unavailableReason, isAccepted, _this$options$otherPa6, scannedIds, retainedScannedDiscounts, _this$store$discount5, retainedDiscounts;
445
446
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
446
447
  while (1) switch (_context6.prev = _context6.next) {
447
448
  case 0:
@@ -523,30 +524,65 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
523
524
  isAvailable: false,
524
525
  productList: this.store.productList || [],
525
526
  discountList: this.getDiscountList()
526
- }, newProductList = _ref2.productList, newDiscountList = _ref2.discountList, isAvailable = _ref2.isAvailable, unavailableReason = _ref2.unavailableReason;
527
+ }, newProductList = _ref2.productList, newDiscountList = _ref2.discountList, evaluatedDiscountList = _ref2.evaluatedDiscountList, isAvailable = _ref2.isAvailable, unavailableReason = _ref2.unavailableReason;
528
+ isAccepted = isAvailable;
527
529
  if (!isAvailable) {
528
- _context6.next = 25;
530
+ _context6.next = 28;
529
531
  break;
530
532
  }
531
533
  this.setDiscountList(newDiscountList || []);
532
534
  this.store.originalDiscountList = newDiscountList || [];
533
535
  this.setProductList(newProductList || []);
534
536
  if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop' && !((resultDiscountList[0].customer_id || 1) === 1))) {
535
- _context6.next = 25;
537
+ _context6.next = 26;
536
538
  break;
537
539
  }
538
- _context6.next = 25;
540
+ _context6.next = 26;
539
541
  return this.getCustomerWallet(resultDiscountList[0].customer_id);
540
- case 25:
542
+ case 26:
543
+ _context6.next = 38;
544
+ break;
545
+ case 28:
546
+ scannedIds = new Set(withScanList.map(function (discount) {
547
+ return String(discount.id);
548
+ }));
549
+ retainedScannedDiscounts = (evaluatedDiscountList || withScanList).filter(function (discount) {
550
+ return scannedIds.has(String(discount.id)) && !getDiscountLifecycleReason(discount);
551
+ });
552
+ if (!retainedScannedDiscounts.length) {
553
+ _context6.next = 38;
554
+ break;
555
+ }
556
+ retainedDiscounts = new Map(this.getDiscountList().map(function (discount) {
557
+ return [String(discount.id), discount];
558
+ }));
559
+ retainedScannedDiscounts.forEach(function (discount) {
560
+ retainedDiscounts.set(String(discount.id), _objectSpread(_objectSpread({}, discount), {}, {
561
+ isScan: true,
562
+ isAvailable: false,
563
+ isSelected: false,
564
+ reasonCode: discount.reasonCode || 'product_not_applicable',
565
+ appliedProductDetails: [],
566
+ savedAmount: 0
567
+ }));
568
+ });
569
+ this.setDiscountList(_toConsumableArray(retainedDiscounts.values()));
570
+ this.store.originalDiscountList = this.getDiscountList();
571
+ _context6.next = 37;
572
+ return (_this$store$discount5 = this.store.discount) === null || _this$store$discount5 === void 0 ? void 0 : _this$store$discount5.setOriginalDiscountList(this.getDiscountList());
573
+ case 37:
574
+ isAccepted = true;
575
+ case 38:
541
576
  return _context6.abrupt("return", {
542
577
  type: "clientCalc",
543
578
  isAvailable: isAvailable || false,
579
+ isAccepted: Boolean(isAccepted),
544
580
  productList: newProductList || this.store.productList || [],
545
- discountList: newDiscountList || this.getDiscountList(),
581
+ discountList: this.getDiscountList(),
546
582
  unavailableReason: unavailableReason
547
583
  });
548
- case 28:
549
- _context6.prev = 28;
584
+ case 41:
585
+ _context6.prev = 41;
550
586
  _context6.t1 = _context6["catch"](0);
551
587
  console.error('[ShopDiscount] 扫码出错:', _context6.t1);
552
588
  return _context6.abrupt("return", {
@@ -556,11 +592,11 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
556
592
  discountList: this.getDiscountList(),
557
593
  unavailableReason: UnavailableReason.Unknown
558
594
  });
559
- case 32:
595
+ case 45:
560
596
  case "end":
561
597
  return _context6.stop();
562
598
  }
563
- }, _callee6, this, [[0, 28]]);
599
+ }, _callee6, this, [[0, 41]]);
564
600
  }));
565
601
  function scanCode(_x5, _x6) {
566
602
  return _scanCode.apply(this, arguments);
@@ -570,8 +606,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
570
606
  }, {
571
607
  key: "calcDiscountApplicableProductTotalPrice",
572
608
  value: function calcDiscountApplicableProductTotalPrice(discount) {
573
- var _this$store$discount5;
574
- return (_this$store$discount5 = this.store.discount) === null || _this$store$discount5 === void 0 ? void 0 : _this$store$discount5.calcDiscountApplicableProductTotalPrice(discount);
609
+ var _this$store$discount6;
610
+ return (_this$store$discount6 = this.store.discount) === null || _this$store$discount6 === void 0 ? void 0 : _this$store$discount6.calcDiscountApplicableProductTotalPrice(discount);
575
611
  }
576
612
 
577
613
  // =========== 私有辅助方法 ===========
@@ -616,7 +652,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
616
652
  key: "setDiscountList",
617
653
  value: function setDiscountList(discountList) {
618
654
  var _this3 = this,
619
- _this$store$discount6;
655
+ _this$store$discount7;
620
656
  var productList = this.store.productList || [];
621
657
  var editModeDiscountList = [];
622
658
  productList.forEach(function (item) {
@@ -699,7 +735,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
699
735
  item.isDisabledForProductUsed = false;
700
736
  }
701
737
  });
702
- (_this$store$discount6 = this.store.discount) === null || _this$store$discount6 === void 0 || _this$store$discount6.setDiscountList(newDiscountList);
738
+ (_this$store$discount7 = this.store.discount) === null || _this$store$discount7 === void 0 || _this$store$discount7.setDiscountList(newDiscountList);
703
739
  this.emitDiscountListChange(newDiscountList);
704
740
  return newDiscountList;
705
741
  }
@@ -708,8 +744,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
708
744
  }, {
709
745
  key: "getDiscountList",
710
746
  value: function getDiscountList() {
711
- var _this$store$discount7;
712
- return ((_this$store$discount7 = this.store.discount) === null || _this$store$discount7 === void 0 ? void 0 : _this$store$discount7.getDiscountList()) || [];
747
+ var _this$store$discount8;
748
+ return ((_this$store$discount8 = this.store.discount) === null || _this$store$discount8 === void 0 ? void 0 : _this$store$discount8.getDiscountList()) || [];
713
749
  }
714
750
 
715
751
  // 获取客户钱包信息
@@ -791,7 +827,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
791
827
  key: "loadPrepareConfig",
792
828
  value: function () {
793
829
  var _loadPrepareConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
794
- var _this$getCustomer2, _this$store$discount8, _this$getDiscountList, _this$store$discount9, _this$store$productLi2, orderId, customerId, prepareConfigResult, goodPassList, scanDiscount, scanDiscountById, refreshedScanEntitlementIds, newGoodPassList, retainedScanDiscounts, newDiscountList, filteredDiscountList, _result3;
830
+ var _this$getCustomer2, _this$store$discount9, _this$getDiscountList, _this$store$discount10, _this$store$productLi2, orderId, customerId, prepareConfigResult, goodPassList, scanDiscount, scanDiscountById, refreshedScanEntitlementIds, newGoodPassList, retainedScanDiscounts, newDiscountList, filteredDiscountList, _result3;
795
831
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
796
832
  while (1) switch (_context10.prev = _context10.next) {
797
833
  case 0:
@@ -801,13 +837,14 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
801
837
  // return
802
838
  // }
803
839
  _context10.next = 5;
804
- return (_this$store$discount8 = this.store.discount) === null || _this$store$discount8 === void 0 ? void 0 : _this$store$discount8.loadPrepareConfig(_objectSpread({
840
+ return (_this$store$discount9 = this.store.discount) === null || _this$store$discount9 === void 0 ? void 0 : _this$store$discount9.loadPrepareConfig(_objectSpread({
805
841
  customer_id: customerId,
806
842
  action: orderId ? 'edit' : 'create',
807
843
  with_good_pass: 1,
808
844
  with_discount_card: 1,
809
845
  with_wallet_pass_holder: 1,
810
846
  with_entitlement_pass: 1,
847
+ filter_order_wallet_pass_usage: 0,
811
848
  request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
812
849
  }, orderId ? {
813
850
  order_id: orderId
@@ -844,10 +881,10 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
844
881
  newDiscountList = [].concat(_toConsumableArray(retainedScanDiscounts), _toConsumableArray(newGoodPassList)); // 存储原始优惠券列表
845
882
  this.store.originalDiscountList = newDiscountList;
846
883
  _context10.next = 16;
847
- return (_this$store$discount9 = this.store.discount) === null || _this$store$discount9 === void 0 ? void 0 : _this$store$discount9.setOriginalDiscountList(newDiscountList);
884
+ return (_this$store$discount10 = this.store.discount) === null || _this$store$discount10 === void 0 ? void 0 : _this$store$discount10.setOriginalDiscountList(newDiscountList);
848
885
  case 16:
849
- // 根据当前预约时间过滤优惠券列表
850
- filteredDiscountList = this.filterDiscountListByBookingTime(newDiscountList, this.store.currentBookingTime);
886
+ // 日程限制交给 Rules 计算可用状态,展示列表保留当前不可用的卡券。
887
+ filteredDiscountList = newDiscountList;
851
888
  this.store.filteredDiscountList = filteredDiscountList;
852
889
  this.setDiscountList(filteredDiscountList || []);
853
890
  if (!((_this$store$productLi2 = this.store.productList) !== null && _this$store$productLi2 !== void 0 && _this$store$productLi2.length)) {
@@ -59,12 +59,14 @@ export interface ScheduleItem {
59
59
  }
60
60
  export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
61
61
  /**
62
- * 根据预约时间过滤优惠券列表
62
+ * 根据商品使用时间过滤优惠券列表(预约开始时间或普通商品的当前时间)
63
63
  * @param discountList 优惠券列表
64
- * @param bookingTime 预约时间 (格式: YYYY-MM-DD HH:mm:ss)
64
+ * @param bookingTime 使用时间 (格式: YYYY-MM-DD HH:mm:ss),未确定时不提前过滤
65
65
  * @returns 过滤后的优惠券列表
66
66
  */
67
67
  export declare const filterDiscountListByBookingTime: (discountList: Discount[], bookingTime: string | null) => Discount[];
68
+ /** 与抵扣计算共用时间判断,区分未开始、有效期不匹配和日程限制。 */
69
+ export declare const getDiscountTimeUnavailableReason: (discount: Discount, useTime: string) => 'not_started' | 'time_limit' | 'outside_schedule' | undefined;
68
70
  /**
69
71
  * 判断是否是订单级别的固定金额折扣卡
70
72
  * @param discount 折扣
@@ -9,7 +9,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
9
9
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
10
  import Decimal from "decimal.js";
11
11
  import dayjs from "dayjs";
12
+ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
13
+ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
12
14
  import { isFullCoveragePass } from "../../modules/Discount/entitlementPass";
15
+ dayjs.extend(isSameOrAfter);
16
+ dayjs.extend(isSameOrBefore);
13
17
  export var uniqueById = function uniqueById(arr) {
14
18
  var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
15
19
  var seen = new Set();
@@ -440,36 +444,51 @@ var isInWeeklyRepeatForDate = function isInWeeklyRepeatForDate(targetDate, start
440
444
  };
441
445
 
442
446
  /**
443
- * 根据预约时间过滤优惠券列表
447
+ * 根据商品使用时间过滤优惠券列表(预约开始时间或普通商品的当前时间)
444
448
  * @param discountList 优惠券列表
445
- * @param bookingTime 预约时间 (格式: YYYY-MM-DD HH:mm:ss)
449
+ * @param bookingTime 使用时间 (格式: YYYY-MM-DD HH:mm:ss),未确定时不提前过滤
446
450
  * @returns 过滤后的优惠券列表
447
451
  */
448
452
  export var filterDiscountListByBookingTime = function filterDiscountListByBookingTime(discountList, bookingTime) {
449
- if (!bookingTime) {
450
- return discountList;
451
- }
453
+ if (!bookingTime) return discountList;
452
454
  return discountList.filter(function (discount) {
453
- var _discount$metadata2;
455
+ return !getDiscountTimeUnavailableReason(discount, bookingTime);
456
+ });
457
+ };
458
+
459
+ /** 与抵扣计算共用时间判断,区分未开始、有效期不匹配和日程限制。 */
460
+ export var getDiscountTimeUnavailableReason = function getDiscountTimeUnavailableReason(discount, useTime) {
461
+ var useTimeDayjs = dayjs(useTime);
462
+ if (!useTimeDayjs.isValid()) return 'time_limit';
463
+ try {
464
+ var _discount$metadata2, _discount$extension_d, _discount$custom_sche2;
454
465
  if ((discount === null || discount === void 0 || (_discount$metadata2 = discount.metadata) === null || _discount$metadata2 === void 0 ? void 0 : _discount$metadata2.validity_type) === "custom_schedule_validity") {
455
466
  var _discount$custom_sche;
456
- return getDateIsInSchedule(bookingTime, ((_discount$custom_sche = discount.custom_schedule_snapshot) === null || _discount$custom_sche === void 0 ? void 0 : _discount$custom_sche.data) || []);
467
+ return getDateIsInSchedule(useTime, ((_discount$custom_sche = discount.custom_schedule_snapshot) === null || _discount$custom_sche === void 0 ? void 0 : _discount$custom_sche.data) || []) ? undefined : 'outside_schedule';
457
468
  }
458
- try {
459
- var isHasStart = !!discount.start_date && !!discount.start_time;
460
- var startDate = dayjs("".concat(discount.start_date, " ").concat(discount.start_time));
461
- var bookingTimeDayjs = dayjs(bookingTime);
462
-
463
- // 判断预约时间是否在开始时间之后
464
- var isAfterStart = isHasStart ? bookingTimeDayjs.isSameOrAfter(startDate) : true;
465
-
466
- // 判断预约时间是否在过期时间之前(expire_time 为空时为长期有效)
467
- var isBeforeExpire = discount.expire_time ? bookingTimeDayjs.isSameOrBefore(dayjs(discount.expire_time)) : true;
468
- return isAfterStart && isBeforeExpire;
469
- } catch (error) {
470
- return true;
469
+ var isHasStart = !!discount.start_date && !!discount.start_time;
470
+ var startDate = dayjs("".concat(discount.start_date, " ").concat(discount.start_time));
471
+
472
+ // 开始时刻包含在有效期内。
473
+ if (isHasStart) {
474
+ if (!startDate.isValid()) return 'time_limit';
475
+ if (useTimeDayjs.isBefore(startDate)) return 'not_started';
471
476
  }
472
- });
477
+
478
+ // 到期时刻不再可用;expire_time 为空时为长期有效。
479
+ var expireTime = discount.expire_time ? dayjs(discount.expire_time) : null;
480
+ var isBeforeExpire = expireTime ? expireTime.isValid() && useTimeDayjs.isBefore(expireTime) : true;
481
+ if (!isBeforeExpire) return 'time_limit';
482
+ var validity = (_discount$extension_d = discount.extension_data) === null || _discount$extension_d === void 0 || (_discount$extension_d = _discount$extension_d.find(function (field) {
483
+ return field.field_key === 'valid_times';
484
+ })) === null || _discount$extension_d === void 0 ? void 0 : _discount$extension_d.value;
485
+ if ((validity === null || validity === void 0 ? void 0 : validity.restrict_use_by_schedule) === true && !getDateIsInSchedule(useTime, ((_discount$custom_sche2 = discount.custom_schedule_snapshot) === null || _discount$custom_sche2 === void 0 ? void 0 : _discount$custom_sche2.data) || [])) {
486
+ return 'outside_schedule';
487
+ }
488
+ return undefined;
489
+ } catch (error) {
490
+ return 'time_limit';
491
+ }
473
492
  };
474
493
  /**
475
494
  * 判断是否是订单级别的固定金额折扣卡
@@ -2,10 +2,11 @@ import type { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import type { ProductData } from '../../modules';
3
3
  import { type InvoiceLayoutConfig, type InvoiceTemplateSettings, type OpenDataConfig } from '../../modules/OpenData';
4
4
  import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
5
- import type { ProductListLoadProductsParams } from '../../modules/ProductList';
5
+ import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
6
6
  import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
7
- import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
7
+ import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesResolveProductAllergyRequirementParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
8
8
  import { BookingTicket } from '../BookingTicket';
9
+ import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
9
10
  export * from './types';
10
11
  export { AvailabilityError } from '../../modules/ResourcePlanner';
11
12
  /**
@@ -73,6 +74,9 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
73
74
  private availabilityRemoteResourceQuerySequence;
74
75
  private availabilityRemoteResourceEpoch;
75
76
  private availabilityCommitLocks;
77
+ private allergyItemRuleEvaluator;
78
+ private allergyItemRuleConfigs;
79
+ private allergyItemRuleConfigsPromise;
76
80
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
77
81
  protected getSubmitOrderSalesChannel(): string;
78
82
  private createAvailabilityFacadeError;
@@ -144,6 +148,14 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
144
148
  */
145
149
  loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
146
150
  getOpenData(): Promise<OpenDataConfig | null>;
151
+ private resetAllergyItemRuleState;
152
+ private fetchAllergyItemRuleConfigs;
153
+ private ensureAllergyItemRuleConfigsLoaded;
154
+ /**
155
+ * 评估当前渠道与商品是否命中 ALLERGY_CHECK。
156
+ * 只返回优先级最高 Action 中当前商品 Target 的 dataSource,不跨商品或 Action 合并。
157
+ */
158
+ resolveProductAllergyRequirement(params: UnifiedBookingSalesResolveProductAllergyRequirementParams): Promise<AllergyRequirement | null>;
147
159
  clearOpenDataCache(): void;
148
160
  getInvoiceLayoutConfig(): Promise<InvoiceLayoutConfig>;
149
161
  getInvoiceTemplateSettings(): Promise<InvoiceTemplateSettings>;
@@ -160,6 +172,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
160
172
  callback?: (result: any) => void;
161
173
  subscriberId?: string;
162
174
  }): Promise<ProductData[]>;
175
+ queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
163
176
  /** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
164
177
  loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
165
178
  /**