@pisell/pisellos 2.3.124 → 2.3.126

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 (93) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +0 -2
  3. package/dist/model/strategy/adapter/walletPass/evaluator.js +2 -4
  4. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +19 -58
  5. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +12 -24
  6. package/dist/modules/Customer/index.js +3 -6
  7. package/dist/modules/Customer/types.d.ts +0 -2
  8. package/dist/modules/Discount/index.d.ts +2 -2
  9. package/dist/modules/Discount/index.js +151 -37
  10. package/dist/modules/Discount/types.d.ts +5 -36
  11. package/dist/modules/Order/index.d.ts +12 -7
  12. package/dist/modules/Order/index.js +307 -432
  13. package/dist/modules/Order/types.d.ts +5 -0
  14. package/dist/modules/Order/utils/orderCollectionIdentity.js +12 -16
  15. package/dist/modules/Order/utils.d.ts +11 -1
  16. package/dist/modules/Order/utils.js +127 -122
  17. package/dist/modules/Payment/types.d.ts +1 -21
  18. package/dist/modules/Payment/types.js +0 -2
  19. package/dist/modules/Payment/walletpass.d.ts +1 -1
  20. package/dist/modules/Payment/walletpass.js +47 -80
  21. package/dist/modules/Rules/index.d.ts +2 -2
  22. package/dist/modules/Rules/index.js +186 -480
  23. package/dist/modules/Rules/types.d.ts +0 -4
  24. package/dist/server/modules/order/types.d.ts +0 -2
  25. package/dist/solution/BaseSales/index.d.ts +0 -1
  26. package/dist/solution/BaseSales/index.js +59 -51
  27. package/dist/solution/BaseSales/types.d.ts +2 -2
  28. package/dist/solution/BaseSales/utils/cartPromotion.js +126 -141
  29. package/dist/solution/BookingByStep/index.d.ts +1 -1
  30. package/dist/solution/BookingTicket/index.d.ts +2 -1
  31. package/dist/solution/BookingTicket/index.js +63 -60
  32. package/dist/solution/BookingTicket/types.d.ts +1 -5
  33. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -2
  34. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +147 -338
  35. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +4 -8
  36. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -6
  37. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +6 -19
  38. package/dist/solution/ShopDiscount/index.d.ts +0 -2
  39. package/dist/solution/ShopDiscount/index.js +42 -99
  40. package/dist/solution/ShopDiscount/utils.d.ts +2 -4
  41. package/dist/solution/ShopDiscount/utils.js +23 -43
  42. package/dist/solution/UnifiedBookingSales/index.js +2 -2
  43. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  44. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +0 -2
  45. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -2
  46. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +6 -35
  47. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -13
  48. package/lib/modules/Customer/index.js +1 -5
  49. package/lib/modules/Customer/types.d.ts +0 -2
  50. package/lib/modules/Discount/index.d.ts +2 -2
  51. package/lib/modules/Discount/index.js +129 -23
  52. package/lib/modules/Discount/types.d.ts +5 -36
  53. package/lib/modules/Order/index.d.ts +12 -7
  54. package/lib/modules/Order/index.js +107 -215
  55. package/lib/modules/Order/types.d.ts +5 -0
  56. package/lib/modules/Order/utils/orderCollectionIdentity.js +11 -14
  57. package/lib/modules/Order/utils.d.ts +11 -1
  58. package/lib/modules/Order/utils.js +45 -39
  59. package/lib/modules/Payment/types.d.ts +1 -21
  60. package/lib/modules/Payment/types.js +0 -1
  61. package/lib/modules/Payment/walletpass.d.ts +1 -1
  62. package/lib/modules/Payment/walletpass.js +9 -29
  63. package/lib/modules/Rules/index.d.ts +2 -2
  64. package/lib/modules/Rules/index.js +110 -357
  65. package/lib/modules/Rules/types.d.ts +0 -4
  66. package/lib/server/modules/order/types.d.ts +0 -2
  67. package/lib/solution/BaseSales/index.d.ts +0 -1
  68. package/lib/solution/BaseSales/index.js +12 -5
  69. package/lib/solution/BaseSales/types.d.ts +2 -2
  70. package/lib/solution/BaseSales/utils/cartPromotion.js +4 -12
  71. package/lib/solution/BookingByStep/index.d.ts +1 -1
  72. package/lib/solution/BookingTicket/index.d.ts +2 -1
  73. package/lib/solution/BookingTicket/index.js +33 -36
  74. package/lib/solution/BookingTicket/types.d.ts +1 -5
  75. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -2
  76. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +42 -174
  77. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +4 -8
  78. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -6
  79. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +3 -11
  80. package/lib/solution/ShopDiscount/index.d.ts +0 -2
  81. package/lib/solution/ShopDiscount/index.js +9 -55
  82. package/lib/solution/ShopDiscount/utils.d.ts +2 -4
  83. package/lib/solution/ShopDiscount/utils.js +25 -42
  84. package/lib/solution/UnifiedBookingSales/index.js +2 -2
  85. package/package.json +1 -1
  86. package/dist/modules/Discount/availability.d.ts +0 -7
  87. package/dist/modules/Discount/availability.js +0 -49
  88. package/dist/modules/Discount/entitlementPass.d.ts +0 -34
  89. package/dist/modules/Discount/entitlementPass.js +0 -147
  90. package/lib/modules/Discount/availability.d.ts +0 -7
  91. package/lib/modules/Discount/availability.js +0 -43
  92. package/lib/modules/Discount/entitlementPass.d.ts +0 -34
  93. package/lib/modules/Discount/entitlementPass.js +0 -141
@@ -14,6 +14,7 @@ exports.buildSubmitPayload = buildSubmitPayload;
14
14
  exports.buildVirtualCurrencySnapshotFromList = buildVirtualCurrencySnapshotFromList;
15
15
  exports.calculateOrderProductsDeposit = calculateOrderProductsDeposit;
16
16
  exports.clearTempOrderHolderAssignments = clearTempOrderHolderAssignments;
17
+ exports.collectPointCardSnapshotCodeCandidates = collectPointCardSnapshotCodeCandidates;
17
18
  exports.composeLinePrice = composeLinePrice;
18
19
  exports.createDefaultOrderRulesHooks = createDefaultOrderRulesHooks;
19
20
  exports.createDefaultTempOrder = createDefaultTempOrder;
@@ -66,6 +67,7 @@ Object.defineProperty(exports, "mergeManualProductDiscountIntoList", {
66
67
  }
67
68
  });
68
69
  exports.mergeOrderProductDisplayFields = mergeOrderProductDisplayFields;
70
+ exports.mergePointCardSnapshotCodes = mergePointCardSnapshotCodes;
69
71
  exports.mergeRelationForms = void 0;
70
72
  exports.normalizeBookingIsAll = normalizeBookingIsAll;
71
73
  exports.normalizeBookingSubType = normalizeBookingSubType;
@@ -127,7 +129,6 @@ Object.defineProperty(exports, "syncManualProductDiscountProductNum", {
127
129
  }
128
130
  });
129
131
  var _dayjs = _interopRequireDefault(require("dayjs"));
130
- var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat"));
131
132
  var _decimal = _interopRequireDefault(require("decimal.js"));
132
133
  var _utils = require("../Holder/utils");
133
134
  var _utils2 = require("../../solution/ScanOrder/utils");
@@ -135,7 +136,6 @@ var _orderCollectionIdentity = require("./utils/orderCollectionIdentity");
135
136
  var _salesNotes = require("./salesNotes");
136
137
  var _manualProductDiscount = require("./utils/manualProductDiscount");
137
138
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
138
- _dayjs.default.extend(_customParseFormat.default);
139
139
  const POINT_CARD_SNAPSHOT_TAG = 'point_card';
140
140
  const VIRTUAL_CURRENCY_SNAPSHOT_TAG = 'virtual_currency';
141
141
  function isPlainObject(value) {
@@ -179,6 +179,46 @@ function buildPointCardSnapshotFromWalletPassList(value) {
179
179
  return result;
180
180
  }, []);
181
181
  }
182
+ function collectPointCardSnapshotCodeCandidates(value) {
183
+ if (!Array.isArray(value)) return [];
184
+ const codeById = new Map();
185
+ value.forEach(item => {
186
+ if (!isPlainObject(item)) return;
187
+ const id = normalizeSnapshotScalar(item.id ?? item.voucher_id);
188
+ const code = normalizeSnapshotScalar(item.code);
189
+ if (id === undefined || code === undefined) return;
190
+ const identity = String(id).trim();
191
+ const normalizedCode = String(code).trim();
192
+ if (!identity || !normalizedCode || codeById.has(identity)) return;
193
+ codeById.set(identity, normalizedCode);
194
+ });
195
+ return [...codeById].map(([id, code]) => ({
196
+ id,
197
+ code
198
+ }));
199
+ }
200
+
201
+ /**
202
+ * Payment 的 WalletPass 列表包含实例 code,而 prepare/config 通常只提供
203
+ * 卡名称和余额。按实例 ID 仅补齐 Snapshot 缺失的 code,避免后到的运行态
204
+ * 数据覆盖下单时已经冻结的卡名称和余额。
205
+ */
206
+ function mergePointCardSnapshotCodes(snapshotsValue, walletPassesValue) {
207
+ const snapshots = buildPointCardSnapshotFromWalletPassList(snapshotsValue);
208
+ if (!snapshots.length || !Array.isArray(walletPassesValue)) return snapshots;
209
+ const codeById = new Map(collectPointCardSnapshotCodeCandidates(walletPassesValue).map(({
210
+ id,
211
+ code
212
+ }) => [id, code]));
213
+ return snapshots.map(snapshot => {
214
+ if (snapshot.code) return snapshot;
215
+ const code = codeById.get(String(snapshot.id).trim());
216
+ return code ? {
217
+ ...snapshot,
218
+ code
219
+ } : snapshot;
220
+ });
221
+ }
182
222
  function normalizeSnapshotNameMap(value) {
183
223
  if (typeof value === 'string' || typeof value === 'number') {
184
224
  const normalizedText = String(value).trim();
@@ -672,24 +712,6 @@ function resolveSubmitBundleMapId(bundle) {
672
712
  }
673
713
  return undefined;
674
714
  }
675
- function ensureSubmitDiscountIdentity(discount) {
676
- if (!discount || typeof discount !== 'object' || Array.isArray(discount)) {
677
- return discount;
678
- }
679
- const discountRecord = discount;
680
- const metadata = discountRecord.metadata && typeof discountRecord.metadata === 'object' && !Array.isArray(discountRecord.metadata) ? discountRecord.metadata : {};
681
- const uniqueIdentificationNumber = metadata.unique_identification_number;
682
- if (uniqueIdentificationNumber !== undefined && uniqueIdentificationNumber !== null && String(uniqueIdentificationNumber).trim() !== '') {
683
- return discount;
684
- }
685
- return {
686
- ...discountRecord,
687
- metadata: {
688
- ...metadata,
689
- unique_identification_number: (0, _orderCollectionIdentity.createUuidV4)()
690
- }
691
- };
692
- }
693
715
  function collectSubmitProductDiscountList(product) {
694
716
  const submitDiscountList = Array.isArray(product?.discount_list) ? [...product.discount_list] : [];
695
717
  for (const bundle of product?.product_bundle || []) {
@@ -711,7 +733,7 @@ function collectSubmitProductDiscountList(product) {
711
733
  });
712
734
  }
713
735
  }
714
- return normalizeOrderProductDiscountList(submitDiscountList.map(ensureSubmitDiscountIdentity));
736
+ return normalizeOrderProductDiscountList(submitDiscountList);
715
737
  }
716
738
 
717
739
  /**
@@ -778,23 +800,7 @@ function resolveEffectivePerUnitDiscount(product) {
778
800
  if (!Number.isFinite(originalPrice) || !Number.isFinite(finalPrice)) return fromList;
779
801
  return fromList + (originalPrice - finalPrice);
780
802
  }
781
- function createDefaultOrderRulesHooks(getBookings) {
782
- const getProductStartDate = product => {
783
- const productUid = String(product.metadata?.unique_identification_number ?? product.unique_identification_number ?? '');
784
- const bookingUid = String(product.booking_uid ?? product.metadata?.booking_uid ?? '');
785
- // 每次读取当前 bookings,覆盖改期、订单回显以及直接调用 Rules 的选券入口。
786
- const bookings = getBookings?.() || [];
787
- const booking = bookings.find(item => productUid && String(item?.product_uid ?? item?.metadata?.product_uid ?? '') === productUid) || bookings.find(item => bookingUid && String(item?.metadata?.unique_identification_number ?? item?.booking_uid ?? '') === bookingUid);
788
- if (booking) {
789
- // 严格解析并保留 Invalid Date,让公共时间校验拒绝缺失/非法时间,避免回退到当前时间。
790
- return (0, _dayjs.default)(`${booking.start_date} ${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);
791
- }
792
- if (getBookings && (bookingUid || product.booking_id || product.metadata?.booking_id)) {
793
- return (0, _dayjs.default)('');
794
- }
795
- const legacyStartDate = product.metadata?.start_date || product.metadata?.startDate;
796
- return legacyStartDate ? (0, _dayjs.default)(legacyStartDate) : undefined;
797
- };
803
+ function createDefaultOrderRulesHooks() {
798
804
  const toUnitPriceString = (totalLike, num) => {
799
805
  const effectiveNum = Number(num) > 0 ? Number(num) : 1;
800
806
  return new _decimal.default(Number(totalLike) || 0).dividedBy(effectiveNum).toDecimalPlaces(2).toString();
@@ -882,7 +888,7 @@ function createDefaultOrderRulesHooks(getBookings) {
882
888
  // 无券时会把 bundle 价还原成 original_price(手动改价套餐会从 20 回到 30)。
883
889
  isManualDiscount: resolveRulesManualDiscountFlag(metadataAny),
884
890
  holder_id: product.metadata?.holder_id,
885
- startDate: getProductStartDate(product),
891
+ startDate: product.metadata?.start_date || product.metadata?.startDate,
886
892
  main_product_selling_price: metadataAny.main_product_selling_price !== undefined ? new _decimal.default(Number(metadataAny.main_product_selling_price) || 0).minus(optionSum).toDecimalPlaces(2).toString() : undefined,
887
893
  inPromotion: metadataAny._promotion?.inPromotion === true,
888
894
  _promotion: metadataAny._promotion
@@ -412,8 +412,6 @@ export interface WalletAssetsBehaviorOptions {
412
412
  export interface RefreshWalletAssetsOptions {
413
413
  /** 商品/金额变化默认保留并重验选择;客户变化由实现层强制清空。 */
414
414
  preserveSelection?: boolean;
415
- /** 客户变化时,仅保留与本次扫码匹配的搜索结果;其他搜索缓存仍会清空。 */
416
- retainSearchResultCodes?: string[];
417
415
  }
418
416
  export interface SelectWalletAssetOptions {
419
417
  selected: boolean;
@@ -421,8 +419,6 @@ export interface SelectWalletAssetOptions {
421
419
  }
422
420
  export interface ScanWalletAssetResult {
423
421
  type: SearchIdentificationCodeResult['type'];
424
- /** walletCode 时保留完整 Wallet Detail,供客户解析与客户选择器使用。 */
425
- data?: WalletDetailSearchData;
426
422
  asset?: any;
427
423
  selected: boolean;
428
424
  state: WalletAssetsState;
@@ -868,8 +864,6 @@ export interface SearchIdentificationCodeParams extends WalletDeductionRecommend
868
864
  * 搜索识别码响应数据
869
865
  */
870
866
  export interface SearchIdentificationCodeResponse {
871
- /** 业务是否成功 */
872
- status?: boolean;
873
867
  /** 响应状态码 */
874
868
  code?: number;
875
869
  /** 响应消息 */
@@ -877,26 +871,12 @@ export interface SearchIdentificationCodeResponse {
877
871
  /** 响应数据 */
878
872
  data?: SearchIdentificationCodeItem[];
879
873
  }
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
- }
894
874
  /**
895
875
  * 搜索识别码结果类型
896
876
  */
897
877
  export type SearchIdentificationCodeResult = {
898
878
  type: 'walletCode';
899
- data: WalletDetailSearchData;
879
+ data: SearchIdentificationCodeItem[];
900
880
  } | {
901
881
  type: 'normalCode';
902
882
  data: SearchIdentificationCodeItem[];
@@ -221,7 +221,6 @@ let PaymentHooks = exports.PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
221
221
  /**
222
222
  * 搜索识别码响应数据
223
223
  */
224
- /** Wallet code 精确搜索返回的 Wallet Detail。 */
225
224
  /**
226
225
  * 搜索识别码结果类型
227
226
  */
@@ -96,7 +96,7 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
96
96
  * 搜索识别码信息
97
97
  * 通过识别码搜索相关的钱包通行证信息
98
98
  * 基于 WalletDeductionRecommendParams 参数结构
99
- * 特殊逻辑:WL 或指定 200 格式的 Wallet Code 调用 /wallet/detail/search 接口。
99
+ * 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
100
100
  */
101
101
  searchIdentificationCodeAsync(params: SearchIdentificationCodeParams, config?: {
102
102
  noCache?: boolean;
@@ -705,7 +705,7 @@ class WalletPassPaymentImpl {
705
705
  * 搜索识别码信息
706
706
  * 通过识别码搜索相关的钱包通行证信息
707
707
  * 基于 WalletDeductionRecommendParams 参数结构
708
- * 特殊逻辑:WL 或指定 200 格式的 Wallet Code 调用 /wallet/detail/search 接口。
708
+ * 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
709
709
  */
710
710
  async searchIdentificationCodeAsync(params, config = {}) {
711
711
  try {
@@ -725,7 +725,6 @@ class WalletPassPaymentImpl {
725
725
  const walletDetailParams = {
726
726
  code: code,
727
727
  with_customer: 1,
728
- with_franchisor_data: 1,
729
728
  with: ['wallet']
730
729
  };
731
730
  this.paymentModule.logInfo('[WalletPass] 搜索钱包识别码', {
@@ -734,18 +733,15 @@ class WalletPassPaymentImpl {
734
733
  with: walletDetailParams.with
735
734
  });
736
735
  const response = await this.paymentModule.request.post('/wallet/detail/search', walletDetailParams);
737
- const walletDetail = response?.data;
738
- if (response?.status !== true || response?.code !== 200 || !walletDetail || typeof walletDetail !== 'object' || Array.isArray(walletDetail)) {
739
- throw new Error(response?.message || 'Wallet detail search failed');
740
- }
736
+ const searchResults = response?.data || [];
741
737
  this.paymentModule.logInfo('[WalletPass] 钱包识别码搜索完成', {
742
738
  code: code,
743
- results_count: 1,
739
+ results_count: searchResults.length,
744
740
  type: 'walletCode'
745
741
  });
746
742
  return {
747
743
  type: 'walletCode',
748
- data: walletDetail
744
+ data: searchResults
749
745
  };
750
746
  }
751
747
 
@@ -834,16 +830,9 @@ class WalletPassPaymentImpl {
834
830
  const previousCustomerId = this.walletAssetsState.customerId;
835
831
  const customerChanged = String(previousCustomerId ?? '') !== String(nextCustomerId ?? '');
836
832
  const preserveSelection = options.preserveSelection !== false && !customerChanged;
837
- const retainedSearchCodeKeys = new Set((options.retainSearchResultCodes || []).map(normalizeWalletAssetCode).filter(Boolean));
838
- const retainedSearchResults = customerChanged && retainedSearchCodeKeys.size > 0 ? this.searchResults.filter(item => isWalletPaymentAsset(item) && getWalletAssetCodeKeys(item).some(code => retainedSearchCodeKeys.has(code))) : [];
839
833
  if (customerChanged) {
840
834
  this.clearSearchResults();
841
- if (retainedSearchResults.length > 0) {
842
- this.searchResults = mergeWalletAssets(retainedSearchResults);
843
- this.queuePendingAutoSelectForAssets(retainedSearchResults);
844
- }
845
835
  }
846
- const preserveSearchContext = preserveSelection || retainedSearchResults.length > 0;
847
836
  const committedKeys = new Set(this.walletAssetsState.committedIds.map(id => String(id)));
848
837
  const committedItems = this.walletAssetsState.items.filter(item => committedKeys.has(getWalletAssetKey(item)));
849
838
  const selectedIds = preserveSelection ? [...this.walletAssetsState.selectedIds] : [];
@@ -912,8 +901,8 @@ class WalletPassPaymentImpl {
912
901
  error: null
913
902
  });
914
903
  try {
915
- const searchedWalletAssetCodes = preserveSearchContext ? this.getSearchedWalletAssetCodes() : [];
916
- const useAggregateRecalculate = preserveSearchContext && (selectedIds.length > 0 || searchedWalletAssetCodes.length > 0);
904
+ const searchedWalletAssetCodes = preserveSelection ? this.getSearchedWalletAssetCodes() : [];
905
+ const useAggregateRecalculate = preserveSelection && (selectedIds.length > 0 || searchedWalletAssetCodes.length > 0);
917
906
  const aggregateResult = useAggregateRecalculate ? await this.aggregateRecalculateWalletAssetsAsync(businessData, selectedIds) : null;
918
907
  const result = aggregateResult || (await this.initializeWalletDataFromBusinessAsync(businessData));
919
908
  if (requestSequence !== this.walletAssetsRequestSequence) {
@@ -931,7 +920,7 @@ class WalletPassPaymentImpl {
931
920
  this.searchResults = this.searchResults.filter(item => !missingSelectedKeys.has(getWalletAssetKey(item)));
932
921
  }
933
922
  }
934
- const searchedWalletAssets = preserveSearchContext ? this.syncSearchedWalletAssets([...(result.transformList || []), ...(result.noApplicableVoucher || [])]) : [];
923
+ const searchedWalletAssets = preserveSelection ? this.syncSearchedWalletAssets([...(result.transformList || []), ...(result.noApplicableVoucher || [])]) : [];
935
924
  if (requestSequence !== this.walletAssetsRequestSequence) {
936
925
  return this.getWalletAssetsState();
937
926
  }
@@ -1133,23 +1122,14 @@ class WalletPassPaymentImpl {
1133
1122
  code: normalizedCode,
1134
1123
  prepare_payments: this.formatWalletPassList2PreparePayments(this.walletAssetsState.selectedItems)
1135
1124
  });
1136
- if (result.type === 'walletCode') {
1137
- return {
1138
- type: 'walletCode',
1139
- data: result.data,
1140
- asset: result.data,
1141
- selected: false,
1142
- state: this.getWalletAssetsState()
1143
- };
1144
- }
1145
1125
  const paymentAssets = this.formatSearchedWalletPaymentAssets(result.data.filter(isWalletPaymentAsset));
1146
1126
  if (paymentAssets.length > 0) {
1147
1127
  this.searchResults = mergeWalletAssets(this.searchResults, paymentAssets);
1148
1128
  }
1149
1129
  const asset = paymentAssets.find(item => String(item?.code || '') === normalizedCode) || paymentAssets[0];
1150
- if (!asset) {
1130
+ if (!asset || result.type === 'walletCode') {
1151
1131
  return {
1152
- type: 'normalCode',
1132
+ type: result.type,
1153
1133
  asset,
1154
1134
  selected: false,
1155
1135
  state: this.getWalletAssetsState()
@@ -16,8 +16,8 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
16
16
  getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
17
17
  private normalizeHolderRecordIds;
18
18
  /**
19
- * 商品未开启 Holder 选择时跳过匹配;已开启时,特定 form Holder 卡
20
- * 只适用于同一 Holder Record,是否必填不影响匹配规则。
19
+ * 特定 form Holder 卡只授权给绑定同一 Holder Record 的商品行。
20
+ * required/isNeedHolder 仅控制是否强制选择 Holder,不参与优惠资格。
21
21
  */
22
22
  private checkHolderMatch;
23
23
  isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {