@pisell/pisellos 2.2.171 → 2.2.173

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 (160) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/modules/BookingContext/index.d.ts +37 -0
  3. package/dist/modules/BookingContext/index.js +436 -0
  4. package/dist/modules/BookingContext/types.d.ts +102 -0
  5. package/dist/modules/BookingContext/types.js +51 -0
  6. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  7. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +193 -0
  8. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  9. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +137 -0
  10. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
  11. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +215 -0
  12. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  13. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  14. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  15. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  16. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  17. package/dist/modules/BookingContext/utils/index.js +11 -0
  18. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  19. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  20. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  21. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  22. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  23. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  24. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  25. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  26. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  27. package/dist/modules/BookingContext/utils/resources.js +486 -0
  28. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  29. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  30. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  31. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  32. package/dist/modules/Customer/index.d.ts +6 -0
  33. package/dist/modules/Customer/index.js +129 -83
  34. package/dist/modules/Customer/types.d.ts +2 -0
  35. package/dist/modules/Discount/index.d.ts +2 -4
  36. package/dist/modules/Discount/index.js +8 -93
  37. package/dist/modules/Discount/types.d.ts +1 -7
  38. package/dist/modules/Order/index.d.ts +33 -17
  39. package/dist/modules/Order/index.js +757 -395
  40. package/dist/modules/Order/types.d.ts +58 -17
  41. package/dist/modules/Order/types.js +2 -0
  42. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  43. package/dist/modules/Order/utils/manualProductDiscount.js +212 -0
  44. package/dist/modules/Order/utils.d.ts +39 -1
  45. package/dist/modules/Order/utils.js +219 -31
  46. package/dist/modules/Quotation/index.js +16 -5
  47. package/dist/modules/Rules/index.d.ts +4 -0
  48. package/dist/modules/Rules/index.js +26 -10
  49. package/dist/modules/SalesSummary/index.js +4 -2
  50. package/dist/modules/Schedule/index.js +6 -2
  51. package/dist/modules/index.d.ts +1 -0
  52. package/dist/modules/index.js +2 -1
  53. package/dist/server/index.js +10 -6
  54. package/dist/server/modules/order/utils/filterOrders.js +20 -6
  55. package/dist/server/modules/products/index.js +113 -94
  56. package/dist/server/modules/schedule/index.js +13 -6
  57. package/dist/solution/BaseSales/index.d.ts +53 -7
  58. package/dist/solution/BaseSales/index.js +1160 -339
  59. package/dist/solution/BaseSales/types.d.ts +67 -1
  60. package/dist/solution/BaseSales/types.js +3 -1
  61. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  62. package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
  63. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +65 -15
  64. package/dist/solution/BaseSales/utils.js +46 -8
  65. package/dist/solution/BookingByStep/index.d.ts +1 -1
  66. package/dist/solution/BookingTicket/index.d.ts +134 -2
  67. package/dist/solution/BookingTicket/index.js +776 -175
  68. package/dist/solution/BookingTicket/types.d.ts +2 -0
  69. package/dist/solution/BookingTicket/types.js +3 -0
  70. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
  71. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  72. package/dist/solution/ScanOrder/index.d.ts +9 -3
  73. package/dist/solution/ScanOrder/index.js +231 -128
  74. package/dist/solution/ScanOrder/utils.js +46 -8
  75. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  76. package/dist/solution/ShopDiscount/index.js +18 -23
  77. package/dist/solution/VenueBooking/index.d.ts +5 -9
  78. package/dist/solution/VenueBooking/index.js +103 -55
  79. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  80. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
  81. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  82. package/lib/modules/BookingContext/index.d.ts +37 -0
  83. package/lib/modules/BookingContext/index.js +297 -0
  84. package/lib/modules/BookingContext/types.d.ts +102 -0
  85. package/lib/modules/BookingContext/types.js +34 -0
  86. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  87. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +207 -0
  88. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  89. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +141 -0
  90. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
  91. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +198 -0
  92. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  93. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  94. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  95. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  96. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  97. package/lib/modules/BookingContext/utils/index.js +43 -0
  98. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  99. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  100. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  101. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  102. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  103. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  104. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  105. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  106. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  107. package/lib/modules/BookingContext/utils/resources.js +377 -0
  108. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  109. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  110. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  111. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  112. package/lib/modules/Customer/index.d.ts +6 -0
  113. package/lib/modules/Customer/index.js +26 -11
  114. package/lib/modules/Customer/types.d.ts +2 -0
  115. package/lib/modules/Discount/index.d.ts +2 -4
  116. package/lib/modules/Discount/index.js +8 -63
  117. package/lib/modules/Discount/types.d.ts +1 -7
  118. package/lib/modules/Order/index.d.ts +33 -17
  119. package/lib/modules/Order/index.js +402 -148
  120. package/lib/modules/Order/types.d.ts +58 -17
  121. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  122. package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
  123. package/lib/modules/Order/utils.d.ts +39 -1
  124. package/lib/modules/Order/utils.js +197 -22
  125. package/lib/modules/Quotation/index.js +17 -6
  126. package/lib/modules/Rules/index.d.ts +4 -0
  127. package/lib/modules/Rules/index.js +22 -14
  128. package/lib/modules/SalesSummary/index.js +4 -2
  129. package/lib/modules/Schedule/index.js +3 -1
  130. package/lib/modules/index.d.ts +1 -0
  131. package/lib/modules/index.js +3 -1
  132. package/lib/server/index.js +2 -0
  133. package/lib/server/modules/order/utils/filterOrders.js +12 -4
  134. package/lib/server/modules/products/index.js +23 -12
  135. package/lib/server/modules/schedule/index.js +2 -1
  136. package/lib/solution/BaseSales/index.d.ts +53 -7
  137. package/lib/solution/BaseSales/index.js +527 -20
  138. package/lib/solution/BaseSales/types.d.ts +67 -1
  139. package/lib/solution/BaseSales/types.js +3 -1
  140. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  141. package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
  142. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +70 -11
  143. package/lib/solution/BaseSales/utils.js +46 -6
  144. package/lib/solution/BookingByStep/index.d.ts +1 -1
  145. package/lib/solution/BookingTicket/index.d.ts +134 -2
  146. package/lib/solution/BookingTicket/index.js +349 -8
  147. package/lib/solution/BookingTicket/types.d.ts +2 -0
  148. package/lib/solution/BookingTicket/types.js +6 -0
  149. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
  150. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  151. package/lib/solution/ScanOrder/index.d.ts +9 -3
  152. package/lib/solution/ScanOrder/index.js +147 -66
  153. package/lib/solution/ScanOrder/utils.js +46 -6
  154. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  155. package/lib/solution/ShopDiscount/index.js +2 -4
  156. package/lib/solution/VenueBooking/index.d.ts +5 -9
  157. package/lib/solution/VenueBooking/index.js +50 -14
  158. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  159. package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
  160. package/package.json +2 -2
@@ -13,7 +13,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
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 dayjs from 'dayjs';
15
15
  import Decimal from 'decimal.js';
16
- import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
16
+ import { composeLinePrice, createUuidV4, resolveManualOverrideLineOriginalPrice, sumOptionUnitPrice } from "../../modules/Order/utils";
17
+ import { ensureManualProductDiscountList } from "../../modules/Order/utils/manualProductDiscount";
17
18
 
18
19
  /**
19
20
  * 构建金额全为 0 的空 summary。
@@ -480,17 +481,42 @@ export function getProductIdentityIndex(products, identity) {
480
481
  * - 因此多次 normalize 不会重复叠加 option/bundle。
481
482
  */
482
483
  export function normalizeOrderProduct(product) {
483
- var _product$metadata, _metadata$origin, _variantList$find, _product$is_charge_ta;
484
+ var _product$metadata, _metadata$origin, _metadata$origin2, _variantList$find, _product$is_charge_ta;
484
485
  var metadata = _objectSpread({}, product.metadata || {});
485
486
  // 不透明 identity 契约:每条订单行必须带 identity_key。
486
487
  // 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
487
488
  var resolvedIdentityKey = (_product$metadata = product.metadata) !== null && _product$metadata !== void 0 && _product$metadata.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
488
489
  metadata.unique_identification_number = resolvedIdentityKey;
489
- var normalizedBundle = (product.product_bundle || []).map(function (item) {
490
- var _ref4, _item$bundle_selling_, _ref5, _ref6, _item$price2, _ref7, _item$price_type, _ref8, _item$price_type_ext;
490
+ var priceOverride = metadata.price_override;
491
+ var originOtherBundle = (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin._extend) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin.other) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.bundle;
492
+ var bundleInput = product.product_bundle || [];
493
+ if (priceOverride !== undefined && priceOverride !== null && priceOverride !== '' && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
494
+ var priceById = new Map();
495
+ originOtherBundle.forEach(function (item) {
496
+ var _item$price2;
497
+ if ((item === null || item === void 0 ? void 0 : item.id) == null) return;
498
+ var unit = (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.bundle_selling_price;
499
+ if (unit === undefined || unit === null) return;
500
+ priceById.set(String(item.id), String(unit));
501
+ });
502
+ var base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
503
+ bundleInput = base.map(function (item) {
504
+ var unit = priceById.get(String(item === null || item === void 0 ? void 0 : item.id));
505
+ if (unit === undefined) return item;
506
+ return _objectSpread(_objectSpread({}, item), {}, {
507
+ price: unit,
508
+ bundle_selling_price: unit
509
+ });
510
+ });
511
+ }
512
+ var normalizedBundle = bundleInput.map(function (item) {
513
+ var _item$bundle_id2, _item$bundle_product_, _item$bundle_group_id, _ref4, _item$bundle_selling_, _ref5, _ref6, _item$price3, _ref7, _item$price_type, _ref8, _item$price_type_ext;
491
514
  return _objectSpread(_objectSpread({}, item), {}, {
515
+ bundle_id: (_item$bundle_id2 = item.bundle_id) !== null && _item$bundle_id2 !== void 0 ? _item$bundle_id2 : item.id,
516
+ bundle_product_id: (_item$bundle_product_ = item.bundle_product_id) !== null && _item$bundle_product_ !== void 0 ? _item$bundle_product_ : item._bundle_product_id,
517
+ bundle_group_id: (_item$bundle_group_id = item.bundle_group_id) !== null && _item$bundle_group_id !== void 0 ? _item$bundle_group_id : item.group_id,
492
518
  bundle_selling_price: (_ref4 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref4 !== void 0 ? _ref4 : '0.00',
493
- price: (_ref5 = (_ref6 = (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.custom_price) !== null && _ref6 !== void 0 ? _ref6 : item.bundle_selling_price) !== null && _ref5 !== void 0 ? _ref5 : '0.00',
519
+ price: (_ref5 = (_ref6 = (_item$price3 = item.price) !== null && _item$price3 !== void 0 ? _item$price3 : item.custom_price) !== null && _ref6 !== void 0 ? _ref6 : item.bundle_selling_price) !== null && _ref5 !== void 0 ? _ref5 : '0.00',
494
520
  price_type: (_ref7 = (_item$price_type = item.price_type) !== null && _item$price_type !== void 0 ? _item$price_type : item.custom_price_type) !== null && _ref7 !== void 0 ? _ref7 : '',
495
521
  price_type_ext: (_ref8 = (_item$price_type_ext = item.price_type_ext) !== null && _item$price_type_ext !== void 0 ? _item$price_type_ext : item.custom_price_type_ext) !== null && _ref8 !== void 0 ? _ref8 : ''
496
522
  });
@@ -508,7 +534,7 @@ export function normalizeOrderProduct(product) {
508
534
  // 6) 入参 selling_price(最末兜底,新添加路径 caller 只给 selling_price)
509
535
  var isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === '2';
510
536
  var variantId = Number(product.product_variant_id || 0);
511
- var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.variant : null;
537
+ var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin2 = metadata.origin) === null || _metadata$origin2 === void 0 ? void 0 : _metadata$origin2.variant : null;
512
538
  var variantPrice = Array.isArray(variantList) ? (_variantList$find = variantList.find(function (v) {
513
539
  return Number(v === null || v === void 0 ? void 0 : v.id) === variantId;
514
540
  })) === null || _variantList$find === void 0 ? void 0 : _variantList$find.price : undefined;
@@ -578,6 +604,18 @@ export function normalizeOrderProduct(product) {
578
604
  bundle: normalizedBundle,
579
605
  useOriginalBundle: true
580
606
  });
607
+ var finalOriginalPrice = resolveManualOverrideLineOriginalPrice({
608
+ num: product.num,
609
+ metadata: metadata,
610
+ lineOriginalPrice: product.original_price
611
+ }, composedOriginalPrice);
612
+ var discountList = ensureManualProductDiscountList({
613
+ discountList: product.discount_list,
614
+ metadata: metadata,
615
+ originalPrice: finalOriginalPrice,
616
+ sellingPrice: composedSellingPrice,
617
+ quantity: getSafeProductNum(product.num)
618
+ });
581
619
  return {
582
620
  order_detail_id: product.order_detail_id || null,
583
621
  product_id: product.product_id,
@@ -585,10 +623,10 @@ export function normalizeOrderProduct(product) {
585
623
  product_variant_id: product.product_variant_id,
586
624
  product_option_item: normalizedOptions,
587
625
  selling_price: composedSellingPrice,
588
- original_price: composedOriginalPrice,
626
+ original_price: finalOriginalPrice,
589
627
  tax_fee: product.tax_fee || '0.00',
590
628
  is_charge_tax: (_product$is_charge_ta = product.is_charge_tax) !== null && _product$is_charge_ta !== void 0 ? _product$is_charge_ta : 0,
591
- discount_list: product.discount_list || [],
629
+ discount_list: discountList,
592
630
  product_bundle: normalizedBundle,
593
631
  metadata: metadata,
594
632
  note: product.note != null ? String(product.note) : ''
@@ -46,7 +46,6 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
46
46
  discountList: Discount[];
47
47
  type: "server" | "clientCalc";
48
48
  unavailableReason?: UnavailableReason;
49
- unavailableReasonKey?: string | null;
50
49
  }>;
51
50
  calcDiscountApplicableProductTotalPrice(discount: Discount): number | undefined;
52
51
  private getCustomer;
@@ -406,7 +406,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
406
406
  key: "scanCode",
407
407
  value: function () {
408
408
  var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, customerId) {
409
- var _this$store$discount3, _this$store$bookingSu2, resultDiscountWithReason, resultDiscountList, unavailableReasonKey, rulesModule, withScanList, currentSelectedDiscountList, _ref2, newProductList, newDiscountList, isAvailable, unavailableReason, _this$options$otherPa6;
409
+ var _this$store$discount3, _this$store$bookingSu2, resultDiscountList, rulesModule, withScanList, currentSelectedDiscountList, _ref2, newProductList, newDiscountList, isAvailable, unavailableReason, _this$options$otherPa6;
410
410
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
411
411
  while (1) switch (_context5.prev = _context5.next) {
412
412
  case 0:
@@ -422,16 +422,12 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
422
422
  _context5.next = 6;
423
423
  break;
424
424
  }
425
- _context5.t0 = {
426
- discountList: [],
427
- unavailableReasonKey: null
428
- };
425
+ _context5.t0 = [];
429
426
  case 6:
430
- resultDiscountWithReason = _context5.t0;
431
- resultDiscountList = resultDiscountWithReason.discountList, unavailableReasonKey = resultDiscountWithReason.unavailableReasonKey;
427
+ resultDiscountList = _context5.t0;
432
428
  rulesModule = this.store.rules;
433
429
  if (rulesModule) {
434
- _context5.next = 11;
430
+ _context5.next = 10;
435
431
  break;
436
432
  }
437
433
  return _context5.abrupt("return", {
@@ -441,19 +437,18 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
441
437
  discountList: this.getDiscountList(),
442
438
  unavailableReason: UnavailableReason.Unknown
443
439
  });
444
- case 11:
440
+ case 10:
445
441
  if (resultDiscountList.length) {
446
- _context5.next = 13;
442
+ _context5.next = 12;
447
443
  break;
448
444
  }
449
445
  return _context5.abrupt("return", {
450
446
  type: "server",
451
447
  isAvailable: false,
452
448
  productList: this.store.productList || [],
453
- discountList: this.getDiscountList(),
454
- unavailableReasonKey: unavailableReasonKey
449
+ discountList: this.getDiscountList()
455
450
  });
456
- case 13:
451
+ case 12:
457
452
  withScanList = resultDiscountList.map(function (item) {
458
453
  return _objectSpread(_objectSpread({}, item), {}, {
459
454
  isScan: true
@@ -467,7 +462,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
467
462
  return m.id === n.id;
468
463
  });
469
464
  }))) {
470
- _context5.next = 17;
465
+ _context5.next = 16;
471
466
  break;
472
467
  }
473
468
  return _context5.abrupt("return", {
@@ -476,7 +471,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
476
471
  productList: this.store.productList || [],
477
472
  discountList: this.getDiscountList()
478
473
  });
479
- case 17:
474
+ case 16:
480
475
  _ref2 = rulesModule.isDiscountListAvailable({
481
476
  productList: this.store.productList || [],
482
477
  oldDiscountList: this.getDiscountList(),
@@ -490,19 +485,19 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
490
485
  discountList: this.getDiscountList()
491
486
  }, newProductList = _ref2.productList, newDiscountList = _ref2.discountList, isAvailable = _ref2.isAvailable, unavailableReason = _ref2.unavailableReason;
492
487
  if (!isAvailable) {
493
- _context5.next = 25;
488
+ _context5.next = 24;
494
489
  break;
495
490
  }
496
491
  this.setDiscountList(newDiscountList || []);
497
492
  this.store.originalDiscountList = newDiscountList || [];
498
493
  this.setProductList(newProductList || []);
499
494
  if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop' && !((resultDiscountList[0].customer_id || 1) === 1))) {
500
- _context5.next = 25;
495
+ _context5.next = 24;
501
496
  break;
502
497
  }
503
- _context5.next = 25;
498
+ _context5.next = 24;
504
499
  return this.getCustomerWallet(resultDiscountList[0].customer_id);
505
- case 25:
500
+ case 24:
506
501
  return _context5.abrupt("return", {
507
502
  type: "clientCalc",
508
503
  isAvailable: isAvailable || false,
@@ -510,8 +505,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
510
505
  discountList: newDiscountList || this.getDiscountList(),
511
506
  unavailableReason: unavailableReason
512
507
  });
513
- case 28:
514
- _context5.prev = 28;
508
+ case 27:
509
+ _context5.prev = 27;
515
510
  _context5.t1 = _context5["catch"](0);
516
511
  console.error('[ShopDiscount] 扫码出错:', _context5.t1);
517
512
  return _context5.abrupt("return", {
@@ -521,11 +516,11 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
521
516
  discountList: this.getDiscountList(),
522
517
  unavailableReason: UnavailableReason.Unknown
523
518
  });
524
- case 32:
519
+ case 31:
525
520
  case "end":
526
521
  return _context5.stop();
527
522
  }
528
- }, _callee5, this, [[0, 28]]);
523
+ }, _callee5, this, [[0, 27]]);
529
524
  }));
530
525
  function scanCode(_x4, _x5) {
531
526
  return _scanCode.apply(this, arguments);
@@ -2,7 +2,7 @@ import { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../../modules/BaseModule';
3
3
  import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
4
4
  import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
5
- import type { UpdateProductInOrderParams } from '../../modules/Order/types';
5
+ import type { UpdateOrderProductParams } from '../../modules/Order/types';
6
6
  import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
7
7
  import type { ProductData } from '../../modules/Product/types';
8
8
  import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
@@ -41,6 +41,8 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
41
41
  private loadOpenDataConfigInFlight;
42
42
  private static readonly OPEN_DATA_CACHE_TTL;
43
43
  private getLoggerContext;
44
+ private safeStringify;
45
+ private pickErrorMessage;
44
46
  private serializeError;
45
47
  private addVenueBookingLog;
46
48
  private logMethodStart;
@@ -148,13 +150,7 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
148
150
  customerId: number;
149
151
  }): Promise<void>;
150
152
  private recalculateOrderPricesFromQuotation;
151
- scanCode(code: string, customerId?: number): Promise<{
152
- isAvailable: boolean;
153
- discountList: import("../../modules/Discount").Discount[];
154
- type: "server" | "clientCalc";
155
- unavailableReason?: import("../../modules/Rules/types").UnavailableReason | undefined;
156
- unavailableReasonKey?: string | null | undefined;
157
- }>;
153
+ scanCode(code: string, customerId?: number): Promise<import("../../modules/Order/types").OrderScanCodeResult>;
158
154
  /** 获取当前折扣列表(包装 order.getDiscountList) */
159
155
  getDiscountList(): import("../../modules/Discount").Discount[];
160
156
  /** 勾选/取消勾选某张折扣券,重新计算折扣并持久化 */
@@ -167,7 +163,7 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
167
163
  getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
168
164
  submitOrder<T = any>(): Promise<T>;
169
165
  addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
170
- updateProductInOrder(params: UpdateProductInOrderParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
166
+ updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
171
167
  removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
172
168
  getProductList(): Promise<ProductData[]>;
173
169
  private loadOpenDataConfig;
@@ -44,7 +44,7 @@ import { ItemRuleEvaluator } from "../../model/strategy/adapter/itemRule";
44
44
  import { extractResourceIds, buildResourceProductMap } from "./utils/resource";
45
45
  import { buildTimeSlotGrid, isBusinessHoursCrossDay, generateTimeLabels } from "./utils/timeSlot";
46
46
  import { buildDateRangeSummary } from "./utils/dateSummary";
47
- import { mergeConsecutiveSlots, expandMergedSlotToIndividual, buildVenueIdentityKey, buildVenueBookingEntry, buildPriceBreakdown } from "./utils/slotMerge";
47
+ import { mergeConsecutiveSlots, expandMergedSlotToIndividual, buildVenueIdentityKey, buildVenueBookingEntry, buildVenueResourceMetadata, buildPriceBreakdown } from "./utils/slotMerge";
48
48
  import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
49
49
  import { OrderModule } from "../../modules/Order";
50
50
  import { RegisterAndLoginHooks } from "../RegisterAndLogin/types";
@@ -112,6 +112,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
112
112
  moduleName: 'venueBooking'
113
113
  };
114
114
  }
115
+ }, {
116
+ key: "safeStringify",
117
+ value: function safeStringify(value) {
118
+ try {
119
+ return JSON.stringify(value);
120
+ } catch (_unused) {
121
+ return undefined;
122
+ }
123
+ }
124
+ }, {
125
+ key: "pickErrorMessage",
126
+ value: function pickErrorMessage(error) {
127
+ var _error$data, _error$response, _error$error;
128
+ var candidates = [error.message, (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.message, (_error$response = error.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message, (_error$error = error.error) === null || _error$error === void 0 ? void 0 : _error$error.message];
129
+ for (var _i = 0, _candidates = candidates; _i < _candidates.length; _i++) {
130
+ var candidate = _candidates[_i];
131
+ if (typeof candidate === 'string' && candidate.trim()) return candidate;
132
+ }
133
+ return undefined;
134
+ }
115
135
  }, {
116
136
  key: "serializeError",
117
137
  value: function serializeError(error) {
@@ -122,6 +142,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
122
142
  stack: error.stack
123
143
  };
124
144
  }
145
+ if (error && _typeof(error) === 'object') {
146
+ var raw = error;
147
+ var message = this.pickErrorMessage(raw) || this.safeStringify(raw) || String(error);
148
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typeof raw.name === 'string' ? {
149
+ name: raw.name
150
+ } : {}), {}, {
151
+ message: message
152
+ }, 'code' in raw ? {
153
+ code: raw.code
154
+ } : {}), 'status' in raw ? {
155
+ status: raw.status
156
+ } : {}), this.safeStringify(raw) ? {
157
+ raw: this.safeStringify(raw)
158
+ } : {});
159
+ }
125
160
  return {
126
161
  message: String(error)
127
162
  };
@@ -246,8 +281,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
246
281
  value: function resolveCustomerIdFromLoginPayload(payload) {
247
282
  var _payload$user, _payload$user2, _payload$user3, _payload$user4, _payload$account, _payload$account2, _payload$account3, _payload$_origin;
248
283
  var candidates = [payload === null || payload === void 0 ? void 0 : payload.customerId, payload === null || payload === void 0 ? void 0 : payload.customer_id, payload === null || payload === void 0 ? void 0 : payload.id, payload === null || payload === void 0 || (_payload$user = payload.user) === null || _payload$user === void 0 ? void 0 : _payload$user.customerId, payload === null || payload === void 0 || (_payload$user2 = payload.user) === null || _payload$user2 === void 0 ? void 0 : _payload$user2.customer_id, payload === null || payload === void 0 || (_payload$user3 = payload.user) === null || _payload$user3 === void 0 ? void 0 : _payload$user3.id, payload === null || payload === void 0 || (_payload$user4 = payload.user) === null || _payload$user4 === void 0 || (_payload$user4 = _payload$user4._origin) === null || _payload$user4 === void 0 ? void 0 : _payload$user4.customer_id, payload === null || payload === void 0 || (_payload$account = payload.account) === null || _payload$account === void 0 ? void 0 : _payload$account.customerId, payload === null || payload === void 0 || (_payload$account2 = payload.account) === null || _payload$account2 === void 0 ? void 0 : _payload$account2.customer_id, payload === null || payload === void 0 || (_payload$account3 = payload.account) === null || _payload$account3 === void 0 ? void 0 : _payload$account3.id, payload === null || payload === void 0 || (_payload$_origin = payload._origin) === null || _payload$_origin === void 0 ? void 0 : _payload$_origin.customer_id];
249
- for (var _i = 0, _candidates = candidates; _i < _candidates.length; _i++) {
250
- var candidate = _candidates[_i];
284
+ for (var _i2 = 0, _candidates2 = candidates; _i2 < _candidates2.length; _i2++) {
285
+ var candidate = _candidates2[_i2];
251
286
  var customerId = this.normalizeCustomerId(candidate);
252
287
  if (customerId) return customerId;
253
288
  }
@@ -499,12 +534,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
499
534
  var _this4$store$order, _this4$otherParams, _this4$otherParams2, _this4$otherParams3, _this4$otherParams4;
500
535
  _this4.store[step] = targetModule;
501
536
  var initialState = step === 'salesSummary' ? {
502
- // TODO(Order types): VenueBooking should read OrderState.summary instead of tempOrder.summary.
503
537
  summary: ((_this4$store$order = _this4.store.order) === null || _this4$store$order === void 0 || (_this4$store$order = _this4$store$order.getTempOrder()) === null || _this4$store$order === void 0 ? void 0 : _this4$store$order.summary) || createEmptySummary()
504
538
  } : {};
505
539
  var loggerProvider = ((_this4$otherParams = _this4.otherParams) === null || _this4$otherParams === void 0 ? void 0 : _this4$otherParams.loggerProvider) || 'feishu';
506
540
  var loggerConfig = ((_this4$otherParams2 = _this4.otherParams) === null || _this4$otherParams2 === void 0 ? void 0 : _this4$otherParams2.loggerConfig) || {
507
- feishu: {}
541
+ feishu: {
542
+ webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
543
+ errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
544
+ }
508
545
  };
509
546
  _this4.core.registerModule(targetModule, {
510
547
  initialState: initialState,
@@ -829,24 +866,28 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
829
866
  }
830
867
  throw new Error('addonProducts 模块未初始化');
831
868
  case 6:
869
+ _context11.next = 8;
870
+ return this.loadOpenDataConfig();
871
+ case 8:
832
872
  associatedMenus = ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 || (_this$otherParams7 = _this$otherParams7.openData) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7['menu.associated_menus']) || [];
833
873
  if (associatedMenus.length) {
834
- _context11.next = 9;
874
+ _context11.next = 12;
835
875
  break;
836
876
  }
877
+ this.logMethodError('loadAllProducts', new Error('未获取到餐牌配置(menu.associated_menus),请检查 OpenData 配置'));
837
878
  throw new Error('未获取到餐牌配置(menu.associated_menus),请检查 OpenData 配置');
838
- case 9:
879
+ case 12:
839
880
  menuListIds = associatedMenus.map(function (n) {
840
881
  return Number(n.value);
841
882
  });
842
- _context11.next = 12;
883
+ _context11.next = 15;
843
884
  return this.store.venueProducts.loadProducts({
844
885
  menu_list_ids: menuListIds,
845
886
  cacheId: this.cacheId,
846
887
  schedule_date: dayjs().format('YYYY-MM-DD'),
847
888
  schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
848
889
  });
849
- case 12:
890
+ case 15:
850
891
  allProducts = _context11.sent;
851
892
  list = Array.isArray(allProducts) ? allProducts : [];
852
893
  venueList = list.filter(function (p) {
@@ -874,16 +915,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
874
915
  venueProducts: venueList,
875
916
  addonProducts: addonList
876
917
  });
877
- case 25:
878
- _context11.prev = 25;
918
+ case 28:
919
+ _context11.prev = 28;
879
920
  _context11.t0 = _context11["catch"](1);
880
921
  this.logMethodError('loadAllProducts', _context11.t0);
881
922
  throw _context11.t0;
882
- case 29:
923
+ case 32:
883
924
  case "end":
884
925
  return _context11.stop();
885
926
  }
886
- }, _callee11, this, [[1, 25]]);
927
+ }, _callee11, this, [[1, 28]]);
887
928
  }));
888
929
  function _doLoadAllProducts() {
889
930
  return _doLoadAllProducts2.apply(this, arguments);
@@ -995,7 +1036,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
995
1036
  key: "fetchResourceAvailability",
996
1037
  value: function () {
997
1038
  var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
998
- var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator2, _step2, item, _i2, _rawData, _item, mappings, _iterator3, _step3, mapping;
1039
+ var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator2, _step2, item, _i3, _rawData, _item, mappings, _iterator3, _step3, mapping;
999
1040
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1000
1041
  while (1) switch (_context15.prev = _context15.next) {
1001
1042
  case 0:
@@ -1063,13 +1104,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1063
1104
  }
1064
1105
  }
1065
1106
  this.store.rawResourceData = rawData;
1066
- _i2 = 0, _rawData = rawData;
1107
+ _i3 = 0, _rawData = rawData;
1067
1108
  case 24:
1068
- if (!(_i2 < _rawData.length)) {
1109
+ if (!(_i3 < _rawData.length)) {
1069
1110
  _context15.next = 34;
1070
1111
  break;
1071
1112
  }
1072
- _item = _rawData[_i2];
1113
+ _item = _rawData[_i3];
1073
1114
  mappings = this.resourceProductMap.get(_item.resourceId);
1074
1115
  if (mappings) {
1075
1116
  _context15.next = 29;
@@ -1090,7 +1131,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1090
1131
  _iterator3.f();
1091
1132
  }
1092
1133
  case 31:
1093
- _i2++;
1134
+ _i3++;
1094
1135
  _context15.next = 24;
1095
1136
  break;
1096
1137
  case 34:
@@ -1628,7 +1669,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1628
1669
  form_id: (_rawResource$form_id = rawResource === null || rawResource === void 0 ? void 0 : rawResource.form_id) !== null && _rawResource$form_id !== void 0 ? _rawResource$form_id : mapping.formId,
1629
1670
  relation_id: resourceId,
1630
1671
  capacity: 1,
1631
- metadata: {}
1672
+ metadata: buildVenueResourceMetadata({
1673
+ mapping: mapping,
1674
+ rawResource: rawResource
1675
+ })
1632
1676
  };
1633
1677
  if (childRawResources && childRawResources.length) {
1634
1678
  resourceEntry.children = childRawResources.map(function (child) {
@@ -2182,7 +2226,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2182
2226
  });
2183
2227
  case 50:
2184
2228
  this.store.order.persistTempOrder();
2185
- // TODO(Order types): VenueBooking should read OrderState.summary instead of tempOrder.summary.
2186
2229
  finalSummary = ((_this$store$order$get = this.store.order.getTempOrder()) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.summary) || null;
2187
2230
  finalProduct = ((_this$store$order$get2 = this.store.order.getTempOrder()) === null || _this$store$order$get2 === void 0 || (_this$store$order$get2 = _this$store$order$get2.products) === null || _this$store$order$get2 === void 0 ? void 0 : _this$store$order$get2[0]) || null;
2188
2231
  this.logMethodSuccess('setDiscountSelected', params);
@@ -2405,14 +2448,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2405
2448
  return addProductToOrder;
2406
2449
  }()
2407
2450
  }, {
2408
- key: "updateProductInOrder",
2451
+ key: "updateOrderProduct",
2409
2452
  value: function () {
2410
- var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
2453
+ var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
2411
2454
  var products;
2412
2455
  return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2413
2456
  while (1) switch (_context26.prev = _context26.next) {
2414
2457
  case 0:
2415
- this.logMethodStart('updateProductInOrder', {
2458
+ this.logMethodStart('updateOrderProduct', {
2416
2459
  product_id: params.product_id,
2417
2460
  product_variant_id: params.product_variant_id
2418
2461
  });
@@ -2424,7 +2467,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2424
2467
  throw new Error('order 模块未初始化');
2425
2468
  case 4:
2426
2469
  _context26.next = 6;
2427
- return this.store.order.updateProductInOrder(params);
2470
+ return this.store.order.updateOrderProduct(params);
2428
2471
  case 6:
2429
2472
  products = _context26.sent;
2430
2473
  _context26.next = 9;
@@ -2433,14 +2476,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2433
2476
  _context26.next = 11;
2434
2477
  return this.refreshCartValidationPassed();
2435
2478
  case 11:
2436
- this.logMethodSuccess('updateProductInOrder', {
2479
+ this.logMethodSuccess('updateOrderProduct', {
2437
2480
  productCount: products.length
2438
2481
  });
2439
2482
  return _context26.abrupt("return", products);
2440
2483
  case 15:
2441
2484
  _context26.prev = 15;
2442
2485
  _context26.t0 = _context26["catch"](1);
2443
- this.logMethodError('updateProductInOrder', _context26.t0);
2486
+ this.logMethodError('updateOrderProduct', _context26.t0);
2444
2487
  throw _context26.t0;
2445
2488
  case 19:
2446
2489
  case "end":
@@ -2448,10 +2491,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2448
2491
  }
2449
2492
  }, _callee26, this, [[1, 15]]);
2450
2493
  }));
2451
- function updateProductInOrder(_x17) {
2452
- return _updateProductInOrder.apply(this, arguments);
2494
+ function updateOrderProduct(_x17) {
2495
+ return _updateOrderProduct.apply(this, arguments);
2453
2496
  }
2454
- return updateProductInOrder;
2497
+ return updateOrderProduct;
2455
2498
  }()
2456
2499
  }, {
2457
2500
  key: "removeProductFromOrder",
@@ -2498,7 +2541,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2498
2541
  }
2499
2542
  return _context27.abrupt("continue", 20);
2500
2543
  case 18:
2501
- // TODO(Order types): VenueBooking should use metadata.unique_identification_number only.
2502
2544
  if (product.identity_key) venueProductUids.add(String(product.identity_key));
2503
2545
  if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
2504
2546
  venueBookingUids.add(String(product.metadata.booking_uid));
@@ -2593,8 +2635,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2593
2635
  key: "loadOpenDataConfig",
2594
2636
  value: function () {
2595
2637
  var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2596
- var _this11 = this;
2597
- var lastFetchedAt, cachedData;
2638
+ var lastFetchedAt, cachedData, openDataConfig;
2598
2639
  return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2599
2640
  while (1) switch (_context29.prev = _context29.next) {
2600
2641
  case 0:
@@ -2614,27 +2655,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2614
2655
  return _context29.abrupt("return", cachedData);
2615
2656
  case 7:
2616
2657
  if (!this.loadOpenDataConfigInFlight) {
2617
- _context29.next = 9;
2658
+ _context29.next = 11;
2618
2659
  break;
2619
2660
  }
2620
- return _context29.abrupt("return", this.loadOpenDataConfigInFlight);
2621
- case 9:
2661
+ _context29.next = 10;
2662
+ return this.loadOpenDataConfigInFlight;
2663
+ case 10:
2664
+ return _context29.abrupt("return", _context29.sent);
2665
+ case 11:
2622
2666
  this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
2623
2667
  scope: 'board',
2624
2668
  target: 'venue_booking+online_store',
2625
2669
  section_code: [].concat(OPEN_DATA_SECTION_CODES)
2626
- }).then(function (openDataConfig) {
2627
- _this11.otherParams.openData = openDataConfig;
2628
- return openDataConfig;
2629
- }).finally(function () {
2630
- _this11.loadOpenDataConfigInFlight = null;
2631
2670
  });
2632
- return _context29.abrupt("return", this.loadOpenDataConfigInFlight);
2633
- case 11:
2671
+ _context29.prev = 12;
2672
+ _context29.next = 15;
2673
+ return this.loadOpenDataConfigInFlight;
2674
+ case 15:
2675
+ openDataConfig = _context29.sent;
2676
+ this.otherParams.openData = openDataConfig;
2677
+ return _context29.abrupt("return", openDataConfig);
2678
+ case 18:
2679
+ _context29.prev = 18;
2680
+ this.loadOpenDataConfigInFlight = null;
2681
+ return _context29.finish(18);
2682
+ case 21:
2634
2683
  case "end":
2635
2684
  return _context29.stop();
2636
2685
  }
2637
- }, _callee29, this);
2686
+ }, _callee29, this, [[12,, 18, 21]]);
2638
2687
  }));
2639
2688
  function loadOpenDataConfig() {
2640
2689
  return _loadOpenDataConfig.apply(this, arguments);
@@ -2780,8 +2829,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2780
2829
  var key = buildProductKey(productId, normalizedVariantId);
2781
2830
  if (!sourceMap.has(key)) sourceMap.set(key, node);
2782
2831
  }
2783
- for (var _i3 = 0, _Object$values = Object.values(node); _i3 < _Object$values.length; _i3++) {
2784
- var childValue = _Object$values[_i3];
2832
+ for (var _i4 = 0, _Object$values = Object.values(node); _i4 < _Object$values.length; _i4++) {
2833
+ var childValue = _Object$values[_i4];
2785
2834
  if (childValue && _typeof(childValue) === 'object') collectFromValue(childValue);
2786
2835
  }
2787
2836
  };
@@ -2814,7 +2863,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2814
2863
  key: "ensureItemRuleConfigsLoaded",
2815
2864
  value: function () {
2816
2865
  var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
2817
- var _this12 = this;
2866
+ var _this11 = this;
2818
2867
  return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2819
2868
  while (1) switch (_context34.prev = _context34.next) {
2820
2869
  case 0:
@@ -2835,19 +2884,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2835
2884
  return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2836
2885
  while (1) switch (_context33.prev = _context33.next) {
2837
2886
  case 0:
2838
- runtimeConfig = _this12.getItemRuleRuntimeConfig();
2887
+ runtimeConfig = _this11.getItemRuleRuntimeConfig();
2839
2888
  staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
2840
2889
  if (!(staticConfigs.length > 0)) {
2841
2890
  _context33.next = 6;
2842
2891
  break;
2843
2892
  }
2844
- _this12.itemRuleConfigs = staticConfigs;
2845
- _this12.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
2846
- return _context33.abrupt("return", _this12.itemRuleConfigs);
2893
+ _this11.itemRuleConfigs = staticConfigs;
2894
+ _this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
2895
+ return _context33.abrupt("return", _this11.itemRuleConfigs);
2847
2896
  case 6:
2848
- _this12.itemRuleConfigs = [];
2849
- _this12.itemRuleEvaluator.setStrategyConfigs([]);
2850
- return _context33.abrupt("return", _this12.itemRuleConfigs);
2897
+ _this11.itemRuleConfigs = [];
2898
+ _this11.itemRuleEvaluator.setStrategyConfigs([]);
2899
+ return _context33.abrupt("return", _this11.itemRuleConfigs);
2851
2900
  case 9:
2852
2901
  case "end":
2853
2902
  return _context33.stop();
@@ -3028,7 +3077,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3028
3077
  item_rule_prefill: true,
3029
3078
  item_rule_id: prefillItem.ruleId
3030
3079
  }),
3031
- // TODO(Order types): migrate VenueBooking prefill origin runtime into tempOrder._extend.
3032
3080
  _origin: sourceItem ? _objectSpread(_objectSpread({}, targetProduct._origin || {}), sourceItem) : targetProduct._origin
3033
3081
  });
3034
3082
  if (delta > 0 || Boolean(sourceItem && (!targetProduct._origin || ((_origin2 = targetProduct._origin) === null || _origin2 === void 0 ? void 0 : _origin2.price) !== (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price)))) {
@@ -3309,7 +3357,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3309
3357
  var raw = this.window.sessionStorage.getItem(key) || '{}';
3310
3358
  var parsed = JSON.parse(raw);
3311
3359
  return parsed && _typeof(parsed) === 'object' ? parsed : {};
3312
- } catch (_unused2) {
3360
+ } catch (_unused3) {
3313
3361
  return {};
3314
3362
  }
3315
3363
  }