@pisell/pisellos 2.2.291 → 2.2.293

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 (174) hide show
  1. package/dist/core/index.d.ts +7 -0
  2. package/dist/core/index.js +108 -65
  3. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  4. package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
  5. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  6. package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
  7. package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
  8. package/dist/model/strategy/adapter/itemRule/type.js +19 -1
  9. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  10. package/dist/modules/BookingContext/index.d.ts +3 -0
  11. package/dist/modules/BookingContext/index.js +42 -13
  12. package/dist/modules/BookingContext/types.d.ts +4 -4
  13. package/dist/modules/BookingContext/types.js +3 -3
  14. package/dist/modules/OpenData/types.d.ts +1 -0
  15. package/dist/modules/Order/index.d.ts +18 -3
  16. package/dist/modules/Order/index.js +885 -485
  17. package/dist/modules/Order/salesNotes.d.ts +31 -0
  18. package/dist/modules/Order/salesNotes.js +492 -0
  19. package/dist/modules/Order/types.d.ts +93 -5
  20. package/dist/modules/Order/types.js +5 -0
  21. package/dist/modules/Order/utils.d.ts +12 -0
  22. package/dist/modules/Order/utils.js +96 -31
  23. package/dist/modules/Product/types.d.ts +2 -0
  24. package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
  25. package/dist/modules/ProductList/clientDataVariants.js +216 -0
  26. package/dist/modules/ProductList/index.d.ts +18 -3
  27. package/dist/modules/ProductList/index.js +220 -38
  28. package/dist/modules/ProductList/types.d.ts +10 -0
  29. package/dist/modules/Quotation/index.d.ts +22 -0
  30. package/dist/modules/Quotation/index.js +293 -28
  31. package/dist/modules/ResourcePlanner/index.d.ts +0 -22
  32. package/dist/modules/ResourcePlanner/index.js +1 -180
  33. package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
  34. package/dist/modules/ResourcePlanner/localClock.js +183 -0
  35. package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
  36. package/dist/modules/ResourcePlanner/planner.js +2111 -958
  37. package/dist/modules/ResourcePlanner/types.d.ts +359 -187
  38. package/dist/modules/ResourcePlanner/types.js +33 -1
  39. package/dist/plugins/request.d.ts +1 -0
  40. package/dist/server/index.d.ts +17 -2
  41. package/dist/server/index.js +1134 -932
  42. package/dist/server/modules/floor-plan/index.d.ts +4 -0
  43. package/dist/server/modules/floor-plan/index.js +240 -98
  44. package/dist/server/modules/menu/index.js +48 -23
  45. package/dist/server/modules/order/index.d.ts +17 -7
  46. package/dist/server/modules/order/index.js +419 -207
  47. package/dist/server/modules/products/index.d.ts +10 -4
  48. package/dist/server/modules/products/index.js +177 -84
  49. package/dist/server/modules/resource/index.js +21 -13
  50. package/dist/server/utils/product.d.ts +1 -1
  51. package/dist/server/utils/product.js +186 -22
  52. package/dist/server/utils/small-ticket.d.ts +9 -1
  53. package/dist/server/utils/small-ticket.js +131 -84
  54. package/dist/solution/BaseSales/index.d.ts +26 -3
  55. package/dist/solution/BaseSales/index.js +1384 -905
  56. package/dist/solution/BaseSales/types.d.ts +2 -0
  57. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  58. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
  59. package/dist/solution/BaseSales/utils.js +6 -3
  60. package/dist/solution/BookingByStep/index.d.ts +4 -4
  61. package/dist/solution/BookingTicket/index.d.ts +1 -1
  62. package/dist/solution/BookingTicket/index.js +4 -2
  63. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  64. package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
  65. package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
  66. package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
  67. package/dist/solution/RegisterAndLogin/config.js +95 -40
  68. package/dist/solution/RegisterAndLogin/index.js +4 -1
  69. package/dist/solution/ScanOrder/index.d.ts +1 -0
  70. package/dist/solution/ScanOrder/index.js +31 -27
  71. package/dist/solution/ScanOrder/types.d.ts +2 -0
  72. package/dist/solution/ScanOrder/utils.d.ts +1 -0
  73. package/dist/solution/ScanOrder/utils.js +8 -3
  74. package/dist/solution/UnifiedBookingSales/index.d.ts +128 -74
  75. package/dist/solution/UnifiedBookingSales/index.js +3877 -963
  76. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  77. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
  78. package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
  79. package/dist/solution/UnifiedBookingSales/types.js +4 -9
  80. package/dist/solution/VenueBooking/index.d.ts +3 -0
  81. package/dist/solution/VenueBooking/index.js +549 -497
  82. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  83. package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
  84. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  85. package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
  86. package/dist/utils/platform.d.ts +8 -0
  87. package/dist/utils/platform.js +15 -0
  88. package/lib/core/index.d.ts +7 -0
  89. package/lib/core/index.js +20 -2
  90. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  91. package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
  92. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  93. package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
  94. package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
  95. package/lib/model/strategy/adapter/itemRule/type.js +19 -1
  96. package/lib/modules/BookingContext/index.d.ts +3 -0
  97. package/lib/modules/BookingContext/index.js +35 -8
  98. package/lib/modules/BookingContext/types.d.ts +4 -4
  99. package/lib/modules/BookingContext/types.js +3 -3
  100. package/lib/modules/OpenData/types.d.ts +1 -0
  101. package/lib/modules/Order/index.d.ts +18 -3
  102. package/lib/modules/Order/index.js +325 -28
  103. package/lib/modules/Order/salesNotes.d.ts +31 -0
  104. package/lib/modules/Order/salesNotes.js +382 -0
  105. package/lib/modules/Order/types.d.ts +93 -5
  106. package/lib/modules/Order/types.js +4 -0
  107. package/lib/modules/Order/utils.d.ts +12 -0
  108. package/lib/modules/Order/utils.js +85 -16
  109. package/lib/modules/Product/types.d.ts +2 -0
  110. package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
  111. package/lib/modules/ProductList/clientDataVariants.js +204 -0
  112. package/lib/modules/ProductList/index.d.ts +18 -3
  113. package/lib/modules/ProductList/index.js +137 -8
  114. package/lib/modules/ProductList/types.d.ts +10 -0
  115. package/lib/modules/Quotation/index.d.ts +22 -0
  116. package/lib/modules/Quotation/index.js +158 -11
  117. package/lib/modules/ResourcePlanner/index.d.ts +0 -22
  118. package/lib/modules/ResourcePlanner/index.js +9 -129
  119. package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
  120. package/lib/modules/ResourcePlanner/localClock.js +205 -0
  121. package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
  122. package/lib/modules/ResourcePlanner/planner.js +1807 -783
  123. package/lib/modules/ResourcePlanner/types.d.ts +359 -187
  124. package/lib/modules/ResourcePlanner/types.js +13 -1
  125. package/lib/plugins/request.d.ts +1 -0
  126. package/lib/server/index.d.ts +17 -2
  127. package/lib/server/index.js +149 -21
  128. package/lib/server/modules/floor-plan/index.d.ts +4 -0
  129. package/lib/server/modules/floor-plan/index.js +60 -7
  130. package/lib/server/modules/menu/index.js +26 -4
  131. package/lib/server/modules/order/index.d.ts +17 -7
  132. package/lib/server/modules/order/index.js +194 -57
  133. package/lib/server/modules/products/index.d.ts +10 -4
  134. package/lib/server/modules/products/index.js +93 -23
  135. package/lib/server/modules/resource/index.js +12 -2
  136. package/lib/server/utils/product.d.ts +1 -1
  137. package/lib/server/utils/product.js +163 -3
  138. package/lib/server/utils/small-ticket.d.ts +9 -1
  139. package/lib/server/utils/small-ticket.js +123 -79
  140. package/lib/solution/BaseSales/index.d.ts +26 -3
  141. package/lib/solution/BaseSales/index.js +396 -70
  142. package/lib/solution/BaseSales/types.d.ts +2 -0
  143. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  144. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
  145. package/lib/solution/BaseSales/utils.js +3 -0
  146. package/lib/solution/BookingByStep/index.d.ts +4 -4
  147. package/lib/solution/BookingTicket/index.d.ts +1 -1
  148. package/lib/solution/BookingTicket/index.js +2 -1
  149. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  150. package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
  151. package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
  152. package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
  153. package/lib/solution/RegisterAndLogin/config.js +49 -8
  154. package/lib/solution/RegisterAndLogin/index.js +4 -1
  155. package/lib/solution/ScanOrder/index.d.ts +1 -0
  156. package/lib/solution/ScanOrder/index.js +5 -1
  157. package/lib/solution/ScanOrder/types.d.ts +2 -0
  158. package/lib/solution/ScanOrder/utils.d.ts +1 -0
  159. package/lib/solution/ScanOrder/utils.js +4 -0
  160. package/lib/solution/UnifiedBookingSales/index.d.ts +128 -74
  161. package/lib/solution/UnifiedBookingSales/index.js +2592 -424
  162. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  163. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
  164. package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
  165. package/lib/solution/UnifiedBookingSales/types.js +4 -6
  166. package/lib/solution/VenueBooking/index.d.ts +3 -0
  167. package/lib/solution/VenueBooking/index.js +33 -9
  168. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  169. package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
  170. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  171. package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
  172. package/lib/utils/platform.d.ts +8 -0
  173. package/lib/utils/platform.js +22 -0
  174. 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';
@@ -44,6 +44,8 @@ export interface ScanOrderProductSku {
44
44
  export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
45
45
  order_detail_id: number | null;
46
46
  num: number;
47
+ /** Product 或当前 Variant 的生产编码 */
48
+ production_code?: string;
47
49
  product_sku: ScanOrderProductSku;
48
50
  /**
49
51
  * 券后 **行 composite 单价** = `metadata.main_product_selling_price`
@@ -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
@@ -660,11 +662,14 @@ export function normalizeOrderProduct(product) {
660
662
  sellingPrice: composedSellingPrice,
661
663
  quantity: getSafeProductNum(product.num)
662
664
  });
663
- return {
665
+ return _objectSpread(_objectSpread({
664
666
  order_detail_id: product.order_detail_id || null,
665
667
  product_id: product.product_id,
666
668
  num: getSafeProductNum(product.num),
667
- product_variant_id: product.product_variant_id,
669
+ product_variant_id: product.product_variant_id
670
+ }, product.production_code !== undefined && product.production_code !== null ? {
671
+ production_code: String(product.production_code).trim()
672
+ } : {}), {}, {
668
673
  product_sku: productSku,
669
674
  selling_price: composedSellingPrice,
670
675
  original_price: manualOriginalPrice,
@@ -674,7 +679,7 @@ export function normalizeOrderProduct(product) {
674
679
  product_bundle: normalizedBundle,
675
680
  metadata: metadata,
676
681
  note: product.note != null ? String(product.note) : ''
677
- };
682
+ });
678
683
  }
679
684
 
680
685
  /**
@@ -1,12 +1,14 @@
1
- import type { Module } from '../../types';
1
+ import type { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import type { ProductData } from '../../modules';
3
3
  import type { OpenDataConfig } from '../../modules/OpenData';
4
4
  import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
5
- import type { ProductListLoadProductsParams } from '../../modules/ProductList';
6
- import type { ResourcePlannerAssignment, ResourcePlannerAssignableSlotResult, ResourcePlannerEvent, ResourcePlannerProduct, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerResource, ResourcePlannerSelectionPatch, ResourcePlannerSnapshot, ResourcePlannerValidationResult } from '../../modules/ResourcePlanner';
7
- import type { UnifiedBookingSalesCommitPlannerSelectionParams, UnifiedBookingSalesCommitResult, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadPlannerContextParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesStagePlannerProductsParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
5
+ import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
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, 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';
11
+ export { AvailabilityError } from '../../modules/ResourcePlanner';
10
12
  /**
11
13
  * Converts Rules/Order discount internals into a small UI-facing diagnostic. The result keeps
12
14
  * candidate-card state separate from line-level applications: a selected card is not proof that
@@ -22,39 +24,37 @@ export declare function buildPlannerDiscountResult(params: {
22
24
  preferredDiscountId?: number | string;
23
25
  preferredDiscountFound?: boolean;
24
26
  }): UnifiedBookingSalesDiscountResult;
25
- /** Converts a ProductList record into the pure input shape consumed by ResourcePlanner. */
26
- export declare function normalizeProductForPlanner(product: ProductData | Record<string, any>): ResourcePlannerProduct;
27
+ /** Converts ProductList and schedule records into the pure Availability vocabulary. */
28
+ export declare function normalizeProductForAvailability(product: ProductData | Record<string, any>, scheduleList?: ScheduleItem[], fixedOffsetMinutes?: number): AvailabilityProduct;
27
29
  /**
28
30
  * Materializes resource work windows locally from v2's schedule ids, then keeps its flat
29
- * event_list as planner events. This deliberately avoids the older API's times -> event_list
31
+ * event_list as resource occupancy records. This deliberately avoids the older API's times -> event_list
30
32
  * response nesting and lets one resource response serve any requested date range.
31
33
  */
32
- export declare function buildPlannerResourcesFromV2(params: {
34
+ export declare function buildAvailabilityResourcesFromV2(params: {
33
35
  rawResources: Record<string, any>[];
34
36
  scheduleList: ScheduleItem[];
35
- dateRange?: ResourcePlannerQuery['dateRange'];
37
+ dateRange?: AvailabilityDateRange;
38
+ fixedOffsetMinutes?: number;
36
39
  }): {
37
- resources: ResourcePlannerResource[];
38
- externalEvents: ResourcePlannerEvent[];
40
+ resources: AvailabilityResource[];
41
+ resourceOccupancies: AvailabilityOccupancy[];
39
42
  };
40
43
  /** Combines URL-locked resources with every resource referenced by the selected products. */
41
- export declare function collectPlannerResourceIds(products: ResourcePlannerProduct[], explicitResourceIds?: Array<number | string>): Array<number | string>;
42
- /** Convenience wrapper for the usual one-resource booking case. */
43
- export declare function buildBookingFromAssignment(params: {
44
- assignment: ResourcePlannerAssignment;
45
- product: ResourcePlannerProduct;
44
+ export declare function collectAvailabilityResourceIds(products: AvailabilityProduct[], explicitResourceIds?: Array<number | string>): Array<number | string>;
45
+ export declare function buildAvailabilityLineIdentity(product: Record<string, any>): Record<string, any>;
46
+ export declare function buildBookingFromAvailabilityAssignment(params: {
47
+ assignment: Record<string, any>;
48
+ product: AvailabilityProduct;
49
+ timezone?: string;
50
+ fixedOffsetMinutes?: number;
46
51
  }): Record<string, any>;
47
- /**
48
- * Converts all resources needed by one product/time interval into the one booking expected by
49
- * OrderModule. Callers must group assignments before this function so a multi-form booking does
50
- * not become several competing bookings.
51
- */
52
- export declare function buildBookingFromAssignments(params: {
53
- assignments: ResourcePlannerAssignment[];
54
- product: ResourcePlannerProduct;
52
+ export declare function buildBookingFromAvailabilityAssignments(params: {
53
+ assignments: Record<string, any>[];
54
+ product: AvailabilityProduct;
55
+ timezone?: string;
56
+ fixedOffsetMinutes?: number;
55
57
  }): Record<string, any>;
56
- /** Builds the exact identity BaseSales needs to remove only this solution's order lines. */
57
- export declare function buildPlannerLineIdentity(product: Record<string, any>): Record<string, any>;
58
58
  export declare class UnifiedBookingSalesImpl extends BookingTicket {
59
59
  protected defaultName: string;
60
60
  protected defaultVersion: string;
@@ -63,7 +63,55 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
63
63
  private openDataTarget;
64
64
  private loadOpenDataInFlight;
65
65
  private loadOpenDataInFlightTarget;
66
+ private availabilityRuntimeOffsetMinutes;
67
+ private availabilityScheduleCatalog;
68
+ private availabilityProjectionSequence;
69
+ private availabilityContextSequence;
70
+ private availabilityLifecycleGeneration;
71
+ private availabilityContextRegistry;
72
+ private availabilityProjectionPool;
73
+ private availabilityPrepareInFlight;
74
+ private availabilityProjectionRefreshInFlight;
75
+ private availabilityRemoteOccupancyCache;
76
+ private availabilityRemoteResourceQueryInFlight;
77
+ private availabilityRemoteResourceQuerySequence;
78
+ private availabilityRemoteResourceEpoch;
79
+ private availabilityCommitLocks;
80
+ private allergyItemRuleEvaluator;
81
+ private allergyItemRuleConfigs;
82
+ private allergyItemRuleConfigsPromise;
83
+ initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
66
84
  protected getSubmitOrderSalesChannel(): string;
85
+ private createAvailabilityFacadeError;
86
+ private getAvailabilityScopeDescriptor;
87
+ private normalizeAvailabilityIdList;
88
+ private normalizeAvailabilityStringList;
89
+ private normalizeAvailabilityPrepareDescriptor;
90
+ private resolveAvailabilityPrepareDefaults;
91
+ private buildAvailabilityPrepareKey;
92
+ private clearAvailabilityRemoteResourceState;
93
+ private buildAvailabilityRemoteResourceScopeKey;
94
+ private buildAvailabilityRemoteResourceQueryKey;
95
+ setOtherParams(params: Record<string, any>, { cover }?: {
96
+ cover?: boolean;
97
+ }): Promise<void>;
98
+ destroy(): Promise<void>;
99
+ private createAvailabilityContextId;
100
+ private buildAvailabilityProjectionKey;
101
+ private getAvailabilityRuntimeOffsetMinutes;
102
+ private getAvailabilityRuntimeDateTime;
103
+ private cloneAvailabilityPrepareParams;
104
+ private getAvailabilityDurationCandidateAnchorAt;
105
+ private createAvailabilityContextRef;
106
+ private emitAvailabilityDiagnostic;
107
+ private touchAvailabilityContext;
108
+ private touchAvailabilityProjection;
109
+ private removeAvailabilityProjection;
110
+ private removeAvailabilityContext;
111
+ private evictAvailabilityProjectionPool;
112
+ private evictAvailabilityContextRegistry;
113
+ private invalidateAvailabilityContextsAfterCommit;
114
+ private resetAvailabilityProjectionState;
67
115
  protected isSessionStoragePersistEnabled(): boolean;
68
116
  protected shouldUseSessionStorageForSubModule(moduleName?: string): boolean;
69
117
  /**
@@ -103,6 +151,18 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
103
151
  */
104
152
  loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
105
153
  getOpenData(): Promise<OpenDataConfig | null>;
154
+ private resetAllergyItemRuleState;
155
+ private fetchAllergyItemRuleConfigs;
156
+ private ensureAllergyItemRuleConfigsLoaded;
157
+ /**
158
+ * 评估当前渠道与商品是否命中 ALLERGY_CHECK。
159
+ * 只返回优先级最高 Action 中当前商品 Target 的 dataSource,不跨商品或 Action 合并。
160
+ */
161
+ resolveProductAllergyRequirement(params: UnifiedBookingSalesResolveProductAllergyRequirementParams): Promise<AllergyRequirement | null>;
162
+ /**
163
+ * Load a resource policy without depending on the legacy appointmentBooking solution.
164
+ */
165
+ getProtocol(policyId: string | number): Promise<UnifiedBookingSalesPolicyResponse>;
106
166
  /**
107
167
  * Loads the product catalog used by both UI and Planner. Schedule data is requested with each
108
168
  * product because session products carry their fixed intervals there.
@@ -111,6 +171,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
111
171
  callback?: (result: any) => void;
112
172
  subscriberId?: string;
113
173
  }): Promise<ProductData[]>;
174
+ queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
114
175
  /** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
115
176
  loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
116
177
  /**
@@ -133,17 +194,10 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
133
194
  * diagnostic boundary for new booking skins: no pricing logic is duplicated in the planner.
134
195
  */
135
196
  applyPlannerDiscounts(params?: UnifiedBookingSalesApplyPlannerDiscountsParams): Promise<UnifiedBookingSalesDiscountResult>;
136
- /** ResourcePlanner is a required child module; fail early instead of producing partial availability. */
137
- private getPlanner;
138
197
  private buildUnifiedOrderProduct;
139
198
  /** Replacing a staged selection is idempotent and never removes unrelated cart lines. */
140
199
  private removeExistingStagedLines;
141
200
  private stageProducts;
142
- /**
143
- * Adds the current product choice to an otherwise clean planner cart without creating bookings.
144
- * This separates "what the customer wants" from the later time/resource confirmation step.
145
- */
146
- stagePlannerProducts(params: UnifiedBookingSalesStagePlannerProductsParams): Promise<Record<string, any> | null>;
147
201
  /**
148
202
  * Adds ordinary retail products without asking ResourcePlanner for booking facts.
149
203
  * Its staged lines have separate ownership so planner and retail skins can coexist safely.
@@ -155,50 +209,50 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
155
209
  * "replace the staged selection" for demo and wizard-like callers.
156
210
  */
157
211
  addRetailProduct(params: UnifiedBookingSalesAddRetailProductParams): Promise<Record<string, any>[]>;
158
- /** Normalizes caller-provided products or loads the catalog before any resource request is made. */
159
- private loadPlannerProducts;
160
- /** Loads the reusable store-level schedule catalog on demand. */
161
- private ensurePlannerSchedulesLoaded;
162
- /**
163
- * v2 resources reference schedule ids rather than expanded work times. Refresh once when the
164
- * cached schedule catalog cannot materialize all referenced ids.
165
- */
166
- private ensurePlannerSchedulesForResources;
212
+ private normalizeAvailabilityDateRange;
213
+ private assertAvailabilityPrepareParams;
214
+ private captureAvailabilityScheduleCatalog;
215
+ /** Returns the solution-lifetime schedule snapshot captured after initialization. */
216
+ private getAvailabilityScheduleCatalog;
217
+ private buildAvailabilityOperatingHoursSnapshot;
218
+ private loadAvailabilityProducts;
167
219
  /**
168
220
  * Fetches resource metadata plus flat occupied events. Work windows are intentionally derived
169
- * locally in buildPlannerResourcesFromV2 from /schedule, rather than requested from the legacy
221
+ * locally in buildAvailabilityResourcesFromV2 from /schedule, rather than requested from the legacy
170
222
  * resource dates endpoint.
171
223
  */
172
- private fetchPlannerResourcesV2;
173
- /**
174
- * Resolves the Planner context in precedence order: explicit normalized context, test raw data,
175
- * then the v2 resource API inferred from selected product requirements and any URL lock.
176
- */
177
- private loadPlannerResources;
178
- /**
179
- * Boundary between IO and pure planning. Once this returns, all later availability/slot calls
180
- * operate on the ResourcePlanner snapshot and do not issue resource requests themselves.
181
- */
182
- loadPlannerContext(params?: UnifiedBookingSalesLoadPlannerContextParams): Promise<ResourcePlannerSnapshot>;
183
- /** Returns cells, date summaries and a derived grid; cells are continuous ranges, not UI slots. */
184
- queryPlannerAvailability(query?: ResourcePlannerQuery): Promise<ResourcePlannerProjection>;
185
- /** Turns compatible availability ranges into user-selectable intervals and ready-to-commit assignments. */
186
- resolveAssignableSlots(query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
187
- /** Stores a UI choice only. It is deliberately side-effect free with respect to tempOrder. */
188
- setPlannerSelection(patch: ResourcePlannerSelectionPatch): ResourcePlannerSnapshot;
189
- /**
190
- * Legacy-friendly automatic assignment for already fixed intervals. Duration products without a
191
- * start time intentionally remain unresolved; callers offering a picker should use slots.
192
- */
193
- autoAssignPlanner(query?: ResourcePlannerQuery): Promise<ResourcePlannerSnapshot>;
194
- /** Rechecks remote events, capacity and conflicts among the current selection before committing. */
195
- validatePlannerSelection(): ResourcePlannerValidationResult;
196
- /** Read-only snapshot for UI diagnostics and progressive flow steps. */
197
- getPlannerSnapshot(): ResourcePlannerSnapshot;
198
- /**
199
- * Validates then writes assignments to tempOrder. Real order submission is opt-in so UI callers
200
- * can safely preview the cart; pass submitAfterCommit only after an explicit confirmation.
201
- */
202
- commitPlannerSelection(params?: UnifiedBookingSalesCommitPlannerSelectionParams): Promise<UnifiedBookingSalesCommitResult>;
224
+ private fetchAvailabilityResourcesV2;
225
+ private fetchAndPublishAvailabilityResourcesV2;
226
+ private refreshAvailabilityRemoteResourceQuery;
227
+ private loadAvailabilityResources;
228
+ private resolveEditingOccupancyExclusions;
229
+ private occupancyIsExcluded;
230
+ private collectCartResourceOccupancies;
231
+ private getCurrentOrderRevision;
232
+ private getAvailabilityContextEntry;
233
+ private getAvailabilityProjectionByKey;
234
+ private getActiveAvailabilityProjectionEntry;
235
+ private decorateAvailabilityCandidate;
236
+ private assertAvailabilityCandidateFreshness;
237
+ private assertContextualQueryFreshness;
238
+ private storeAvailabilityProjectionEntry;
239
+ private buildAvailabilityProjectionSnapshot;
240
+ private getSharedPreparedAvailabilitySnapshot;
241
+ private refreshAvailabilityContextProjection;
242
+ private ensureAvailabilityContextProjection;
243
+ private tryAcquireAvailabilityCommitLock;
244
+ private releaseAvailabilityCommitLock;
245
+ /** IO boundary: loads catalog, schedules, resources, occupancies, and registers one context. */
246
+ prepareAvailabilityProjection(params: UnifiedBookingSalesPrepareAvailabilityProjectionParams): Promise<AvailabilityContextRef>;
247
+ /** Candidate calculation over the current context projection and runtime minute. */
248
+ getProductTimeRanges(contextId: string, request?: GetProductTimeRangesRequest): Promise<ContextualProductTimeRangeGroup[]>;
249
+ /** Thin facade: auto-refresh on cart drift, then delegate to the pure projection query. */
250
+ queryBookingAvailability(contextId: string, request: ContextualAvailabilityQuery): Promise<ContextualAvailabilityQueryResult>;
251
+ releaseAvailabilityContext(contextId: string): void;
252
+ private assertAvailabilityCommitWriteCAS;
253
+ private findProductLineByUid;
254
+ private findLinkedBooking;
255
+ /** Revalidates against the latest landed occupancy cache, then mutates exactly one product line. */
256
+ commitAvailabilitySelection(contextId: string, params: ContextualCommitAvailabilitySelectionParams): Promise<UnifiedBookingSalesCommitAvailabilitySelectionResult>;
203
257
  }
204
258
  export declare const UnifiedBookingSales: typeof UnifiedBookingSalesImpl;