@pisell/pisellos 2.2.302 → 2.2.304

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 (157) hide show
  1. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +18 -2
  2. package/dist/model/strategy/adapter/dataVariant/evaluator.js +287 -101
  3. package/dist/model/strategy/adapter/dataVariant/type.d.ts +25 -0
  4. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  5. package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
  6. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  7. package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
  8. package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
  9. package/dist/model/strategy/adapter/itemRule/type.js +19 -1
  10. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  11. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +10 -7
  12. package/dist/modules/Discount/index.d.ts +2 -0
  13. package/dist/modules/Discount/index.js +41 -5
  14. package/dist/modules/Discount/types.d.ts +21 -0
  15. package/dist/modules/OpenData/index.d.ts +15 -2
  16. package/dist/modules/OpenData/index.js +307 -19
  17. package/dist/modules/OpenData/types.d.ts +55 -0
  18. package/dist/modules/OpenData/types.js +7 -1
  19. package/dist/modules/OpenData/utils.d.ts +21 -1
  20. package/dist/modules/OpenData/utils.js +138 -0
  21. package/dist/modules/Order/index.d.ts +50 -7
  22. package/dist/modules/Order/index.js +1690 -815
  23. package/dist/modules/Order/salesNotes.d.ts +31 -0
  24. package/dist/modules/Order/salesNotes.js +492 -0
  25. package/dist/modules/Order/types.d.ts +117 -10
  26. package/dist/modules/Order/types.js +6 -1
  27. package/dist/modules/Order/utils/virtualSettlement.d.ts +63 -0
  28. package/dist/modules/Order/utils/virtualSettlement.js +284 -0
  29. package/dist/modules/Order/utils.d.ts +5 -1
  30. package/dist/modules/Order/utils.js +138 -33
  31. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
  32. package/dist/modules/Payment/cashRecommendationAlgorithm.js +17 -367
  33. package/dist/modules/Payment/walletpass.js +20 -21
  34. package/dist/modules/Product/types.d.ts +23 -0
  35. package/dist/modules/ProductList/index.d.ts +2 -1
  36. package/dist/modules/ProductList/index.js +100 -20
  37. package/dist/modules/ProductList/types.d.ts +10 -0
  38. package/dist/modules/Rules/index.d.ts +5 -0
  39. package/dist/modules/Rules/index.js +30 -14
  40. package/dist/modules/SalesSummary/index.d.ts +1 -0
  41. package/dist/modules/SalesSummary/index.js +4 -3
  42. package/dist/modules/SalesSummary/types.d.ts +1 -0
  43. package/dist/modules/SalesSummary/utils.d.ts +1 -0
  44. package/dist/modules/SalesSummary/utils.js +21 -1
  45. package/dist/plugins/request.d.ts +2 -1
  46. package/dist/plugins/request.js +4 -2
  47. package/dist/server/index.d.ts +21 -0
  48. package/dist/server/index.js +1774 -1285
  49. package/dist/server/modules/order/types.d.ts +50 -0
  50. package/dist/server/modules/order/types.js +2 -0
  51. package/dist/server/utils/small-ticket.d.ts +4 -1
  52. package/dist/server/utils/small-ticket.js +461 -96
  53. package/dist/solution/BaseSales/index.d.ts +24 -3
  54. package/dist/solution/BaseSales/index.js +1484 -873
  55. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  56. package/dist/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  57. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  58. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +72 -9
  59. package/dist/solution/BookingByStep/index.d.ts +1 -1
  60. package/dist/solution/BookingTicket/index.d.ts +22 -5
  61. package/dist/solution/BookingTicket/index.js +558 -443
  62. package/dist/solution/BookingTicket/utils/addProductDecision.js +2 -1
  63. package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
  64. package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
  65. package/dist/solution/RegisterAndLogin/config.js +95 -40
  66. package/dist/solution/RegisterAndLogin/index.js +4 -1
  67. package/dist/solution/Sales/index.d.ts +16 -1
  68. package/dist/solution/Sales/index.js +338 -63
  69. package/dist/solution/Sales/types.d.ts +10 -0
  70. package/dist/solution/ScanOrder/index.d.ts +1 -0
  71. package/dist/solution/ScanOrder/index.js +31 -27
  72. package/dist/solution/ScanOrder/utils.d.ts +1 -0
  73. package/dist/solution/ScanOrder/utils.js +2 -0
  74. package/dist/solution/UnifiedBookingSales/index.d.ts +20 -6
  75. package/dist/solution/UnifiedBookingSales/index.js +874 -527
  76. package/dist/solution/UnifiedBookingSales/types.d.ts +21 -2
  77. package/dist/solution/VenueBooking/index.d.ts +1 -0
  78. package/dist/solution/VenueBooking/index.js +8 -4
  79. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +18 -2
  80. package/lib/model/strategy/adapter/dataVariant/evaluator.js +137 -6
  81. package/lib/model/strategy/adapter/dataVariant/type.d.ts +25 -0
  82. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  83. package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
  84. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  85. package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
  86. package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
  87. package/lib/model/strategy/adapter/itemRule/type.js +19 -1
  88. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  89. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +4 -0
  90. package/lib/modules/Discount/index.d.ts +2 -0
  91. package/lib/modules/Discount/index.js +34 -2
  92. package/lib/modules/Discount/types.d.ts +21 -0
  93. package/lib/modules/OpenData/index.d.ts +15 -2
  94. package/lib/modules/OpenData/index.js +230 -3
  95. package/lib/modules/OpenData/types.d.ts +55 -0
  96. package/lib/modules/OpenData/types.js +9 -1
  97. package/lib/modules/OpenData/utils.d.ts +21 -1
  98. package/lib/modules/OpenData/utils.js +126 -0
  99. package/lib/modules/Order/index.d.ts +50 -7
  100. package/lib/modules/Order/index.js +704 -64
  101. package/lib/modules/Order/salesNotes.d.ts +31 -0
  102. package/lib/modules/Order/salesNotes.js +382 -0
  103. package/lib/modules/Order/types.d.ts +117 -10
  104. package/lib/modules/Order/types.js +5 -1
  105. package/lib/modules/Order/utils/virtualSettlement.d.ts +63 -0
  106. package/lib/modules/Order/utils/virtualSettlement.js +262 -0
  107. package/lib/modules/Order/utils.d.ts +5 -1
  108. package/lib/modules/Order/utils.js +127 -21
  109. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
  110. package/lib/modules/Payment/cashRecommendationAlgorithm.js +9 -354
  111. package/lib/modules/Payment/walletpass.js +14 -11
  112. package/lib/modules/Product/types.d.ts +23 -0
  113. package/lib/modules/ProductList/index.d.ts +2 -1
  114. package/lib/modules/ProductList/index.js +47 -2
  115. package/lib/modules/ProductList/types.d.ts +10 -0
  116. package/lib/modules/Rules/index.d.ts +5 -0
  117. package/lib/modules/Rules/index.js +22 -12
  118. package/lib/modules/SalesSummary/index.d.ts +1 -0
  119. package/lib/modules/SalesSummary/index.js +4 -2
  120. package/lib/modules/SalesSummary/types.d.ts +1 -0
  121. package/lib/modules/SalesSummary/utils.d.ts +1 -0
  122. package/lib/modules/SalesSummary/utils.js +17 -1
  123. package/lib/plugins/request.d.ts +2 -1
  124. package/lib/plugins/request.js +3 -2
  125. package/lib/server/index.d.ts +21 -0
  126. package/lib/server/index.js +492 -108
  127. package/lib/server/modules/order/types.d.ts +50 -0
  128. package/lib/server/modules/order/types.js +1 -0
  129. package/lib/server/utils/small-ticket.d.ts +4 -1
  130. package/lib/server/utils/small-ticket.js +427 -72
  131. package/lib/solution/BaseSales/index.d.ts +24 -3
  132. package/lib/solution/BaseSales/index.js +433 -30
  133. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  134. package/lib/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  135. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  136. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +38 -0
  137. package/lib/solution/BookingByStep/index.d.ts +1 -1
  138. package/lib/solution/BookingTicket/index.d.ts +22 -5
  139. package/lib/solution/BookingTicket/index.js +60 -15
  140. package/lib/solution/BookingTicket/utils/addProductDecision.js +1 -0
  141. package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
  142. package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
  143. package/lib/solution/RegisterAndLogin/config.js +49 -8
  144. package/lib/solution/RegisterAndLogin/index.js +4 -1
  145. package/lib/solution/Sales/index.d.ts +16 -1
  146. package/lib/solution/Sales/index.js +168 -1
  147. package/lib/solution/Sales/types.d.ts +10 -0
  148. package/lib/solution/ScanOrder/index.d.ts +1 -0
  149. package/lib/solution/ScanOrder/index.js +5 -1
  150. package/lib/solution/ScanOrder/utils.d.ts +1 -0
  151. package/lib/solution/ScanOrder/utils.js +1 -0
  152. package/lib/solution/UnifiedBookingSales/index.d.ts +20 -6
  153. package/lib/solution/UnifiedBookingSales/index.js +169 -16
  154. package/lib/solution/UnifiedBookingSales/types.d.ts +21 -2
  155. package/lib/solution/VenueBooking/index.d.ts +1 -0
  156. package/lib/solution/VenueBooking/index.js +5 -1
  157. 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,
@@ -2775,11 +2779,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2775
2779
  resourceId: normalizedResourceId
2776
2780
  });
2777
2781
  _context37.prev = 3;
2778
- 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();
2779
- 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();
2782
+ 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();
2783
+ 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();
2780
2784
  openDataTarget = businessCode && channel ? "".concat(businessCode, "+").concat(channel) : 'dine_in+scan_to_order';
2781
2785
  _context37.next = 9;
2782
- 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, {
2786
+ 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, {
2783
2787
  scope: 'board',
2784
2788
  target: openDataTarget,
2785
2789
  section_code: ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow']
@@ -3043,7 +3047,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3043
3047
  }, []) : []; // pax 由 setEntryPaxNumber 负责写入 itemRuleRuntimeConfig.pax
3044
3048
  _context37.next = 79;
3045
3049
  return this.setItemRuleRuntimeConfig({
3046
- serviceType: (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.businessCode,
3050
+ serviceType: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.businessCode,
3047
3051
  submissionIndex: isAdditionalOrderMode ? 1 : 0,
3048
3052
  historicalItems: historicalItems
3049
3053
  });
@@ -3169,14 +3173,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3169
3173
  key: "getProductList",
3170
3174
  value: function () {
3171
3175
  var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3172
- var _this$otherParams19;
3176
+ var _this$otherParams20;
3173
3177
  var associatedMenus, menu_list_ids, res, productList, formattedRes;
3174
3178
  return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3175
3179
  while (1) switch (_context40.prev = _context40.next) {
3176
3180
  case 0:
3177
3181
  this.logMethodStart('getProductList');
3178
3182
  // 可以直接通过配置里的 menu 读取
3179
- 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'];
3183
+ 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'];
3180
3184
  menu_list_ids = associatedMenus.map(function (n) {
3181
3185
  return Number(n.value);
3182
3186
  }) || [];
@@ -3235,14 +3239,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3235
3239
  key: "setOtherParams",
3236
3240
  value: function () {
3237
3241
  var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(params) {
3238
- var _ref8,
3239
- _ref8$cover,
3242
+ var _ref9,
3243
+ _ref9$cover,
3240
3244
  cover,
3241
3245
  _args41 = arguments;
3242
3246
  return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3243
3247
  while (1) switch (_context41.prev = _context41.next) {
3244
3248
  case 0:
3245
- _ref8 = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : {}, _ref8$cover = _ref8.cover, cover = _ref8$cover === void 0 ? false : _ref8$cover;
3249
+ _ref9 = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : {}, _ref9$cover = _ref9.cover, cover = _ref9$cover === void 0 ? false : _ref9$cover;
3246
3250
  if (cover) {
3247
3251
  this.otherParams = params;
3248
3252
  } else {
@@ -3393,7 +3397,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3393
3397
  key: "syncAdditionalOrderFromResource",
3394
3398
  value: function () {
3395
3399
  var _syncAdditionalOrderFromResource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(resourceId) {
3396
- var _ref9, _ref10, _ref11, _this$store$resource5, _this$store$resource6, _occupyDetails$2, _this$store$resource7, _this$otherParams20, _this$store$order8;
3400
+ var _ref10, _ref11, _ref12, _this$store$resource5, _this$store$resource6, _occupyDetails$2, _this$store$resource7, _this$otherParams21, _this$store$order8;
3397
3401
  var tempOrder, normalizedResourceId, _result, occupyDetails, occupyDetail, resourceSelectType, allowAddItems, result;
3398
3402
  return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3399
3403
  while (1) switch (_context43.prev = _context43.next) {
@@ -3405,7 +3409,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3405
3409
  throw new Error('order 模块未初始化');
3406
3410
  case 2:
3407
3411
  tempOrder = this.store.order.ensureTempOrder();
3408
- 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();
3412
+ 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();
3409
3413
  this.logMethodStart('syncAdditionalOrderFromResource', {
3410
3414
  resourceId: normalizedResourceId
3411
3415
  });
@@ -3426,7 +3430,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3426
3430
  occupyDetails = _context43.sent;
3427
3431
  occupyDetail = (_occupyDetails$2 = occupyDetails[0]) !== null && _occupyDetails$2 !== void 0 ? _occupyDetails$2 : null;
3428
3432
  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));
3429
- 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']);
3433
+ 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']);
3430
3434
  result = this.resolveAdditionalOrderFromOccupyDetail(occupyDetail, resourceSelectType, allowAddItems);
3431
3435
  if (!(!result.matched || !result.order_id)) {
3432
3436
  _context43.next = 19;
@@ -3484,9 +3488,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3484
3488
  }, {
3485
3489
  key: "checkAllowAddItems",
3486
3490
  value: function checkAllowAddItems() {
3487
- var _this$otherParams21;
3491
+ var _this$otherParams22;
3488
3492
  this.logMethodStart('checkAllowAddItems');
3489
- var dineInConfig = ((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.dineInConfig) || {};
3493
+ var dineInConfig = ((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.dineInConfig) || {};
3490
3494
  var result = {
3491
3495
  enabled: toBoolean(dineInConfig['sale.allow_add_items'])
3492
3496
  };
@@ -3499,9 +3503,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3499
3503
  }, {
3500
3504
  key: "getFulfillmentModes",
3501
3505
  value: function getFulfillmentModes() {
3502
- var _this$otherParams22;
3506
+ var _this$otherParams23;
3503
3507
  this.logMethodStart('getFulfillmentModes');
3504
- var dineInConfig = ((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.dineInConfig) || {};
3508
+ var dineInConfig = ((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.dineInConfig) || {};
3505
3509
  var result = {
3506
3510
  enablePickup: Boolean(dineInConfig['fulfillment.enable_pickup']),
3507
3511
  enableTableService: Boolean(dineInConfig['fulfillment.enable_table_service'])
@@ -3515,9 +3519,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3515
3519
  }, {
3516
3520
  key: "checkManualPickupRef",
3517
3521
  value: function checkManualPickupRef() {
3518
- var _this$otherParams23;
3522
+ var _this$otherParams24;
3519
3523
  this.logMethodStart('checkManualPickupRef');
3520
- var dineInConfig = ((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.dineInConfig) || {};
3524
+ var dineInConfig = ((_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.dineInConfig) || {};
3521
3525
  var refMode = dineInConfig['fulfillment.fulfillment_ref_mode'];
3522
3526
  var manualInputType = dineInConfig['fulfillment.manual_input_type'];
3523
3527
  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
@@ -1,11 +1,12 @@
1
1
  import type { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import type { ProductData } from '../../modules';
3
- import type { OpenDataConfig } from '../../modules/OpenData';
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
  /**
@@ -59,9 +60,6 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
59
60
  protected defaultVersion: string;
60
61
  protected store: UnifiedBookingSalesState;
61
62
  private unifiedProductCatalog;
62
- private openDataTarget;
63
- private loadOpenDataInFlight;
64
- private loadOpenDataInFlightTarget;
65
63
  private availabilityRuntimeOffsetMinutes;
66
64
  private availabilityScheduleCatalog;
67
65
  private availabilityProjectionSequence;
@@ -76,6 +74,9 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
76
74
  private availabilityRemoteResourceQuerySequence;
77
75
  private availabilityRemoteResourceEpoch;
78
76
  private availabilityCommitLocks;
77
+ private allergyItemRuleEvaluator;
78
+ private allergyItemRuleConfigs;
79
+ private allergyItemRuleConfigsPromise;
79
80
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
80
81
  protected getSubmitOrderSalesChannel(): string;
81
82
  private createAvailabilityFacadeError;
@@ -147,6 +148,18 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
147
148
  */
148
149
  loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
149
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>;
159
+ clearOpenDataCache(): void;
160
+ getInvoiceLayoutConfig(): Promise<InvoiceLayoutConfig>;
161
+ getInvoiceTemplateSettings(): Promise<InvoiceTemplateSettings>;
162
+ protected isInvoiceOpenDataCacheCurrent(): boolean;
150
163
  /**
151
164
  * Load a resource policy without depending on the legacy appointmentBooking solution.
152
165
  */
@@ -159,6 +172,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
159
172
  callback?: (result: any) => void;
160
173
  subscriberId?: string;
161
174
  }): Promise<ProductData[]>;
175
+ queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
162
176
  /** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
163
177
  loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
164
178
  /**