@pisell/pisellos 0.10.76 → 0.10.77
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/apis/picoding.d.ts +0 -0
- package/dist/effects/index.d.ts +19 -0
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +173 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +70 -0
- package/dist/model/strategy/adapter/promotion/examples.d.ts +224 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/promotion/type.d.ts +535 -0
- package/dist/model/strategy/adapter/type.d.ts +28 -0
- package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts +192 -0
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/dist/model/strategy/engine.d.ts +119 -0
- package/dist/model/strategy/type.d.ts +245 -0
- package/dist/modules/Account/types.d.ts +56 -0
- package/dist/modules/BookingContext/types.d.ts +104 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Date/types.d.ts +84 -0
- package/dist/modules/Date/utils.d.ts +36 -0
- package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
- package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
- package/dist/modules/Order/payment-utils.d.ts +26 -0
- package/dist/modules/Order/pickupTiming.d.ts +46 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
- package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/types.d.ts +943 -0
- package/dist/modules/Payment/utils.d.ts +19 -0
- package/dist/modules/Quotation/types.d.ts +61 -0
- package/dist/modules/Resource/types.d.ts +50 -0
- package/dist/modules/Resource/utils.d.ts +23 -0
- package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/dist/modules/SalesSummary/types.d.ts +69 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
- package/dist/modules/Schedule/type.d.ts +157 -0
- package/dist/modules/Schedule/types.d.ts +201 -0
- package/dist/modules/Schedule/utils.d.ts +67 -0
- package/dist/modules/Step/tyeps.d.ts +20 -0
- package/dist/modules/SurchargeList/types.d.ts +15 -0
- package/dist/plugins/app.d.ts +10 -0
- package/dist/plugins/shopStore.d.ts +4 -0
- package/dist/plugins/user.d.ts +7 -0
- package/dist/server/modules/floor-plan/types.d.ts +43 -0
- package/dist/server/modules/menu/types.d.ts +68 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/quotation/types.d.ts +50 -0
- package/dist/server/modules/resource/types.d.ts +121 -0
- package/dist/server/modules/schedule/types.d.ts +1 -0
- package/dist/server/modules/schedule/utils.d.ts +32 -0
- package/dist/server/types.d.ts +66 -0
- package/dist/server/utils/index.d.ts +5 -0
- package/dist/server/utils/schedule.d.ts +14 -0
- package/dist/server/utils/time.d.ts +18 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/dist/solution/PlaceOrder/index.d.ts +0 -0
- package/dist/solution/RegisterAndLogin/config.d.ts +93 -0
- package/dist/solution/RegisterAndLogin/types.d.ts +445 -0
- package/dist/solution/RegisterAndLogin/utils.d.ts +103 -0
- package/dist/solution/UnifiedBookingSales/index.js +107 -58
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +2 -0
- package/dist/store/createStore.d.ts +3 -0
- package/dist/types/index.d.ts +132 -0
- package/dist/utils/os-private-payload.d.ts +5 -0
- package/dist/utils/payment-number.d.ts +9 -0
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/watch.d.ts +102 -0
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/effects/index.d.ts +19 -0
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +173 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +70 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +224 -0
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/model/strategy/adapter/promotion/type.d.ts +535 -0
- package/lib/model/strategy/adapter/type.d.ts +28 -0
- package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/lib/model/strategy/adapter/walletPass/type.d.ts +192 -0
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/lib/model/strategy/engine.d.ts +119 -0
- package/lib/model/strategy/type.d.ts +245 -0
- package/lib/modules/Account/types.d.ts +56 -0
- package/lib/modules/BookingContext/types.d.ts +104 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Date/types.d.ts +84 -0
- package/lib/modules/Date/utils.d.ts +36 -0
- package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
- package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
- package/lib/modules/Order/payment-utils.d.ts +26 -0
- package/lib/modules/Order/pickupTiming.d.ts +46 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
- package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/types.d.ts +943 -0
- package/lib/modules/Payment/utils.d.ts +19 -0
- package/lib/modules/Quotation/types.d.ts +61 -0
- package/lib/modules/Resource/types.d.ts +50 -0
- package/lib/modules/Resource/utils.d.ts +23 -0
- package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/lib/modules/SalesSummary/types.d.ts +69 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
- package/lib/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
- package/lib/modules/Schedule/type.d.ts +157 -0
- package/lib/modules/Schedule/types.d.ts +201 -0
- package/lib/modules/Schedule/utils.d.ts +67 -0
- package/lib/modules/Step/tyeps.d.ts +20 -0
- package/lib/modules/SurchargeList/types.d.ts +15 -0
- package/lib/plugins/app.d.ts +10 -0
- package/lib/plugins/shopStore.d.ts +4 -0
- package/lib/plugins/user.d.ts +7 -0
- package/lib/server/modules/floor-plan/types.d.ts +43 -0
- package/lib/server/modules/menu/types.d.ts +68 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/quotation/types.d.ts +50 -0
- package/lib/server/modules/resource/types.d.ts +121 -0
- package/lib/server/modules/schedule/types.d.ts +1 -0
- package/lib/server/modules/schedule/utils.d.ts +32 -0
- package/lib/server/types.d.ts +66 -0
- package/lib/server/utils/index.d.ts +5 -0
- package/lib/server/utils/schedule.d.ts +14 -0
- package/lib/server/utils/time.d.ts +18 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/lib/solution/PlaceOrder/index.d.ts +0 -0
- package/lib/solution/RegisterAndLogin/config.d.ts +93 -0
- package/lib/solution/RegisterAndLogin/types.d.ts +445 -0
- package/lib/solution/RegisterAndLogin/utils.d.ts +103 -0
- package/lib/solution/UnifiedBookingSales/index.js +42 -11
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +2 -0
- package/lib/store/createStore.d.ts +3 -0
- package/lib/types/index.d.ts +132 -0
- package/lib/utils/os-private-payload.d.ts +5 -0
- package/lib/utils/payment-number.d.ts +9 -0
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/watch.d.ts +102 -0
- package/package.json +1 -1
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type EffectCallback = (payload: any) => void | Promise<void | {
|
|
2
|
+
status: boolean;
|
|
3
|
+
message?: string;
|
|
4
|
+
}>;
|
|
5
|
+
type UnsubscribeFunction = () => void;
|
|
6
|
+
declare class EffectsManager {
|
|
7
|
+
private listeners;
|
|
8
|
+
on(event: string, callback: EffectCallback): UnsubscribeFunction;
|
|
9
|
+
only(event: string, callback: EffectCallback): UnsubscribeFunction;
|
|
10
|
+
off(event: string, callback: EffectCallback): void;
|
|
11
|
+
offByModuleDestroy(module: string): void;
|
|
12
|
+
once(event: string, callback: EffectCallback): UnsubscribeFunction;
|
|
13
|
+
emit(event: string, payload: any): Promise<{
|
|
14
|
+
status: boolean;
|
|
15
|
+
data: any;
|
|
16
|
+
}>;
|
|
17
|
+
clear(): void;
|
|
18
|
+
}
|
|
19
|
+
export { EffectsManager, UnsubscribeFunction };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { EvaluationResult, RuntimeContext } from '../../type';
|
|
2
|
+
import type { BusinessAdapter } from '../type';
|
|
3
|
+
import type { DataVariantBusinessData, DataVariantProduct } from './type';
|
|
4
|
+
/**
|
|
5
|
+
* Data Variant 适配器。
|
|
6
|
+
*
|
|
7
|
+
* 负责把智能定价运行态数据转换为 StrategyEngine 能识别的 attributes。
|
|
8
|
+
*/
|
|
9
|
+
export declare class DataVariantAdapter implements BusinessAdapter {
|
|
10
|
+
name: string;
|
|
11
|
+
version: string;
|
|
12
|
+
/**
|
|
13
|
+
* 准备批量全局上下文。
|
|
14
|
+
*
|
|
15
|
+
* 这里只放不依赖单个商品的字段,用于预计算 schedule/channel/orderType 等条件。
|
|
16
|
+
*/
|
|
17
|
+
prepareContext(businessData: DataVariantBusinessData): RuntimeContext;
|
|
18
|
+
/**
|
|
19
|
+
* 准备全局预计算上下文。
|
|
20
|
+
*/
|
|
21
|
+
prepareGlobalContext(businessData: DataVariantBusinessData): RuntimeContext;
|
|
22
|
+
/**
|
|
23
|
+
* 准备单商品上下文。
|
|
24
|
+
*
|
|
25
|
+
* 商品级条件只在当前商品 data_variants 引用到对应规则后才评估。
|
|
26
|
+
*/
|
|
27
|
+
prepareProductContext(businessData: DataVariantBusinessData, product: DataVariantProduct): RuntimeContext;
|
|
28
|
+
transformResult(result: EvaluationResult): EvaluationResult;
|
|
29
|
+
formatConfig(result: EvaluationResult, businessData?: DataVariantBusinessData): {
|
|
30
|
+
result: EvaluationResult;
|
|
31
|
+
businessData?: DataVariantBusinessData;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 构建 menu_match 使用的轻量商品对象。
|
|
35
|
+
*
|
|
36
|
+
* collection_ids 来自商品 collection 字段,避免 operator 读取复杂商品对象。
|
|
37
|
+
*/
|
|
38
|
+
buildProductValue(product: DataVariantProduct): {
|
|
39
|
+
id: number;
|
|
40
|
+
product_variant_id: number;
|
|
41
|
+
collection_ids: number[];
|
|
42
|
+
};
|
|
43
|
+
private toNumber;
|
|
44
|
+
/**
|
|
45
|
+
* 归一化客户 id:无效值返回 undefined,有效值统一为 number。
|
|
46
|
+
*/
|
|
47
|
+
private normalizeCustomerId;
|
|
48
|
+
private normalizeNumberArray;
|
|
49
|
+
}
|
|
50
|
+
export default DataVariantAdapter;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ConditionRule, StrategyConfig } from '../../type';
|
|
2
|
+
import type { ConditionScope, DataVariantBusinessData, DataVariantMenu, DataVariantRuleMetadata, MenuScope, ResolvedDataVariantResult } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* Data Variant 评估器。
|
|
5
|
+
*
|
|
6
|
+
* OS Server 商品路由开启时由 ProductsModule 调用;路由关闭时由 ProductList 在远端响应后调用。
|
|
7
|
+
*/
|
|
8
|
+
export declare class DataVariantEvaluator {
|
|
9
|
+
private adapter;
|
|
10
|
+
private strategyConfigs;
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* 设置策略配置列表,仅保留 metadata.type === 'data_variant' 的策略。
|
|
14
|
+
*/
|
|
15
|
+
setStrategyConfigs(configs: StrategyConfig[]): void;
|
|
16
|
+
getStrategyConfigs(): StrategyConfig<DataVariantRuleMetadata>[];
|
|
17
|
+
/**
|
|
18
|
+
* 批量解析商品 Data Variant。
|
|
19
|
+
*
|
|
20
|
+
* 优先使用商品 metadata.data_variant_ids;缺少权威命中结果时才执行本地策略判断。
|
|
21
|
+
*/
|
|
22
|
+
resolveProducts(businessData: DataVariantBusinessData): ResolvedDataVariantResult;
|
|
23
|
+
/**
|
|
24
|
+
* 根据 operator/field 判断条件是否依赖当前商品。
|
|
25
|
+
*/
|
|
26
|
+
getConditionScope(rule: ConditionRule): ConditionScope;
|
|
27
|
+
/**
|
|
28
|
+
* 将餐牌 partyroom_package 预构建为 Map/Set 索引。
|
|
29
|
+
*/
|
|
30
|
+
buildMenuScopeMap(menuList: DataVariantMenu[]): Map<number, MenuScope>;
|
|
31
|
+
/**
|
|
32
|
+
* 从当前策略中所有 schedule_match.value 绑定的 schedule_id 提取时间点。
|
|
33
|
+
*
|
|
34
|
+
* 这里不依赖餐牌,只读取策略配置和调用方传入的 scheduleList。
|
|
35
|
+
*/
|
|
36
|
+
buildScheduleTimePoints(strategyConfigs: StrategyConfig<DataVariantRuleMetadata>[], scheduleList: NonNullable<DataVariantBusinessData['scheduleList']>): string[];
|
|
37
|
+
/**
|
|
38
|
+
* 判断商品(含套餐子商品)是否仍需要本地执行策略条件。
|
|
39
|
+
* metadata.data_variant_ids 只要是数组,即使为空,也表示接口已经给出权威命中结果。
|
|
40
|
+
*/
|
|
41
|
+
private requiresLocalStrategyEvaluation;
|
|
42
|
+
/**
|
|
43
|
+
* 将接口返回的高 -> 低优先级 Variant ID 转成数值优先级。
|
|
44
|
+
* 返回 null 表示接口没有提供该字段;空 Map 表示已计算但没有任何命中。
|
|
45
|
+
*/
|
|
46
|
+
private getAuthoritativeVariantPriorities;
|
|
47
|
+
private normalizeDataVariantId;
|
|
48
|
+
private buildGlobalEffectiveRuleMap;
|
|
49
|
+
private resolveProduct;
|
|
50
|
+
/**
|
|
51
|
+
* 多货币 Data Variant 只生成候选列表,不参与商品字段覆盖。
|
|
52
|
+
* rule_id=0 是无条件默认价;同币种命中的条件价优先于默认价。
|
|
53
|
+
*/
|
|
54
|
+
private resolveSettlementOptions;
|
|
55
|
+
/**
|
|
56
|
+
* 解析套餐子商品上的 Data Variant 覆盖。
|
|
57
|
+
*
|
|
58
|
+
* bundle_item 以 bundle_product_id / bundle_variant_id 作为商品身份参与 product_match 等条件判断。
|
|
59
|
+
*/
|
|
60
|
+
private resolveProductBundleItems;
|
|
61
|
+
/**
|
|
62
|
+
* 将 bundle_item 转为 DataVariantProduct 并评估 data_variants。
|
|
63
|
+
*/
|
|
64
|
+
private resolveBundleItem;
|
|
65
|
+
/**
|
|
66
|
+
* bundle_item 的商品身份映射:bundle_product_id + bundle_variant_id。
|
|
67
|
+
*/
|
|
68
|
+
private toBundleItemDataVariantProduct;
|
|
69
|
+
/**
|
|
70
|
+
* 仅回写命中的字段,避免污染 bundle_item 的结构字段。
|
|
71
|
+
*/
|
|
72
|
+
private mergeBundleItemResolvedData;
|
|
73
|
+
private evaluateProductRules;
|
|
74
|
+
/**
|
|
75
|
+
* 拆分策略条件。
|
|
76
|
+
*
|
|
77
|
+
* 当前 MVP 支持顶层 and 原子条件拆分;复杂条件保守地放到商品级完整判断。
|
|
78
|
+
*/
|
|
79
|
+
private splitStrategyConfig;
|
|
80
|
+
private createEngine;
|
|
81
|
+
private evaluateScheduleMatch;
|
|
82
|
+
private evaluateMenuMatch;
|
|
83
|
+
private evaluateArrayIntersects;
|
|
84
|
+
private collectScheduleIdsFromStrategies;
|
|
85
|
+
private extractTimePointsFromSchedules;
|
|
86
|
+
private addDateTimePoint;
|
|
87
|
+
private addRawTimePoint;
|
|
88
|
+
private extractTimeFromDateTime;
|
|
89
|
+
private normalizeTime;
|
|
90
|
+
private timeToMinutes;
|
|
91
|
+
private isProductInMenuScope;
|
|
92
|
+
private mergeMatchedVariants;
|
|
93
|
+
private getProductDataVariants;
|
|
94
|
+
private normalizeStrategyConfigs;
|
|
95
|
+
private isStrategyActive;
|
|
96
|
+
private getStrategyPriority;
|
|
97
|
+
private createAlwaysTrueConditions;
|
|
98
|
+
private flattenConditionRules;
|
|
99
|
+
private isConditionGroup;
|
|
100
|
+
private normalizeNumberArray;
|
|
101
|
+
private normalizeComparableArray;
|
|
102
|
+
private buildProductKey;
|
|
103
|
+
private toNumber;
|
|
104
|
+
}
|
|
105
|
+
export default DataVariantEvaluator;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { StrategyConfig } from '../../type';
|
|
2
|
+
import type { ScheduleItem } from '../../../../modules/Schedule/types';
|
|
3
|
+
import type { DataVariantItem, DataVariantMenu, DataVariantProduct, DataVariantRuleMetadata } from './type';
|
|
4
|
+
/**
|
|
5
|
+
* 构造示例用 data_variant 记录,字段结构与后端 /product/query 返回一致。
|
|
6
|
+
*/
|
|
7
|
+
export declare function createExampleDataVariant(ruleId: number | string, data: Record<string, any>, overrides?: Partial<Omit<DataVariantItem, 'data_variant_rule_id' | 'data'>>): DataVariantItem;
|
|
8
|
+
/**
|
|
9
|
+
* 晚场餐牌价:命中日程 + 餐牌商品范围后覆盖 price / stock。
|
|
10
|
+
*/
|
|
11
|
+
export declare const EVENING_MENU_PRICE_STRATEGY: StrategyConfig<DataVariantRuleMetadata>;
|
|
12
|
+
/**
|
|
13
|
+
* VIP 商品价:演示 product_match 与更高优先级字段覆盖。
|
|
14
|
+
*/
|
|
15
|
+
export declare const VIP_PRODUCT_PRICE_STRATEGY: StrategyConfig<DataVariantRuleMetadata>;
|
|
16
|
+
/**
|
|
17
|
+
* 客户/渠道/业务范围价:演示 customer_id、channel、business_code 的 in 条件。
|
|
18
|
+
*/
|
|
19
|
+
export declare const CUSTOMER_SCOPE_PRICE_STRATEGY: StrategyConfig<DataVariantRuleMetadata>;
|
|
20
|
+
/**
|
|
21
|
+
* 示例日程:2026-06-26 17:00 ~ 20:00 生效。
|
|
22
|
+
*/
|
|
23
|
+
export declare const DATA_VARIANT_EXAMPLE_SCHEDULES: ScheduleItem[];
|
|
24
|
+
/**
|
|
25
|
+
* 示例餐牌:product_collection = 128 的商品均属于餐牌。
|
|
26
|
+
*/
|
|
27
|
+
export declare const DATA_VARIANT_EXAMPLE_MENUS: DataVariantMenu[];
|
|
28
|
+
/**
|
|
29
|
+
* 示例商品:同时带两条 Data Variant 覆盖数据。
|
|
30
|
+
*/
|
|
31
|
+
export declare const DATA_VARIANT_EXAMPLE_PRODUCTS: DataVariantProduct[];
|
|
32
|
+
/**
|
|
33
|
+
* Data Variant 评估器示例调用。
|
|
34
|
+
*/
|
|
35
|
+
export declare function runDataVariantDemo(): import("./type").ResolvedDataVariantResult;
|
|
36
|
+
/**
|
|
37
|
+
* 客户/渠道/业务范围条件示例调用。
|
|
38
|
+
*/
|
|
39
|
+
export declare function runCustomerScopeDataVariantDemo(): import("./type").ResolvedDataVariantResult;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { ConditionRule, EvaluationResult, StrategyConfig } from '../../type';
|
|
2
|
+
import type { ScheduleItem } from '../../../../modules/Schedule/types';
|
|
3
|
+
/**
|
|
4
|
+
* Data Variant 动作类型。
|
|
5
|
+
*
|
|
6
|
+
* 当前阶段动作只用于标识“该策略可应用 data variant 覆盖”,真实覆盖数据来自商品 data_variants。
|
|
7
|
+
*/
|
|
8
|
+
export declare const DATA_VARIANT_ACTION_TYPES: {
|
|
9
|
+
readonly APPLY: "DATA_VARIANT_APPLY";
|
|
10
|
+
};
|
|
11
|
+
export type DataVariantActionType = (typeof DATA_VARIANT_ACTION_TYPES)[keyof typeof DATA_VARIANT_ACTION_TYPES];
|
|
12
|
+
/**
|
|
13
|
+
* Data Variant 规则元数据。
|
|
14
|
+
*
|
|
15
|
+
* priority 数字越大优先级越高,合并时后覆盖低优先级字段。
|
|
16
|
+
*/
|
|
17
|
+
export interface DataVariantRuleMetadata {
|
|
18
|
+
module?: 'product' | string;
|
|
19
|
+
priority?: number;
|
|
20
|
+
status?: 'active' | 'inactive' | string;
|
|
21
|
+
updated_at?: string;
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 商品上的单条 Data Variant 记录,结构与后端 data_variant 表对齐。
|
|
26
|
+
*/
|
|
27
|
+
export interface DataVariantItem {
|
|
28
|
+
/** 变体记录 id */
|
|
29
|
+
id?: number;
|
|
30
|
+
/** 店铺 id */
|
|
31
|
+
shop_id?: number;
|
|
32
|
+
/** 所属模块,商品场景固定为 product */
|
|
33
|
+
module?: 'product' | string;
|
|
34
|
+
/** 模块数据 id,商品场景对应 product.id */
|
|
35
|
+
module_data_id?: number;
|
|
36
|
+
/** 关联策略模型 metadata.id / data_variant_rule.id */
|
|
37
|
+
data_variant_rule_id: number | string;
|
|
38
|
+
/** 业务类型;多货币结算候选不会走普通字段覆盖 */
|
|
39
|
+
business_type?: 'multi_currency_settlement' | string;
|
|
40
|
+
/** 数据状态;多货币结算仅处理 enable 记录 */
|
|
41
|
+
status?: 'enable' | 'disable' | string;
|
|
42
|
+
/** 命中策略后需要覆盖到商品上的字段 */
|
|
43
|
+
data: Record<string, any>;
|
|
44
|
+
created_at?: string | null;
|
|
45
|
+
updated_at?: string | null;
|
|
46
|
+
deleted_at?: string | null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Data Variant 评估使用的轻量商品结构。
|
|
50
|
+
*/
|
|
51
|
+
export interface DataVariantProduct {
|
|
52
|
+
id?: number | string;
|
|
53
|
+
product_id?: number | string;
|
|
54
|
+
product_variant_id?: number | string;
|
|
55
|
+
variant_id?: number | string;
|
|
56
|
+
collection?: Array<{
|
|
57
|
+
id?: number | string;
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* 商品接口已经完成规则计算时返回的命中结果。
|
|
62
|
+
* 数组按 Data Variant 优先级从高到低排列;空数组表示已计算但无命中。
|
|
63
|
+
*/
|
|
64
|
+
metadata?: {
|
|
65
|
+
data_variant_ids?: Array<number | string>;
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
};
|
|
68
|
+
/** 后端 /product/query with dataVariants 返回的智能定价变体列表 */
|
|
69
|
+
data_variants?: DataVariantItem[];
|
|
70
|
+
/** 当前上下文解析后的可选结算货币,不覆盖商品原始多货币配置 */
|
|
71
|
+
available_settlement_options?: AvailableSettlementOption[];
|
|
72
|
+
_dataVariant?: DataVariantAppliedInfo;
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}
|
|
75
|
+
export interface AvailableSettlementOption extends Record<string, any> {
|
|
76
|
+
settlement_type: 'legal_currency' | 'virtual_currency' | string;
|
|
77
|
+
currency_product_id?: number;
|
|
78
|
+
price: string;
|
|
79
|
+
data_variant_id?: number;
|
|
80
|
+
data_variant_rule_id: number | string;
|
|
81
|
+
available: boolean;
|
|
82
|
+
disabled_reason?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 餐牌商品配置项。
|
|
86
|
+
*/
|
|
87
|
+
export interface DataVariantMenuProductItem {
|
|
88
|
+
product_collection_id?: number | string;
|
|
89
|
+
product_id?: number | string;
|
|
90
|
+
product_variant_id?: number | string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 餐牌数据的最小结构。
|
|
94
|
+
*/
|
|
95
|
+
export interface DataVariantMenu {
|
|
96
|
+
form_record_id: number | string;
|
|
97
|
+
status?: string;
|
|
98
|
+
schedule?: Array<number | string>;
|
|
99
|
+
partyroom_package?: {
|
|
100
|
+
type?: 'product_all' | 'product_collection' | 'products' | string;
|
|
101
|
+
products?: DataVariantMenuProductItem[];
|
|
102
|
+
};
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 单个餐牌预构建后的商品范围索引。
|
|
107
|
+
*/
|
|
108
|
+
export interface MenuScope {
|
|
109
|
+
isAllProducts: boolean;
|
|
110
|
+
collectionIds: Set<number>;
|
|
111
|
+
productKeys: Set<string>;
|
|
112
|
+
productAllVariantIds: Set<number>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 批量评估输入。
|
|
116
|
+
*/
|
|
117
|
+
export interface DataVariantBusinessData {
|
|
118
|
+
products: DataVariantProduct[];
|
|
119
|
+
strategyConfigs?: StrategyConfig<DataVariantRuleMetadata>[];
|
|
120
|
+
scheduleDateTime?: string;
|
|
121
|
+
scheduleList?: ScheduleItem[];
|
|
122
|
+
menuList?: DataVariantMenu[];
|
|
123
|
+
channel?: string;
|
|
124
|
+
orderType?: string;
|
|
125
|
+
/** 当前业务编码,对应策略条件 field: business_code */
|
|
126
|
+
businessCode?: string;
|
|
127
|
+
customerId?: number | string;
|
|
128
|
+
/** 当前客户可用 wallet/pass id 合并列表,对应策略条件 field: available_wallet_ids */
|
|
129
|
+
availableWalletIds?: Array<number | string>;
|
|
130
|
+
custom?: Record<string, any>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* 全局预计算后的规则信息。
|
|
134
|
+
*/
|
|
135
|
+
export interface EffectiveRuleInfo {
|
|
136
|
+
ruleId: string;
|
|
137
|
+
priority: number;
|
|
138
|
+
strategyConfig: StrategyConfig<DataVariantRuleMetadata>;
|
|
139
|
+
productRules: ConditionRule[];
|
|
140
|
+
globalResult: EvaluationResult;
|
|
141
|
+
}
|
|
142
|
+
export type GlobalEffectiveRuleMap = Map<string, EffectiveRuleInfo>;
|
|
143
|
+
/**
|
|
144
|
+
* 单条商品命中的变体覆盖信息。
|
|
145
|
+
*/
|
|
146
|
+
export interface MatchedDataVariant {
|
|
147
|
+
ruleId: string;
|
|
148
|
+
priority: number;
|
|
149
|
+
data: Record<string, any>;
|
|
150
|
+
variant: DataVariantItem;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 商品上记录的 Data Variant 调试信息。
|
|
154
|
+
*/
|
|
155
|
+
export interface DataVariantAppliedInfo {
|
|
156
|
+
appliedRuleIds: string[];
|
|
157
|
+
/** 本地策略实际应用的 Data Variant ID,按优先级从高到低排列。 */
|
|
158
|
+
appliedVariantIds?: Array<number | string>;
|
|
159
|
+
appliedFields: string[];
|
|
160
|
+
original: DataVariantProduct;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* 批量解析结果。
|
|
164
|
+
*/
|
|
165
|
+
export interface ResolvedDataVariantResult {
|
|
166
|
+
products: DataVariantProduct[];
|
|
167
|
+
globalEffectiveRuleMap: GlobalEffectiveRuleMap;
|
|
168
|
+
menuScopeMap: Map<number, MenuScope>;
|
|
169
|
+
/** 当前策略中 schedule_match 绑定的日程提取出的时间点,格式如 ["10:00", "13:00"] */
|
|
170
|
+
scheduleTimePoints: string[];
|
|
171
|
+
rawResults: EvaluationResult[];
|
|
172
|
+
}
|
|
173
|
+
export type ConditionScope = 'global' | 'product';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { EvaluationResult, RuntimeContext } from '../../type';
|
|
2
|
+
import type { BusinessAdapter } from '../type';
|
|
3
|
+
import type { PromotionBusinessData, PromotionTransformResult } from './type';
|
|
4
|
+
/**
|
|
5
|
+
* Promotion 适配器
|
|
6
|
+
*
|
|
7
|
+
* 用于将促销活动业务数据转换为策略引擎可识别的格式
|
|
8
|
+
* 策略引擎只负责匹配,具体的优惠计算由业务层完成
|
|
9
|
+
*/
|
|
10
|
+
export declare class PromotionAdapter implements BusinessAdapter {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
/**
|
|
14
|
+
* 准备运行时上下文
|
|
15
|
+
*
|
|
16
|
+
* 将业务数据转换为策略引擎可识别的 RuntimeContext
|
|
17
|
+
*/
|
|
18
|
+
prepareContext(businessData: PromotionBusinessData): RuntimeContext;
|
|
19
|
+
/**
|
|
20
|
+
* 转换执行结果
|
|
21
|
+
*
|
|
22
|
+
* 将策略引擎的通用结果转换为业务层需要的格式
|
|
23
|
+
* 主要是整理 matchedActions,让业务层更容易使用
|
|
24
|
+
*/
|
|
25
|
+
transformResult(result: EvaluationResult, businessData?: PromotionBusinessData): PromotionTransformResult;
|
|
26
|
+
/**
|
|
27
|
+
* 格式化配置
|
|
28
|
+
*/
|
|
29
|
+
formatConfig(result: EvaluationResult, businessData?: PromotionBusinessData): {
|
|
30
|
+
result: EvaluationResult;
|
|
31
|
+
businessData?: PromotionBusinessData;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 格式化日期时间
|
|
35
|
+
*/
|
|
36
|
+
private formatDateTime;
|
|
37
|
+
/**
|
|
38
|
+
* 解析 Action 详情
|
|
39
|
+
*
|
|
40
|
+
* 将 matchedAction 转换为更易用的结构
|
|
41
|
+
*/
|
|
42
|
+
private parseActionDetail;
|
|
43
|
+
/**
|
|
44
|
+
* 解析 X件Y元 Action
|
|
45
|
+
*/
|
|
46
|
+
private parseXItemsForYPriceAction;
|
|
47
|
+
/**
|
|
48
|
+
* 解析 买X送Y Action
|
|
49
|
+
*/
|
|
50
|
+
private parseBuyXGetYFreeAction;
|
|
51
|
+
/**
|
|
52
|
+
* 解析 商品奖励 Action
|
|
53
|
+
*/
|
|
54
|
+
private parseItemRewardAction;
|
|
55
|
+
/**
|
|
56
|
+
* 获取适用的商品列表
|
|
57
|
+
*
|
|
58
|
+
* 从购物车商品中筛选出符合策略条件的商品
|
|
59
|
+
*/
|
|
60
|
+
private getApplicableProducts;
|
|
61
|
+
/**
|
|
62
|
+
* 查找商品匹配规则
|
|
63
|
+
*/
|
|
64
|
+
private findProductMatchRule;
|
|
65
|
+
/**
|
|
66
|
+
* 检查商品是否匹配
|
|
67
|
+
*/
|
|
68
|
+
private isProductMatch;
|
|
69
|
+
}
|
|
70
|
+
export default PromotionAdapter;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* X件Y元策略配置示例
|
|
3
|
+
*
|
|
4
|
+
* 业务规则:
|
|
5
|
+
* - 每X件商品固定价格Y元(可累计)
|
|
6
|
+
* - 支持跨商品组合(A+B可以凑成一组)
|
|
7
|
+
* - 买5件 = 2组优惠 + 1件原价
|
|
8
|
+
*
|
|
9
|
+
* 商品匹配规则:
|
|
10
|
+
* - product_variant_id = 0 表示匹配任意变体
|
|
11
|
+
* - product_variant_id != 0 表示精确匹配该变体
|
|
12
|
+
*/
|
|
13
|
+
export declare const X_ITEMS_FOR_Y_PRICE_STRATEGY: {
|
|
14
|
+
metadata: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: {
|
|
17
|
+
en: string;
|
|
18
|
+
'zh-CN': string;
|
|
19
|
+
'zh-HK': string;
|
|
20
|
+
};
|
|
21
|
+
type: string;
|
|
22
|
+
custom: {
|
|
23
|
+
display: {
|
|
24
|
+
product_card: {
|
|
25
|
+
text: {
|
|
26
|
+
en: string;
|
|
27
|
+
'zh-CN': string;
|
|
28
|
+
'zh-HK': string;
|
|
29
|
+
};
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
conditions: {
|
|
36
|
+
operator: string;
|
|
37
|
+
rules: ({
|
|
38
|
+
type: string;
|
|
39
|
+
field: string;
|
|
40
|
+
value: string;
|
|
41
|
+
operator: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: string;
|
|
44
|
+
field: string;
|
|
45
|
+
value: {
|
|
46
|
+
product_id: number;
|
|
47
|
+
product_variant_id: number;
|
|
48
|
+
}[];
|
|
49
|
+
operator: string;
|
|
50
|
+
})[];
|
|
51
|
+
actionIds: string[];
|
|
52
|
+
};
|
|
53
|
+
actions: {
|
|
54
|
+
id: string;
|
|
55
|
+
type: string;
|
|
56
|
+
value: {
|
|
57
|
+
x: number;
|
|
58
|
+
price: number;
|
|
59
|
+
};
|
|
60
|
+
valueType: string;
|
|
61
|
+
target: string;
|
|
62
|
+
priority: number;
|
|
63
|
+
config: {
|
|
64
|
+
allowCrossProduct: boolean;
|
|
65
|
+
cumulative: boolean;
|
|
66
|
+
};
|
|
67
|
+
}[];
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* 买X送Y策略配置示例
|
|
71
|
+
*
|
|
72
|
+
* 业务规则:
|
|
73
|
+
* - 买X件送Y件(可累计:买2送2、买3送3...)
|
|
74
|
+
* - 赠品由用户从列表中选择
|
|
75
|
+
*
|
|
76
|
+
* 商品匹配规则:
|
|
77
|
+
* - product_variant_id = 0 表示匹配任意变体
|
|
78
|
+
* - product_variant_id != 0 表示精确匹配该变体
|
|
79
|
+
*/
|
|
80
|
+
export declare const BUY_X_GET_Y_FREE_STRATEGY: {
|
|
81
|
+
metadata: {
|
|
82
|
+
id: string;
|
|
83
|
+
name: {
|
|
84
|
+
en: string;
|
|
85
|
+
'zh-CN': string;
|
|
86
|
+
'zh-HK': string;
|
|
87
|
+
};
|
|
88
|
+
type: string;
|
|
89
|
+
custom: {
|
|
90
|
+
display: {
|
|
91
|
+
product_card: {
|
|
92
|
+
text: {
|
|
93
|
+
en: string;
|
|
94
|
+
'zh-CN': string;
|
|
95
|
+
'zh-HK': string;
|
|
96
|
+
};
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
conditions: {
|
|
103
|
+
operator: string;
|
|
104
|
+
rules: ({
|
|
105
|
+
type: string;
|
|
106
|
+
field: string;
|
|
107
|
+
value: string;
|
|
108
|
+
operator: string;
|
|
109
|
+
} | {
|
|
110
|
+
type: string;
|
|
111
|
+
field: string;
|
|
112
|
+
value: {
|
|
113
|
+
product_id: number;
|
|
114
|
+
product_variant_id: number;
|
|
115
|
+
}[];
|
|
116
|
+
operator: string;
|
|
117
|
+
})[];
|
|
118
|
+
actionIds: string[];
|
|
119
|
+
};
|
|
120
|
+
actions: {
|
|
121
|
+
id: string;
|
|
122
|
+
type: string;
|
|
123
|
+
value: {
|
|
124
|
+
buyQuantity: number;
|
|
125
|
+
freeQuantity: number;
|
|
126
|
+
};
|
|
127
|
+
valueType: string;
|
|
128
|
+
target: string;
|
|
129
|
+
priority: number;
|
|
130
|
+
config: {
|
|
131
|
+
cumulative: boolean;
|
|
132
|
+
giftProducts: {
|
|
133
|
+
product_id: number;
|
|
134
|
+
product_variant_id: number;
|
|
135
|
+
}[];
|
|
136
|
+
};
|
|
137
|
+
}[];
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* ITEM_REWARD 策略配置示例:儿童票触发婴儿票免费
|
|
141
|
+
*
|
|
142
|
+
* 业务规则:
|
|
143
|
+
* - 条件商品:儿童票(conditions.rules.productIdAndVariantId)
|
|
144
|
+
* - 奖励商品:购物车/订单内已经存在的婴儿票(actions[0].config.rewardTargets)
|
|
145
|
+
* - 本 action 不自动新增婴儿票;每次购物车变更后由统一促销链路重算
|
|
146
|
+
*
|
|
147
|
+
* 字段说明:
|
|
148
|
+
* - type: "ITEM_REWARD" 表示商品奖励 action
|
|
149
|
+
* - target: "product" 表示本期只奖励商品行
|
|
150
|
+
* - config.rewardTargets: 奖励对象数组,支持 { product_id, product_variant_id }
|
|
151
|
+
* - config.targetSelection: "consumer_best" 表示目标商品超额时选择节省金额最高的商品
|
|
152
|
+
* - value.rewardMethod:
|
|
153
|
+
* - "free": 目标商品最终价为 0
|
|
154
|
+
* - "percent_off": 百分比折扣,rewardValue 为 0-100
|
|
155
|
+
* - "amount_off": 每个目标商品固定减免 rewardValue
|
|
156
|
+
* - "fixed_price": 目标商品最终单价为 rewardValue
|
|
157
|
+
* - value.quantityRule:
|
|
158
|
+
* - "per_condition_quantity": 每满足 triggerQuantity 个条件商品,奖励 rewardQuantity 个目标商品
|
|
159
|
+
* - "all_targets": 满足条件后奖励全部目标商品
|
|
160
|
+
* - "max_per_order": 满足条件后每单最多奖励 maxRewardQuantity 个目标商品
|
|
161
|
+
*/
|
|
162
|
+
export declare const ITEM_REWARD_STRATEGY: {
|
|
163
|
+
metadata: {
|
|
164
|
+
id: string;
|
|
165
|
+
name: {
|
|
166
|
+
en: string;
|
|
167
|
+
'zh-CN': string;
|
|
168
|
+
'zh-HK': string;
|
|
169
|
+
};
|
|
170
|
+
type: string;
|
|
171
|
+
custom: {
|
|
172
|
+
display: {
|
|
173
|
+
product_card: {
|
|
174
|
+
text: {
|
|
175
|
+
en: string;
|
|
176
|
+
'zh-CN': string;
|
|
177
|
+
'zh-HK': string;
|
|
178
|
+
};
|
|
179
|
+
type: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
conditions: {
|
|
185
|
+
operator: string;
|
|
186
|
+
rules: ({
|
|
187
|
+
type: string;
|
|
188
|
+
field: string;
|
|
189
|
+
value: string;
|
|
190
|
+
operator: string;
|
|
191
|
+
} | {
|
|
192
|
+
type: string;
|
|
193
|
+
field: string;
|
|
194
|
+
value: {
|
|
195
|
+
product_id: number;
|
|
196
|
+
product_variant_id: number;
|
|
197
|
+
}[];
|
|
198
|
+
operator: string;
|
|
199
|
+
})[];
|
|
200
|
+
actionIds: string[];
|
|
201
|
+
};
|
|
202
|
+
actions: {
|
|
203
|
+
id: string;
|
|
204
|
+
type: string;
|
|
205
|
+
value: {
|
|
206
|
+
rewardMethod: string;
|
|
207
|
+
rewardValue: number;
|
|
208
|
+
quantityRule: string;
|
|
209
|
+
triggerQuantity: number;
|
|
210
|
+
rewardQuantity: number;
|
|
211
|
+
maxRewardQuantity: number;
|
|
212
|
+
};
|
|
213
|
+
valueType: string;
|
|
214
|
+
target: string;
|
|
215
|
+
priority: number;
|
|
216
|
+
config: {
|
|
217
|
+
rewardTargets: {
|
|
218
|
+
product_id: number;
|
|
219
|
+
product_variant_id: number;
|
|
220
|
+
}[];
|
|
221
|
+
targetSelection: string;
|
|
222
|
+
};
|
|
223
|
+
}[];
|
|
224
|
+
};
|