@pisell/pisellos 2.2.308 → 2.2.310
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.
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -2
- package/dist/modules/BookingContext/index.js +4 -4
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +58 -19
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +24 -12
- package/dist/modules/Customer/index.js +6 -3
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/availability.d.ts +7 -0
- package/dist/modules/Discount/availability.js +49 -0
- package/dist/modules/Discount/entitlementPass.d.ts +34 -0
- package/dist/modules/Discount/entitlementPass.js +147 -0
- package/dist/modules/Discount/index.d.ts +2 -2
- package/dist/modules/Discount/index.js +37 -151
- package/dist/modules/Discount/types.d.ts +36 -5
- package/dist/modules/OpenData/index.d.ts +1 -1
- package/dist/modules/OpenData/index.js +21 -12
- package/dist/modules/Order/index.d.ts +33 -4
- package/dist/modules/Order/index.js +830 -411
- package/dist/modules/Order/types.d.ts +17 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +16 -12
- package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/dist/modules/Order/utils/weighedProduct.js +94 -0
- package/dist/modules/Order/utils.d.ts +14 -2
- package/dist/modules/Order/utils.js +280 -79
- package/dist/modules/Payment/index.d.ts +0 -5
- package/dist/modules/Payment/index.js +35 -85
- package/dist/modules/Payment/types.d.ts +21 -1
- package/dist/modules/Payment/types.js +2 -0
- package/dist/modules/Payment/walletpass.d.ts +1 -1
- package/dist/modules/Payment/walletpass.js +80 -47
- package/dist/modules/ProductList/index.js +18 -5
- package/dist/modules/Rules/index.d.ts +2 -2
- package/dist/modules/Rules/index.js +484 -188
- package/dist/modules/Rules/types.d.ts +6 -0
- package/dist/server/index.js +8 -5
- package/dist/server/modules/order/index.js +6 -0
- package/dist/server/modules/order/types.d.ts +12 -0
- package/dist/server/modules/payment/index.d.ts +25 -6
- package/dist/server/modules/payment/index.js +660 -133
- package/dist/server/utils/small-ticket.d.ts +8 -5
- package/dist/server/utils/small-ticket.js +1269 -199
- package/dist/solution/BaseSales/index.d.ts +11 -2
- package/dist/solution/BaseSales/index.js +1463 -1173
- package/dist/solution/BaseSales/types.d.ts +7 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +141 -126
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +40 -25
- package/dist/solution/BaseSales/utils.js +3 -2
- package/dist/solution/BookingTicket/index.d.ts +11 -2
- package/dist/solution/BookingTicket/index.js +663 -542
- package/dist/solution/BookingTicket/types.d.ts +5 -1
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +338 -147
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +19 -6
- package/dist/solution/ScanOrder/utils.js +3 -2
- package/dist/solution/ShopDiscount/index.d.ts +2 -0
- package/dist/solution/ShopDiscount/index.js +99 -42
- package/dist/solution/ShopDiscount/utils.d.ts +4 -2
- package/dist/solution/ShopDiscount/utils.js +43 -23
- package/dist/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/dist/solution/UnifiedBookingSales/index.js +5 -5
- package/dist/utils/os-private-payload.d.ts +5 -0
- package/dist/utils/os-private-payload.js +17 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -0
- package/lib/modules/BookingContext/index.js +3 -3
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +35 -6
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +13 -6
- package/lib/modules/Customer/index.js +5 -1
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/availability.d.ts +7 -0
- package/lib/modules/Discount/availability.js +43 -0
- package/lib/modules/Discount/entitlementPass.d.ts +34 -0
- package/lib/modules/Discount/entitlementPass.js +141 -0
- package/lib/modules/Discount/index.d.ts +2 -2
- package/lib/modules/Discount/index.js +23 -129
- package/lib/modules/Discount/types.d.ts +36 -5
- package/lib/modules/OpenData/index.d.ts +1 -1
- package/lib/modules/OpenData/index.js +11 -2
- package/lib/modules/Order/index.d.ts +33 -4
- package/lib/modules/Order/index.js +411 -81
- package/lib/modules/Order/types.d.ts +17 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +14 -11
- package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/lib/modules/Order/utils/weighedProduct.js +89 -0
- package/lib/modules/Order/utils.d.ts +14 -2
- package/lib/modules/Order/utils.js +189 -5
- package/lib/modules/Payment/index.d.ts +0 -5
- package/lib/modules/Payment/index.js +3 -28
- package/lib/modules/Payment/types.d.ts +21 -1
- package/lib/modules/Payment/types.js +1 -0
- package/lib/modules/Payment/walletpass.d.ts +1 -1
- package/lib/modules/Payment/walletpass.js +29 -9
- package/lib/modules/ProductList/index.js +14 -1
- package/lib/modules/Rules/index.d.ts +2 -2
- package/lib/modules/Rules/index.js +361 -112
- package/lib/modules/Rules/types.d.ts +6 -0
- package/lib/server/index.js +8 -5
- package/lib/server/modules/order/index.js +6 -0
- package/lib/server/modules/order/types.d.ts +12 -0
- package/lib/server/modules/payment/index.d.ts +25 -6
- package/lib/server/modules/payment/index.js +350 -78
- package/lib/server/utils/small-ticket.d.ts +8 -5
- package/lib/server/utils/small-ticket.js +1009 -121
- package/lib/solution/BaseSales/index.d.ts +11 -2
- package/lib/solution/BaseSales/index.js +164 -30
- package/lib/solution/BaseSales/types.d.ts +7 -3
- package/lib/solution/BaseSales/utils/cartPromotion.js +12 -4
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -9
- package/lib/solution/BaseSales/utils.js +2 -1
- package/lib/solution/BookingTicket/index.d.ts +11 -2
- package/lib/solution/BookingTicket/index.js +103 -41
- package/lib/solution/BookingTicket/types.d.ts +5 -1
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +174 -42
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +11 -3
- package/lib/solution/ScanOrder/utils.js +2 -1
- package/lib/solution/ShopDiscount/index.d.ts +2 -0
- package/lib/solution/ShopDiscount/index.js +55 -9
- package/lib/solution/ShopDiscount/utils.d.ts +4 -2
- package/lib/solution/ShopDiscount/utils.js +42 -25
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/lib/solution/UnifiedBookingSales/index.js +5 -5
- package/lib/utils/os-private-payload.d.ts +5 -0
- package/lib/utils/os-private-payload.js +22 -0
- package/package.json +1 -1
|
@@ -705,7 +705,7 @@ class WalletPassPaymentImpl {
|
|
|
705
705
|
* 搜索识别码信息
|
|
706
706
|
* 通过识别码搜索相关的钱包通行证信息
|
|
707
707
|
* 基于 WalletDeductionRecommendParams 参数结构
|
|
708
|
-
*
|
|
708
|
+
* 特殊逻辑:WL 或指定 200 格式的 Wallet Code 调用 /wallet/detail/search 接口。
|
|
709
709
|
*/
|
|
710
710
|
async searchIdentificationCodeAsync(params, config = {}) {
|
|
711
711
|
try {
|
|
@@ -725,6 +725,7 @@ class WalletPassPaymentImpl {
|
|
|
725
725
|
const walletDetailParams = {
|
|
726
726
|
code: code,
|
|
727
727
|
with_customer: 1,
|
|
728
|
+
with_franchisor_data: 1,
|
|
728
729
|
with: ['wallet']
|
|
729
730
|
};
|
|
730
731
|
this.paymentModule.logInfo('[WalletPass] 搜索钱包识别码', {
|
|
@@ -733,15 +734,18 @@ class WalletPassPaymentImpl {
|
|
|
733
734
|
with: walletDetailParams.with
|
|
734
735
|
});
|
|
735
736
|
const response = await this.paymentModule.request.post('/wallet/detail/search', walletDetailParams);
|
|
736
|
-
const
|
|
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
|
+
}
|
|
737
741
|
this.paymentModule.logInfo('[WalletPass] 钱包识别码搜索完成', {
|
|
738
742
|
code: code,
|
|
739
|
-
results_count:
|
|
743
|
+
results_count: 1,
|
|
740
744
|
type: 'walletCode'
|
|
741
745
|
});
|
|
742
746
|
return {
|
|
743
747
|
type: 'walletCode',
|
|
744
|
-
data:
|
|
748
|
+
data: walletDetail
|
|
745
749
|
};
|
|
746
750
|
}
|
|
747
751
|
|
|
@@ -830,9 +834,16 @@ class WalletPassPaymentImpl {
|
|
|
830
834
|
const previousCustomerId = this.walletAssetsState.customerId;
|
|
831
835
|
const customerChanged = String(previousCustomerId ?? '') !== String(nextCustomerId ?? '');
|
|
832
836
|
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))) : [];
|
|
833
839
|
if (customerChanged) {
|
|
834
840
|
this.clearSearchResults();
|
|
841
|
+
if (retainedSearchResults.length > 0) {
|
|
842
|
+
this.searchResults = mergeWalletAssets(retainedSearchResults);
|
|
843
|
+
this.queuePendingAutoSelectForAssets(retainedSearchResults);
|
|
844
|
+
}
|
|
835
845
|
}
|
|
846
|
+
const preserveSearchContext = preserveSelection || retainedSearchResults.length > 0;
|
|
836
847
|
const committedKeys = new Set(this.walletAssetsState.committedIds.map(id => String(id)));
|
|
837
848
|
const committedItems = this.walletAssetsState.items.filter(item => committedKeys.has(getWalletAssetKey(item)));
|
|
838
849
|
const selectedIds = preserveSelection ? [...this.walletAssetsState.selectedIds] : [];
|
|
@@ -901,8 +912,8 @@ class WalletPassPaymentImpl {
|
|
|
901
912
|
error: null
|
|
902
913
|
});
|
|
903
914
|
try {
|
|
904
|
-
const searchedWalletAssetCodes =
|
|
905
|
-
const useAggregateRecalculate =
|
|
915
|
+
const searchedWalletAssetCodes = preserveSearchContext ? this.getSearchedWalletAssetCodes() : [];
|
|
916
|
+
const useAggregateRecalculate = preserveSearchContext && (selectedIds.length > 0 || searchedWalletAssetCodes.length > 0);
|
|
906
917
|
const aggregateResult = useAggregateRecalculate ? await this.aggregateRecalculateWalletAssetsAsync(businessData, selectedIds) : null;
|
|
907
918
|
const result = aggregateResult || (await this.initializeWalletDataFromBusinessAsync(businessData));
|
|
908
919
|
if (requestSequence !== this.walletAssetsRequestSequence) {
|
|
@@ -920,7 +931,7 @@ class WalletPassPaymentImpl {
|
|
|
920
931
|
this.searchResults = this.searchResults.filter(item => !missingSelectedKeys.has(getWalletAssetKey(item)));
|
|
921
932
|
}
|
|
922
933
|
}
|
|
923
|
-
const searchedWalletAssets =
|
|
934
|
+
const searchedWalletAssets = preserveSearchContext ? this.syncSearchedWalletAssets([...(result.transformList || []), ...(result.noApplicableVoucher || [])]) : [];
|
|
924
935
|
if (requestSequence !== this.walletAssetsRequestSequence) {
|
|
925
936
|
return this.getWalletAssetsState();
|
|
926
937
|
}
|
|
@@ -1122,14 +1133,23 @@ class WalletPassPaymentImpl {
|
|
|
1122
1133
|
code: normalizedCode,
|
|
1123
1134
|
prepare_payments: this.formatWalletPassList2PreparePayments(this.walletAssetsState.selectedItems)
|
|
1124
1135
|
});
|
|
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
|
+
}
|
|
1125
1145
|
const paymentAssets = this.formatSearchedWalletPaymentAssets(result.data.filter(isWalletPaymentAsset));
|
|
1126
1146
|
if (paymentAssets.length > 0) {
|
|
1127
1147
|
this.searchResults = mergeWalletAssets(this.searchResults, paymentAssets);
|
|
1128
1148
|
}
|
|
1129
1149
|
const asset = paymentAssets.find(item => String(item?.code || '') === normalizedCode) || paymentAssets[0];
|
|
1130
|
-
if (!asset
|
|
1150
|
+
if (!asset) {
|
|
1131
1151
|
return {
|
|
1132
|
-
type:
|
|
1152
|
+
type: 'normalCode',
|
|
1133
1153
|
asset,
|
|
1134
1154
|
selected: false,
|
|
1135
1155
|
state: this.getWalletAssetsState()
|
|
@@ -130,6 +130,19 @@ class ProductList extends _BaseModule.BaseModule {
|
|
|
130
130
|
};
|
|
131
131
|
const rawApplicationCode = this.otherParams?.channel;
|
|
132
132
|
const mappedApplicationCode = typeof rawApplicationCode === 'string' ? channelMap[rawApplicationCode] || rawApplicationCode : rawApplicationCode;
|
|
133
|
+
const configuredBusinessCode = this.otherParams?.businessCode ?? this.otherParams?.business_code;
|
|
134
|
+
// application_code 是后端商品筛选字段;智能定价评估器则只读取
|
|
135
|
+
// strategy_context 中的 channel / business_code。默认补齐两者,
|
|
136
|
+
// 但允许调用方显式传入的上下文覆盖默认值。
|
|
137
|
+
const resolvedStrategyContext = {
|
|
138
|
+
...(mappedApplicationCode ? {
|
|
139
|
+
channel: mappedApplicationCode
|
|
140
|
+
} : {}),
|
|
141
|
+
...(configuredBusinessCode ? {
|
|
142
|
+
business_code: configuredBusinessCode
|
|
143
|
+
} : {}),
|
|
144
|
+
...(strategy_context || {})
|
|
145
|
+
};
|
|
133
146
|
const queryPayload = {
|
|
134
147
|
...((0, _platform.isCustomerUserPlatform)(this.otherParams?.platform) ? {} : {
|
|
135
148
|
open_quotation: 1
|
|
@@ -162,7 +175,7 @@ class ProductList extends _BaseModule.BaseModule {
|
|
|
162
175
|
with_schedule,
|
|
163
176
|
schedule_datetime,
|
|
164
177
|
extension_type,
|
|
165
|
-
strategy_context
|
|
178
|
+
strategy_context: Object.keys(resolvedStrategyContext).length ? resolvedStrategyContext : undefined
|
|
166
179
|
};
|
|
167
180
|
const handledByOsServer = (0, _clientDataVariants.isProductQueryHandledByOsServer)(this.core, this.request);
|
|
168
181
|
const originalCallback = options?.callback;
|
|
@@ -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
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* 商品未开启 Holder 选择时跳过匹配;已开启时,特定 form Holder 卡
|
|
20
|
+
* 只适用于同一 Holder Record,是否必填不影响匹配规则。
|
|
21
21
|
*/
|
|
22
22
|
private checkHolderMatch;
|
|
23
23
|
isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {
|