@pisell/pisellos 2.3.49 → 2.3.50

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 (162) hide show
  1. package/dist/modules/Discount/index.d.ts +1 -0
  2. package/dist/modules/Discount/index.js +40 -11
  3. package/dist/modules/Discount/types.d.ts +1 -0
  4. package/dist/modules/Holder/index.d.ts +48 -0
  5. package/dist/modules/Holder/index.js +640 -0
  6. package/dist/modules/Holder/types.d.ts +123 -0
  7. package/dist/modules/Holder/types.js +1 -0
  8. package/dist/modules/Holder/utils.d.ts +13 -0
  9. package/dist/modules/Holder/utils.js +34 -0
  10. package/dist/modules/OpenData/index.js +2 -2
  11. package/dist/modules/Order/index.d.ts +3 -1
  12. package/dist/modules/Order/index.js +54 -25
  13. package/dist/modules/Order/types.d.ts +9 -0
  14. package/dist/modules/Order/utils.d.ts +10 -0
  15. package/dist/modules/Order/utils.js +35 -3
  16. package/dist/modules/Payment/types.d.ts +0 -8
  17. package/dist/modules/Payment/walletpass.d.ts +1 -7
  18. package/dist/modules/Payment/walletpass.js +45 -155
  19. package/dist/modules/Product/types.d.ts +1 -0
  20. package/dist/modules/ProductList/index.js +33 -14
  21. package/dist/modules/Quotation/index.d.ts +1 -1
  22. package/dist/modules/Quotation/index.js +2 -2
  23. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  24. package/dist/modules/ResourcePlanner/index.js +181 -0
  25. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  26. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  27. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  28. package/dist/modules/ResourcePlanner/types.js +1 -0
  29. package/dist/modules/Rules/index.js +47 -13
  30. package/dist/modules/SalesSummary/index.js +12 -13
  31. package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
  32. package/dist/modules/ScanOrderLogger/index.js +15 -2
  33. package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
  34. package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
  35. package/dist/modules/Schedule/index.d.ts +3 -1
  36. package/dist/modules/Schedule/index.js +21 -16
  37. package/dist/modules/Summary/utils.js +38 -13
  38. package/dist/modules/index.d.ts +2 -0
  39. package/dist/modules/index.js +3 -1
  40. package/dist/plugins/window.d.ts +1 -0
  41. package/dist/server/index.d.ts +14 -0
  42. package/dist/server/index.js +907 -793
  43. package/dist/server/modules/index.d.ts +1 -1
  44. package/dist/server/modules/order/index.d.ts +0 -16
  45. package/dist/server/modules/order/index.js +776 -964
  46. package/dist/server/modules/order/types.d.ts +0 -14
  47. package/dist/server/modules/order/types.js +0 -6
  48. package/dist/solution/BaseSales/index.d.ts +8 -3
  49. package/dist/solution/BaseSales/index.js +64 -50
  50. package/dist/solution/BookingByStep/index.d.ts +17 -2
  51. package/dist/solution/BookingByStep/index.js +294 -215
  52. package/dist/solution/BookingByStep/types.d.ts +2 -1
  53. package/dist/solution/BookingByStep/types.js +3 -1
  54. package/dist/solution/BookingByStep/utils/capacity.js +17 -1
  55. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  56. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  57. package/dist/solution/BookingTicket/index.d.ts +1 -1
  58. package/dist/solution/BookingTicket/index.js +2 -2
  59. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  60. package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
  61. package/dist/solution/ScanOrder/index.d.ts +26 -14
  62. package/dist/solution/ScanOrder/index.js +1142 -739
  63. package/dist/solution/ScanOrder/types.d.ts +21 -1
  64. package/dist/solution/ScanOrder/utils.d.ts +8 -0
  65. package/dist/solution/ScanOrder/utils.js +66 -25
  66. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  67. package/dist/solution/ShopDiscount/index.js +125 -87
  68. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  69. package/dist/solution/UnifiedBookingSales/index.js +1891 -0
  70. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  71. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  72. package/dist/solution/VenueBooking/index.d.ts +39 -11
  73. package/dist/solution/VenueBooking/index.js +1167 -841
  74. package/dist/solution/VenueBooking/types.d.ts +3 -0
  75. package/dist/solution/VenueBooking/utils/resource.js +1 -0
  76. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  77. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
  78. package/dist/solution/index.d.ts +1 -0
  79. package/dist/solution/index.js +2 -1
  80. package/dist/types/index.d.ts +1 -0
  81. package/lib/model/strategy/adapter/promotion/index.js +51 -0
  82. package/lib/modules/Discount/index.d.ts +1 -0
  83. package/lib/modules/Discount/index.js +9 -0
  84. package/lib/modules/Discount/types.d.ts +1 -0
  85. package/lib/modules/Holder/index.d.ts +48 -0
  86. package/lib/modules/Holder/index.js +402 -0
  87. package/lib/modules/Holder/types.d.ts +123 -0
  88. package/lib/modules/Holder/types.js +17 -0
  89. package/lib/modules/Holder/utils.d.ts +13 -0
  90. package/lib/modules/Holder/utils.js +71 -0
  91. package/lib/modules/OpenData/index.js +1 -1
  92. package/lib/modules/Order/index.d.ts +3 -1
  93. package/lib/modules/Order/index.js +26 -10
  94. package/lib/modules/Order/types.d.ts +9 -0
  95. package/lib/modules/Order/utils.d.ts +10 -0
  96. package/lib/modules/Order/utils.js +36 -5
  97. package/lib/modules/Payment/types.d.ts +0 -8
  98. package/lib/modules/Payment/walletpass.d.ts +1 -7
  99. package/lib/modules/Payment/walletpass.js +9 -107
  100. package/lib/modules/Product/types.d.ts +1 -0
  101. package/lib/modules/ProductList/index.js +40 -31
  102. package/lib/modules/Quotation/index.d.ts +1 -1
  103. package/lib/modules/Quotation/index.js +2 -2
  104. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  105. package/lib/modules/ResourcePlanner/index.js +148 -0
  106. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  107. package/lib/modules/ResourcePlanner/planner.js +933 -0
  108. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  109. package/lib/modules/ResourcePlanner/types.js +17 -0
  110. package/lib/modules/Rules/index.js +33 -16
  111. package/lib/modules/SalesSummary/index.js +6 -7
  112. package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
  113. package/lib/modules/ScanOrderLogger/index.js +13 -1
  114. package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
  115. package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
  116. package/lib/modules/Schedule/index.d.ts +3 -1
  117. package/lib/modules/Schedule/index.js +10 -8
  118. package/lib/modules/Summary/utils.js +21 -1
  119. package/lib/modules/index.d.ts +2 -0
  120. package/lib/modules/index.js +5 -1
  121. package/lib/plugins/window.d.ts +1 -0
  122. package/lib/server/index.d.ts +14 -0
  123. package/lib/server/index.js +72 -15
  124. package/lib/server/modules/index.d.ts +1 -1
  125. package/lib/server/modules/order/index.d.ts +0 -16
  126. package/lib/server/modules/order/index.js +4 -140
  127. package/lib/server/modules/order/types.d.ts +0 -14
  128. package/lib/server/modules/order/types.js +0 -1
  129. package/lib/solution/BaseSales/index.d.ts +8 -3
  130. package/lib/solution/BaseSales/index.js +24 -14
  131. package/lib/solution/BookingByStep/index.d.ts +17 -2
  132. package/lib/solution/BookingByStep/index.js +60 -18
  133. package/lib/solution/BookingByStep/types.d.ts +2 -1
  134. package/lib/solution/BookingByStep/types.js +5 -0
  135. package/lib/solution/BookingByStep/utils/capacity.js +20 -1
  136. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  137. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  138. package/lib/solution/BookingTicket/index.d.ts +1 -1
  139. package/lib/solution/BookingTicket/index.js +10 -2
  140. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  141. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  142. package/lib/solution/ScanOrder/index.d.ts +26 -14
  143. package/lib/solution/ScanOrder/index.js +449 -182
  144. package/lib/solution/ScanOrder/types.d.ts +21 -1
  145. package/lib/solution/ScanOrder/utils.d.ts +8 -0
  146. package/lib/solution/ScanOrder/utils.js +31 -0
  147. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  148. package/lib/solution/ShopDiscount/index.js +14 -0
  149. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  150. package/lib/solution/UnifiedBookingSales/index.js +1084 -0
  151. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  152. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  153. package/lib/solution/VenueBooking/index.d.ts +39 -11
  154. package/lib/solution/VenueBooking/index.js +322 -110
  155. package/lib/solution/VenueBooking/types.d.ts +3 -0
  156. package/lib/solution/VenueBooking/utils/resource.js +1 -0
  157. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  158. package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
  159. package/lib/solution/index.d.ts +1 -0
  160. package/lib/solution/index.js +3 -1
  161. package/lib/types/index.d.ts +1 -0
  162. package/package.json +1 -1
@@ -123,21 +123,24 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
123
123
  key: "loadAllSchedule",
124
124
  value: (function () {
125
125
  var _loadAllSchedule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
126
- var _scheduleList$data;
127
- var scheduleList;
126
+ var _options$useCache, _scheduleList$data;
127
+ var options,
128
+ scheduleList,
129
+ _args2 = arguments;
128
130
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
129
131
  while (1) switch (_context2.prev = _context2.next) {
130
132
  case 0:
131
- _context2.next = 2;
133
+ options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
134
+ _context2.next = 3;
132
135
  return this.request.get("/schedule", {
133
136
  num: 999
134
137
  }, {
135
- useCache: true
138
+ useCache: (_options$useCache = options.useCache) !== null && _options$useCache !== void 0 ? _options$useCache : true
136
139
  });
137
- case 2:
140
+ case 3:
138
141
  scheduleList = _context2.sent;
139
142
  this.setScheduleList(((_scheduleList$data = scheduleList.data) === null || _scheduleList$data === void 0 ? void 0 : _scheduleList$data.list) || []);
140
- case 4:
143
+ case 5:
141
144
  case "end":
142
145
  return _context2.stop();
143
146
  }
@@ -176,8 +179,7 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
176
179
  key: "loadScheduleAvailableDate",
177
180
  value: function () {
178
181
  var _loadScheduleAvailableDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
179
- var _res$data$date_list, _res$data$other_produ, _res$data$other_produ2;
180
- var startDate, endDate, custom_page_id, channel, dates, res;
182
+ var startDate, endDate, custom_page_id, channel, dates, res, responseData, dateList, otherProductIds;
181
183
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
182
184
  while (1) switch (_context3.prev = _context3.next) {
183
185
  case 0:
@@ -205,22 +207,25 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
205
207
  });
206
208
  case 8:
207
209
  res = _context3.sent;
208
- this.setAvailabilityScheduleDateList(res.data.date_list);
209
- this.setOtherProductsIds(res.data.other_product_ids || []);
210
+ responseData = res.data || {};
211
+ dateList = Array.isArray(responseData.date_list) ? responseData.date_list : [];
212
+ otherProductIds = Array.isArray(responseData.other_product_ids) ? responseData.other_product_ids : [];
213
+ this.setAvailabilityScheduleDateList(dateList);
214
+ this.setOtherProductsIds(otherProductIds);
210
215
  // 如果没有schedule或者结束日期在今天之前,则所有日期均不可用
211
- if (!(!((_res$data$date_list = res.data.date_list) !== null && _res$data$date_list !== void 0 && _res$data$date_list.length) && !((_res$data$other_produ = res.data.other_product_ids) !== null && _res$data$other_produ !== void 0 && _res$data$other_produ.length) || dayjs(endDate).isBefore(dayjs(), 'day'))) {
212
- _context3.next = 13;
216
+ if (!(!dateList.length && !otherProductIds.length || dayjs(endDate).isBefore(dayjs(), 'day'))) {
217
+ _context3.next = 16;
213
218
  break;
214
219
  }
215
220
  return _context3.abrupt("return", dates);
216
- case 13:
217
- if ((_res$data$other_produ2 = res.data.other_product_ids) !== null && _res$data$other_produ2 !== void 0 && _res$data$other_produ2.length) {
221
+ case 16:
222
+ if (otherProductIds.length) {
218
223
  // 如果后端有返回 other_product_ids ,意味着有 duration 商品,则今天以及今天以后的日期均可用
219
224
  dates.forEach(function (n) {
220
225
  n.status = 'available';
221
226
  });
222
227
  } else {
223
- res.data.date_list.forEach(function (n) {
228
+ dateList.forEach(function (n) {
224
229
  var index = dates.findIndex(function (m) {
225
230
  return m.date === n.date;
226
231
  });
@@ -231,7 +236,7 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
231
236
  }
232
237
  dates = disableDatesBeforeOneDay(dates);
233
238
  return _context3.abrupt("return", dates);
234
- case 16:
239
+ case 19:
235
240
  case "end":
236
241
  return _context3.stop();
237
242
  }
@@ -706,25 +706,50 @@ var getBundleItemIsDiscountPrice = function getBundleItemIsDiscountPrice(item) {
706
706
  var getBundleItemIsMarkupOrDiscountPrice = function getBundleItemIsMarkupOrDiscountPrice(item) {
707
707
  return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
708
708
  };
709
+ var getDiscountAmount = function getDiscountAmount(discounts) {
710
+ return (discounts || []).reduce(function (total, discount) {
711
+ return total.add(new Decimal(discount.amount || 0));
712
+ }, new Decimal(0)).toNumber();
713
+ };
709
714
 
710
715
  /**
711
716
  * 获取主商品加价减价后的总价 (主商品价格 + 子商品加价减价)
712
717
  */
713
718
  var getMainProductTotal = function getMainProductTotal(item) {
714
- var _ref8, _ref9, _item$main_product_se, _item$metadata, _item$metadata2;
719
+ var _ref8, _ref9, _item$main_product_se, _item$metadata, _item$metadata2, _item$metadata3, _item$metadata4;
715
720
  // 新语义 v2 下 `main_product_selling_price` / `metadata.main_product_selling_price`
716
721
  // 已经是"含 option、含主商品折扣"的主价,直接作为主商品基准,无需再减折扣或加 option。
717
722
  // 仅需叠加 markup / markdown 类 bundle(原价 bundle 的税费单独处理)。
718
723
  var total = new Decimal((_ref8 = (_ref9 = (_item$main_product_se = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se !== void 0 ? _item$main_product_se : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.main_product_selling_price) !== null && _ref9 !== void 0 ? _ref9 : item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.main_product_original_price) !== null && _ref8 !== void 0 ? _ref8 : 0);
724
+
725
+ // 做个兜底 如果新语义价格字段都没有,则切换回老逻辑
726
+ var hasMainProductPrice = (item === null || item === void 0 ? void 0 : item.main_product_selling_price) != null || (item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.main_product_selling_price) != null || (item === null || item === void 0 || (_item$metadata4 = item.metadata) === null || _item$metadata4 === void 0 ? void 0 : _item$metadata4.main_product_original_price) != null;
727
+ if (!hasMainProductPrice) {
728
+ var _ref10, _ref11, _item$main_product_se2, _item$metadata5, _item$_origin3, _item$_originData;
729
+ total = new Decimal((_ref10 = (_ref11 = (_item$main_product_se2 = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se2 !== void 0 ? _item$main_product_se2 : item === null || item === void 0 || (_item$metadata5 = item.metadata) === null || _item$metadata5 === void 0 ? void 0 : _item$metadata5.main_product_selling_price) !== null && _ref11 !== void 0 ? _ref11 : item.price) !== null && _ref10 !== void 0 ? _ref10 : 0);
730
+ var discount = (item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.discount_list) || (item === null || item === void 0 || (_item$_originData = item._originData) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.product) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.discount_list) === null || _item$_originData === void 0 ? void 0 : _item$_originData.filter(function (item) {
731
+ var _item$metadata6;
732
+ return !(item !== null && item !== void 0 && (_item$metadata6 = item.metadata) !== null && _item$metadata6 !== void 0 && _item$metadata6.custom_product_bundle_map_id);
733
+ })) || [];
734
+ var mainProductDiscountAmount = getDiscountAmount(discount);
735
+ total = total.minus(mainProductDiscountAmount);
736
+
737
+ // 单规格
738
+ if (item !== null && item !== void 0 && item.option && Array.isArray(item === null || item === void 0 ? void 0 : item.option)) {
739
+ total = total.add(item === null || item === void 0 ? void 0 : item.option.reduce(function (t, option) {
740
+ return t.add(new Decimal(option.price || 0).mul(option.num || 1));
741
+ }, new Decimal(0)));
742
+ }
743
+ }
719
744
  var _iterator4 = _createForOfIteratorHelper((item === null || item === void 0 ? void 0 : item.bundle) || []),
720
745
  _step4;
721
746
  try {
722
747
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
723
748
  var bundleItem = _step4.value;
724
749
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
725
- var _ref10, _bundleItem$bundle_se2;
750
+ var _ref12, _bundleItem$bundle_se2;
726
751
  // IMPORTANT: 套餐子商品如果应用了 discount,bundle_selling_price 和 price 其实都已经是折后价格了,不需要单独再减一次
727
- var bundleItemTotal = new Decimal((_ref10 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref10 !== void 0 ? _ref10 : 0);
752
+ var bundleItemTotal = new Decimal((_ref12 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref12 !== void 0 ? _ref12 : 0);
728
753
  total = total.add(bundleItemTotal);
729
754
  }
730
755
  }
@@ -844,12 +869,12 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
844
869
  * @param options.scheduleById schedule 映射表:`{ [scheduleId]: schedule }`(用于根据配置的 `available_schedule_ids` 做日程匹配)
845
870
  * @returns 附加费列表(仅返回金额 > 0 的项)
846
871
  */
847
- export var getSurcharge = function getSurcharge(_ref11, options) {
872
+ export var getSurcharge = function getSurcharge(_ref13, options) {
848
873
  var _service$filter;
849
- var service = _ref11.service,
850
- addons = _ref11.addons,
851
- bookingDetail = _ref11.bookingDetail,
852
- bookingId = _ref11.bookingId;
874
+ var service = _ref13.service,
875
+ addons = _ref13.addons,
876
+ bookingDetail = _ref13.bookingDetail,
877
+ bookingId = _ref13.bookingId;
853
878
  var isEdit = options.isEdit,
854
879
  isInScheduleByDate = options.isInScheduleByDate,
855
880
  surcharge_list = options.surcharge_list,
@@ -971,11 +996,11 @@ export var getSurcharge = function getSurcharge(_ref11, options) {
971
996
  scheduleById: scheduleById || {},
972
997
  isInScheduleByDate: isInScheduleByDate
973
998
  })) {
974
- var _ref12, _bundleItem$bundle_se3;
999
+ var _ref14, _bundleItem$bundle_se3;
975
1000
  var _mainQuantity = item.num || 1;
976
1001
  matchedItems.push({
977
1002
  isMain: false,
978
- total: Number((_ref12 = (_bundleItem$bundle_se3 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se3 !== void 0 ? _bundleItem$bundle_se3 : bundleItem.price) !== null && _ref12 !== void 0 ? _ref12 : 0),
1003
+ total: Number((_ref14 = (_bundleItem$bundle_se3 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se3 !== void 0 ? _bundleItem$bundle_se3 : bundleItem.price) !== null && _ref14 !== void 0 ? _ref14 : 0),
979
1004
  quantity: bundleItem.num || bundleItem.quantity || 1,
980
1005
  item: bundleItem,
981
1006
  mainQuantity: _mainQuantity // 子商品的mainQuantity是所属主商品的quantity
@@ -1191,9 +1216,9 @@ export var getSurcharge = function getSurcharge(_ref11, options) {
1191
1216
  }
1192
1217
  return surchargeWithAmount;
1193
1218
  };
1194
- function resetItemsSurchargeSideEffects(_ref13) {
1195
- var service = _ref13.service,
1196
- addons = _ref13.addons;
1219
+ function resetItemsSurchargeSideEffects(_ref15) {
1220
+ var service = _ref15.service,
1221
+ addons = _ref15.addons;
1197
1222
  var resetItem = function resetItem(item) {
1198
1223
  if (!item) return;
1199
1224
  item.surcharge_fee = 0;
@@ -18,3 +18,5 @@ export * from './Quotation';
18
18
  export * from './ScanOrderLogger';
19
19
  export * from './OpenData';
20
20
  export * from './BookingContext';
21
+ export * from './Holder';
22
+ export * from './ResourcePlanner';
@@ -17,4 +17,6 @@ export * from "./Schedule";
17
17
  export * from "./Quotation";
18
18
  export * from "./ScanOrderLogger";
19
19
  export * from "./OpenData";
20
- export * from "./BookingContext";
20
+ export * from "./BookingContext";
21
+ export * from "./Holder";
22
+ export * from "./ResourcePlanner";
@@ -16,6 +16,7 @@ export interface WindowPlugin extends Plugin {
16
16
  history: History;
17
17
  interaction?: any;
18
18
  getWalletPassEvaluator?: () => WalletPassEvaluator;
19
+ getLocalStorage?: (key: string) => string | null;
19
20
  }
20
21
  /**
21
22
  * 简单的 Storage 接口实现
@@ -49,6 +49,10 @@ declare class Server {
49
49
  private productQuerySubscribers;
50
50
  /** subscriberId → 智能定价变价时间点定时器句柄(与 subscriber 分离存储,便于 clear) */
51
51
  private productQueryScheduleTimers;
52
+ /** 餐牌筛选为空时才触发的菜单/日程缓存自愈,避免每次商品查询都请求远端。 */
53
+ private menuScheduleRefreshInFlight;
54
+ private lastMenuScheduleRefreshAt;
55
+ private readonly MENU_SCHEDULE_REFRESH_COOLDOWN_MS;
52
56
  private orderQuerySubscribers;
53
57
  private bookingQuerySubscribers;
54
58
  private bookingRemoteQuerySubscribers;
@@ -262,6 +266,16 @@ declare class Server {
262
266
  * 存储订阅者信息,便于数据变更时推送最新结果
263
267
  */
264
268
  private handleProductQuery;
269
+ /**
270
+ * ProductList callers such as standalone retail pages do not always have a selected schedule.
271
+ * In that case query against the current local time so menu availability can still be evaluated.
272
+ */
273
+ private resolveProductQueryScheduleContext;
274
+ /**
275
+ * OpenData 的关联餐牌可能已更新,而 server_menu/server_schedule 仍命中本地持久化缓存。
276
+ * 仅在当前筛选没有任何生效餐牌时刷新一次,并由调用方重新计算筛选结果。
277
+ */
278
+ private refreshMenuScheduleCacheAfterEmptyResult;
265
279
  /**
266
280
  * 按商品 id 查询单条(GET /shop/product/query/:productId)
267
281
  * schedule_date 必填:query 或 data;schedule_datetime 可选。不走订阅。