@pisell/pisellos 2.2.71 → 2.2.73

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 (47) hide show
  1. package/dist/model/strategy/adapter/index.d.ts +2 -0
  2. package/dist/model/strategy/adapter/index.js +2 -1
  3. package/dist/model/strategy/adapter/promotion/adapter.d.ts +66 -0
  4. package/dist/model/strategy/adapter/promotion/adapter.js +271 -0
  5. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
  6. package/dist/model/strategy/adapter/promotion/evaluator.js +1210 -0
  7. package/dist/model/strategy/adapter/promotion/examples.d.ts +138 -0
  8. package/dist/model/strategy/adapter/promotion/examples.js +166 -0
  9. package/dist/model/strategy/adapter/promotion/index.d.ts +4 -0
  10. package/dist/model/strategy/adapter/promotion/index.js +0 -0
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +447 -0
  12. package/dist/model/strategy/adapter/promotion/type.js +209 -0
  13. package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -1
  14. package/dist/model/strategy/engine.d.ts +106 -0
  15. package/dist/model/strategy/engine.js +611 -0
  16. package/dist/model/strategy/index.d.ts +2 -93
  17. package/dist/model/strategy/index.js +6 -549
  18. package/dist/modules/BaseModule.d.ts +4 -0
  19. package/dist/modules/BaseModule.js +5 -0
  20. package/dist/modules/Product/index.d.ts +1 -1
  21. package/dist/modules/Rules/index.d.ts +1 -0
  22. package/dist/modules/Rules/index.js +52 -23
  23. package/dist/solution/BookingTicket/index.d.ts +1 -1
  24. package/lib/model/strategy/adapter/index.d.ts +2 -0
  25. package/lib/model/strategy/adapter/index.js +6 -0
  26. package/lib/model/strategy/adapter/promotion/adapter.d.ts +66 -0
  27. package/lib/model/strategy/adapter/promotion/adapter.js +217 -0
  28. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
  29. package/lib/model/strategy/adapter/promotion/evaluator.js +846 -0
  30. package/lib/model/strategy/adapter/promotion/examples.d.ts +138 -0
  31. package/lib/model/strategy/adapter/promotion/examples.js +192 -0
  32. package/lib/model/strategy/adapter/promotion/index.d.ts +4 -0
  33. package/lib/model/strategy/adapter/promotion/index.js +0 -0
  34. package/lib/model/strategy/adapter/promotion/type.d.ts +447 -0
  35. package/lib/model/strategy/adapter/promotion/type.js +51 -0
  36. package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -1
  37. package/lib/model/strategy/engine.d.ts +106 -0
  38. package/lib/model/strategy/engine.js +450 -0
  39. package/lib/model/strategy/index.d.ts +2 -93
  40. package/lib/model/strategy/index.js +6 -381
  41. package/lib/modules/BaseModule.d.ts +4 -0
  42. package/lib/modules/BaseModule.js +3 -0
  43. package/lib/modules/Product/index.d.ts +1 -1
  44. package/lib/modules/Rules/index.d.ts +1 -0
  45. package/lib/modules/Rules/index.js +35 -19
  46. package/lib/solution/BookingTicket/index.d.ts +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,447 @@
1
+ import { StrategyConfig } from '../../type';
2
+ /**
3
+ * Promotion 策略类型定义
4
+ *
5
+ * 定义促销活动相关的 Action 类型、值结构和配置
6
+ */
7
+ /**
8
+ * 促销活动 Action 类型
9
+ */
10
+ export declare const PROMOTION_ACTION_TYPES: {
11
+ /** X件Y元(每X件固定价格Y元,可累计) */
12
+ readonly X_ITEMS_FOR_Y_PRICE: "X_ITEMS_FOR_Y_PRICE";
13
+ /** 买X送Y(买X件送Y件,可累计) */
14
+ readonly BUY_X_GET_Y_FREE: "BUY_X_GET_Y_FREE";
15
+ /** 固定折扣 */
16
+ readonly DISCOUNT_RATE: "DISCOUNT_RATE";
17
+ /** 固定减价 */
18
+ readonly DEDUCT_AMOUNT: "DEDUCT_AMOUNT";
19
+ };
20
+ export type PromotionActionType = (typeof PROMOTION_ACTION_TYPES)[keyof typeof PROMOTION_ACTION_TYPES];
21
+ /**
22
+ * X件Y元 - Action Value
23
+ *
24
+ * @example
25
+ * value: { x: 2, price: 10 } // 每2件10元
26
+ */
27
+ export interface XItemsForYPriceValue {
28
+ /** 每X件(需要凑满的数量) */
29
+ x: number;
30
+ /** 固定价格Y元 */
31
+ price: number;
32
+ }
33
+ /**
34
+ * X件Y元 - Action Config
35
+ */
36
+ export interface XItemsForYPriceConfig {
37
+ /** 允许跨商品组合(A+B可以凑成一组) */
38
+ allowCrossProduct?: boolean;
39
+ /** 可累计(买5件 = 2组优惠 + 1件原价) */
40
+ cumulative?: boolean;
41
+ }
42
+ /**
43
+ * 买X送Y - Action Value
44
+ *
45
+ * @example
46
+ * value: { buyQuantity: 1, freeQuantity: 1 } // 买1送1
47
+ */
48
+ export interface BuyXGetYFreeValue {
49
+ /** 买X件 */
50
+ buyQuantity: number;
51
+ /** 送Y件 */
52
+ freeQuantity: number;
53
+ }
54
+ /**
55
+ * 赠品选择模式
56
+ */
57
+ export type GiftSelectionMode = 'user_select' | 'auto' | 'cheapest';
58
+ /**
59
+ * 买X送Y - Action Config
60
+ */
61
+ export interface BuyXGetYFreeConfig {
62
+ /** 赠品选择模式 */
63
+ giftSelectionMode?: GiftSelectionMode;
64
+ /** 可累计(买2送2、买3送3...) */
65
+ cumulative?: boolean;
66
+ /** 可选的赠品列表 */
67
+ giftProducts?: ProductIdentifier[];
68
+ }
69
+ /**
70
+ * 商品标识
71
+ *
72
+ * 匹配规则:
73
+ * - product_variant_id = 0 表示匹配任意变体
74
+ * - product_variant_id != 0 表示精确匹配该变体
75
+ */
76
+ export interface ProductIdentifier {
77
+ /** 商品ID */
78
+ product_id: number;
79
+ /**
80
+ * 变体ID
81
+ * - 0 表示匹配任意变体
82
+ * - 非0 表示精确匹配该变体
83
+ */
84
+ product_variant_id: number;
85
+ }
86
+ import { ActionEffect } from '../../type';
87
+ /**
88
+ * X件Y元 Action
89
+ */
90
+ export interface XItemsForYPriceAction extends Omit<ActionEffect, 'type' | 'value' | 'config'> {
91
+ type: typeof PROMOTION_ACTION_TYPES.X_ITEMS_FOR_Y_PRICE;
92
+ value: XItemsForYPriceValue;
93
+ valueType: 'object';
94
+ config?: XItemsForYPriceConfig;
95
+ }
96
+ /**
97
+ * 买X送Y Action
98
+ */
99
+ export interface BuyXGetYFreeAction extends Omit<ActionEffect, 'type' | 'value' | 'config'> {
100
+ type: typeof PROMOTION_ACTION_TYPES.BUY_X_GET_Y_FREE;
101
+ value: BuyXGetYFreeValue;
102
+ valueType: 'object';
103
+ config?: BuyXGetYFreeConfig;
104
+ }
105
+ /**
106
+ * 促销活动 Action 联合类型
107
+ */
108
+ export type PromotionAction = XItemsForYPriceAction | BuyXGetYFreeAction;
109
+ /**
110
+ * 促销相关运算符
111
+ */
112
+ export declare const PROMOTION_OPERATORS: {
113
+ /**
114
+ * 商品匹配运算符
115
+ *
116
+ * 匹配规则:
117
+ * - 首先匹配 product_id
118
+ * - 如果配置的 product_variant_id = 0,只需要 product_id 匹配
119
+ * - 如果配置的 product_variant_id != 0,还需要 product_variant_id 匹配
120
+ */
121
+ readonly PRODUCT_MATCH: "product_match";
122
+ };
123
+ /**
124
+ * 促销活动业务数据
125
+ *
126
+ * 由业务层传入,用于策略评估
127
+ */
128
+ export interface PromotionBusinessData {
129
+ /** 商品列表 */
130
+ products: PromotionProduct[];
131
+ /** 当前评估的商品(用于单商品场景,如商品卡片展示) */
132
+ currentProduct?: PromotionProduct;
133
+ /** 渠道 */
134
+ channel?: string;
135
+ /** 自定义属性 */
136
+ custom?: Record<string, any>;
137
+ }
138
+ type ProductBundleItem = {
139
+ /** 主商品ID */
140
+ product_id: number;
141
+ /** 变体ID(0 表示无变体) */
142
+ product_variant_id: number;
143
+ /** 数量 */
144
+ quantity: number;
145
+ /** 单价 */
146
+ price: number;
147
+ /** 原价 */
148
+ original_price?: number;
149
+ /** 套餐明细id */
150
+ id: number;
151
+ /** 套餐商品id */
152
+ _bundle_product_id: number;
153
+ };
154
+ /**
155
+ * 促销商品信息
156
+ */
157
+ export interface PromotionProduct {
158
+ id: number;
159
+ /** 商品ID */
160
+ product_id: number;
161
+ /** 变体ID(0 表示无变体) */
162
+ product_variant_id: number;
163
+ /** 商品名称 */
164
+ name?: string;
165
+ /** 单价 */
166
+ price: number;
167
+ /** 商品套餐 */
168
+ bundle: ProductBundleItem[];
169
+ /** 数量 */
170
+ quantity: number;
171
+ /** 原价 */
172
+ original_price?: number;
173
+ }
174
+ /**
175
+ * 促销活动适配器转换结果
176
+ *
177
+ * 返回给业务层,包含策略匹配信息
178
+ */
179
+ export interface PromotionTransformResult {
180
+ /** 策略是否适用 */
181
+ isApplicable: boolean;
182
+ /** 匹配的 Action 类型 */
183
+ actionType?: PromotionActionType;
184
+ /** 匹配的 Action 详情 */
185
+ actionDetail?: PromotionActionDetail;
186
+ /** 适用的商品列表(从购物车商品中筛选出的适用商品) */
187
+ applicableProducts: PromotionProduct[];
188
+ /** 不适用的原因 */
189
+ reason?: string;
190
+ /** 不适用的原因码 */
191
+ reasonCode?: string;
192
+ /** 原始策略引擎结果 */
193
+ strategyResult: import('../../type').EvaluationResult;
194
+ }
195
+ /**
196
+ * Action 详情联合类型
197
+ */
198
+ export type PromotionActionDetail = XItemsForYPriceActionDetail | BuyXGetYFreeActionDetail;
199
+ /**
200
+ * X件Y元 Action 详情
201
+ */
202
+ export interface XItemsForYPriceActionDetail {
203
+ type: typeof PROMOTION_ACTION_TYPES.X_ITEMS_FOR_Y_PRICE;
204
+ /** 每X件 */
205
+ x: number;
206
+ /** 固定价格Y元 */
207
+ price: number;
208
+ /** 允许跨商品组合 */
209
+ allowCrossProduct: boolean;
210
+ /** 可累计 */
211
+ cumulative: boolean;
212
+ }
213
+ /**
214
+ * 买X送Y Action 详情
215
+ */
216
+ export interface BuyXGetYFreeActionDetail {
217
+ type: typeof PROMOTION_ACTION_TYPES.BUY_X_GET_Y_FREE;
218
+ /** 买X件 */
219
+ buyQuantity: number;
220
+ /** 送Y件 */
221
+ freeQuantity: number;
222
+ /** 赠品选择模式 */
223
+ giftSelectionMode: GiftSelectionMode;
224
+ /** 可累计 */
225
+ cumulative: boolean;
226
+ /** 可选的赠品列表 */
227
+ giftProducts: ProductIdentifier[];
228
+ }
229
+ /**
230
+ * X件Y元 - 业务层计算结果
231
+ *
232
+ * 由业务层根据 matchedAction 计算后返回
233
+ */
234
+ export interface XItemsForYPriceResult {
235
+ /** 满足条件的组数 */
236
+ groupCount: number;
237
+ /** 剩余件数(原价) */
238
+ remainingCount: number;
239
+ /** 优惠金额 */
240
+ discountAmount: number;
241
+ /** 分组详情 */
242
+ groups: Array<{
243
+ products: Array<{
244
+ product_id: number;
245
+ product_variant_id: number;
246
+ originalPrice: number;
247
+ }>;
248
+ originalTotal: number;
249
+ discountedPrice: number;
250
+ }>;
251
+ }
252
+ /**
253
+ * 买X送Y - 业务层计算结果
254
+ *
255
+ * 由业务层根据 matchedAction 计算后返回
256
+ */
257
+ export interface BuyXGetYFreeResult {
258
+ /** 可送的赠品数量 */
259
+ freeCount: number;
260
+ /** 需要用户选择的赠品数量 */
261
+ pendingSelectCount: number;
262
+ /** 已选择的赠品 */
263
+ selectedGifts: ProductIdentifier[];
264
+ /** 可选的赠品列表 */
265
+ availableGifts: ProductIdentifier[];
266
+ }
267
+ /**
268
+ * 评估器输入
269
+ */
270
+ export interface PromotionEvaluatorInput {
271
+ /** 商品列表 */
272
+ products: PromotionProduct[];
273
+ /** 策略配置列表(可选,如果不传则使用 setStrategyConfigs 设置的) */
274
+ strategyConfigs?: StrategyConfig[];
275
+ /** 渠道 */
276
+ channel?: string;
277
+ }
278
+ /**
279
+ * 单商品评估结果
280
+ */
281
+ export interface ProductPromotionResult {
282
+ /** 商品信息 */
283
+ product: PromotionProduct;
284
+ /** 适用的促销列表 */
285
+ applicablePromotions: ApplicablePromotion[];
286
+ /** 是否有适用的促销 */
287
+ hasPromotion: boolean;
288
+ }
289
+ /**
290
+ * 适用的促销信息
291
+ */
292
+ export interface ApplicablePromotion {
293
+ /** 策略ID */
294
+ strategyId: string;
295
+ /** 策略名称 */
296
+ strategyName: string | Record<string, string>;
297
+ /** Action 类型 */
298
+ actionType: string;
299
+ /** Action 详情 */
300
+ actionDetail: PromotionActionDetail;
301
+ /** 展示配置 */
302
+ display?: {
303
+ text: string | Record<string, string>;
304
+ type: string;
305
+ };
306
+ /** 原始策略配置 */
307
+ strategyConfig: StrategyConfig;
308
+ /** 匹配的 bundle 子商品索引(如果是 bundle 子商品匹配) */
309
+ matchedBundleIndex?: number;
310
+ /** 满足促销所需的商品数量 */
311
+ requiredQuantity?: number;
312
+ /** 参与促销的商品列表 */
313
+ eligibleProducts?: ProductIdentifier[];
314
+ }
315
+ /**
316
+ * 购物车评估结果
317
+ */
318
+ export interface CartEvaluationResult {
319
+ /** 每个商品的促销结果 */
320
+ productResults: ProductPromotionResult[];
321
+ /** 购物车中所有适用的促销(去重) */
322
+ applicablePromotions: CartApplicablePromotion[];
323
+ /** 按促销分组的商品 */
324
+ promotionGroups: PromotionGroup[];
325
+ }
326
+ /**
327
+ * 购物车适用的促销
328
+ */
329
+ export interface CartApplicablePromotion extends ApplicablePromotion {
330
+ /** 适用此促销的商品列表 */
331
+ applicableProducts: PromotionProduct[];
332
+ /** 适用商品的总数量 */
333
+ totalQuantity: number;
334
+ /** 适用商品的总金额 */
335
+ totalAmount: number;
336
+ /** 商品ID -> 匹配的 bundle 子商品索引映射 */
337
+ productMatchedBundleIndexMap?: Map<number, number | undefined>;
338
+ }
339
+ /**
340
+ * 促销分组
341
+ */
342
+ export interface PromotionGroup {
343
+ /** 策略ID */
344
+ strategyId: string;
345
+ /** 策略名称 */
346
+ strategyName: string | Record<string, string>;
347
+ /** 策略元数据 */
348
+ strategyMetadata?: StrategyConfig['metadata'];
349
+ /** 原始策略配置 */
350
+ strategyConfig?: StrategyConfig;
351
+ /** Action 类型 */
352
+ actionType: string;
353
+ /** Action 详情 */
354
+ actionDetail: PromotionActionDetail;
355
+ /** 分组内的商品 */
356
+ products: PromotionProduct[];
357
+ /** 商品总数量 */
358
+ totalQuantity: number;
359
+ /** 商品总金额 */
360
+ totalAmount: number;
361
+ /** 商品ID -> 匹配的 bundle 子商品索引映射 */
362
+ productMatchedBundleIndexMap?: Map<number, number | undefined>;
363
+ }
364
+ /**
365
+ * 带定价的商品
366
+ *
367
+ * 在 PromotionProduct 基础上增加了均摊后的最终价格和促销信息
368
+ */
369
+ export interface PricedProduct extends PromotionProduct {
370
+ /**
371
+ * 原始商品ID
372
+ * 当商品被拆分时,此字段记录拆分前的原始商品id
373
+ * 例如 A*5 拆成 A*4(参与促销)+ A*1(原价),A*4 的 originalId 指向原始 A 的 id
374
+ */
375
+ originalId?: number;
376
+ /**
377
+ * 最终单价(均摊后)
378
+ * - 参与促销的商品:按原价比例均摊后的价格
379
+ * - 未参与促销的商品:等于 price
380
+ */
381
+ finalPrice: number;
382
+ /**
383
+ * 应用的策略ID
384
+ * 如果商品参与了促销,记录对应的策略ID
385
+ */
386
+ strategyId?: string;
387
+ /**
388
+ * 应用的策略元数据
389
+ * 如果商品参与了促销,记录对应策略的 metadata
390
+ */
391
+ strategyMetadata?: StrategyConfig['metadata'];
392
+ /**
393
+ * 是否参与了促销
394
+ */
395
+ inPromotion: boolean;
396
+ /**
397
+ * 是否为拆分出来的商品
398
+ * true 表示这是从原商品拆分出来的新记录
399
+ */
400
+ isSplit?: boolean;
401
+ /**
402
+ * 匹配的 bundle 子商品索引
403
+ * 如果促销匹配的是 bundle 子商品而非主商品,记录对应的 bundle 索引
404
+ * undefined 表示匹配的是主商品
405
+ */
406
+ matchedBundleIndex?: number;
407
+ }
408
+ /**
409
+ * 赠品信息
410
+ *
411
+ * 记录某个促销产生的赠品数量和可选赠品列表
412
+ */
413
+ export interface GiftInfo {
414
+ /** 策略ID */
415
+ strategyId: string;
416
+ /** 策略名称 */
417
+ strategyName: string | Record<string, string>;
418
+ /** 可送赠品数量 */
419
+ giftCount: number;
420
+ /** 可选赠品列表 */
421
+ giftOptions: ProductIdentifier[];
422
+ }
423
+ /**
424
+ * 带定价的购物车评估结果
425
+ *
426
+ * evaluateCartWithPricing 方法的返回结果
427
+ */
428
+ export interface CartWithPricingResult {
429
+ /**
430
+ * 处理后的商品数组
431
+ * - 包含所有商品(参与促销和未参与促销的)
432
+ * - 参与促销的商品可能被拆分(如 A*5 拆成 A*4 + A*1)
433
+ * - 每个商品都有 finalPrice 字段
434
+ */
435
+ products: PricedProduct[];
436
+ /**
437
+ * 赠品信息列表
438
+ * 按促销分组,每个促销对应一个 GiftInfo
439
+ */
440
+ gifts: GiftInfo[];
441
+ /**
442
+ * 总优惠金额
443
+ * 所有商品的原价总和 - 所有商品的 finalPrice 总和
444
+ */
445
+ totalDiscount: number;
446
+ }
447
+ export {};
@@ -0,0 +1,209 @@
1
+ /**
2
+ * Promotion 策略类型定义
3
+ *
4
+ * 定义促销活动相关的 Action 类型、值结构和配置
5
+ */
6
+
7
+ // ============================================
8
+ // Action Type 常量
9
+ // ============================================
10
+
11
+ /**
12
+ * 促销活动 Action 类型
13
+ */
14
+ export var PROMOTION_ACTION_TYPES = {
15
+ /** X件Y元(每X件固定价格Y元,可累计) */
16
+ X_ITEMS_FOR_Y_PRICE: 'X_ITEMS_FOR_Y_PRICE',
17
+ /** 买X送Y(买X件送Y件,可累计) */
18
+ BUY_X_GET_Y_FREE: 'BUY_X_GET_Y_FREE',
19
+ /** 固定折扣 */
20
+ DISCOUNT_RATE: 'DISCOUNT_RATE',
21
+ /** 固定减价 */
22
+ DEDUCT_AMOUNT: 'DEDUCT_AMOUNT'
23
+ };
24
+
25
+ // ============================================
26
+ // Action Value 类型定义
27
+ // ============================================
28
+
29
+ /**
30
+ * X件Y元 - Action Value
31
+ *
32
+ * @example
33
+ * value: { x: 2, price: 10 } // 每2件10元
34
+ */
35
+
36
+ /**
37
+ * X件Y元 - Action Config
38
+ */
39
+
40
+ /**
41
+ * 买X送Y - Action Value
42
+ *
43
+ * @example
44
+ * value: { buyQuantity: 1, freeQuantity: 1 } // 买1送1
45
+ */
46
+
47
+ /**
48
+ * 赠品选择模式
49
+ */
50
+
51
+ // 自动选最便宜的
52
+
53
+ /**
54
+ * 买X送Y - Action Config
55
+ */
56
+
57
+ // ============================================
58
+ // 商品标识
59
+ // ============================================
60
+
61
+ /**
62
+ * 商品标识
63
+ *
64
+ * 匹配规则:
65
+ * - product_variant_id = 0 表示匹配任意变体
66
+ * - product_variant_id != 0 表示精确匹配该变体
67
+ */
68
+
69
+ // ============================================
70
+ // 完整的 Promotion Action 类型
71
+ // ============================================
72
+
73
+ /**
74
+ * X件Y元 Action
75
+ */
76
+
77
+ /**
78
+ * 买X送Y Action
79
+ */
80
+
81
+ /**
82
+ * 促销活动 Action 联合类型
83
+ */
84
+
85
+ // ============================================
86
+ // 运算符常量
87
+ // ============================================
88
+
89
+ /**
90
+ * 促销相关运算符
91
+ */
92
+ export var PROMOTION_OPERATORS = {
93
+ /**
94
+ * 商品匹配运算符
95
+ *
96
+ * 匹配规则:
97
+ * - 首先匹配 product_id
98
+ * - 如果配置的 product_variant_id = 0,只需要 product_id 匹配
99
+ * - 如果配置的 product_variant_id != 0,还需要 product_variant_id 匹配
100
+ */
101
+ PRODUCT_MATCH: 'product_match'
102
+ };
103
+
104
+ // ============================================
105
+ // 业务数据类型(输入)
106
+ // ============================================
107
+
108
+ /**
109
+ * 促销活动业务数据
110
+ *
111
+ * 由业务层传入,用于策略评估
112
+ */
113
+
114
+ var obj = {
115
+ product_id: 1,
116
+ product_variant_id: 0,
117
+ quantity: 1,
118
+ price: 100,
119
+ original_price: 100,
120
+ id: 1
121
+ };
122
+
123
+ /**
124
+ * 促销商品信息
125
+ */
126
+
127
+ // ============================================
128
+ // 适配器输出类型
129
+ // ============================================
130
+
131
+ /**
132
+ * 促销活动适配器转换结果
133
+ *
134
+ * 返回给业务层,包含策略匹配信息
135
+ */
136
+
137
+ /**
138
+ * Action 详情联合类型
139
+ */
140
+
141
+ /**
142
+ * X件Y元 Action 详情
143
+ */
144
+
145
+ /**
146
+ * 买X送Y Action 详情
147
+ */
148
+
149
+ // ============================================
150
+ // 业务层输出类型(供参考)
151
+ // ============================================
152
+
153
+ /**
154
+ * X件Y元 - 业务层计算结果
155
+ *
156
+ * 由业务层根据 matchedAction 计算后返回
157
+ */
158
+
159
+ /**
160
+ * 买X送Y - 业务层计算结果
161
+ *
162
+ * 由业务层根据 matchedAction 计算后返回
163
+ */
164
+
165
+ /**
166
+ * 评估器输入
167
+ */
168
+
169
+ /**
170
+ * 单商品评估结果
171
+ */
172
+
173
+ /**
174
+ * 适用的促销信息
175
+ */
176
+
177
+ /**
178
+ * 购物车评估结果
179
+ */
180
+
181
+ /**
182
+ * 购物车适用的促销
183
+ */
184
+
185
+ /**
186
+ * 促销分组
187
+ */
188
+
189
+ // ============================================
190
+ // 带定价的购物车评估结果类型
191
+ // ============================================
192
+
193
+ /**
194
+ * 带定价的商品
195
+ *
196
+ * 在 PromotionProduct 基础上增加了均摊后的最终价格和促销信息
197
+ */
198
+
199
+ /**
200
+ * 赠品信息
201
+ *
202
+ * 记录某个促销产生的赠品数量和可选赠品列表
203
+ */
204
+
205
+ /**
206
+ * 带定价的购物车评估结果
207
+ *
208
+ * evaluateCartWithPricing 方法的返回结果
209
+ */
@@ -40,7 +40,10 @@ export var WalletPassEvaluator = /*#__PURE__*/function () {
40
40
  _createClass(WalletPassEvaluator, [{
41
41
  key: "setStrategyConfigs",
42
42
  value: function setStrategyConfigs(strategyConfigs) {
43
- this.strategyConfigs = strategyConfigs;
43
+ var newStrategyConfigs = strategyConfigs.filter(function (item) {
44
+ return item.metadata.type === 'wallet_pass';
45
+ });
46
+ this.strategyConfigs = newStrategyConfigs;
44
47
  }
45
48
  }, {
46
49
  key: "getStrategyConfigs",