@pisell/pisellos 2.2.260 → 2.2.261

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 (129) hide show
  1. package/dist/model/strategy/adapter/index.d.ts +0 -4
  2. package/dist/model/strategy/adapter/index.js +1 -5
  3. package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  4. package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
  5. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  6. package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
  7. package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
  8. package/dist/model/strategy/adapter/promotion/examples.js +99 -0
  9. package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
  10. package/dist/model/strategy/adapter/promotion/index.js +1 -1
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
  12. package/dist/model/strategy/adapter/promotion/type.js +45 -0
  13. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +17 -13
  14. package/dist/modules/Order/index.d.ts +33 -2
  15. package/dist/modules/Order/index.js +615 -288
  16. package/dist/modules/Order/types.d.ts +20 -2
  17. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  18. package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
  19. package/dist/modules/Order/utils.d.ts +4 -0
  20. package/dist/modules/Order/utils.js +116 -29
  21. package/dist/modules/Product/types.d.ts +0 -22
  22. package/dist/modules/ProductList/index.d.ts +1 -1
  23. package/dist/modules/ProductList/index.js +2 -4
  24. package/dist/modules/ProductList/types.d.ts +0 -2
  25. package/dist/modules/Rules/index.d.ts +4 -3
  26. package/dist/modules/Rules/index.js +42 -17
  27. package/dist/modules/Rules/types.d.ts +2 -1
  28. package/dist/modules/SalesSummary/index.d.ts +7 -3
  29. package/dist/modules/SalesSummary/index.js +67 -39
  30. package/dist/modules/SalesSummary/types.d.ts +1 -0
  31. package/dist/modules/SalesSummary/utils.js +2 -1
  32. package/dist/modules/SurchargeList/index.d.ts +6 -4
  33. package/dist/modules/SurchargeList/index.js +62 -39
  34. package/dist/modules/SurchargeList/types.d.ts +6 -2
  35. package/dist/server/index.d.ts +3 -50
  36. package/dist/server/index.js +1075 -1040
  37. package/dist/server/modules/order/index.d.ts +22 -3
  38. package/dist/server/modules/order/index.js +398 -316
  39. package/dist/server/modules/products/index.d.ts +7 -26
  40. package/dist/server/modules/products/index.js +76 -166
  41. package/dist/server/modules/products/types.d.ts +0 -14
  42. package/dist/solution/BaseSales/index.d.ts +22 -2
  43. package/dist/solution/BaseSales/index.js +995 -701
  44. package/dist/solution/BaseSales/types.d.ts +1 -0
  45. package/dist/solution/BaseSales/types.js +2 -1
  46. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  47. package/dist/solution/BaseSales/utils/cartPromotion.js +74 -29
  48. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
  49. package/dist/solution/BookingByStep/index.d.ts +1 -1
  50. package/dist/solution/BookingTicket/index.d.ts +9 -1
  51. package/dist/solution/BookingTicket/index.js +153 -6
  52. package/dist/solution/BookingTicket/types.d.ts +0 -2
  53. package/dist/solution/ScanOrder/index.js +31 -20
  54. package/dist/solution/VenueBooking/index.js +30 -19
  55. package/lib/model/strategy/adapter/index.d.ts +0 -4
  56. package/lib/model/strategy/adapter/index.js +2 -13
  57. package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  58. package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
  59. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  60. package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
  61. package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
  62. package/lib/model/strategy/adapter/promotion/examples.js +91 -0
  63. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  64. package/lib/model/strategy/adapter/promotion/index.js +2 -0
  65. package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
  66. package/lib/model/strategy/adapter/promotion/type.js +2 -0
  67. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +11 -1
  68. package/lib/modules/Order/index.d.ts +33 -2
  69. package/lib/modules/Order/index.js +402 -64
  70. package/lib/modules/Order/types.d.ts +20 -2
  71. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  72. package/lib/modules/Order/utils/bundleDiscountHydration.js +139 -0
  73. package/lib/modules/Order/utils.d.ts +4 -0
  74. package/lib/modules/Order/utils.js +90 -3
  75. package/lib/modules/Product/types.d.ts +0 -22
  76. package/lib/modules/ProductList/index.d.ts +1 -1
  77. package/lib/modules/ProductList/index.js +2 -4
  78. package/lib/modules/ProductList/types.d.ts +0 -2
  79. package/lib/modules/Rules/index.d.ts +4 -3
  80. package/lib/modules/Rules/index.js +27 -7
  81. package/lib/modules/Rules/types.d.ts +2 -1
  82. package/lib/modules/SalesSummary/index.d.ts +7 -3
  83. package/lib/modules/SalesSummary/index.js +28 -11
  84. package/lib/modules/SalesSummary/types.d.ts +1 -0
  85. package/lib/modules/SalesSummary/utils.js +2 -0
  86. package/lib/modules/SurchargeList/index.d.ts +6 -4
  87. package/lib/modules/SurchargeList/index.js +41 -21
  88. package/lib/modules/SurchargeList/types.d.ts +6 -2
  89. package/lib/server/index.d.ts +3 -50
  90. package/lib/server/index.js +244 -215
  91. package/lib/server/modules/order/index.d.ts +22 -3
  92. package/lib/server/modules/order/index.js +103 -53
  93. package/lib/server/modules/products/index.d.ts +7 -26
  94. package/lib/server/modules/products/index.js +35 -113
  95. package/lib/server/modules/products/types.d.ts +0 -14
  96. package/lib/solution/BaseSales/index.d.ts +22 -2
  97. package/lib/solution/BaseSales/index.js +246 -60
  98. package/lib/solution/BaseSales/types.d.ts +1 -0
  99. package/lib/solution/BaseSales/types.js +2 -1
  100. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  101. package/lib/solution/BaseSales/utils/cartPromotion.js +59 -16
  102. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -6
  103. package/lib/solution/BookingByStep/index.d.ts +1 -1
  104. package/lib/solution/BookingTicket/index.d.ts +9 -1
  105. package/lib/solution/BookingTicket/index.js +101 -0
  106. package/lib/solution/BookingTicket/types.d.ts +0 -2
  107. package/lib/solution/ScanOrder/index.js +8 -0
  108. package/lib/solution/VenueBooking/index.js +8 -0
  109. package/package.json +1 -1
  110. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -49
  111. package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -152
  112. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -87
  113. package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -755
  114. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  115. package/dist/model/strategy/adapter/dataVariant/examples.js +0 -282
  116. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  117. package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
  118. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -146
  119. package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
  120. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -49
  121. package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -139
  122. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -87
  123. package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -564
  124. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  125. package/lib/model/strategy/adapter/dataVariant/examples.js +0 -295
  126. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  127. package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
  128. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -146
  129. package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
@@ -14,6 +14,7 @@ export declare const BaseSalesHookNames: {
14
14
  readonly onCartValidationChanged: "onCartValidationChanged";
15
15
  readonly onPaymentSyncStart: "onPaymentSyncStart";
16
16
  readonly onPaymentSyncEnd: "onPaymentSyncEnd";
17
+ readonly onDepositPaymentSyncEnd: "onDepositPaymentSyncEnd";
17
18
  };
18
19
  export type BaseSalesHookName = typeof BaseSalesHookNames[keyof typeof BaseSalesHookNames];
19
20
  export declare function createBaseSalesHook(moduleName: string, hookName: BaseSalesHookName): string;
@@ -9,7 +9,8 @@ export var BaseSalesHookNames = {
9
9
  onRefresh: 'onRefresh',
10
10
  onCartValidationChanged: 'onCartValidationChanged',
11
11
  onPaymentSyncStart: 'onPaymentSyncStart',
12
- onPaymentSyncEnd: 'onPaymentSyncEnd'
12
+ onPaymentSyncEnd: 'onPaymentSyncEnd',
13
+ onDepositPaymentSyncEnd: 'onDepositPaymentSyncEnd'
13
14
  };
14
15
  export function createBaseSalesHook(moduleName, hookName) {
15
16
  return "".concat(moduleName, ":").concat(hookName);
@@ -78,6 +78,7 @@ export interface CartPromotionEvaluator {
78
78
  }>;
79
79
  hasApplicableStrategy: boolean;
80
80
  }>;
81
+ getStrategyConfigs?: () => unknown[];
81
82
  }
82
83
  /** 单个赠品减量项 */
83
84
  export interface GiftReduceItem {
@@ -267,7 +268,8 @@ export declare function appendPromotionTags<T extends Record<string, any>>(produ
267
268
  * 处理购物车的促销计算与赠品差异化。
268
269
  *
269
270
  * 流程:
270
- * 1. 分离 main / gift / edit-product 三类(带 `booking_id` 的编辑态商品不参与促销)
271
+ * 1. 分离 main / gift / edit-product 三类(普通促销下带 `booking_id` 的编辑态商品不参与;
272
+ * 配置 ITEM_REWARD 时,编辑态商品也参与商品奖励重算)
271
273
  * 2. 转 PromotionProduct 喂评估器 → 拿到 `evaluateCartWithPricing` 与 `getProductsApplicableStrategies`
272
274
  * 3. 把 PricedProduct 映射回 OrderProduct 形态:
273
275
  * - 参与促销的,写 `metadata._promotion` + 调整 `selling_price` / `main_product_selling_price`
@@ -1,17 +1,17 @@
1
1
  var _excluded = ["_promotionTags"];
2
2
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
4
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
6
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
7
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
9
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
16
16
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
17
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -116,24 +116,35 @@ export function getOrderProductOriginalPriceForPromotion(product) {
116
116
  }
117
117
  return getOrderProductBasePrice(product);
118
118
  }
119
+ var X_ITEMS_FOR_Y_PRICE = 'X_ITEMS_FOR_Y_PRICE';
120
+ var BUY_X_GET_Y_FREE = 'BUY_X_GET_Y_FREE';
121
+ var ITEM_REWARD = 'ITEM_REWARD';
122
+ function isManagedPromotionDiscountItem(item) {
123
+ var _item$metadata, _item$metadata2;
124
+ if ((item === null || item === void 0 ? void 0 : item.type) === 'promotion') return true;
125
+ return (item === null || item === void 0 ? void 0 : item.type) === 'product' && (item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.source) === 'promotion' && (item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.actionType) === ITEM_REWARD;
126
+ }
119
127
 
120
128
  /**
121
- * 写入/清除促销 discount_list(type=promotion)。
129
+ * 写入/清除促销 discount_list
122
130
  *
123
131
  * applyDiscount → applyProductDiscountPrices 会从 source_product_price 减去 discount_list 合计
124
132
  * 重算 main_product_selling_price;保留券前 source 时必须同步写入促销差额,否则会还原成原价。
125
133
  *
134
+ * ITEM_REWARD 使用 type=product,复用商品级折扣排他规则,避免客户折扣继续叠加到奖励商品行。
135
+ *
126
136
  * @example
127
137
  * updatePromotionDiscountList(line, { title: '2 items for $10', amount: '17.00', original_amount: '22.00', fixed_amount: '17.00' });
128
138
  */
129
- function updatePromotionDiscountList(item, promotionDiscount) {
139
+ function updatePromotionDiscountList(item, promotionDiscount, options) {
130
140
  var discountList = Array.isArray(item.discount_list) ? _toConsumableArray(item.discount_list) : [];
131
141
  discountList = discountList.filter(function (d) {
132
- return (d === null || d === void 0 ? void 0 : d.type) !== 'promotion';
142
+ return !isManagedPromotionDiscountItem(d);
133
143
  });
134
144
  if (promotionDiscount) {
135
- discountList.push({
136
- type: 'promotion',
145
+ var discountType = (options === null || options === void 0 ? void 0 : options.discountType) || 'promotion';
146
+ discountList.push(_objectSpread({
147
+ type: discountType,
137
148
  amount: promotionDiscount.amount,
138
149
  discount: {
139
150
  original_amount: promotionDiscount.original_amount,
@@ -141,7 +152,12 @@ function updatePromotionDiscountList(item, promotionDiscount) {
141
152
  title: promotionDiscount.title,
142
153
  resource_id: ''
143
154
  }
144
- });
155
+ }, discountType === 'product' ? {
156
+ metadata: {
157
+ source: 'promotion',
158
+ actionType: (options === null || options === void 0 ? void 0 : options.actionType) || ITEM_REWARD
159
+ }
160
+ } : {}));
145
161
  }
146
162
  if (discountList.length > 0) {
147
163
  item.discount_list = discountList;
@@ -149,11 +165,19 @@ function updatePromotionDiscountList(item, promotionDiscount) {
149
165
  delete item.discount_list;
150
166
  }
151
167
  }
152
- var X_ITEMS_FOR_Y_PRICE = 'X_ITEMS_FOR_Y_PRICE';
153
- var BUY_X_GET_Y_FREE = 'BUY_X_GET_Y_FREE';
168
+ function evaluatorHasActionType(evaluator, actionType) {
169
+ var _evaluator$getStrateg;
170
+ var configs = evaluator === null || evaluator === void 0 || (_evaluator$getStrateg = evaluator.getStrategyConfigs) === null || _evaluator$getStrateg === void 0 ? void 0 : _evaluator$getStrateg.call(evaluator);
171
+ if (!Array.isArray(configs)) return false;
172
+ return configs.some(function (config) {
173
+ return ((config === null || config === void 0 ? void 0 : config.actions) || []).some(function (action) {
174
+ return (action === null || action === void 0 ? void 0 : action.type) === actionType;
175
+ });
176
+ });
177
+ }
154
178
 
155
179
  /**
156
- * 将促销单价写入 OrderProduct(含 metadata 三字段 + promotion discount_list)。
180
+ * 将促销单价写入 OrderProduct(含 metadata 三字段 + 行内折扣)。
157
181
  *
158
182
  * @example
159
183
  * applyPromoUnitPriceToLine(newItem, { promoUnitPrice: '5.00', originalBasePrice: 1, strategyTitle: '2 for 10' });
@@ -184,6 +208,9 @@ function applyPromoUnitPriceToLine(item, input) {
184
208
  amount: discountAmount,
185
209
  original_amount: catalogSource,
186
210
  fixed_amount: discountAmount
211
+ }, {
212
+ actionType: input.actionType,
213
+ discountType: input.actionType === ITEM_REWARD ? 'product' : 'promotion'
187
214
  });
188
215
  } else {
189
216
  updatePromotionDiscountList(item, null);
@@ -460,10 +487,10 @@ function getProductBundleForEvaluator(product) {
460
487
  * // => 单行 num=4,清除 _promotion 后重新评估
461
488
  */
462
489
  export function buildConsolidateKeyForPromotion(item) {
463
- var _item$booking_uid, _item$metadata, _item$order_detail_id, _item$product_variant3;
490
+ var _item$booking_uid, _item$metadata3, _item$order_detail_id, _item$product_variant3;
464
491
  var fingerprint = buildProductLineFingerprint(getProductSkuOptions(item), item.product_bundle);
465
492
  var noteSignature = getProductLineNoteSignature(item);
466
- var bookingUid = (_item$booking_uid = item === null || item === void 0 ? void 0 : item.booking_uid) !== null && _item$booking_uid !== void 0 ? _item$booking_uid : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.booking_uid;
493
+ var bookingUid = (_item$booking_uid = item === null || item === void 0 ? void 0 : item.booking_uid) !== null && _item$booking_uid !== void 0 ? _item$booking_uid : item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.booking_uid;
467
494
  var orderDetailId = (_item$order_detail_id = item === null || item === void 0 ? void 0 : item.order_detail_id) !== null && _item$order_detail_id !== void 0 ? _item$order_detail_id : item === null || item === void 0 ? void 0 : item.orderDetailId;
468
495
  if (orderDetailId !== undefined && orderDetailId !== null && orderDetailId !== '') {
469
496
  var _item$product_variant;
@@ -484,12 +511,12 @@ function consolidateMainProductsForPromotion(entries) {
484
511
  _step5;
485
512
  try {
486
513
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
487
- var _item$metadata2;
514
+ var _item$metadata4;
488
515
  var _step5$value = _step5.value,
489
516
  item = _step5$value.item,
490
517
  originalListIndex = _step5$value.originalListIndex;
491
518
  var key = buildConsolidateKeyForPromotion(item);
492
- var wasInPromotion = (item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 || (_item$metadata2 = _item$metadata2._promotion) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.inPromotion) === true;
519
+ var wasInPromotion = (item === null || item === void 0 || (_item$metadata4 = item.metadata) === null || _item$metadata4 === void 0 || (_item$metadata4 = _item$metadata4._promotion) === null || _item$metadata4 === void 0 ? void 0 : _item$metadata4.inPromotion) === true;
493
520
  var existing = groups.get(key);
494
521
  if (!existing) {
495
522
  var mergedItem = cloneDeep(item);
@@ -586,6 +613,9 @@ function splitXItemsPromoLinesByGroup(lines, strategyActionMap) {
586
613
  function generateNumericId() {
587
614
  return Math.floor(Math.random() * 1000000000) + Date.now();
588
615
  }
616
+ function isBookingEditProductLine(product) {
617
+ return (product === null || product === void 0 ? void 0 : product.booking_id) !== undefined && (product === null || product === void 0 ? void 0 : product.booking_id) !== null && product.booking_id !== 0 && product.booking_id !== '0';
618
+ }
589
619
 
590
620
  /**
591
621
  * 把 OrderProduct 转成 evaluator 的 PromotionProduct(仅评估期使用)。
@@ -606,6 +636,7 @@ function convertToPromotionProduct(product, index) {
606
636
  price: getOrderProductOriginalPriceForPromotion(product),
607
637
  quantity: Number((_product$num = product === null || product === void 0 ? void 0 : product.num) !== null && _product$num !== void 0 ? _product$num : 1) || 1,
608
638
  bundle: getProductBundleForEvaluator(product),
639
+ _promotionOnlyForItemReward: isBookingEditProductLine(product),
609
640
  _originalItem: originalItem,
610
641
  _originalId: getOrderProductUid(product),
611
642
  _originalIndex: index
@@ -813,6 +844,9 @@ export function resolveStrategyRequiredQuantity(matched) {
813
844
  if (matched.actionType === 'BUY_X_GET_Y_FREE') {
814
845
  return Number(detail.buyQuantity) || 1;
815
846
  }
847
+ if (matched.actionType === 'ITEM_REWARD') {
848
+ return Number(detail.triggerQuantity) || 1;
849
+ }
816
850
  return 1;
817
851
  }
818
852
 
@@ -972,7 +1006,8 @@ export function appendPromotionTags(products, evaluator) {
972
1006
  * 处理购物车的促销计算与赠品差异化。
973
1007
  *
974
1008
  * 流程:
975
- * 1. 分离 main / gift / edit-product 三类(带 `booking_id` 的编辑态商品不参与促销)
1009
+ * 1. 分离 main / gift / edit-product 三类(普通促销下带 `booking_id` 的编辑态商品不参与;
1010
+ * 配置 ITEM_REWARD 时,编辑态商品也参与商品奖励重算)
976
1011
  * 2. 转 PromotionProduct 喂评估器 → 拿到 `evaluateCartWithPricing` 与 `getProductsApplicableStrategies`
977
1012
  * 3. 把 PricedProduct 映射回 OrderProduct 形态:
978
1013
  * - 参与促销的,写 `metadata._promotion` + 调整 `selling_price` / `main_product_selling_price`
@@ -1002,6 +1037,7 @@ export function processCartPromotion(list, evaluator, options) {
1002
1037
  if (!list || list.length === 0 || !evaluator) return empty;
1003
1038
 
1004
1039
  // 0. 分类
1040
+ var shouldIncludeEditProductsForItemReward = evaluatorHasActionType(evaluator, ITEM_REWARD);
1005
1041
  var mainProductsWithIndex = [];
1006
1042
  var existingGiftsWithIndex = [];
1007
1043
  var editProductsWithIndex = [];
@@ -1018,11 +1054,18 @@ export function processCartPromotion(list, evaluator, options) {
1018
1054
  item: item,
1019
1055
  originalListIndex: i
1020
1056
  });
1021
- } else if ((item === null || item === void 0 ? void 0 : item.booking_id) !== undefined && (item === null || item === void 0 ? void 0 : item.booking_id) !== null && item.booking_id !== 0 && item.booking_id !== '0') {
1022
- editProductsWithIndex.push({
1023
- item: item,
1024
- originalListIndex: i
1025
- });
1057
+ } else if (isBookingEditProductLine(item)) {
1058
+ if (shouldIncludeEditProductsForItemReward) {
1059
+ mainProductsWithIndex.push({
1060
+ item: item,
1061
+ originalListIndex: i
1062
+ });
1063
+ } else {
1064
+ editProductsWithIndex.push({
1065
+ item: item,
1066
+ originalListIndex: i
1067
+ });
1068
+ }
1026
1069
  } else {
1027
1070
  mainProductsWithIndex.push({
1028
1071
  item: item,
@@ -1077,16 +1120,17 @@ export function processCartPromotion(list, evaluator, options) {
1077
1120
  var promotionProducts = [];
1078
1121
  var originalItemMap = new Map();
1079
1122
  var productsForStrategies = consolidatedMainProductsWithIndex.map(function (_ref16, i) {
1080
- var _item$product_id, _item$product_variant5, _item$metadata3, _item$num;
1123
+ var _item$product_id, _item$product_variant5, _item$metadata5, _item$num;
1081
1124
  var item = _ref16.item;
1082
1125
  return {
1083
1126
  id: i,
1084
1127
  product_id: Number((_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : 0) || 0,
1085
1128
  product_variant_id: Number((_item$product_variant5 = item === null || item === void 0 ? void 0 : item.product_variant_id) !== null && _item$product_variant5 !== void 0 ? _item$product_variant5 : 0) || 0,
1086
- name: (item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.product_name) || (item === null || item === void 0 ? void 0 : item.title) || '',
1129
+ name: (item === null || item === void 0 || (_item$metadata5 = item.metadata) === null || _item$metadata5 === void 0 ? void 0 : _item$metadata5.product_name) || (item === null || item === void 0 ? void 0 : item.title) || '',
1087
1130
  price: getOrderProductBasePrice(item),
1088
1131
  quantity: Number((_item$num = item === null || item === void 0 ? void 0 : item.num) !== null && _item$num !== void 0 ? _item$num : 1) || 1,
1089
- bundle: getProductBundleForEvaluator(item)
1132
+ bundle: getProductBundleForEvaluator(item),
1133
+ _promotionOnlyForItemReward: isBookingEditProductLine(item)
1090
1134
  };
1091
1135
  });
1092
1136
  for (var _i = 0; _i < consolidatedMainProductsWithIndex.length; _i++) {
@@ -1234,12 +1278,13 @@ export function processCartPromotion(list, evaluator, options) {
1234
1278
  var priceUnchangedPromo = _priced.inPromotion && Number(_priced.finalPrice) === Number(originalBasePrice);
1235
1279
  if (shouldModifyPrice) {
1236
1280
  if (_priced.inPromotion && !priceUnchangedPromo) {
1237
- var _priced$strategyMetad;
1281
+ var _priced$strategyMetad, _strategyActionMap$ge;
1238
1282
  var promoUnitPrice = new Decimal(_priced.finalPrice).toDecimalPlaces(2).toFixed(2);
1239
1283
  applyPromoUnitPriceToLine(newItem, {
1240
1284
  promoUnitPrice: promoUnitPrice,
1241
1285
  originalBasePrice: originalBasePrice,
1242
- strategyTitle: (_priced$strategyMetad = _priced.strategyMetadata) === null || _priced$strategyMetad === void 0 ? void 0 : _priced$strategyMetad.name
1286
+ strategyTitle: (_priced$strategyMetad = _priced.strategyMetadata) === null || _priced$strategyMetad === void 0 ? void 0 : _priced$strategyMetad.name,
1287
+ actionType: _priced.strategyId ? (_strategyActionMap$ge = strategyActionMap.get(_priced.strategyId)) === null || _strategyActionMap$ge === void 0 ? void 0 : _strategyActionMap$ge.actionType : undefined
1243
1288
  });
1244
1289
  } else {
1245
1290
  // 撤销上一轮促销:还原 selling_price 到 main_product_original_price 派生值
@@ -66,7 +66,8 @@ function normalizeBundleItems(bundleItems) {
66
66
  price: (_bundleItem$price3 = bundleItem.price) !== null && _bundleItem$price3 !== void 0 ? _bundleItem$price3 : unitStr,
67
67
  bundle_selling_price: unitStr,
68
68
  original_price: (_ref8 = (_ref9 = (_bundleItem$original_ = bundleItem.original_price) !== null && _bundleItem$original_ !== void 0 ? _bundleItem$original_ : bundleItem.product_price) !== null && _ref9 !== void 0 ? _ref9 : bundleItem.price) !== null && _ref8 !== void 0 ? _ref8 : unitStr,
69
- option: normalizeOptionItems(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.option)
69
+ option: normalizeOptionItems(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.option),
70
+ discount_list: preferPriceField ? [] : bundleItem.discount_list
70
71
  });
71
72
  // bundle_selling_price 落「正净额」:markdown = |price| − Σoptions;markup/原价维持原值。
72
73
  normalizedItem.bundle_selling_price = getBundleSellingMagnitude(magnitudeSource).toFixed(2);
@@ -105,7 +106,9 @@ export function transformBaseProductToOrderProduct(params) {
105
106
  var origin = _objectSpread(_objectSpread({}, sourceProduct || {}), callbackOrigin || {});
106
107
  var matchedVariant = (_ref15 = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceProduct, productVariantId)) !== null && _ref15 !== void 0 ? _ref15 : findVariantById(origin, productVariantId);
107
108
  var sourceProductPrice = toPriceString((_ref16 = (_ref17 = (_ref18 = (_ref19 = (_ref20 = (_ref21 = (_ref22 = (_payload$price = payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload.selling_price) !== null && _ref22 !== void 0 ? _ref22 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.price) !== null && _ref21 !== void 0 ? _ref21 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.base_price) !== null && _ref20 !== void 0 ? _ref20 : origin === null || origin === void 0 ? void 0 : origin.price) !== null && _ref19 !== void 0 ? _ref19 : origin === null || origin === void 0 ? void 0 : origin.base_price) !== null && _ref18 !== void 0 ? _ref18 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _ref17 !== void 0 ? _ref17 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.selling_price) !== null && _ref16 !== void 0 ? _ref16 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.base_price, '0.00');
108
- var lineCompositeTotal = toPriceString((_ref23 = (_payload$line_total = payload.line_total) !== null && _payload$line_total !== void 0 ? _payload$line_total : payload.total) !== null && _ref23 !== void 0 ? _ref23 : (_payload$_extend = payload._extend) === null || _payload$_extend === void 0 ? void 0 : _payload$_extend.total, sourceProductPrice);
109
+ var explicitLineTotal = (_ref23 = (_payload$line_total = payload.line_total) !== null && _payload$line_total !== void 0 ? _payload$line_total : payload.total) !== null && _ref23 !== void 0 ? _ref23 : (_payload$_extend = payload._extend) === null || _payload$_extend === void 0 ? void 0 : _payload$_extend.total;
110
+ var hasExplicitLineTotal = Number.isFinite(Number(explicitLineTotal));
111
+ var lineCompositeTotal = toPriceString(explicitLineTotal, sourceProductPrice);
109
112
  var hasPriceOverride = payload.price_override !== undefined && payload.price_override !== null && payload.price_override !== '';
110
113
  var productOptionItem = normalizeProductSkuOptions(normalizeOptionItems((_ref24 = (_ref25 = (_payload$product_sku$ = (_payload$product_sku = payload.product_sku) === null || _payload$product_sku === void 0 ? void 0 : _payload$product_sku.option) !== null && _payload$product_sku$ !== void 0 ? _payload$product_sku$ : payload.option) !== null && _ref25 !== void 0 ? _ref25 : payload.options) !== null && _ref24 !== void 0 ? _ref24 : payload.product_option_item));
111
114
  var productBundle = normalizeBundleItems((_payload$bundle = payload.bundle) !== null && _payload$bundle !== void 0 ? _payload$bundle : payload.product_bundle, hasPriceOverride);
@@ -148,7 +151,7 @@ export function transformBaseProductToOrderProduct(params) {
148
151
  mainPrice: 0,
149
152
  bundle: productBundle
150
153
  });
151
- var derivedMainSelling = Number(lineCompositeTotal) - Number(bundleOnlyComposite);
154
+ var derivedMainSelling = hasExplicitLineTotal ? Number(lineCompositeTotal) - Number(bundleOnlyComposite) : Number(mainProductOriginalPrice);
152
155
  var mainProductSellingPrice = toPriceString(Number.isFinite(derivedMainSelling) && derivedMainSelling >= 0 ? derivedMainSelling : Number(mainProductOriginalPrice));
153
156
  var metadata = _objectSpread(_objectSpread({
154
157
  unique: payload.unique,
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
314
+ weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -322,7 +322,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
322
322
  * 获取当前的客户搜索条件
323
323
  * @returns 当前搜索条件
324
324
  */
325
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
325
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
326
326
  /**
327
327
  * 获取客户列表状态(包含滚动加载相关状态)
328
328
  * @returns 客户状态
@@ -551,6 +551,14 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
551
551
  setOtherParams(params: Record<string, any>, { cover }?: {
552
552
  cover?: boolean;
553
553
  }): Promise<void>;
554
+ private getDeviceTaskPlugin;
555
+ handlePrintWristband(params: {
556
+ voucher_ids: number[];
557
+ }): Promise<void>;
558
+ handleRedeem(params: {
559
+ voucher_ids: number[];
560
+ is_checkin: boolean;
561
+ }): Promise<any>;
554
562
  /**
555
563
  * 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
556
564
  * 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
@@ -49,6 +49,7 @@ import { buildNormalProductCacheItemFromOrderLine as buildNormalProductCacheItem
49
49
  import { buildProductOptionStringFromOrderLine } from "../../modules/BookingContext/utils/orderLineDisplay";
50
50
  import { applyBookingsStatus, applyChildBookingStatus, resolveScheduleId, resolveStatusAfterTransition, restoreBookingsStatus, restoreChildBookingStatus } from "./utils/bookingStatus";
51
51
  import { resolveBestAddTimePlan as _resolveBestAddTimePlan } from "./utils/resolveBestAddTimePlan";
52
+ import { createUuidV4 } from "../../modules/Order/utils";
52
53
  var OPEN_DATA_SECTION_CODES = ['sale', 'reservation', 'fulfillment', 'menu', 'workflow'];
53
54
  var OPEN_DATA_CACHE_TTL = 5 * 60 * 1000;
54
55
 
@@ -2586,6 +2587,152 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2586
2587
  }
2587
2588
  return setOtherParams;
2588
2589
  }()
2590
+ }, {
2591
+ key: "getDeviceTaskPlugin",
2592
+ value: function getDeviceTaskPlugin() {
2593
+ var _app$getApp;
2594
+ var app = this.core.getPlugin('app');
2595
+ return (app === null || app === void 0 || (_app$getApp = app.getApp()) === null || _app$getApp === void 0 ? void 0 : _app$getApp.getPlugin('deviceTask')) || null;
2596
+ }
2597
+
2598
+ // 打印手环,单个或批量都可以
2599
+ }, {
2600
+ key: "handlePrintWristband",
2601
+ value: function () {
2602
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
2603
+ var _this$getOrderIdentit;
2604
+ var deviceTask, deviceId, idempotencyKey;
2605
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2606
+ while (1) switch (_context32.prev = _context32.next) {
2607
+ case 0:
2608
+ deviceTask = this.getDeviceTaskPlugin();
2609
+ if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
2610
+ _context32.next = 4;
2611
+ break;
2612
+ }
2613
+ this.logger.addLog({
2614
+ type: 'info',
2615
+ title: '[BookingTicket] handlePrintWristband: deviceTask.dispatch 不可用',
2616
+ metadata: {
2617
+ voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2618
+ }
2619
+ });
2620
+ return _context32.abrupt("return");
2621
+ case 4:
2622
+ this.logger.addLog({
2623
+ type: 'info',
2624
+ title: '[BookingTicket] handlePrintWristband',
2625
+ metadata: {
2626
+ voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2627
+ }
2628
+ });
2629
+ _context32.next = 7;
2630
+ return this.getShortNumberOrDeviceId();
2631
+ case 7:
2632
+ deviceId = _context32.sent;
2633
+ idempotencyKey = createUuidV4();
2634
+ deviceTask.dispatch({
2635
+ action: 'print_all',
2636
+ device_id: deviceId,
2637
+ payload: {
2638
+ type: 'WRISTBAND',
2639
+ data: {
2640
+ order_id: (_this$getOrderIdentit = this.getOrderIdentity()) === null || _this$getOrderIdentit === void 0 ? void 0 : _this$getOrderIdentit.orderId,
2641
+ voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2642
+ }
2643
+ },
2644
+ idempotency_key: idempotencyKey,
2645
+ name: 'PRINT_WRISTBAND',
2646
+ source: 'bookingTicket',
2647
+ source_type: 'handlePrintWristband',
2648
+ source_id: idempotencyKey
2649
+ });
2650
+ case 10:
2651
+ case "end":
2652
+ return _context32.stop();
2653
+ }
2654
+ }, _callee32, this);
2655
+ }));
2656
+ function handlePrintWristband(_x23) {
2657
+ return _handlePrintWristband.apply(this, arguments);
2658
+ }
2659
+ return handlePrintWristband;
2660
+ }() // 触发核销
2661
+ }, {
2662
+ key: "handleRedeem",
2663
+ value: function () {
2664
+ var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
2665
+ var _this$store$order5, _this$store$order5$ge, _this$store$order6, _ref20, _tempOrder$order_id2;
2666
+ var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
2667
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2668
+ while (1) switch (_context33.prev = _context33.next) {
2669
+ case 0:
2670
+ voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
2671
+ status = params.is_checkin ? 'used' : 'unused';
2672
+ this.logger.addLog({
2673
+ type: 'info',
2674
+ title: '[BookingTicket] handleRedeem',
2675
+ metadata: {
2676
+ voucher_ids: voucherIds,
2677
+ status: status
2678
+ }
2679
+ });
2680
+ voucherIdSet = new Set(voucherIds);
2681
+ tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 || (_this$store$order5$ge = _this$store$order5.getTempOrder) === null || _this$store$order5$ge === void 0 ? void 0 : _this$store$order5$ge.call(_this$store$order5);
2682
+ vouchers = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.vouchers) || ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 ? void 0 : _this$store$order6.getVouchers()) || [];
2683
+ hasUpdatedVoucher = false;
2684
+ nextVouchers = vouchers.map(function (voucher) {
2685
+ if (!voucherIdSet.has(voucher.voucher_id)) return voucher;
2686
+ hasUpdatedVoucher = true;
2687
+ return _objectSpread(_objectSpread({}, voucher), {}, {
2688
+ status: status
2689
+ });
2690
+ });
2691
+ if (!(tempOrder && hasUpdatedVoucher)) {
2692
+ _context33.next = 11;
2693
+ break;
2694
+ }
2695
+ _context33.next = 11;
2696
+ return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
2697
+ vouchers: nextVouchers
2698
+ }));
2699
+ case 11:
2700
+ this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
2701
+ if (!(voucherIds.length === 0)) {
2702
+ _context33.next = 14;
2703
+ break;
2704
+ }
2705
+ return _context33.abrupt("return", {
2706
+ code: 200,
2707
+ status: true,
2708
+ message: '',
2709
+ data: []
2710
+ });
2711
+ case 14:
2712
+ identity = this.getOrderIdentity();
2713
+ externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
2714
+ orderId = (_ref20 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref20 !== void 0 ? _ref20 : undefined;
2715
+ orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
2716
+ return _context33.abrupt("return", this.request.post('/machinecode/batch', {
2717
+ ids: voucherIds,
2718
+ status: status,
2719
+ order_lookup: orderLookup,
2720
+ order_id: orderId,
2721
+ external_sale_number: externalSaleNumber
2722
+ }, {
2723
+ osServer: true
2724
+ }));
2725
+ case 19:
2726
+ case "end":
2727
+ return _context33.stop();
2728
+ }
2729
+ }, _callee33, this);
2730
+ }));
2731
+ function handleRedeem(_x24) {
2732
+ return _handleRedeem.apply(this, arguments);
2733
+ }
2734
+ return handleRedeem;
2735
+ }()
2589
2736
  /**
2590
2737
  * 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
2591
2738
  * 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
@@ -2593,12 +2740,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2593
2740
  }, {
2594
2741
  key: "destroy",
2595
2742
  value: (function () {
2596
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
2743
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
2597
2744
  var _this$scan;
2598
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2599
- while (1) switch (_context32.prev = _context32.next) {
2745
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2746
+ while (1) switch (_context34.prev = _context34.next) {
2600
2747
  case 0:
2601
- _context32.next = 2;
2748
+ _context34.next = 2;
2602
2749
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
2603
2750
  case 2:
2604
2751
  try {
@@ -2609,9 +2756,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2609
2756
  scanCache.clear();
2610
2757
  case 4:
2611
2758
  case "end":
2612
- return _context32.stop();
2759
+ return _context34.stop();
2613
2760
  }
2614
- }, _callee32, this);
2761
+ }, _callee34, this);
2615
2762
  }));
2616
2763
  function destroy() {
2617
2764
  return _destroy.apply(this, arguments);
@@ -83,8 +83,6 @@ export interface ILoadProductsParams {
83
83
  extension_type?: string[];
84
84
  /** 商品发布状态 */
85
85
  status?: string;
86
- /** 智能定价条件上下文,仅影响策略命中,不参与商品集合筛选 */
87
- strategy_context?: Record<string, any>;
88
86
  }
89
87
  /**
90
88
  * 加载商品详情的参数