@pisell/pisellos 0.10.21 → 0.10.22

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 (67) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/BookingContext/index.d.ts +3 -0
  3. package/dist/modules/BookingContext/index.js +42 -13
  4. package/dist/modules/BookingContext/types.d.ts +4 -4
  5. package/dist/modules/BookingContext/types.js +3 -3
  6. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +10 -7
  7. package/dist/modules/Order/index.d.ts +5 -0
  8. package/dist/modules/Order/index.js +148 -84
  9. package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
  10. package/dist/modules/ProductList/clientDataVariants.js +216 -0
  11. package/dist/modules/ProductList/index.d.ts +14 -13
  12. package/dist/modules/ProductList/index.js +105 -77
  13. package/dist/modules/Quotation/index.d.ts +16 -0
  14. package/dist/modules/Quotation/index.js +240 -27
  15. package/dist/modules/ResourcePlanner/planner.d.ts +2 -2
  16. package/dist/modules/ResourcePlanner/planner.js +88 -21
  17. package/dist/modules/ResourcePlanner/types.d.ts +12 -0
  18. package/dist/modules/Rules/index.d.ts +5 -0
  19. package/dist/modules/Rules/index.js +27 -12
  20. package/dist/solution/BaseSales/index.d.ts +16 -1
  21. package/dist/solution/BaseSales/index.js +667 -349
  22. package/dist/solution/BookingByStep/index.d.ts +1 -1
  23. package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
  24. package/dist/solution/UnifiedBookingSales/index.js +290 -81
  25. package/dist/solution/UnifiedBookingSales/types.d.ts +4 -0
  26. package/dist/solution/VenueBooking/index.d.ts +2 -0
  27. package/dist/solution/VenueBooking/index.js +542 -494
  28. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  29. package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
  30. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  31. package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
  32. package/dist/utils/platform.d.ts +8 -0
  33. package/dist/utils/platform.js +15 -0
  34. package/lib/model/strategy/adapter/promotion/index.js +46 -1
  35. package/lib/modules/BookingContext/index.d.ts +3 -0
  36. package/lib/modules/BookingContext/index.js +35 -8
  37. package/lib/modules/BookingContext/types.d.ts +4 -4
  38. package/lib/modules/BookingContext/types.js +3 -3
  39. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +4 -0
  40. package/lib/modules/Order/index.d.ts +5 -0
  41. package/lib/modules/Order/index.js +65 -8
  42. package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
  43. package/lib/modules/ProductList/clientDataVariants.js +204 -0
  44. package/lib/modules/ProductList/index.d.ts +14 -13
  45. package/lib/modules/ProductList/index.js +77 -58
  46. package/lib/modules/Quotation/index.d.ts +16 -0
  47. package/lib/modules/Quotation/index.js +112 -9
  48. package/lib/modules/ResourcePlanner/planner.d.ts +2 -2
  49. package/lib/modules/ResourcePlanner/planner.js +80 -20
  50. package/lib/modules/ResourcePlanner/types.d.ts +12 -0
  51. package/lib/modules/Rules/index.d.ts +5 -0
  52. package/lib/modules/Rules/index.js +20 -11
  53. package/lib/solution/BaseSales/index.d.ts +16 -1
  54. package/lib/solution/BaseSales/index.js +293 -66
  55. package/lib/solution/BookingByStep/index.d.ts +1 -1
  56. package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
  57. package/lib/solution/UnifiedBookingSales/index.js +225 -20
  58. package/lib/solution/UnifiedBookingSales/types.d.ts +4 -0
  59. package/lib/solution/VenueBooking/index.d.ts +2 -0
  60. package/lib/solution/VenueBooking/index.js +28 -8
  61. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  62. package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
  63. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  64. package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
  65. package/lib/utils/platform.d.ts +8 -0
  66. package/lib/utils/platform.js +22 -0
  67. package/package.json +1 -1
@@ -1,9 +0,0 @@
1
- // 导出评估器
2
- export { PromotionEvaluator } from "./evaluator";
3
-
4
- // 导出适配器
5
- export { PromotionAdapter } from "./adapter";
6
- export { default } from "./adapter";
7
-
8
- // 导出策略配置示例常量
9
- export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
@@ -19,12 +19,15 @@ export declare class BookingContextModule extends BaseModule implements Module,
19
19
  protected defaultVersion: string;
20
20
  private request;
21
21
  private store;
22
+ private otherParams;
22
23
  /** 上次成功 loadBookingConfig 的 query key;命中则不再请求。 */
23
24
  private lastConfigQueryKey;
24
25
  /** 上次成功 loadResources 的 query key(date|bookingIds);命中则不再请求。 */
25
26
  private lastResourcesQueryKey;
26
27
  constructor(name?: string, version?: string);
27
28
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
29
+ /** 同步父级解决方案的运行态参数;platform 变化后会自然切换 config endpoint/cache key。 */
30
+ updateOtherParams(params: Record<string, any>): void;
28
31
  loadBookingConfig(params?: LoadBookingConfigParams, options?: {
29
32
  forceRefresh?: boolean;
30
33
  }): Promise<BookingContextConfig | null>;
@@ -26,6 +26,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
26
26
  import dayjs from 'dayjs';
27
27
  import { BaseModule } from "../BaseModule";
28
28
  import { RequestModeENUM } from "../../plugins/request";
29
+ import { normalizeRuntimePlatform } from "../../utils/platform";
29
30
  import { BookingContextEvent } from "./types";
30
31
  import { formatResourceListAndMap } from "./utils/formatResourceList";
31
32
  export * from "./types";
@@ -40,6 +41,8 @@ var DEFAULT_BOOKING_CONFIG_PARAMS = {
40
41
  item_type: 'appointment_booking',
41
42
  sub_type: 'ticket'
42
43
  };
44
+ var BOOKING_CONFIG_ENDPOINT = '/core/board/management/config';
45
+ var H5_BOOKING_CONFIG_ENDPOINT = '/core/board/config';
43
46
  var BOARD_CONFIG_CACHE = {
44
47
  useCache: true,
45
48
  cache: {
@@ -153,6 +156,24 @@ export function buildBookingConfigQueryKey() {
153
156
  });
154
157
  return JSON.stringify(sorted);
155
158
  }
159
+ function resolveBookingConfigRequest(platform) {
160
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
161
+ var isH5 = normalizeRuntimePlatform(platform) === 'h5';
162
+ var endpoint = isH5 ? H5_BOOKING_CONFIG_ENDPOINT : BOOKING_CONFIG_ENDPOINT;
163
+ var query = isH5 ? {
164
+ item_type: params.item_type || DEFAULT_BOOKING_CONFIG_PARAMS.item_type
165
+ } : _objectSpread(_objectSpread({}, DEFAULT_BOOKING_CONFIG_PARAMS), params);
166
+ var keys = Object.keys(query).sort();
167
+ var sortedQuery = {};
168
+ keys.forEach(function (key) {
169
+ sortedQuery[key] = query[key];
170
+ });
171
+ return {
172
+ endpoint: endpoint,
173
+ query: query,
174
+ key: "".concat(endpoint, ":").concat(JSON.stringify(sortedQuery))
175
+ };
176
+ }
156
177
 
157
178
  /** 稳定序列化资源列表查询(date + bookingIds),用于跳过重复 loadResources。 */
158
179
  export function buildBookingResourcesQueryKey() {
@@ -176,6 +197,7 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
176
197
  _defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
177
198
  _defineProperty(_assertThisInitialized(_this), "request", void 0);
178
199
  _defineProperty(_assertThisInitialized(_this), "store", _objectSpread({}, EMPTY_STATE));
200
+ _defineProperty(_assertThisInitialized(_this), "otherParams", {});
179
201
  /** 上次成功 loadBookingConfig 的 query key;命中则不再请求。 */
180
202
  _defineProperty(_assertThisInitialized(_this), "lastConfigQueryKey", null);
181
203
  /** 上次成功 loadResources 的 query key(date|bookingIds);命中则不再请求。 */
@@ -201,6 +223,7 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
201
223
  }
202
224
  throw new Error('BookingContextModule 需要 request 插件支持');
203
225
  case 5:
226
+ this.otherParams = options.otherParams || {};
204
227
  this.store = {
205
228
  bookingConfig: null,
206
229
  resourcesOrigin: [],
@@ -218,7 +241,7 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
218
241
  if (initialState.date) {
219
242
  this.store.date = initialState.date;
220
243
  }
221
- case 10:
244
+ case 11:
222
245
  case "end":
223
246
  return _context.stop();
224
247
  }
@@ -228,16 +251,22 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
228
251
  return _initialize.apply(this, arguments);
229
252
  }
230
253
  return initialize;
231
- }()
254
+ }() /** 同步父级解决方案的运行态参数;platform 变化后会自然切换 config endpoint/cache key。 */
255
+ }, {
256
+ key: "updateOtherParams",
257
+ value: function updateOtherParams(params) {
258
+ this.otherParams = params || {};
259
+ }
232
260
  }, {
233
261
  key: "loadBookingConfig",
234
262
  value: function () {
235
263
  var _loadBookingConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
236
- var _this2 = this;
264
+ var _this$otherParams,
265
+ _this2 = this;
237
266
  var params,
238
267
  options,
268
+ requestConfig,
239
269
  configKey,
240
- query,
241
270
  sharedKey,
242
271
  _sharedBookingConfigC,
243
272
  cached,
@@ -250,14 +279,14 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
250
279
  case 0:
251
280
  params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
252
281
  options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
253
- configKey = buildBookingConfigQueryKey(params);
282
+ requestConfig = resolveBookingConfigRequest((_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.platform, params);
283
+ configKey = requestConfig.key;
254
284
  if (!(!options.forceRefresh && this.store.bookingConfig != null && this.lastConfigQueryKey === configKey)) {
255
- _context3.next = 5;
285
+ _context3.next = 6;
256
286
  break;
257
287
  }
258
288
  return _context3.abrupt("return", this.store.bookingConfig);
259
- case 5:
260
- query = _objectSpread(_objectSpread({}, DEFAULT_BOOKING_CONFIG_PARAMS), params);
289
+ case 6:
261
290
  sharedKey = buildSharedCacheKey(this.request, configKey);
262
291
  if (!(!options.forceRefresh && sharedBookingConfigCache.has(sharedKey))) {
263
292
  _context3.next = 12;
@@ -277,7 +306,7 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
277
306
  case 0:
278
307
  _context2.prev = 0;
279
308
  _context2.next = 3;
280
- return _this2.request.get('/core/board/management/config', query, BOARD_CONFIG_CACHE);
309
+ return _this2.request.get(requestConfig.endpoint, requestConfig.query, BOARD_CONFIG_CACHE);
281
310
  case 3:
282
311
  res = _context2.sent;
283
312
  _config = (_res$data = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data !== void 0 ? _res$data : null;
@@ -411,9 +440,9 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
411
440
  }, {
412
441
  key: "isBookingContextReady",
413
442
  value: function isBookingContextReady() {
414
- var _ref3, _params$date2;
443
+ var _this$otherParams2, _ref3, _params$date2;
415
444
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
416
- var configKey = buildBookingConfigQueryKey(params.bookingConfigParams);
445
+ var configKey = resolveBookingConfigRequest((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.platform, params.bookingConfigParams).key;
417
446
  var dateInput = (_ref3 = (_params$date2 = params.date) !== null && _params$date2 !== void 0 ? _params$date2 : this.store.date) !== null && _ref3 !== void 0 ? _ref3 : dayjs();
418
447
  var queryDate = toScheduleQueryDate(dateInput);
419
448
  var resourcesKey = buildBookingResourcesQueryKey({
@@ -428,7 +457,7 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
428
457
  key: "initBookingContext",
429
458
  value: function () {
430
459
  var _initBookingContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
431
- var _ref4, _params$date3;
460
+ var _ref4, _params$date3, _this$otherParams3;
432
461
  var params,
433
462
  dateInput,
434
463
  queryDate,
@@ -450,7 +479,7 @@ export var BookingContextModule = /*#__PURE__*/function (_BaseModule) {
450
479
  }
451
480
  return _context6.abrupt("return", this.getState());
452
481
  case 6:
453
- configKey = buildBookingConfigQueryKey(params.bookingConfigParams);
482
+ configKey = resolveBookingConfigRequest((_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.platform, params.bookingConfigParams).key;
454
483
  resourcesKey = buildBookingResourcesQueryKey({
455
484
  date: queryDate,
456
485
  bookingIds: params.bookingIds
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * BookingContext 子模块:承载「预约 UI 上下文」三件套。
3
3
  *
4
- * - bookingConfig:来自 `/core/board/management/config` 的整套预约配置(service_time / resource_tab /
4
+ * - bookingConfig:来自 staff `/core/board/management/config` 或 H5 `/core/board/config` 的整套预约配置(service_time / resource_tab /
5
5
  * appointment_subject / subject_require / stock_setting / basic / capacity 等)。
6
6
  * - resourcesOrigin / resourcesOriginMap:来自 `/schedule/resource/list` 的资源全集,含 times / event_list /
7
7
  * combined_resource 等运行态信息,是 getResourceByIds / getResourceTimeIsUsable 的输入。
@@ -11,7 +11,7 @@
11
11
  * - 默认由 `loadBookingConfig` / `loadResources` 拉取并写入 store;也支持消费方 `set*` 直接灌入(复用 ticketBooking 已拉到的数据)。
12
12
  * - 所有读 API 返回浅克隆(数组)或原引用(map / config),避免 UI 写穿。
13
13
  */
14
- /** `loadBookingConfig` 入参,与 ticketBooking `getBookingConfig` 一致。 */
14
+ /** `loadBookingConfig` 入参;H5 公共接口只消费 `item_type`。 */
15
15
  export interface LoadBookingConfigParams {
16
16
  item_type?: string;
17
17
  sub_type?: string;
@@ -42,7 +42,7 @@ export interface InitBookingContextParams {
42
42
  export type BookingContextResource = Record<string, any>;
43
43
  export type BookingContextResourceMap = Record<string, BookingContextResource>;
44
44
  /**
45
- * 形参 booking_config(结构来自 `/core/board/management/config` 接口)。
45
+ * 形参 booking_config(结构来自 staff management 或 H5 board config 接口的 `data`)。
46
46
  * OS 不强制 schema,保留 `Record<string, any>` 兼容现网;常用路径文档化在 SDK docs。
47
47
  */
48
48
  export type BookingContextConfig = Record<string, any>;
@@ -80,7 +80,7 @@ export interface BookingContextModuleAPI {
80
80
  getState(): BookingContextState;
81
81
  /** 一键清空,destroy / 切租户场景用。 */
82
82
  clear(): void;
83
- /** 拉取 board config 并写入 store(`/core/board/management/config`)。 */
83
+ /** 按运行平台拉取 board config 并写入 store */
84
84
  loadBookingConfig(params?: LoadBookingConfigParams): Promise<BookingContextConfig | null>;
85
85
  /** 拉取资源全集并写入 store(`/schedule/resource/list`)。 */
86
86
  loadResources(params?: LoadBookingResourcesParams): Promise<BookingContextResource[]>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * BookingContext 子模块:承载「预约 UI 上下文」三件套。
3
3
  *
4
- * - bookingConfig:来自 `/core/board/management/config` 的整套预约配置(service_time / resource_tab /
4
+ * - bookingConfig:来自 staff `/core/board/management/config` 或 H5 `/core/board/config` 的整套预约配置(service_time / resource_tab /
5
5
  * appointment_subject / subject_require / stock_setting / basic / capacity 等)。
6
6
  * - resourcesOrigin / resourcesOriginMap:来自 `/schedule/resource/list` 的资源全集,含 times / event_list /
7
7
  * combined_resource 等运行态信息,是 getResourceByIds / getResourceTimeIsUsable 的输入。
@@ -12,7 +12,7 @@
12
12
  * - 所有读 API 返回浅克隆(数组)或原引用(map / config),避免 UI 写穿。
13
13
  */
14
14
 
15
- /** `loadBookingConfig` 入参,与 ticketBooking `getBookingConfig` 一致。 */
15
+ /** `loadBookingConfig` 入参;H5 公共接口只消费 `item_type`。 */
16
16
 
17
17
  /** `loadResources` 入参,与 info2 `getResourceList` 一致。 */
18
18
 
@@ -24,7 +24,7 @@
24
24
  */
25
25
 
26
26
  /**
27
- * 形参 booking_config(结构来自 `/core/board/management/config` 接口)。
27
+ * 形参 booking_config(结构来自 staff management 或 H5 board config 接口的 `data`)。
28
28
  * OS 不强制 schema,保留 `Record<string, any>` 兼容现网;常用路径文档化在 SDK docs。
29
29
  */
30
30
 
@@ -192,10 +192,11 @@ function synthesizeProductResourceFromBooking(booking) {
192
192
  * 调用方须传入与该行关联的 booking(通常 bookings[].product_uid === product.metadata.unique_identification_number)。
193
193
  */
194
194
  export function buildCacheItemFromOrderLine(input) {
195
- var _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$bundle_edit, _product$product_vari, _product$num, _ref11, _product$note, _booking$detail2, _product$metadata, _product$metadata2, _ref12, _extension_type, _booking$product2, _booking$product3, _price, _product$product_sku, _product$order_detail, _ref13, _booking$id;
195
+ var _ref11, _sourceProduct$holder, _sourceProduct$origin, _product$metadata, _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$bundle_edit, _product$product_vari, _product$num, _ref12, _product$note, _booking$detail2, _product$metadata2, _product$metadata3, _ref13, _extension_type, _booking$product2, _booking$product3, _price, _product$product_sku, _product$order_detail, _ref14, _booking$id;
196
196
  var product = input.product,
197
197
  booking = input.booking,
198
198
  sourceProduct = input.sourceProduct;
199
+ var holderConfig = (_ref11 = (_sourceProduct$holder = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.holder_config) !== null && _sourceProduct$holder !== void 0 ? _sourceProduct$holder : sourceProduct === null || sourceProduct === void 0 || (_sourceProduct$origin = sourceProduct.origin) === null || _sourceProduct$origin === void 0 ? void 0 : _sourceProduct$origin.holder_config) !== null && _ref11 !== void 0 ? _ref11 : (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.holder_config;
199
200
  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;
200
201
  var selling = Number((_product$selling_pric = product.selling_price) !== null && _product$selling_pric !== void 0 ? _product$selling_pric : 0);
201
202
  var original = Number((_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : selling);
@@ -229,7 +230,7 @@ export function buildCacheItemFromOrderLine(input) {
229
230
  quantity: (_product$num = product.num) !== null && _product$num !== void 0 ? _product$num : 1,
230
231
  product_name: productTitle,
231
232
  product_cover: productCover,
232
- note: (_ref11 = (_product$note = product.note) !== null && _product$note !== void 0 ? _product$note : booking === null || booking === void 0 || (_booking$detail2 = booking.detail) === null || _booking$detail2 === void 0 ? void 0 : _booking$detail2.note) !== null && _ref11 !== void 0 ? _ref11 : '',
233
+ note: (_ref12 = (_product$note = product.note) !== null && _product$note !== void 0 ? _product$note : booking === null || booking === void 0 || (_booking$detail2 = booking.detail) === null || _booking$detail2 === void 0 ? void 0 : _booking$detail2.note) !== null && _ref12 !== void 0 ? _ref12 : '',
233
234
  price: mainProductPrice,
234
235
  total: selling,
235
236
  origin_total: original,
@@ -238,7 +239,7 @@ export function buildCacheItemFromOrderLine(input) {
238
239
  holder_id: holderId,
239
240
  other: other,
240
241
  like_status: booking.like_status || 'common',
241
- discount_reason: resolveManualDiscountMessage(product.discount_list, (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.product_discount_reason) || undefined
242
+ discount_reason: resolveManualDiscountMessage(product.discount_list, (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.product_discount_reason) || undefined
242
243
  }, bundleEdit !== undefined ? {
243
244
  bundle_edit: bundleEdit
244
245
  } : {}), productOptionString ? {
@@ -254,7 +255,7 @@ export function buildCacheItemFromOrderLine(input) {
254
255
  extend.origin_total = selling + manualAmount;
255
256
  }
256
257
  }
257
- if (((_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.price_override) != null || manualDiscount) {
258
+ if (((_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.price_override) != null || manualDiscount) {
258
259
  extend.priceOverride = selling;
259
260
  }
260
261
  if (booking.holder !== undefined) {
@@ -263,10 +264,12 @@ export function buildCacheItemFromOrderLine(input) {
263
264
  if (Array.isArray(booking.relation_forms)) {
264
265
  extend.relation_forms = booking.relation_forms;
265
266
  }
266
- var base = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
267
+ var base = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), holderConfig !== undefined && holderConfig !== null ? {
268
+ holder_config: holderConfig
269
+ } : {}), {}, {
267
270
  id: resolvedId,
268
271
  product_id: resolvedId,
269
- extension_type: (_ref12 = (_extension_type = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type) !== null && _extension_type !== void 0 ? _extension_type : booking === null || booking === void 0 || (_booking$product2 = booking.product) === null || _booking$product2 === void 0 ? void 0 : _booking$product2.extension_type) !== null && _ref12 !== void 0 ? _ref12 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type,
272
+ extension_type: (_ref13 = (_extension_type = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type) !== null && _extension_type !== void 0 ? _extension_type : booking === null || booking === void 0 || (_booking$product2 = booking.product) === null || _booking$product2 === void 0 ? void 0 : _booking$product2.extension_type) !== null && _ref13 !== void 0 ? _ref13 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type,
270
273
  title: productTitle || (sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.title) || (booking === null || booking === void 0 || (_booking$product3 = booking.product) === null || _booking$product3 === void 0 ? void 0 : _booking$product3.title),
271
274
  price: (_price = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _price !== void 0 ? _price : selling,
272
275
  selling_price: product.selling_price,
@@ -280,7 +283,7 @@ export function buildCacheItemFromOrderLine(input) {
280
283
  new: 0,
281
284
  autoClose: false,
282
285
  order_detail_id: (_product$order_detail = product.order_detail_id) !== null && _product$order_detail !== void 0 ? _product$order_detail : null,
283
- booking_id: (_ref13 = (_booking$id = booking.id) !== null && _booking$id !== void 0 ? _booking$id : booking.booking_id) !== null && _ref13 !== void 0 ? _ref13 : 0
286
+ booking_id: (_ref14 = (_booking$id = booking.id) !== null && _booking$id !== void 0 ? _booking$id : booking.booking_id) !== null && _ref14 !== void 0 ? _ref14 : 0
284
287
  });
285
288
  if ((sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.capacity) !== undefined) {
286
289
  base.capacity = sourceProduct.capacity;
@@ -415,6 +415,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
415
415
  * if (pending) await pending;
416
416
  */
417
417
  private appendProductLineToTempOrder;
418
+ /**
419
+ * booking 数量拆行时,若 Holder 数量与拆行数严格一致,则按下标分配。
420
+ * 数量不一致时保持旧数据,避免猜测 Holder 与商品份数的对应关系。
421
+ */
422
+ private createSplitBookingLine;
418
423
  /**
419
424
  * 添加商品行。带 booking 时强制独立行;num>1 时拆成多条 num=1 的 product+booking(对齐 BookingByStep / ticketBooking addService)。
420
425
  *