@pisell/pisellos 0.10.68 → 0.10.70

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 (26) hide show
  1. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +5 -4
  2. package/dist/modules/Holder/utils.d.ts +2 -0
  3. package/dist/modules/Holder/utils.js +32 -2
  4. package/dist/modules/Rules/index.js +59 -58
  5. package/dist/server/modules/products/index.js +3 -2
  6. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
  7. package/dist/solution/BookingByStep/index.d.ts +1 -1
  8. package/dist/solution/BookingTicket/index.js +177 -112
  9. package/dist/solution/BookingTicket/types.d.ts +14 -4
  10. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +94 -58
  11. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
  12. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +117 -0
  13. package/lib/model/strategy/adapter/promotion/index.js +46 -1
  14. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
  15. package/lib/modules/Holder/utils.d.ts +2 -0
  16. package/lib/modules/Holder/utils.js +27 -1
  17. package/lib/modules/Rules/index.js +2 -1
  18. package/lib/server/modules/products/index.js +2 -1
  19. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -8
  20. package/lib/solution/BookingByStep/index.d.ts +1 -1
  21. package/lib/solution/BookingTicket/index.js +22 -2
  22. package/lib/solution/BookingTicket/types.d.ts +14 -4
  23. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +14 -2
  24. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
  25. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +71 -0
  26. package/package.json +1 -1
@@ -11,6 +11,7 @@ import { cloneDeep } from 'lodash-es';
11
11
  import { getProductHolderRelations } from "../../Order/holderRelations";
12
12
  import { getProductSkuOptions } from "../../Order/utils";
13
13
  import { isEntitlementPass } from "../../Discount/entitlementPass";
14
+ import { resolveProductHolderConfig } from "../../Holder/utils";
14
15
  import { buildProductOptionStringFromOrderLine } from "./orderLineDisplay";
15
16
  /**
16
17
  * 从已加车的普通商品 order line 反查 SkuDetailModal edit 所需的 cacheItem。
@@ -87,7 +88,7 @@ function mapOrderBundleToOtherBundle(bundle) {
87
88
  });
88
89
  }
89
90
  export function buildNormalProductCacheItemFromOrderLine(input) {
90
- var _product$product_id, _product$selling_pric2, _product$original_pri, _product$metadata, _product$metadata2, _product$metadata3, _product$product_vari, _originExtend$other, _product$num, _product$product_vari2, _product$num2, _title, _product$note, _originExtend$price, _originExtend$total, _originExtend$origin_, _product$metadata4, _originExtend$priceOv, _product$metadata5, _product$metadata6, _ref7, _title2, _ref8, _cover, _price3, _product$order_detail, _product$product_sku;
91
+ var _product$product_id, _product$selling_pric2, _product$original_pri, _product$metadata, _product$metadata2, _product$metadata3, _product$product_vari, _originExtend$other, _product$num, _product$product_vari2, _product$num2, _title, _product$note, _originExtend$price, _originExtend$total, _originExtend$origin_, _product$metadata4, _originExtend$priceOv, _product$metadata5, _ref7, _resolveProductHolder, _ref8, _title2, _ref9, _cover, _price3, _product$order_detail, _product$product_sku;
91
92
  var product = input.product,
92
93
  sourceProduct = input.sourceProduct;
93
94
  var resolvedId = (_product$product_id = product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.id;
@@ -162,12 +163,12 @@ export function buildNormalProductCacheItemFromOrderLine(input) {
162
163
  extend._skuValue = JSON.parse(JSON.stringify(extend.skuValue));
163
164
  }
164
165
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
165
- holder_config: (sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.holder_config) !== undefined ? sourceProduct.holder_config : (_product$metadata6 = product.metadata) === null || _product$metadata6 === void 0 ? void 0 : _product$metadata6.holder_config,
166
+ holder_config: (_ref7 = (_resolveProductHolder = resolveProductHolderConfig(sourceProduct)) !== null && _resolveProductHolder !== void 0 ? _resolveProductHolder : resolveProductHolderConfig(product)) !== null && _ref7 !== void 0 ? _ref7 : undefined,
166
167
  id: resolvedId,
167
168
  product_id: resolvedId,
168
169
  _id: uid,
169
- title: (_ref7 = (_title2 = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.title) !== null && _title2 !== void 0 ? _title2 : product.product_title) !== null && _ref7 !== void 0 ? _ref7 : '',
170
- cover: (_ref8 = (_cover = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.cover) !== null && _cover !== void 0 ? _cover : product.product_cover) !== null && _ref8 !== void 0 ? _ref8 : '',
170
+ title: (_ref8 = (_title2 = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.title) !== null && _title2 !== void 0 ? _title2 : product.product_title) !== null && _ref8 !== void 0 ? _ref8 : '',
171
+ cover: (_ref9 = (_cover = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.cover) !== null && _cover !== void 0 ? _cover : product.product_cover) !== null && _ref9 !== void 0 ? _ref9 : '',
171
172
  price: (_price3 = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _price3 !== void 0 ? _price3 : sourcePrice,
172
173
  selling_price: product.selling_price,
173
174
  original_price: product.original_price
@@ -1,5 +1,7 @@
1
1
  import { ProductData } from '../Product/types';
2
2
  import { IFormItemData, IHolderConfig } from './types';
3
+ /** 保留显式禁用配置;仅在新配置缺失时兼容商品旧 holder 定义。 */
4
+ export declare function resolveProductHolderConfig(product?: ProductData | Record<string, any> | null): Record<string, any> | null;
3
5
  export declare function getProductHolderConfig(product?: ProductData | Record<string, any> | null): IHolderConfig | null;
4
6
  export declare function getFormIdFromHolderConfig(config: IHolderConfig): number;
5
7
  export declare function normalizeFormId(formId: number | string): number;
@@ -1,7 +1,37 @@
1
+ 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); }
2
+ /** 保留显式禁用配置;仅在新配置缺失时兼容商品旧 holder 定义。 */
3
+ export function resolveProductHolderConfig(product) {
4
+ var _source$metadata, _source$origin, _source$metadata2, _source$_origin, _source$_extend, _source$_extend2, _source$_extend3, _source$_extend4, _source$_extend5, _source$_extend6, _source$_extend7, _source$origin2, _source$metadata3, _source$_origin2, _source$_extend8, _source$_extend9, _source$_extend10, _source$_extend11, _legacy$custom, _legacy$custom2;
5
+ if (!product || _typeof(product) !== 'object') return null;
6
+ var source = product;
7
+ var configSources = [source.holder_config, (_source$metadata = source.metadata) === null || _source$metadata === void 0 ? void 0 : _source$metadata.holder_config, (_source$origin = source.origin) === null || _source$origin === void 0 ? void 0 : _source$origin.holder_config, (_source$metadata2 = source.metadata) === null || _source$metadata2 === void 0 || (_source$metadata2 = _source$metadata2.origin) === null || _source$metadata2 === void 0 ? void 0 : _source$metadata2.holder_config, (_source$_origin = source._origin) === null || _source$_origin === void 0 ? void 0 : _source$_origin.holder_config, (_source$_extend = source._extend) === null || _source$_extend === void 0 ? void 0 : _source$_extend.holder_config, (_source$_extend2 = source._extend) === null || _source$_extend2 === void 0 || (_source$_extend2 = _source$_extend2.product) === null || _source$_extend2 === void 0 ? void 0 : _source$_extend2.holder_config, (_source$_extend3 = source._extend) === null || _source$_extend3 === void 0 || (_source$_extend3 = _source$_extend3.product) === null || _source$_extend3 === void 0 || (_source$_extend3 = _source$_extend3.origin) === null || _source$_extend3 === void 0 ? void 0 : _source$_extend3.holder_config, (_source$_extend4 = source._extend) === null || _source$_extend4 === void 0 || (_source$_extend4 = _source$_extend4.product) === null || _source$_extend4 === void 0 || (_source$_extend4 = _source$_extend4.metadata) === null || _source$_extend4 === void 0 ? void 0 : _source$_extend4.holder_config, (_source$_extend5 = source._extend) === null || _source$_extend5 === void 0 || (_source$_extend5 = _source$_extend5.product) === null || _source$_extend5 === void 0 || (_source$_extend5 = _source$_extend5.metadata) === null || _source$_extend5 === void 0 || (_source$_extend5 = _source$_extend5.origin) === null || _source$_extend5 === void 0 ? void 0 : _source$_extend5.holder_config, (_source$_extend6 = source._extend) === null || _source$_extend6 === void 0 || (_source$_extend6 = _source$_extend6.product) === null || _source$_extend6 === void 0 || (_source$_extend6 = _source$_extend6._origin) === null || _source$_extend6 === void 0 ? void 0 : _source$_extend6.holder_config, (_source$_extend7 = source._extend) === null || _source$_extend7 === void 0 || (_source$_extend7 = _source$_extend7.product) === null || _source$_extend7 === void 0 || (_source$_extend7 = _source$_extend7._extend) === null || _source$_extend7 === void 0 ? void 0 : _source$_extend7.holder_config];
8
+ var config = configSources.find(function (value) {
9
+ return value !== null && _typeof(value) === 'object';
10
+ });
11
+ if (config) return config;
12
+
13
+ // metadata.holder / _extend.holder 是选择结果,不能作为商品配置读取。
14
+ var legacySources = [source.holder, (_source$origin2 = source.origin) === null || _source$origin2 === void 0 ? void 0 : _source$origin2.holder, (_source$metadata3 = source.metadata) === null || _source$metadata3 === void 0 || (_source$metadata3 = _source$metadata3.origin) === null || _source$metadata3 === void 0 ? void 0 : _source$metadata3.holder, (_source$_origin2 = source._origin) === null || _source$_origin2 === void 0 ? void 0 : _source$_origin2.holder, (_source$_extend8 = source._extend) === null || _source$_extend8 === void 0 || (_source$_extend8 = _source$_extend8.product) === null || _source$_extend8 === void 0 ? void 0 : _source$_extend8.holder, (_source$_extend9 = source._extend) === null || _source$_extend9 === void 0 || (_source$_extend9 = _source$_extend9.product) === null || _source$_extend9 === void 0 || (_source$_extend9 = _source$_extend9.origin) === null || _source$_extend9 === void 0 ? void 0 : _source$_extend9.holder, (_source$_extend10 = source._extend) === null || _source$_extend10 === void 0 || (_source$_extend10 = _source$_extend10.product) === null || _source$_extend10 === void 0 || (_source$_extend10 = _source$_extend10.metadata) === null || _source$_extend10 === void 0 || (_source$_extend10 = _source$_extend10.origin) === null || _source$_extend10 === void 0 ? void 0 : _source$_extend10.holder, (_source$_extend11 = source._extend) === null || _source$_extend11 === void 0 || (_source$_extend11 = _source$_extend11.product) === null || _source$_extend11 === void 0 || (_source$_extend11 = _source$_extend11._origin) === null || _source$_extend11 === void 0 ? void 0 : _source$_extend11.holder];
15
+ var legacy = legacySources.find(function (value) {
16
+ return value && _typeof(value) === 'object' && !Array.isArray(value) && typeof value.type === 'string';
17
+ });
18
+ if (!legacy) return null;
19
+ var formId = (_legacy$custom = legacy.custom) === null || _legacy$custom === void 0 ? void 0 : _legacy$custom.custom_id;
20
+ if (legacy.type === 'custom' && ((_legacy$custom2 = legacy.custom) === null || _legacy$custom2 === void 0 ? void 0 : _legacy$custom2.type) === 'form' && (typeof formId === 'number' || typeof formId === 'string') && Number.isInteger(Number(formId)) && Number(formId) > 0) {
21
+ return {
22
+ status: 'enable',
23
+ required: 0,
24
+ resource_id: formId
25
+ };
26
+ }
27
+ return {
28
+ status: 'disable',
29
+ required: 0
30
+ };
31
+ }
1
32
  export function getProductHolderConfig(product) {
2
- var _product$holder_confi, _product$origin;
3
33
  if (!product) return null;
4
- var config = (_product$holder_confi = product === null || product === void 0 ? void 0 : product.holder_config) !== null && _product$holder_confi !== void 0 ? _product$holder_confi : product === null || product === void 0 || (_product$origin = product.origin) === null || _product$origin === void 0 ? void 0 : _product$origin.holder_config;
34
+ var config = resolveProductHolderConfig(product);
5
35
  if (config !== null && config !== void 0 && config.status && (config === null || config === void 0 ? void 0 : config.status) !== 'enable') return null;
6
36
  if (!(config !== null && config !== void 0 && config.resource_id)) return null;
7
37
  return config;
@@ -38,6 +38,7 @@ import { BaseModule } from "../BaseModule";
38
38
  import { UnavailableReason } from "./types";
39
39
  import { uniqueById, getDiscountAmount, getDiscountListAmountTotal, getDiscountListAmount, filterDiscountListByBookingTime, getDiscountTimeUnavailableReason } from "../../solution/ShopDiscount/utils";
40
40
  import { getProductOriginTotalPrice, getProductTotalPrice } from "../Cart/utils";
41
+ import { resolveProductHolderConfig } from "../Holder/utils";
41
42
  import Decimal from 'decimal.js';
42
43
  import { cloneDeep, isBoolean } from 'lodash-es';
43
44
  import dayjs from 'dayjs';
@@ -142,12 +143,12 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
142
143
  }, {
143
144
  key: "checkHolderMatch",
144
145
  value: function checkHolderMatch(discount, product, holderSource, holders) {
145
- var _discount$holder, _ref, _ref2, _ref3, _ref4, _ref5, _ref6, _holderSource$holder_, _holderSource$metadat, _holderSource$origin, _holderSource$metadat2, _holderSource$_origin, _holderSource$_extend, _holderSource$_extend2, _holderSource$_extend3;
146
+ var _discount$holder;
146
147
  // 非表单类型 holder 视为匹配
147
148
  if (((_discount$holder = discount.holder) === null || _discount$holder === void 0 ? void 0 : _discount$holder.holder_type) !== 'form') return true;
148
149
 
149
150
  // getProduct 会裁剪商品字段,从原始商品读取配置,套餐子项沿用父商品。
150
- var holderConfig = (_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_ref6 = (_holderSource$holder_ = holderSource === null || holderSource === void 0 ? void 0 : holderSource.holder_config) !== null && _holderSource$holder_ !== void 0 ? _holderSource$holder_ : holderSource === null || holderSource === void 0 || (_holderSource$metadat = holderSource.metadata) === null || _holderSource$metadat === void 0 ? void 0 : _holderSource$metadat.holder_config) !== null && _ref6 !== void 0 ? _ref6 : holderSource === null || holderSource === void 0 || (_holderSource$origin = holderSource.origin) === null || _holderSource$origin === void 0 ? void 0 : _holderSource$origin.holder_config) !== null && _ref5 !== void 0 ? _ref5 : holderSource === null || holderSource === void 0 || (_holderSource$metadat2 = holderSource.metadata) === null || _holderSource$metadat2 === void 0 || (_holderSource$metadat2 = _holderSource$metadat2.origin) === null || _holderSource$metadat2 === void 0 ? void 0 : _holderSource$metadat2.holder_config) !== null && _ref4 !== void 0 ? _ref4 : holderSource === null || holderSource === void 0 || (_holderSource$_origin = holderSource._origin) === null || _holderSource$_origin === void 0 ? void 0 : _holderSource$_origin.holder_config) !== null && _ref3 !== void 0 ? _ref3 : holderSource === null || holderSource === void 0 || (_holderSource$_extend = holderSource._extend) === null || _holderSource$_extend === void 0 ? void 0 : _holderSource$_extend.holder_config) !== null && _ref2 !== void 0 ? _ref2 : holderSource === null || holderSource === void 0 || (_holderSource$_extend2 = holderSource._extend) === null || _holderSource$_extend2 === void 0 || (_holderSource$_extend2 = _holderSource$_extend2.product) === null || _holderSource$_extend2 === void 0 ? void 0 : _holderSource$_extend2.holder_config) !== null && _ref !== void 0 ? _ref : holderSource === null || holderSource === void 0 || (_holderSource$_extend3 = holderSource._extend) === null || _holderSource$_extend3 === void 0 || (_holderSource$_extend3 = _holderSource$_extend3.product) === null || _holderSource$_extend3 === void 0 || (_holderSource$_extend3 = _holderSource$_extend3.metadata) === null || _holderSource$_extend3 === void 0 ? void 0 : _holderSource$_extend3.holder_config;
151
+ var holderConfig = resolveProductHolderConfig(holderSource);
151
152
  var holderStatus = holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.status;
152
153
  var holderEnabled = holderStatus === true || ['enable', '1'].includes(String(holderStatus).trim().toLowerCase());
153
154
  if (!holderEnabled || (holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.resource_id) === undefined || (holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.resource_id) === null || (holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.resource_id) === '') {
@@ -167,14 +168,14 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
167
168
  // 判断discountList 是否可以对当前productList生效
168
169
  }, {
169
170
  key: "isDiscountListAvailable",
170
- value: function isDiscountListAvailable(_ref7) {
171
+ value: function isDiscountListAvailable(_ref) {
171
172
  var _this2 = this;
172
- var oldDiscountList = _ref7.oldDiscountList,
173
- newDiscountList = _ref7.newDiscountList,
174
- productList = _ref7.productList,
175
- orderTotalAmount = _ref7.orderTotalAmount,
176
- holders = _ref7.holders,
177
- isFormSubject = _ref7.isFormSubject;
173
+ var oldDiscountList = _ref.oldDiscountList,
174
+ newDiscountList = _ref.newDiscountList,
175
+ productList = _ref.productList,
176
+ orderTotalAmount = _ref.orderTotalAmount,
177
+ holders = _ref.holders,
178
+ isFormSubject = _ref.isFormSubject;
178
179
  // 首先检查是否有新的优惠券可应用
179
180
  if (!newDiscountList || newDiscountList.length === 0) {
180
181
  return {
@@ -373,14 +374,14 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
373
374
  }
374
375
  }, {
375
376
  key: "calcDiscount",
376
- value: function calcDiscount(_ref8, options) {
377
+ value: function calcDiscount(_ref2, options) {
377
378
  var _options$selectedList,
378
379
  _this4 = this;
379
- var discountList = _ref8.discountList,
380
- productList = _ref8.productList,
381
- holders = _ref8.holders,
382
- isFormSubject = _ref8.isFormSubject,
383
- orderTotalAmount = _ref8.orderTotalAmount;
380
+ var discountList = _ref2.discountList,
381
+ productList = _ref2.productList,
382
+ holders = _ref2.holders,
383
+ isFormSubject = _ref2.isFormSubject,
384
+ orderTotalAmount = _ref2.orderTotalAmount;
384
385
  var preferredEntitlementPassIds = new Set(((options === null || options === void 0 ? void 0 : options.preferredEntitlementPassIds) || []).map(String));
385
386
  var resolveIsFormSubject = function resolveIsFormSubject(product) {
386
387
  return typeof isFormSubject === 'function' ? Boolean(isFormSubject(product)) : Boolean(isFormSubject);
@@ -494,7 +495,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
494
495
  // 2. 展开 bundle 子商品
495
496
  if (product.bundle && Array.isArray(product.bundle) && product.bundle.length > 0) {
496
497
  product.bundle.forEach(function (bundleItem, bundleIndex) {
497
- var _ref9, _bundleItem$bundle_pr;
498
+ var _ref3, _bundleItem$bundle_pr;
498
499
  flattened.push({
499
500
  type: 'bundle',
500
501
  originProduct: originProduct,
@@ -506,7 +507,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
506
507
  // 新增商品运行态通常带 _bundle_product_id;订单 hydrate 后只有
507
508
  // bundle_product_id。Change time 必须兼容两种结构,否则 bundle
508
509
  // 子项无法命中折扣卡的 limited_relation_product_data.product_ids。
509
- id: (_ref9 = (_bundleItem$bundle_pr = bundleItem.bundle_product_id) !== null && _bundleItem$bundle_pr !== void 0 ? _bundleItem$bundle_pr : bundleItem._bundle_product_id) !== null && _ref9 !== void 0 ? _ref9 : bundleItem.product_id,
510
+ id: (_ref3 = (_bundleItem$bundle_pr = bundleItem.bundle_product_id) !== null && _bundleItem$bundle_pr !== void 0 ? _bundleItem$bundle_pr : bundleItem._bundle_product_id) !== null && _ref3 !== void 0 ? _ref3 : bundleItem.product_id,
510
511
  _id: "".concat(product._id, "_bundle_").concat(bundleIndex),
511
512
  parentId: product._id,
512
513
  num: bundleItem.num || 1,
@@ -666,10 +667,10 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
666
667
 
667
668
  // 对扁平化后的列表按价格降序排序(用于应用优惠券时优先选择高价商品)
668
669
  var sortedFlattenedList = flattenedList.sort(function (a, b) {
669
- var _ref10, _a$original_price, _ref11, _b$original_price;
670
+ var _ref4, _a$original_price, _ref5, _b$original_price;
670
671
  // 子商品优先使用 original_price,主商品使用 price
671
- var priceA = new Decimal(a.type === 'bundle' ? (_ref10 = (_a$original_price = a.original_price) !== null && _a$original_price !== void 0 ? _a$original_price : a.price) !== null && _ref10 !== void 0 ? _ref10 : '0' : a.price || '0');
672
- var priceB = new Decimal(b.type === 'bundle' ? (_ref11 = (_b$original_price = b.original_price) !== null && _b$original_price !== void 0 ? _b$original_price : b.price) !== null && _ref11 !== void 0 ? _ref11 : '0' : b.price || '0');
672
+ var priceA = new Decimal(a.type === 'bundle' ? (_ref4 = (_a$original_price = a.original_price) !== null && _a$original_price !== void 0 ? _a$original_price : a.price) !== null && _ref4 !== void 0 ? _ref4 : '0' : a.price || '0');
673
+ var priceB = new Decimal(b.type === 'bundle' ? (_ref5 = (_b$original_price = b.original_price) !== null && _b$original_price !== void 0 ? _b$original_price : b.price) !== null && _ref5 !== void 0 ? _ref5 : '0' : b.price || '0');
673
674
  if (priceA.equals(priceB)) {
674
675
  // 价格相同时,主商品优先
675
676
  if (a.type !== b.type) {
@@ -803,13 +804,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
803
804
  var buildFullCoveragePassUsageGroups = function buildFullCoveragePassUsageGroups(discounts, requestedCount) {
804
805
  var _firstGoodPass$config;
805
806
  var groups = [];
806
- var pendingUsedDiscounts = new Set(Array.from(usedDiscounts.entries()).filter(function (_ref12) {
807
- var _ref13 = _slicedToArray(_ref12, 2),
808
- used = _ref13[1];
807
+ var pendingUsedDiscounts = new Set(Array.from(usedDiscounts.entries()).filter(function (_ref6) {
808
+ var _ref7 = _slicedToArray(_ref6, 2),
809
+ used = _ref7[1];
809
810
  return used;
810
- }).map(function (_ref14) {
811
- var _ref15 = _slicedToArray(_ref14, 1),
812
- discountId = _ref15[0];
811
+ }).map(function (_ref8) {
812
+ var _ref9 = _slicedToArray(_ref8, 1),
813
+ discountId = _ref9[0];
813
814
  return discountId;
814
815
  }));
815
816
  var pendingEntitlementCounts = new Map(entitlementUsageCounts);
@@ -884,7 +885,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
884
885
  _step6;
885
886
  try {
886
887
  for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
887
- var _detail$discount$reso, _detail$discount, _detail$discount$prod, _detail$discount2, _detail$metadata$cust, _detail$metadata, _detail$discount3, _ref16, _detail$metadata$num, _detail$metadata2, _ref17, _existed$metadata$num, _existed$metadata;
888
+ var _detail$discount$reso, _detail$discount, _detail$discount$prod, _detail$discount2, _detail$metadata$cust, _detail$metadata, _detail$discount3, _ref10, _detail$metadata$num, _detail$metadata2, _ref11, _existed$metadata$num, _existed$metadata;
888
889
  var detail = _step6.value;
889
890
  if (!isEntitlementPass(detail)) {
890
891
  mergedDetails.push(detail);
@@ -896,7 +897,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
896
897
  continue;
897
898
  }
898
899
  var key = [resourceId, (_detail$discount$prod = detail === null || detail === void 0 || (_detail$discount2 = detail.discount) === null || _detail$discount2 === void 0 ? void 0 : _detail$discount2.product_id) !== null && _detail$discount$prod !== void 0 ? _detail$discount$prod : '', (_detail$metadata$cust = detail === null || detail === void 0 || (_detail$metadata = detail.metadata) === null || _detail$metadata === void 0 ? void 0 : _detail$metadata.custom_product_bundle_map_id) !== null && _detail$metadata$cust !== void 0 ? _detail$metadata$cust : '', toComparableNumber(detail === null || detail === void 0 ? void 0 : detail.amount), toComparableNumber(detail === null || detail === void 0 || (_detail$discount3 = detail.discount) === null || _detail$discount3 === void 0 ? void 0 : _detail$discount3.fixed_amount)].join('|');
899
- var rawUsageCount = Number((_ref16 = (_detail$metadata$num = detail === null || detail === void 0 || (_detail$metadata2 = detail.metadata) === null || _detail$metadata2 === void 0 ? void 0 : _detail$metadata2.num) !== null && _detail$metadata$num !== void 0 ? _detail$metadata$num : detail === null || detail === void 0 ? void 0 : detail._num) !== null && _ref16 !== void 0 ? _ref16 : 1);
900
+ var rawUsageCount = Number((_ref10 = (_detail$metadata$num = detail === null || detail === void 0 || (_detail$metadata2 = detail.metadata) === null || _detail$metadata2 === void 0 ? void 0 : _detail$metadata2.num) !== null && _detail$metadata$num !== void 0 ? _detail$metadata$num : detail === null || detail === void 0 ? void 0 : detail._num) !== null && _ref10 !== void 0 ? _ref10 : 1);
900
901
  var usageCount = Number.isFinite(rawUsageCount) && rawUsageCount > 0 ? rawUsageCount : 1;
901
902
  var mergedIndex = mergedIndexByKey.get(key);
902
903
  if (mergedIndex === undefined) {
@@ -910,7 +911,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
910
911
  continue;
911
912
  }
912
913
  var existed = mergedDetails[mergedIndex];
913
- var existedUsageCount = Number((_ref17 = (_existed$metadata$num = existed === null || existed === void 0 || (_existed$metadata = existed.metadata) === null || _existed$metadata === void 0 ? void 0 : _existed$metadata.num) !== null && _existed$metadata$num !== void 0 ? _existed$metadata$num : existed === null || existed === void 0 ? void 0 : existed._num) !== null && _ref17 !== void 0 ? _ref17 : 1);
914
+ var existedUsageCount = Number((_ref11 = (_existed$metadata$num = existed === null || existed === void 0 || (_existed$metadata = existed.metadata) === null || _existed$metadata === void 0 ? void 0 : _existed$metadata.num) !== null && _existed$metadata$num !== void 0 ? _existed$metadata$num : existed === null || existed === void 0 ? void 0 : existed._num) !== null && _ref11 !== void 0 ? _ref11 : 1);
914
915
  var totalUsageCount = existedUsageCount + usageCount;
915
916
  mergedDetails[mergedIndex] = _objectSpread(_objectSpread({}, existed), {}, {
916
917
  metadata: _objectSpread(_objectSpread({}, (existed === null || existed === void 0 ? void 0 : existed.metadata) || {}), {}, {
@@ -1078,7 +1079,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1078
1079
  // 收集该折扣卡适用的商品(排除被其他专属折扣卡占用的商品)
1079
1080
  var applicableProducts = [];
1080
1081
  sortedFlattenedList.forEach(function (flatItem) {
1081
- var _flatItem$parentProdu2, _flatItem$parentProdu3, _product$price, _ref18, _flatItem$original_pr;
1082
+ var _flatItem$parentProdu2, _flatItem$parentProdu3, _product$price, _ref12, _flatItem$original_pr;
1082
1083
  // 🔥 检查该商品是否被其他专属折扣卡占用
1083
1084
  var occupyingDiscountId = occupiedItems.get(flatItem._id);
1084
1085
  if (occupyingDiscountId !== undefined && occupyingDiscountId !== discount.id) {
@@ -1106,7 +1107,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1106
1107
 
1107
1108
  // 对于主商品:使用 price
1108
1109
  // 对于子商品:优先使用 flatItem.original_price,否则使用 flatItem.price
1109
- var originalAmount = flatItem.type === 'main' ? Number((_product$price = product.price) !== null && _product$price !== void 0 ? _product$price : 0) : Number((_ref18 = (_flatItem$original_pr = flatItem.original_price) !== null && _flatItem$original_pr !== void 0 ? _flatItem$original_pr : flatItem.price) !== null && _ref18 !== void 0 ? _ref18 : 0);
1110
+ var originalAmount = flatItem.type === 'main' ? Number((_product$price = product.price) !== null && _product$price !== void 0 ? _product$price : 0) : Number((_ref12 = (_flatItem$original_pr = flatItem.original_price) !== null && _flatItem$original_pr !== void 0 ? _flatItem$original_pr : flatItem.price) !== null && _ref12 !== void 0 ? _ref12 : 0);
1110
1111
 
1111
1112
  // 传递 parentQuantity 用于差值处理时判断是否是真正的"数量为1"
1112
1113
  var productData = {
@@ -1244,13 +1245,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1244
1245
  };
1245
1246
  var optionDiscountAmount = 0;
1246
1247
  var discountedOptions = options.map(function (option) {
1247
- var _ref19, _ref20, _option$_original_pri, _ref21, _option$num, _rest$price, _option$_original_pri2;
1248
+ var _ref13, _ref14, _option$_original_pri, _ref15, _option$num, _rest$price, _option$_original_pri2;
1248
1249
  // 折前单价:优先 price,缺失再 add_price;已写回折后价时用 _original_price(或旧字段 _original_add_price)
1249
- var rawUnit = (_ref19 = (_ref20 = (_option$_original_pri = option._original_price) !== null && _option$_original_pri !== void 0 ? _option$_original_pri : option._original_add_price) !== null && _ref20 !== void 0 ? _ref20 : option.price) !== null && _ref19 !== void 0 ? _ref19 : option.add_price;
1250
+ var rawUnit = (_ref13 = (_ref14 = (_option$_original_pri = option._original_price) !== null && _option$_original_pri !== void 0 ? _option$_original_pri : option._original_add_price) !== null && _ref14 !== void 0 ? _ref14 : option.price) !== null && _ref13 !== void 0 ? _ref13 : option.add_price;
1250
1251
  var baseUnitNum = Number(rawUnit !== null && rawUnit !== void 0 ? rawUnit : 0);
1251
1252
  if (baseUnitNum <= 0) return option;
1252
1253
  var discountedPrice = getDiscountAmount(discount, baseUnitNum, baseUnitNum);
1253
- var optQty = Number((_ref21 = (_option$num = option.num) !== null && _option$num !== void 0 ? _option$num : option.quantity) !== null && _ref21 !== void 0 ? _ref21 : 1);
1254
+ var optQty = Number((_ref15 = (_option$num = option.num) !== null && _option$num !== void 0 ? _option$num : option.quantity) !== null && _ref15 !== void 0 ? _ref15 : 1);
1254
1255
  optionDiscountAmount = new Decimal(optionDiscountAmount).plus(new Decimal(baseUnitNum).minus(discountedPrice).mul(optQty)).toNumber();
1255
1256
  var _original_add_price = option._original_add_price,
1256
1257
  rest = _objectWithoutProperties(option, _excluded);
@@ -1284,9 +1285,9 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1284
1285
  var getOptionTotal = function getOptionTotal(options) {
1285
1286
  if (!(options !== null && options !== void 0 && options.length)) return 0;
1286
1287
  return options.reduce(function (sum, opt) {
1287
- var _ref22, _opt$price, _ref23, _opt$num;
1288
- var unit = Number((_ref22 = (_opt$price = opt.price) !== null && _opt$price !== void 0 ? _opt$price : opt.add_price) !== null && _ref22 !== void 0 ? _ref22 : 0);
1289
- var n = Number((_ref23 = (_opt$num = opt.num) !== null && _opt$num !== void 0 ? _opt$num : opt.quantity) !== null && _ref23 !== void 0 ? _ref23 : 1);
1288
+ var _ref16, _opt$price, _ref17, _opt$num;
1289
+ var unit = Number((_ref16 = (_opt$price = opt.price) !== null && _opt$price !== void 0 ? _opt$price : opt.add_price) !== null && _ref16 !== void 0 ? _ref16 : 0);
1290
+ var n = Number((_ref17 = (_opt$num = opt.num) !== null && _opt$num !== void 0 ? _opt$num : opt.quantity) !== null && _ref17 !== void 0 ? _ref17 : 1);
1290
1291
  return new Decimal(sum).plus(new Decimal(unit).mul(n)).toNumber();
1291
1292
  }, 0);
1292
1293
  };
@@ -1439,8 +1440,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1439
1440
  var appliedWalletDiscountIds = new Set((product.discount_list || []).filter(function (item) {
1440
1441
  return ['entitlement_pass', 'discount_card', 'product_discount_card'].includes((item === null || item === void 0 ? void 0 : item.tag) || (item === null || item === void 0 ? void 0 : item.type));
1441
1442
  }).map(function (item) {
1442
- var _ref24, _item$discount$resour, _item$discount;
1443
- return (_ref24 = (_item$discount$resour = item === null || item === void 0 || (_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.resource_id) !== null && _item$discount$resour !== void 0 ? _item$discount$resour : item === null || item === void 0 ? void 0 : item.resource_id) !== null && _ref24 !== void 0 ? _ref24 : item === null || item === void 0 ? void 0 : item.id;
1443
+ var _ref18, _item$discount$resour, _item$discount;
1444
+ return (_ref18 = (_item$discount$resour = item === null || item === void 0 || (_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.resource_id) !== null && _item$discount$resour !== void 0 ? _item$discount$resour : item === null || item === void 0 ? void 0 : item.resource_id) !== null && _ref18 !== void 0 ? _ref18 : item === null || item === void 0 ? void 0 : item.id;
1444
1445
  }).filter(function (id) {
1445
1446
  return id !== undefined && id !== null;
1446
1447
  }).map(String));
@@ -1480,8 +1481,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1480
1481
  isManualDiscount = typeof product.isManualDiscount === 'boolean' ? product.isManualDiscount : ((_product$discount_lis5 = product.discount_list) === null || _product$discount_lis5 === void 0 ? void 0 : _product$discount_lis5.some(function (item) {
1481
1482
  return item.type === 'product';
1482
1483
  })) || product.total != product.origin_total && (product.bundle || []).every(function (item) {
1483
- var _ref25;
1484
- return !((_ref25 = item.discount_list || []) !== null && _ref25 !== void 0 && _ref25.length);
1484
+ var _ref19;
1485
+ return !((_ref19 = item.discount_list || []) !== null && _ref19 !== void 0 && _ref19.length);
1485
1486
  }) && (!((_product$discount_lis6 = product.discount_list) !== null && _product$discount_lis6 !== void 0 && _product$discount_lis6.length) || ((_product12 = product) === null || _product12 === void 0 || (_product12 = _product12.discount_list) === null || _product12 === void 0 || (_product12$every = _product12.every) === null || _product12$every === void 0 ? void 0 : _product12$every.call(_product12, function (item) {
1486
1487
  return item.type === 'product';
1487
1488
  })));
@@ -1497,8 +1498,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1497
1498
  isManualDiscount = typeof parentProduct.isManualDiscount === 'boolean' ? parentProduct.isManualDiscount : ((_parentProduct$discou = parentProduct.discount_list) === null || _parentProduct$discou === void 0 ? void 0 : _parentProduct$discou.some(function (item) {
1498
1499
  return item.type === 'product';
1499
1500
  })) || parentProduct.total != parentProduct.origin_total && (parentProduct.bundle || []).every(function (item) {
1500
- var _ref26;
1501
- return !((_ref26 = item.discount_list || []) !== null && _ref26 !== void 0 && _ref26.length);
1501
+ var _ref20;
1502
+ return !((_ref20 = item.discount_list || []) !== null && _ref20 !== void 0 && _ref20.length);
1502
1503
  }) && (!((_parentProduct$discou2 = parentProduct.discount_list) !== null && _parentProduct$discou2 !== void 0 && _parentProduct$discou2.length) || (parentProduct === null || parentProduct === void 0 || (_parentProduct$discou3 = parentProduct.discount_list) === null || _parentProduct$discou3 === void 0 || (_parentProduct$discou4 = _parentProduct$discou3.every) === null || _parentProduct$discou4 === void 0 ? void 0 : _parentProduct$discou4.call(_parentProduct$discou3, function (item) {
1503
1504
  return item.type === 'product';
1504
1505
  })));
@@ -1591,8 +1592,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1591
1592
  discount_list: isManualDiscount ? _this4.resolveDiscountListForManualOverride(product.discount_list) : _this4.filterDiscountListByType(product.discount_list, 'promotion')
1592
1593
  }))]);
1593
1594
  } else {
1594
- var _ref27, _product$_promotion$f, _product13, _product$origin_total;
1595
- var total = product.inPromotion ? (_ref27 = (_product$_promotion$f = (_product13 = product) === null || _product13 === void 0 || (_product13 = _product13._promotion) === null || _product13 === void 0 ? void 0 : _product13.finalPrice) !== null && _product$_promotion$f !== void 0 ? _product$_promotion$f : product.origin_total) !== null && _ref27 !== void 0 ? _ref27 : product.total : (_product$origin_total = product.origin_total) !== null && _product$origin_total !== void 0 ? _product$origin_total : product.total;
1595
+ var _ref21, _product$_promotion$f, _product13, _product$origin_total;
1596
+ var total = product.inPromotion ? (_ref21 = (_product$_promotion$f = (_product13 = product) === null || _product13 === void 0 || (_product13 = _product13._promotion) === null || _product13 === void 0 ? void 0 : _product13.finalPrice) !== null && _product$_promotion$f !== void 0 ? _product$_promotion$f : product.origin_total) !== null && _ref21 !== void 0 ? _ref21 : product.total : (_product$origin_total = product.origin_total) !== null && _product$origin_total !== void 0 ? _product$origin_total : product.total;
1596
1597
  var main_product_selling_price = product.price;
1597
1598
  if ((product.discount_list || []).some(function (item) {
1598
1599
  return item.type === 'promotion';
@@ -2295,7 +2296,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2295
2296
  } else {
2296
2297
  // 🔥 没有子商品被拆分,使用原有逻辑
2297
2298
  mainProductArr.forEach(function (mainProduct) {
2298
- var _ref29, _mainProductData$main, _mainProductData$disc, _mainProductData$disc2, _mainProductData$disc3;
2299
+ var _ref23, _mainProductData$main, _mainProductData$disc, _mainProductData$disc2, _mainProductData$disc3;
2299
2300
  var mainProductData = _this4.hooks.getProduct(mainProduct);
2300
2301
 
2301
2302
  // 重组bundle
@@ -2310,9 +2311,9 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2310
2311
  } else {
2311
2312
  // 🔥 关键:拆分后的bundle item
2312
2313
  processedBundleItems.forEach(function (item) {
2313
- var _item$price, _ref28, _item$bundle_selling_;
2314
+ var _item$price, _ref22, _item$bundle_selling_;
2314
2315
  var nextBundlePrice = (_item$price = item.price) !== null && _item$price !== void 0 ? _item$price : bundleItem.price;
2315
- var nextBundleSellingPrice = (_ref28 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref28 !== void 0 ? _ref28 : bundleItem.bundle_selling_price;
2316
+ var nextBundleSellingPrice = (_ref22 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref22 !== void 0 ? _ref22 : bundleItem.bundle_selling_price;
2316
2317
  // 🔥 更新 discount_list 中的 num,使其与拆分后的 item.num 一致
2317
2318
  var updatedDiscountList = (item.discount_list || []).map(function (discount) {
2318
2319
  var _discount$metadata11;
@@ -2339,7 +2340,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2339
2340
 
2340
2341
  // 主商品已经在前面的 setProduct 中应用过折扣;这里只替换 bundle,
2341
2342
  // 避免把主商品 discount_list 再扣一次。
2342
- var mainSellingPrice = (_ref29 = (_mainProductData$main = mainProductData.main_product_selling_price) !== null && _mainProductData$main !== void 0 ? _mainProductData$main : mainProductData.price) !== null && _ref29 !== void 0 ? _ref29 : 0;
2343
+ var mainSellingPrice = (_ref23 = (_mainProductData$main = mainProductData.main_product_selling_price) !== null && _mainProductData$main !== void 0 ? _mainProductData$main : mainProductData.price) !== null && _ref23 !== void 0 ? _ref23 : 0;
2343
2344
  var newTotal = Number(mainSellingPrice || 0);
2344
2345
  var newOriginTotal = Number(mainProductData.original_price || mainProductData.price || 0);
2345
2346
 
@@ -2555,15 +2556,15 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2555
2556
  var ruleType = usageRules.type;
2556
2557
  // 套餐适用范围配置
2557
2558
  var packageScope = usageRules === null || usageRules === void 0 ? void 0 : usageRules.package_scope;
2558
- var _ref30 = packageScope || {},
2559
- _ref30$type = _ref30.type,
2560
- scopeType = _ref30$type === void 0 ? 'product_all' : _ref30$type,
2561
- _ref30$exclude_bundle = _ref30.exclude_bundle_product_ids,
2562
- exclude_bundle_product_ids = _ref30$exclude_bundle === void 0 ? [] : _ref30$exclude_bundle,
2563
- _ref30$include_bundle = _ref30.include_bundle_product_ids,
2564
- include_bundle_product_ids = _ref30$include_bundle === void 0 ? [] : _ref30$include_bundle,
2565
- _ref30$filter = _ref30.filter,
2566
- filter = _ref30$filter === void 0 ? 0 : _ref30$filter;
2559
+ var _ref24 = packageScope || {},
2560
+ _ref24$type = _ref24.type,
2561
+ scopeType = _ref24$type === void 0 ? 'product_all' : _ref24$type,
2562
+ _ref24$exclude_bundle = _ref24.exclude_bundle_product_ids,
2563
+ exclude_bundle_product_ids = _ref24$exclude_bundle === void 0 ? [] : _ref24$exclude_bundle,
2564
+ _ref24$include_bundle = _ref24.include_bundle_product_ids,
2565
+ include_bundle_product_ids = _ref24$include_bundle === void 0 ? [] : _ref24$include_bundle,
2566
+ _ref24$filter = _ref24.filter,
2567
+ filter = _ref24$filter === void 0 ? 0 : _ref24$filter;
2567
2568
  var isMainProduct = flatItem.type === 'main'; // 单独购买
2568
2569
  var isBundleItem = flatItem.type === 'bundle'; // 套餐中购买
2569
2570
  var bundleMainProductId = (_flatItem$product = flatItem.product) === null || _flatItem$product === void 0 ? void 0 : _flatItem$product.product_id;
@@ -29,6 +29,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
29
29
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
30
30
  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); }
31
31
  import { BaseModule } from "../../../modules/BaseModule";
32
+ import { resolveProductHolderConfig } from "../../../modules/Holder/utils";
32
33
  import { QuotationModule as ClientQuotationModule } from "../../../modules/Quotation";
33
34
  import { ProductsHooks } from "./types";
34
35
  import { applyDetailValueToProducts, applyPriceDataToProducts, applyI18nToProducts, perfMark } from "../../utils/product";
@@ -1444,7 +1445,7 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
1444
1445
  key: "getProductSnapshotsByIds",
1445
1446
  value: (function () {
1446
1447
  var _getProductSnapshotsByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(ids) {
1447
- var snapshots, seen, _iterator6, _step6, id, product;
1448
+ var snapshots, seen, _iterator6, _step6, _resolveProductHolder, id, product;
1448
1449
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1449
1450
  while (1) switch (_context13.prev = _context13.next) {
1450
1451
  case 0:
@@ -1475,7 +1476,7 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
1475
1476
  case 13:
1476
1477
  snapshots[String(id)] = {
1477
1478
  cover: product.cover,
1478
- holder_config: product.holder_config
1479
+ holder_config: (_resolveProductHolder = resolveProductHolderConfig(product)) !== null && _resolveProductHolder !== void 0 ? _resolveProductHolder : undefined
1479
1480
  };
1480
1481
  case 14:
1481
1482
  _context13.next = 5;
@@ -12,6 +12,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
12
12
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  import { resolveWeighedSourcePrice, withOriginalBundleOptionPrices } from "../../../modules/Order/utils/weighedProduct";
15
+ import { resolveProductHolderConfig } from "../../../modules/Holder/utils";
15
16
  import { isBookingProduct } from "../../../modules/BookingContext/utils/serviceTimes";
16
17
  import { composeLinePrice, getBundleSellingMagnitude, normalizeProductSkuOptions, sumOptionUnitPrice } from "../../../modules/Order/utils";
17
18
  import { buildManualProductDiscountItem, mergeManualProductDiscountIntoList, resolveManualDiscountOriginTotal, resolveManualDiscountReasonFromSources, shouldBuildManualProductDiscount } from "../../../modules/Order/utils/manualProductDiscount";
@@ -169,7 +170,7 @@ function findVariantById(origin, variantId) {
169
170
  * 注意:这里不生成 identity,缺省时由 OrderModule 自动补齐。
170
171
  */
171
172
  export function transformBaseProductToOrderProduct(params) {
172
- var _ref12, _ref13, _ref14, _payload$product_id, _ref15, _ref16, _payload$product_vari, _payload$_origin, _payload$_origin2, _payload$metadata, _sourceProduct$metada, _callbackOrigin$metad, _origin$metadata, _payload$metadata2, _payload$_extend, _sourceProduct$metada2, _sourceProduct$_exten, _callbackOrigin$metad2, _callbackOrigin$_exte, _payload$_dataVariant, _sourceProduct$_dataV, _callbackOrigin$_data, _origin$_dataVariant, _ref17, _findVariantById, _origin$production_co, _ref18, _ref19, _ref20, _ref21, _ref22, _matchedVariant$price, _payload$product_sku, _payload$_extend$weig, _payload$_extend2, _origin$_extend, _ref23, _ref24, _payload$price, _ref25, _payload$line_total, _payload$_extend3, _ref26, _ref27, _payload$product_sku$, _payload$product_sku2, _payload$bundle, _payload$quantity, _payload$_extend4, _extend, _extend2, _ref28, _ref29, _origin$base_price, _ref30, _ref31, _payload$line_total2, _payload$_extend5, _payload$_extend6, _extend3, _payload$_extend7, _payload$_extend8, _find, _ref32, _ref33, _payload$tax_fee, _ref34, _ref35, _payload$is_charge_ta;
173
+ var _ref12, _ref13, _ref14, _payload$product_id, _ref15, _ref16, _payload$product_vari, _payload$_origin, _payload$_origin2, _payload$metadata, _sourceProduct$metada, _callbackOrigin$metad, _origin$metadata, _payload$metadata2, _payload$_extend, _sourceProduct$metada2, _sourceProduct$_exten, _callbackOrigin$metad2, _callbackOrigin$_exte, _payload$_dataVariant, _sourceProduct$_dataV, _callbackOrigin$_data, _origin$_dataVariant, _ref17, _findVariantById, _origin$production_co, _ref18, _ref19, _ref20, _ref21, _ref22, _matchedVariant$price, _payload$product_sku, _payload$_extend$weig, _payload$_extend2, _origin$_extend, _ref23, _ref24, _payload$price, _ref25, _payload$line_total, _payload$_extend3, _ref26, _ref27, _payload$product_sku$, _payload$product_sku2, _payload$bundle, _payload$quantity, _payload$_extend4, _extend, _extend2, _ref28, _ref29, _origin$base_price, _ref30, _ref31, _payload$line_total2, _payload$_extend5, _payload$_extend6, _extend3, _payload$_extend7, _payload$_extend8, _find, _resolveProductHolder, _ref32, _ref33, _payload$tax_fee, _ref34, _ref35, _payload$is_charge_ta;
173
174
  var payload = params.payload,
174
175
  _params$fallbackProdu = params.fallbackProductId,
175
176
  fallbackProductId = _params$fallbackProdu === void 0 ? null : _params$fallbackProdu;
@@ -260,7 +261,7 @@ export function transformBaseProductToOrderProduct(params) {
260
261
  main_product_selling_price: mainProductSellingPrice,
261
262
  main_product_original_price: mainProductOriginalPrice,
262
263
  price_schema_version: 2,
263
- holder_config: sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.holder_config
264
+ holder_config: (_resolveProductHolder = resolveProductHolderConfig(sourceProduct)) !== null && _resolveProductHolder !== void 0 ? _resolveProductHolder : undefined
264
265
  }, dataVariantIds !== undefined ? {
265
266
  data_variant_ids: dataVariantIds
266
267
  } : {}), selectedSettlementSnapshot ? {
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 6 | 5 | 1 | 2 | 3 | 4;
329
+ weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;