@pisell/pisellos 2.3.122 → 2.3.124

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 (92) hide show
  1. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  2. package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -2
  3. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +58 -19
  4. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +24 -12
  5. package/dist/modules/Customer/index.js +6 -3
  6. package/dist/modules/Customer/types.d.ts +2 -0
  7. package/dist/modules/Discount/availability.d.ts +7 -0
  8. package/dist/modules/Discount/availability.js +49 -0
  9. package/dist/modules/Discount/entitlementPass.d.ts +34 -0
  10. package/dist/modules/Discount/entitlementPass.js +147 -0
  11. package/dist/modules/Discount/index.d.ts +2 -2
  12. package/dist/modules/Discount/index.js +37 -151
  13. package/dist/modules/Discount/types.d.ts +36 -5
  14. package/dist/modules/Order/index.d.ts +6 -0
  15. package/dist/modules/Order/index.js +437 -229
  16. package/dist/modules/Order/types.d.ts +1 -0
  17. package/dist/modules/Order/utils/orderCollectionIdentity.js +16 -12
  18. package/dist/modules/Order/utils.d.ts +1 -1
  19. package/dist/modules/Order/utils.js +105 -60
  20. package/dist/modules/Payment/types.d.ts +21 -1
  21. package/dist/modules/Payment/types.js +2 -0
  22. package/dist/modules/Payment/walletpass.d.ts +1 -1
  23. package/dist/modules/Payment/walletpass.js +80 -47
  24. package/dist/modules/Rules/index.d.ts +2 -2
  25. package/dist/modules/Rules/index.js +480 -186
  26. package/dist/modules/Rules/types.d.ts +4 -0
  27. package/dist/server/modules/order/types.d.ts +3 -0
  28. package/dist/server/utils/small-ticket.js +25 -15
  29. package/dist/solution/BaseSales/index.d.ts +1 -0
  30. package/dist/solution/BaseSales/index.js +5 -2
  31. package/dist/solution/BaseSales/types.d.ts +2 -2
  32. package/dist/solution/BaseSales/utils/cartPromotion.js +141 -126
  33. package/dist/solution/BookingTicket/index.d.ts +1 -2
  34. package/dist/solution/BookingTicket/index.js +60 -63
  35. package/dist/solution/BookingTicket/types.d.ts +5 -1
  36. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
  37. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +338 -147
  38. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
  39. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
  40. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +19 -6
  41. package/dist/solution/ShopDiscount/index.d.ts +2 -0
  42. package/dist/solution/ShopDiscount/index.js +99 -42
  43. package/dist/solution/ShopDiscount/utils.d.ts +4 -2
  44. package/dist/solution/ShopDiscount/utils.js +43 -23
  45. package/dist/solution/UnifiedBookingSales/index.js +2 -2
  46. package/lib/model/strategy/adapter/promotion/index.js +46 -1
  47. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  48. package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -0
  49. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +35 -6
  50. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +13 -6
  51. package/lib/modules/Customer/index.js +5 -1
  52. package/lib/modules/Customer/types.d.ts +2 -0
  53. package/lib/modules/Discount/availability.d.ts +7 -0
  54. package/lib/modules/Discount/availability.js +43 -0
  55. package/lib/modules/Discount/entitlementPass.d.ts +34 -0
  56. package/lib/modules/Discount/entitlementPass.js +141 -0
  57. package/lib/modules/Discount/index.d.ts +2 -2
  58. package/lib/modules/Discount/index.js +23 -129
  59. package/lib/modules/Discount/types.d.ts +36 -5
  60. package/lib/modules/Order/index.d.ts +6 -0
  61. package/lib/modules/Order/index.js +213 -40
  62. package/lib/modules/Order/types.d.ts +1 -0
  63. package/lib/modules/Order/utils/orderCollectionIdentity.js +14 -11
  64. package/lib/modules/Order/utils.d.ts +1 -1
  65. package/lib/modules/Order/utils.js +43 -3
  66. package/lib/modules/Payment/types.d.ts +21 -1
  67. package/lib/modules/Payment/types.js +1 -0
  68. package/lib/modules/Payment/walletpass.d.ts +1 -1
  69. package/lib/modules/Payment/walletpass.js +29 -9
  70. package/lib/modules/Rules/index.d.ts +2 -2
  71. package/lib/modules/Rules/index.js +357 -110
  72. package/lib/modules/Rules/types.d.ts +4 -0
  73. package/lib/server/modules/order/types.d.ts +3 -0
  74. package/lib/server/utils/small-ticket.js +25 -14
  75. package/lib/solution/BaseSales/index.d.ts +1 -0
  76. package/lib/solution/BaseSales/index.js +5 -2
  77. package/lib/solution/BaseSales/types.d.ts +2 -2
  78. package/lib/solution/BaseSales/utils/cartPromotion.js +12 -4
  79. package/lib/solution/BookingTicket/index.d.ts +1 -2
  80. package/lib/solution/BookingTicket/index.js +36 -33
  81. package/lib/solution/BookingTicket/types.d.ts +5 -1
  82. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
  83. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +174 -42
  84. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
  85. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
  86. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +11 -3
  87. package/lib/solution/ShopDiscount/index.d.ts +2 -0
  88. package/lib/solution/ShopDiscount/index.js +55 -9
  89. package/lib/solution/ShopDiscount/utils.d.ts +4 -2
  90. package/lib/solution/ShopDiscount/utils.js +42 -25
  91. package/lib/solution/UnifiedBookingSales/index.js +2 -2
  92. package/package.json +1 -1
@@ -199,6 +199,7 @@ export interface PointCardSnapshotItem {
199
199
  id: number | string;
200
200
  tag: 'point_card';
201
201
  product_id?: number | string;
202
+ code?: string;
202
203
  product_name: string;
203
204
  par_value: string;
204
205
  used_par_value: string;
@@ -12,6 +12,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
12
12
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
13
  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); }
14
14
  import { cloneDeep } from 'lodash-es';
15
+ import { isFullCoveragePass } from "../../Discount/entitlementPass";
15
16
  var IDENTITY_CONFIG = {
16
17
  product: {
17
18
  persistentIdField: 'order_detail_id',
@@ -74,22 +75,25 @@ export function setOrderCollectionUid(kind, item, uid) {
74
75
  delete record[uidField];
75
76
  return record;
76
77
  }
77
- function getGoodPassResourceId(product) {
78
- var _ref, _ref2, _goodPass$discount$re, _goodPass$discount;
79
- var goodPass = (product.discount_list || []).find(function (item) {
80
- var _item$discount, _item$discount2;
81
- var type = (item === null || item === void 0 ? void 0 : item.type) || (item === null || item === void 0 ? void 0 : item.tag) || (item === null || item === void 0 || (_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.type) || (item === null || item === void 0 || (_item$discount2 = item.discount) === null || _item$discount2 === void 0 ? void 0 : _item$discount2.tag);
82
- return type === 'good_pass';
78
+ function getFullCoveragePassIdentity(product) {
79
+ var _ref, _ref2, _pass$discount$resour, _pass$discount;
80
+ var pass = (product.discount_list || []).find(function (item) {
81
+ return isFullCoveragePass(item);
83
82
  });
84
- if (!goodPass) return null;
85
- var resourceId = (_ref = (_ref2 = (_goodPass$discount$re = (_goodPass$discount = goodPass.discount) === null || _goodPass$discount === void 0 ? void 0 : _goodPass$discount.resource_id) !== null && _goodPass$discount$re !== void 0 ? _goodPass$discount$re : goodPass.resource_id) !== null && _ref2 !== void 0 ? _ref2 : goodPass.discount_id) !== null && _ref !== void 0 ? _ref : goodPass.id;
86
- return isBlankOrderCollectionIdentity(resourceId) ? null : String(resourceId);
83
+ if (!pass) return null;
84
+ var resourceId = (_ref = (_ref2 = (_pass$discount$resour = (_pass$discount = pass.discount) === null || _pass$discount === void 0 ? void 0 : _pass$discount.resource_id) !== null && _pass$discount$resour !== void 0 ? _pass$discount$resour : pass.resource_id) !== null && _ref2 !== void 0 ? _ref2 : pass.discount_id) !== null && _ref !== void 0 ? _ref : pass.id;
85
+ if (isBlankOrderCollectionIdentity(resourceId)) return null;
86
+ return {
87
+ type: String(pass.type || pass.tag),
88
+ resourceId: String(resourceId)
89
+ };
87
90
  }
88
91
  function buildSplitProductUid(originalUid, product, duplicateOrdinal) {
89
92
  var encodedOriginalUid = encodeURIComponent(originalUid);
90
- var resourceId = getGoodPassResourceId(product);
91
- if (resourceId) {
92
- return "os-split:product:".concat(encodedOriginalUid, ":good-pass:").concat(encodeURIComponent(resourceId), ":").concat(duplicateOrdinal);
93
+ var passIdentity = getFullCoveragePassIdentity(product);
94
+ if (passIdentity) {
95
+ var passType = passIdentity.type === 'good_pass' ? 'good-pass' : 'entitlement-pass';
96
+ return "os-split:product:".concat(encodedOriginalUid, ":").concat(passType, ":").concat(encodeURIComponent(passIdentity.resourceId), ":").concat(duplicateOrdinal);
93
97
  }
94
98
  return "os-split:product:".concat(encodedOriginalUid, ":duplicate:").concat(duplicateOrdinal);
95
99
  }
@@ -161,7 +161,7 @@ export declare function resolveManualOverrideLineOriginalPrice(params: {
161
161
  * // => -4
162
162
  */
163
163
  export declare function resolveEffectivePerUnitDiscount(product: Record<string, any>): number;
164
- export declare function createDefaultOrderRulesHooks(): RulesParamsHooks;
164
+ export declare function createDefaultOrderRulesHooks(getBookings?: () => OrderTempOrder['bookings']): RulesParamsHooks;
165
165
  /**
166
166
  * 通过 session 类商品的开始时间结束时间生成商品的时长
167
167
  * @param {CartItem} cartItem
@@ -23,11 +23,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
23
23
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
24
  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); }
25
25
  import dayjs from "dayjs";
26
+ import customParseFormat from 'dayjs/plugin/customParseFormat';
26
27
  import Decimal from 'decimal.js';
27
28
  import { getProductHolderConfig } from "../Holder/utils";
28
29
  import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
29
30
  import { createUuidV4 } from "./utils/orderCollectionIdentity";
30
31
  import { encodeSalesNotes } from "./salesNotes";
32
+ dayjs.extend(customParseFormat);
31
33
  var POINT_CARD_SNAPSHOT_TAG = 'point_card';
32
34
  var VIRTUAL_CURRENCY_SNAPSHOT_TAG = 'virtual_currency';
33
35
  function isPlainObject(value) {
@@ -58,6 +60,10 @@ export function normalizePointCardSnapshotItem(value) {
58
60
  if (productId !== undefined) {
59
61
  snapshot.product_id = productId;
60
62
  }
63
+ var code = normalizeSnapshotScalar(value.code);
64
+ if (code !== undefined) {
65
+ snapshot.code = String(code).trim();
66
+ }
61
67
  return snapshot;
62
68
  }
63
69
  export function buildPointCardSnapshotFromWalletPassList(value) {
@@ -607,6 +613,22 @@ function resolveSubmitBundleMapId(bundle) {
607
613
  }
608
614
  return undefined;
609
615
  }
616
+ function ensureSubmitDiscountIdentity(discount) {
617
+ if (!discount || _typeof(discount) !== 'object' || Array.isArray(discount)) {
618
+ return discount;
619
+ }
620
+ var discountRecord = discount;
621
+ var metadata = discountRecord.metadata && _typeof(discountRecord.metadata) === 'object' && !Array.isArray(discountRecord.metadata) ? discountRecord.metadata : {};
622
+ var uniqueIdentificationNumber = metadata.unique_identification_number;
623
+ if (uniqueIdentificationNumber !== undefined && uniqueIdentificationNumber !== null && String(uniqueIdentificationNumber).trim() !== '') {
624
+ return discount;
625
+ }
626
+ return _objectSpread(_objectSpread({}, discountRecord), {}, {
627
+ metadata: _objectSpread(_objectSpread({}, metadata), {}, {
628
+ unique_identification_number: createUuidV4()
629
+ })
630
+ });
631
+ }
610
632
  function collectSubmitProductDiscountList(product) {
611
633
  var submitDiscountList = Array.isArray(product === null || product === void 0 ? void 0 : product.discount_list) ? _toConsumableArray(product.discount_list) : [];
612
634
  var _iterator5 = _createForOfIteratorHelper((product === null || product === void 0 ? void 0 : product.product_bundle) || []),
@@ -642,7 +664,7 @@ function collectSubmitProductDiscountList(product) {
642
664
  } finally {
643
665
  _iterator5.f();
644
666
  }
645
- return normalizeOrderProductDiscountList(submitDiscountList);
667
+ return normalizeOrderProductDiscountList(submitDiscountList.map(ensureSubmitDiscountIdentity));
646
668
  }
647
669
 
648
670
  /**
@@ -715,14 +737,37 @@ export function resolveEffectivePerUnitDiscount(product) {
715
737
  if (!Number.isFinite(originalPrice) || !Number.isFinite(finalPrice)) return fromList;
716
738
  return fromList + (originalPrice - finalPrice);
717
739
  }
718
- export function createDefaultOrderRulesHooks() {
740
+ export function createDefaultOrderRulesHooks(getBookings) {
741
+ var getProductStartDate = function getProductStartDate(product) {
742
+ var _ref14, _product$metadata$uni, _product$metadata2, _ref15, _product$booking_uid, _product$metadata3, _product$metadata4, _product$metadata5, _product$metadata6;
743
+ var productUid = String((_ref14 = (_product$metadata$uni = (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.unique_identification_number) !== null && _product$metadata$uni !== void 0 ? _product$metadata$uni : product.unique_identification_number) !== null && _ref14 !== void 0 ? _ref14 : '');
744
+ var bookingUid = String((_ref15 = (_product$booking_uid = product.booking_uid) !== null && _product$booking_uid !== void 0 ? _product$booking_uid : (_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.booking_uid) !== null && _ref15 !== void 0 ? _ref15 : '');
745
+ // 每次读取当前 bookings,覆盖改期、订单回显以及直接调用 Rules 的选券入口。
746
+ var bookings = (getBookings === null || getBookings === void 0 ? void 0 : getBookings()) || [];
747
+ var booking = bookings.find(function (item) {
748
+ var _ref16, _item$product_uid, _item$metadata3;
749
+ return productUid && String((_ref16 = (_item$product_uid = item === null || item === void 0 ? void 0 : item.product_uid) !== null && _item$product_uid !== void 0 ? _item$product_uid : item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.product_uid) !== null && _ref16 !== void 0 ? _ref16 : '') === productUid;
750
+ }) || bookings.find(function (item) {
751
+ var _ref17, _item$metadata$unique, _item$metadata4;
752
+ return bookingUid && String((_ref17 = (_item$metadata$unique = item === null || item === void 0 || (_item$metadata4 = item.metadata) === null || _item$metadata4 === void 0 ? void 0 : _item$metadata4.unique_identification_number) !== null && _item$metadata$unique !== void 0 ? _item$metadata$unique : item === null || item === void 0 ? void 0 : item.booking_uid) !== null && _ref17 !== void 0 ? _ref17 : '') === bookingUid;
753
+ });
754
+ if (booking) {
755
+ // 严格解析并保留 Invalid Date,让公共时间校验拒绝缺失/非法时间,避免回退到当前时间。
756
+ return dayjs("".concat(booking.start_date, " ").concat(booking.start_time), ['YYYY-MM-DD HH:mm', 'YYYY-MM-DD HH:mm:ss', 'YYYY-MM-DD H:mm', 'YYYY-MM-DD H:mm:ss'], true);
757
+ }
758
+ if (getBookings && (bookingUid || product.booking_id || (_product$metadata4 = product.metadata) !== null && _product$metadata4 !== void 0 && _product$metadata4.booking_id)) {
759
+ return dayjs('');
760
+ }
761
+ var legacyStartDate = ((_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.start_date) || ((_product$metadata6 = product.metadata) === null || _product$metadata6 === void 0 ? void 0 : _product$metadata6.startDate);
762
+ return legacyStartDate ? dayjs(legacyStartDate) : undefined;
763
+ };
719
764
  var toUnitPriceString = function toUnitPriceString(totalLike, num) {
720
765
  var effectiveNum = Number(num) > 0 ? Number(num) : 1;
721
766
  return new Decimal(Number(totalLike) || 0).dividedBy(effectiveNum).toDecimalPlaces(2).toString();
722
767
  };
723
768
  var getBundleIdentity = function getBundleIdentity(bundle) {
724
- var _ref14, _bundle$bundle_id, _ref15, _ref16, _bundle$bundle_produc, _ref17, _ref18, _bundle$bundle_varian, _ref19, _bundle$bundle_group_;
725
- return [(_ref14 = (_bundle$bundle_id = bundle.bundle_id) !== null && _bundle$bundle_id !== void 0 ? _bundle$bundle_id : bundle.id) !== null && _ref14 !== void 0 ? _ref14 : '', (_ref15 = (_ref16 = (_bundle$bundle_produc = bundle.bundle_product_id) !== null && _bundle$bundle_produc !== void 0 ? _bundle$bundle_produc : bundle._bundle_product_id) !== null && _ref16 !== void 0 ? _ref16 : bundle.product_id) !== null && _ref15 !== void 0 ? _ref15 : '', (_ref17 = (_ref18 = (_bundle$bundle_varian = bundle.bundle_variant_id) !== null && _bundle$bundle_varian !== void 0 ? _bundle$bundle_varian : bundle.variant_id) !== null && _ref18 !== void 0 ? _ref18 : bundle.product_variant_id) !== null && _ref17 !== void 0 ? _ref17 : 0, (_ref19 = (_bundle$bundle_group_ = bundle.bundle_group_id) !== null && _bundle$bundle_group_ !== void 0 ? _bundle$bundle_group_ : bundle.group_id) !== null && _ref19 !== void 0 ? _ref19 : ''].join('|');
769
+ var _ref18, _bundle$bundle_id, _ref19, _ref20, _bundle$bundle_produc, _ref21, _ref22, _bundle$bundle_varian, _ref23, _bundle$bundle_group_;
770
+ return [(_ref18 = (_bundle$bundle_id = bundle.bundle_id) !== null && _bundle$bundle_id !== void 0 ? _bundle$bundle_id : bundle.id) !== null && _ref18 !== void 0 ? _ref18 : '', (_ref19 = (_ref20 = (_bundle$bundle_produc = bundle.bundle_product_id) !== null && _bundle$bundle_produc !== void 0 ? _bundle$bundle_produc : bundle._bundle_product_id) !== null && _ref20 !== void 0 ? _ref20 : bundle.product_id) !== null && _ref19 !== void 0 ? _ref19 : '', (_ref21 = (_ref22 = (_bundle$bundle_varian = bundle.bundle_variant_id) !== null && _bundle$bundle_varian !== void 0 ? _bundle$bundle_varian : bundle.variant_id) !== null && _ref22 !== void 0 ? _ref22 : bundle.product_variant_id) !== null && _ref21 !== void 0 ? _ref21 : 0, (_ref23 = (_bundle$bundle_group_ = bundle.bundle_group_id) !== null && _bundle$bundle_group_ !== void 0 ? _bundle$bundle_group_ : bundle.group_id) !== null && _ref23 !== void 0 ? _ref23 : ''].join('|');
726
771
  };
727
772
  var mergeRulesBundlePrices = function mergeRulesBundlePrices(currentBundle, rulesBundle) {
728
773
  if (!Array.isArray(rulesBundle)) return rulesBundle;
@@ -732,7 +777,7 @@ export function createDefaultOrderRulesHooks() {
732
777
  currentByIdentity.set(getBundleIdentity(bundle), bundle);
733
778
  });
734
779
  return rulesBundle.map(function (bundle) {
735
- var _bundle$price_type_ex2, _ref20, _ref21, _current$price, _ref22, _ref23, _ref24, _current$original_pri;
780
+ var _bundle$price_type_ex2, _ref24, _ref25, _current$price, _ref26, _ref27, _ref28, _current$original_pri;
736
781
  if (!bundle || _typeof(bundle) !== 'object') return bundle;
737
782
  var current = currentByIdentity.get(getBundleIdentity(bundle));
738
783
  if (!current) return bundle;
@@ -741,8 +786,8 @@ export function createDefaultOrderRulesHooks() {
741
786
  } : {});
742
787
  var isProductPriceBundle = ((_bundle$price_type_ex2 = bundle.price_type_ext) !== null && _bundle$price_type_ex2 !== void 0 ? _bundle$price_type_ex2 : current.price_type_ext) === 'product_price';
743
788
  if (!isProductPriceBundle) return bundleWithDisplayFields;
744
- var sourcePrice = (_ref20 = (_ref21 = (_current$price = current.price) !== null && _current$price !== void 0 ? _current$price : current.custom_price) !== null && _ref21 !== void 0 ? _ref21 : current.original_price) !== null && _ref20 !== void 0 ? _ref20 : current.bundle_selling_price;
745
- var originalPrice = (_ref22 = (_ref23 = (_ref24 = (_current$original_pri = current.original_price) !== null && _current$original_pri !== void 0 ? _current$original_pri : current.product_price) !== null && _ref24 !== void 0 ? _ref24 : current.price) !== null && _ref23 !== void 0 ? _ref23 : current.custom_price) !== null && _ref22 !== void 0 ? _ref22 : sourcePrice;
789
+ var sourcePrice = (_ref24 = (_ref25 = (_current$price = current.price) !== null && _current$price !== void 0 ? _current$price : current.custom_price) !== null && _ref25 !== void 0 ? _ref25 : current.original_price) !== null && _ref24 !== void 0 ? _ref24 : current.bundle_selling_price;
790
+ var originalPrice = (_ref26 = (_ref27 = (_ref28 = (_current$original_pri = current.original_price) !== null && _current$original_pri !== void 0 ? _current$original_pri : current.product_price) !== null && _ref28 !== void 0 ? _ref28 : current.price) !== null && _ref27 !== void 0 ? _ref27 : current.custom_price) !== null && _ref26 !== void 0 ? _ref26 : sourcePrice;
746
791
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bundleWithDisplayFields), sourcePrice !== undefined ? {
747
792
  price: sourcePrice
748
793
  } : {}), originalPrice !== undefined ? {
@@ -754,7 +799,7 @@ export function createDefaultOrderRulesHooks() {
754
799
  };
755
800
  return {
756
801
  getProduct: function getProduct(product) {
757
- var _product$metadata2, _product$metadata3, _product$metadata4, _product$metadata5, _product$metadata6, _metadataAny$_promoti;
802
+ var _product$metadata7, _product$metadata8, _product$metadata9, _metadataAny$_promoti;
758
803
  // source_product_price 是权威源;兜底链:source → mainSelling − options(反推)→ 行 selling_price
759
804
  var metadataAny = product.metadata || {};
760
805
  var optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
@@ -781,7 +826,7 @@ export function createDefaultOrderRulesHooks() {
781
826
  // 否则同 SKU 不同小料会在 calcDiscount 重组时互相覆盖。
782
827
  // 不透明 identity 契约下,normalizeOrderProduct / hydrate 已保证唯一值存在;
783
828
  // 留 fingerprint 分支仅作 Rules 单测里直接传裸 product 时的兜底。
784
- _id: (_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.unique_identification_number ? "".concat(product.product_id, "_").concat(product.product_variant_id, "_").concat(product.metadata.unique_identification_number) : "".concat(product.product_id, "_").concat(product.product_variant_id, "_").concat(buildProductLineFingerprint(getProductSkuOptions(product), product.product_bundle)),
829
+ _id: (_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.unique_identification_number ? "".concat(product.product_id, "_").concat(product.product_variant_id, "_").concat(product.metadata.unique_identification_number) : "".concat(product.product_id, "_").concat(product.product_variant_id, "_").concat(buildProductLineFingerprint(getProductSkuOptions(product), product.product_bundle)),
785
830
  // Rules 内部 getProductTotalPrice / getProductOriginTotalPrice 会各自再叠加 bundle + option,
786
831
  // 所以这里必须喂 source-level(不含 option、不含 bundle、不含折扣)单价,避免双加 option。
787
832
  price: sourcePrice,
@@ -793,23 +838,23 @@ export function createDefaultOrderRulesHooks() {
793
838
  num: product.num || 1,
794
839
  discount_list: product.discount_list || [],
795
840
  bundle: product.product_bundle || [],
796
- booking_id: ((_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.booking_id) || null,
841
+ booking_id: ((_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.booking_id) || null,
797
842
  isClient: false,
798
843
  // 勿写死 false:否则 Rules 不会走 total≠origin_total 的手动价推断,
799
844
  // 无券时会把 bundle 价还原成 original_price(手动改价套餐会从 20 回到 30)。
800
845
  isManualDiscount: resolveRulesManualDiscountFlag(metadataAny),
801
- holder_id: (_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.holder_id,
802
- startDate: ((_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.start_date) || ((_product$metadata6 = product.metadata) === null || _product$metadata6 === void 0 ? void 0 : _product$metadata6.startDate),
846
+ holder_id: (_product$metadata9 = product.metadata) === null || _product$metadata9 === void 0 ? void 0 : _product$metadata9.holder_id,
847
+ startDate: getProductStartDate(product),
803
848
  main_product_selling_price: metadataAny.main_product_selling_price !== undefined ? new Decimal(Number(metadataAny.main_product_selling_price) || 0).minus(optionSum).toDecimalPlaces(2).toString() : undefined,
804
849
  inPromotion: ((_metadataAny$_promoti = metadataAny._promotion) === null || _metadataAny$_promoti === void 0 ? void 0 : _metadataAny$_promoti.inPromotion) === true,
805
850
  _promotion: metadataAny._promotion
806
851
  };
807
852
  },
808
853
  setProduct: function setProduct(product, values) {
809
- var _ref25, _values$quantity, _ref26, _metadataAny$source_p, _values$discount_list, _values$quantity2;
810
- var nextNum = Number((_ref25 = (_values$quantity = values.quantity) !== null && _values$quantity !== void 0 ? _values$quantity : product.num) !== null && _ref25 !== void 0 ? _ref25 : 1) || 1;
854
+ var _ref29, _values$quantity, _ref30, _metadataAny$source_p, _values$discount_list, _values$quantity2;
855
+ var nextNum = Number((_ref29 = (_values$quantity = values.quantity) !== null && _values$quantity !== void 0 ? _values$quantity : product.num) !== null && _ref29 !== void 0 ? _ref29 : 1) || 1;
811
856
  var metadataAny = product.metadata || {};
812
- var existedSource = (_ref26 = (_metadataAny$source_p = metadataAny.source_product_price) !== null && _metadataAny$source_p !== void 0 ? _metadataAny$source_p : product.selling_price) !== null && _ref26 !== void 0 ? _ref26 : '0';
857
+ var existedSource = (_ref30 = (_metadataAny$source_p = metadataAny.source_product_price) !== null && _metadataAny$source_p !== void 0 ? _metadataAny$source_p : product.selling_price) !== null && _ref30 !== void 0 ? _ref30 : '0';
813
858
  var nextOptions = getProductSkuOptions(product);
814
859
  var optionSum = sumOptionUnitPrice(nextOptions);
815
860
 
@@ -1020,7 +1065,7 @@ function formatSubmitBundleItems(bundle) {
1020
1065
  var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1021
1066
  if (!Array.isArray(bundle)) return [];
1022
1067
  return bundle.map(function (b) {
1023
- var _ref27, _rawBundle$price, _rawBundle$surcharge_, _rawBundle$num, _rawBundle$is_charge_, _rawBundle$bundle_var, _rawBundle$quantity, _rawBundle$extension_, _rawBundle$extension_2, _ref28, _rawBundle$price_type, _ref29, _rawBundle$price_type2, _rawBundle$bundle_gro, _rawBundle$bundle_id, _rawBundle$bundle_pro;
1068
+ var _ref31, _rawBundle$price, _rawBundle$surcharge_, _rawBundle$num, _rawBundle$is_charge_, _rawBundle$bundle_var, _rawBundle$quantity, _rawBundle$extension_, _rawBundle$extension_2, _ref32, _rawBundle$price_type, _ref33, _rawBundle$price_type2, _rawBundle$bundle_gro, _rawBundle$bundle_id, _rawBundle$bundle_pro;
1024
1069
  var rawBundle = b && _typeof(b) === 'object' ? b : {};
1025
1070
  var existedMetadata = rawBundle.metadata && _typeof(rawBundle.metadata) === 'object' ? rawBundle.metadata : {};
1026
1071
  var _customProductBundleMapId = existedMetadata.custom_product_bundle_map_id,
@@ -1031,7 +1076,7 @@ function formatSubmitBundleItems(bundle) {
1031
1076
  var sellingPrice = formatOptions.virtualSettlementMode ? '0.00' : getBundleSellingMagnitude(rawBundle).toFixed(2);
1032
1077
  // payment 价由整单折扣均摊层产出;缺省(无折扣)时与 selling 净额同义。
1033
1078
  var paymentPrice = formatOptions.virtualSettlementMode ? '0.00' : rawBundle.bundle_payment_price !== undefined && rawBundle.bundle_payment_price !== null && rawBundle.bundle_payment_price !== '' ? toMoneyString(rawBundle.bundle_payment_price) : sellingPrice;
1034
- var priceValue = formatOptions.virtualSettlementMode ? 0 : (_ref27 = (_rawBundle$price = rawBundle.price) !== null && _rawBundle$price !== void 0 ? _rawBundle$price : rawBundle.custom_price) !== null && _ref27 !== void 0 ? _ref27 : rawBundle.bundle_selling_price;
1079
+ var priceValue = formatOptions.virtualSettlementMode ? 0 : (_ref31 = (_rawBundle$price = rawBundle.price) !== null && _rawBundle$price !== void 0 ? _rawBundle$price : rawBundle.custom_price) !== null && _ref31 !== void 0 ? _ref31 : rawBundle.bundle_selling_price;
1035
1080
  var relationSurchargeIds = Array.isArray(rawBundle.relation_surcharge_ids) ? rawBundle.relation_surcharge_ids : Array.isArray(existedMetadata.relation_surcharge_ids) ? existedMetadata.relation_surcharge_ids : [];
1036
1081
  var surchargeFee = toMoneyString((_rawBundle$surcharge_ = rawBundle.surcharge_fee) !== null && _rawBundle$surcharge_ !== void 0 ? _rawBundle$surcharge_ : existedMetadata.surcharge_fee);
1037
1082
  var productDiscountDifference = toBundleNumber(existedMetadata.product_discount_difference, 0);
@@ -1050,8 +1095,8 @@ function formatSubmitBundleItems(bundle) {
1050
1095
  extension_id: (_rawBundle$extension_ = rawBundle.extension_id) !== null && _rawBundle$extension_ !== void 0 ? _rawBundle$extension_ : 0,
1051
1096
  extension_type: (_rawBundle$extension_2 = rawBundle.extension_type) !== null && _rawBundle$extension_2 !== void 0 ? _rawBundle$extension_2 : 'normal',
1052
1097
  price: priceValue,
1053
- price_type: (_ref28 = (_rawBundle$price_type = rawBundle.price_type) !== null && _rawBundle$price_type !== void 0 ? _rawBundle$price_type : rawBundle.custom_price_type) !== null && _ref28 !== void 0 ? _ref28 : '',
1054
- price_type_ext: (_ref29 = (_rawBundle$price_type2 = rawBundle.price_type_ext) !== null && _rawBundle$price_type2 !== void 0 ? _rawBundle$price_type2 : rawBundle.custom_price_type_ext) !== null && _ref29 !== void 0 ? _ref29 : '',
1098
+ price_type: (_ref32 = (_rawBundle$price_type = rawBundle.price_type) !== null && _rawBundle$price_type !== void 0 ? _rawBundle$price_type : rawBundle.custom_price_type) !== null && _ref32 !== void 0 ? _ref32 : '',
1099
+ price_type_ext: (_ref33 = (_rawBundle$price_type2 = rawBundle.price_type_ext) !== null && _rawBundle$price_type2 !== void 0 ? _rawBundle$price_type2 : rawBundle.custom_price_type_ext) !== null && _ref33 !== void 0 ? _ref33 : '',
1055
1100
  bundle_selling_price: sellingPrice,
1056
1101
  bundle_payment_price: paymentPrice,
1057
1102
  option: formatSubmitOptionItems(rawBundle.option, formatOptions),
@@ -1087,11 +1132,11 @@ function formatSubmitBundleItems(bundle) {
1087
1132
  * 法币仅做字段/metadata 裁剪;虚拟币在出站前再次执行零加价与固定单价断言。
1088
1133
  */
1089
1134
  function normalizeSubmitProduct(product) {
1090
- var _ref31, _submitProduct$bundle, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
1135
+ var _ref35, _submitProduct$bundle, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
1091
1136
  var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1092
- var _ref30 = product,
1093
- _runtimeUid = _ref30.unique_identification_number,
1094
- submitProduct = _objectWithoutProperties(_ref30, _excluded2);
1137
+ var _ref34 = product,
1138
+ _runtimeUid = _ref34.unique_identification_number,
1139
+ submitProduct = _objectWithoutProperties(_ref34, _excluded2);
1095
1140
  var num = submitProduct.num,
1096
1141
  _productSurchargeFee = submitProduct.surcharge_fee,
1097
1142
  _deprecatedDiscountAmount = submitProduct.discount_amount,
@@ -1108,7 +1153,7 @@ function normalizeSubmitProduct(product) {
1108
1153
  // 兼容历史 BigSale 编辑链路:bundle_edit 曾被写入 metadata,
1109
1154
  // 出站时需提升到商品顶层;套餐未编辑时也必须显式提交 0。
1110
1155
  var hasProductBundle = Array.isArray(submitProduct.product_bundle) && submitProduct.product_bundle.length > 0;
1111
- var bundleEdit = (_ref31 = (_submitProduct$bundle = submitProduct.bundle_edit) !== null && _submitProduct$bundle !== void 0 ? _submitProduct$bundle : rawMetadata.bundle_edit) !== null && _ref31 !== void 0 ? _ref31 : hasProductBundle ? 0 : undefined;
1156
+ var bundleEdit = (_ref35 = (_submitProduct$bundle = submitProduct.bundle_edit) !== null && _submitProduct$bundle !== void 0 ? _submitProduct$bundle : rawMetadata.bundle_edit) !== null && _ref35 !== void 0 ? _ref35 : hasProductBundle ? 0 : undefined;
1112
1157
  var cleanMetadata = {};
1113
1158
  if (rawMetadata.unique_identification_number) {
1114
1159
  cleanMetadata.unique_identification_number = rawMetadata.unique_identification_number;
@@ -1339,7 +1384,7 @@ export function resolveSubmitOrderType(params) {
1339
1384
  return 'virtual';
1340
1385
  }
1341
1386
  export function buildSubmitPayload(params) {
1342
- var _tempOrder$metadata2, _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref33, _tempOrder$is_price_i, _tempOrder$is_deposit, _tempOrder$_extend, _enhancedPayload$summ;
1387
+ var _tempOrder$metadata2, _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref37, _tempOrder$is_price_i, _tempOrder$is_deposit, _tempOrder$_extend, _enhancedPayload$summ;
1343
1388
  var tempOrder = params.tempOrder,
1344
1389
  cacheId = params.cacheId,
1345
1390
  _params$now = params.now,
@@ -1353,29 +1398,29 @@ export function buildSubmitPayload(params) {
1353
1398
  var scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
1354
1399
  var bookingUuid = createUuidV4();
1355
1400
  var virtualSettlementMode = ((_tempOrder$metadata2 = tempOrder.metadata) === null || _tempOrder$metadata2 === void 0 || (_tempOrder$metadata2 = _tempOrder$metadata2.currency_settlement_config) === null || _tempOrder$metadata2 === void 0 ? void 0 : _tempOrder$metadata2.settlement_type) === 'virtual_currency';
1356
- var _ref32 = tempOrder,
1357
- _extend = _ref32._extend,
1358
- _relationId = _ref32.relation_id,
1359
- _tableFormId = _ref32.table_form_id,
1360
- _resourceId = _ref32.resource_id,
1361
- _summary = _ref32.summary,
1362
- _lastOrderInfo = _ref32.lastOrderInfo,
1363
- _paidAmount = _ref32.paid_amount,
1364
- _shopId = _ref32.shop_id,
1365
- _shopNote = _ref32.shop_note,
1366
- _shopServiceType = _ref32.shop_service_type,
1367
- _startTime = _ref32.start_time,
1368
- _customer = _ref32.customer,
1369
- _discountList = _ref32.discount_list,
1370
- _orderMetaList = _ref32.order_meta_list,
1371
- _rootTaxFee = _ref32.tax_fee,
1372
- _totalAmount = _ref32.total_amount,
1373
- _totalRefundAmount = _ref32.total_refund_amount,
1374
- _createDate = _ref32.create_date,
1375
- _holderId = _ref32.holder_id,
1376
- _paymentStatus = _ref32.payment_status,
1377
- _notes = _ref32.notes,
1378
- tempOrderRest = _objectWithoutProperties(_ref32, _excluded4);
1401
+ var _ref36 = tempOrder,
1402
+ _extend = _ref36._extend,
1403
+ _relationId = _ref36.relation_id,
1404
+ _tableFormId = _ref36.table_form_id,
1405
+ _resourceId = _ref36.resource_id,
1406
+ _summary = _ref36.summary,
1407
+ _lastOrderInfo = _ref36.lastOrderInfo,
1408
+ _paidAmount = _ref36.paid_amount,
1409
+ _shopId = _ref36.shop_id,
1410
+ _shopNote = _ref36.shop_note,
1411
+ _shopServiceType = _ref36.shop_service_type,
1412
+ _startTime = _ref36.start_time,
1413
+ _customer = _ref36.customer,
1414
+ _discountList = _ref36.discount_list,
1415
+ _orderMetaList = _ref36.order_meta_list,
1416
+ _rootTaxFee = _ref36.tax_fee,
1417
+ _totalAmount = _ref36.total_amount,
1418
+ _totalRefundAmount = _ref36.total_refund_amount,
1419
+ _createDate = _ref36.create_date,
1420
+ _holderId = _ref36.holder_id,
1421
+ _paymentStatus = _ref36.payment_status,
1422
+ _notes = _ref36.notes,
1423
+ tempOrderRest = _objectWithoutProperties(_ref36, _excluded4);
1379
1424
  var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code;
1380
1425
  var normalizedOrderMetaList = normalizeOrderMetaList(tempOrder.order_meta_list);
1381
1426
  var submitType = resolveSubmitOrderType({
@@ -1400,7 +1445,7 @@ export function buildSubmitPayload(params) {
1400
1445
  type: submitType,
1401
1446
  business_code: resolvedBusinessCode,
1402
1447
  sales_channel: tempOrder.sales_channel || 'my_pisel',
1403
- order_sales_channel: (_ref33 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref33 !== void 0 ? _ref33 : 'online_store',
1448
+ order_sales_channel: (_ref37 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref37 !== void 0 ? _ref37 : 'online_store',
1404
1449
  status: tempOrder.status || 'normal'
1405
1450
  }, params.includePaymentStatus !== false ? {
1406
1451
  payment_status: tempOrder.payment_status || 'payment_processing'
@@ -1428,13 +1473,13 @@ export function buildSubmitPayload(params) {
1428
1473
  // holder: tempOrder.holder || null,
1429
1474
  summary: summary || tempOrder.summary || createEmptySummary(),
1430
1475
  metadata: function () {
1431
- var _ref34 = tempOrder.metadata || {},
1432
- _collectPax = _ref34.collect_pax,
1433
- _tableOccupancyDuration = _ref34.table_occupancy_duration,
1434
- _cartSettlementKey = _ref34.cart_settlement_key,
1435
- _cartSettlementSnapshot = _ref34.cart_settlement_snapshot,
1436
- _legalCurrencySnapshot = _ref34.legal_currency_snapshot,
1437
- rest = _objectWithoutProperties(_ref34, _excluded5);
1476
+ var _ref38 = tempOrder.metadata || {},
1477
+ _collectPax = _ref38.collect_pax,
1478
+ _tableOccupancyDuration = _ref38.table_occupancy_duration,
1479
+ _cartSettlementKey = _ref38.cart_settlement_key,
1480
+ _cartSettlementSnapshot = _ref38.cart_settlement_snapshot,
1481
+ _legalCurrencySnapshot = _ref38.legal_currency_snapshot,
1482
+ rest = _objectWithoutProperties(_ref38, _excluded5);
1438
1483
  return _objectSpread({}, rest);
1439
1484
  }()
1440
1485
  }, (_tempOrder$_extend = tempOrder._extend) !== null && _tempOrder$_extend !== void 0 && (_tempOrder$_extend = _tempOrder$_extend.salesNotesState) !== null && _tempOrder$_extend !== void 0 && _tempOrder$_extend.dirty ? {
@@ -1638,9 +1683,9 @@ export function clearTempOrderHolderAssignments(tempOrder) {
1638
1683
  * getOrderProductLineUid({ metadata: { unique_identification_number: 'line-1' } }); // 'line-1'
1639
1684
  */
1640
1685
  export function getOrderProductLineUid(product) {
1641
- var _product$metadata$uni, _product$metadata7;
1686
+ var _product$metadata$uni2, _product$metadata10;
1642
1687
  if (!product || _typeof(product) !== 'object') return null;
1643
- var uid = (_product$metadata$uni = (_product$metadata7 = product.metadata) === null || _product$metadata7 === void 0 ? void 0 : _product$metadata7.unique_identification_number) !== null && _product$metadata$uni !== void 0 ? _product$metadata$uni : product.unique_identification_number;
1688
+ var uid = (_product$metadata$uni2 = (_product$metadata10 = product.metadata) === null || _product$metadata10 === void 0 ? void 0 : _product$metadata10.unique_identification_number) !== null && _product$metadata$uni2 !== void 0 ? _product$metadata$uni2 : product.unique_identification_number;
1644
1689
  if (uid === undefined || uid === null || uid === '') return null;
1645
1690
  return String(uid);
1646
1691
  }
@@ -1651,8 +1696,8 @@ export function getRuntimeProductOrigin(tempOrder, product) {
1651
1696
  return tempOrder._extend.productsByUid[uid].origin;
1652
1697
  }
1653
1698
  var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
1654
- var _ref35, _item$product_id, _ref36, _product$product_id;
1655
- return item === product || getOrderProductLineUid(item) === uid || String((_ref35 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref35 !== void 0 ? _ref35 : '') === String((_ref36 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref36 !== void 0 ? _ref36 : '');
1699
+ var _ref39, _item$product_id, _ref40, _product$product_id;
1700
+ return item === product || getOrderProductLineUid(item) === uid || String((_ref39 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref39 !== void 0 ? _ref39 : '') === String((_ref40 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref40 !== void 0 ? _ref40 : '');
1656
1701
  });
1657
1702
  var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
1658
1703
  return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[matchedUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin) || null : null;
@@ -412,6 +412,8 @@ export interface WalletAssetsBehaviorOptions {
412
412
  export interface RefreshWalletAssetsOptions {
413
413
  /** 商品/金额变化默认保留并重验选择;客户变化由实现层强制清空。 */
414
414
  preserveSelection?: boolean;
415
+ /** 客户变化时,仅保留与本次扫码匹配的搜索结果;其他搜索缓存仍会清空。 */
416
+ retainSearchResultCodes?: string[];
415
417
  }
416
418
  export interface SelectWalletAssetOptions {
417
419
  selected: boolean;
@@ -419,6 +421,8 @@ export interface SelectWalletAssetOptions {
419
421
  }
420
422
  export interface ScanWalletAssetResult {
421
423
  type: SearchIdentificationCodeResult['type'];
424
+ /** walletCode 时保留完整 Wallet Detail,供客户解析与客户选择器使用。 */
425
+ data?: WalletDetailSearchData;
422
426
  asset?: any;
423
427
  selected: boolean;
424
428
  state: WalletAssetsState;
@@ -864,6 +868,8 @@ export interface SearchIdentificationCodeParams extends WalletDeductionRecommend
864
868
  * 搜索识别码响应数据
865
869
  */
866
870
  export interface SearchIdentificationCodeResponse {
871
+ /** 业务是否成功 */
872
+ status?: boolean;
867
873
  /** 响应状态码 */
868
874
  code?: number;
869
875
  /** 响应消息 */
@@ -871,12 +877,26 @@ export interface SearchIdentificationCodeResponse {
871
877
  /** 响应数据 */
872
878
  data?: SearchIdentificationCodeItem[];
873
879
  }
880
+ /** Wallet code 精确搜索返回的 Wallet Detail。 */
881
+ export interface WalletDetailSearchData {
882
+ id?: string | number;
883
+ customer_id?: string | number;
884
+ customer?: Record<string, any> | null;
885
+ is_cross_shop_wallet?: boolean | 0 | 1;
886
+ [key: string]: any;
887
+ }
888
+ export interface WalletDetailSearchResponse {
889
+ status?: boolean;
890
+ code?: number;
891
+ message?: string;
892
+ data?: WalletDetailSearchData | null;
893
+ }
874
894
  /**
875
895
  * 搜索识别码结果类型
876
896
  */
877
897
  export type SearchIdentificationCodeResult = {
878
898
  type: 'walletCode';
879
- data: SearchIdentificationCodeItem[];
899
+ data: WalletDetailSearchData;
880
900
  } | {
881
901
  type: 'normalCode';
882
902
  data: SearchIdentificationCodeItem[];
@@ -262,6 +262,8 @@ export var PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
262
262
  * 搜索识别码响应数据
263
263
  */
264
264
 
265
+ /** Wallet code 精确搜索返回的 Wallet Detail。 */
266
+
265
267
  /**
266
268
  * 搜索识别码结果类型
267
269
  */
@@ -96,7 +96,7 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
96
96
  * 搜索识别码信息
97
97
  * 通过识别码搜索相关的钱包通行证信息
98
98
  * 基于 WalletDeductionRecommendParams 参数结构
99
- * 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
99
+ * 特殊逻辑:WL 或指定 200 格式的 Wallet Code 调用 /wallet/detail/search 接口。
100
100
  */
101
101
  searchIdentificationCodeAsync(params: SearchIdentificationCodeParams, config?: {
102
102
  noCache?: boolean;