@pisell/pisellos 0.10.75 → 0.10.76

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 (189) hide show
  1. package/dist/modules/Product/index.d.ts +1 -1
  2. package/dist/server/index.js +14 -9
  3. package/dist/shared/receipt/small-ticket.d.ts +3 -0
  4. package/dist/shared/receipt/small-ticket.js +23 -2
  5. package/dist/solution/BookingByStep/index.d.ts +2 -2
  6. package/dist/solution/BookingTicket/index.d.ts +13 -1
  7. package/dist/solution/OrderInvoicePreview/index.js +13 -8
  8. package/lib/modules/Product/index.d.ts +1 -1
  9. package/lib/server/index.js +5 -0
  10. package/lib/shared/receipt/small-ticket.d.ts +3 -0
  11. package/lib/shared/receipt/small-ticket.js +21 -0
  12. package/lib/solution/BookingByStep/index.d.ts +2 -2
  13. package/lib/solution/BookingTicket/index.d.ts +13 -1
  14. package/lib/solution/OrderInvoicePreview/index.js +6 -1
  15. package/package.json +1 -1
  16. package/dist/apis/picoding.d.ts +0 -0
  17. package/dist/effects/index.d.ts +0 -19
  18. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  19. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
  20. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  21. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  22. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -173
  23. package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -70
  24. package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -224
  25. package/dist/model/strategy/adapter/promotion/type.d.ts +0 -535
  26. package/dist/model/strategy/adapter/type.d.ts +0 -28
  27. package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
  28. package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  29. package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -192
  30. package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  31. package/dist/model/strategy/engine.d.ts +0 -119
  32. package/dist/model/strategy/type.d.ts +0 -245
  33. package/dist/modules/Account/types.d.ts +0 -56
  34. package/dist/modules/BookingContext/types.d.ts +0 -104
  35. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  36. package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
  37. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  38. package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
  39. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  40. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  41. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  42. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  43. package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  44. package/dist/modules/Customer/constants.d.ts +0 -7
  45. package/dist/modules/Date/types.d.ts +0 -84
  46. package/dist/modules/Date/utils.d.ts +0 -36
  47. package/dist/modules/FulfillmentTiming/index.d.ts +0 -11
  48. package/dist/modules/FulfillmentTiming/types.d.ts +0 -67
  49. package/dist/modules/Order/payment-utils.d.ts +0 -26
  50. package/dist/modules/Order/pickupTiming.d.ts +0 -46
  51. package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  52. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
  53. package/dist/modules/Order/utils/weighedProduct.d.ts +0 -12
  54. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
  55. package/dist/modules/Payment/mx51.d.ts +0 -0
  56. package/dist/modules/Payment/types.d.ts +0 -943
  57. package/dist/modules/Payment/utils.d.ts +0 -19
  58. package/dist/modules/Quotation/types.d.ts +0 -61
  59. package/dist/modules/Resource/types.d.ts +0 -50
  60. package/dist/modules/Resource/utils.d.ts +0 -23
  61. package/dist/modules/ResourcePlanner/localClock.d.ts +0 -33
  62. package/dist/modules/SalesSummary/types.d.ts +0 -69
  63. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  64. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  65. package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
  66. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
  67. package/dist/modules/Schedule/type.d.ts +0 -157
  68. package/dist/modules/Schedule/types.d.ts +0 -201
  69. package/dist/modules/Schedule/utils.d.ts +0 -67
  70. package/dist/modules/Step/tyeps.d.ts +0 -20
  71. package/dist/modules/SurchargeList/types.d.ts +0 -15
  72. package/dist/plugins/app.d.ts +0 -10
  73. package/dist/plugins/shopStore.d.ts +0 -4
  74. package/dist/plugins/user.d.ts +0 -7
  75. package/dist/server/modules/floor-plan/types.d.ts +0 -43
  76. package/dist/server/modules/menu/types.d.ts +0 -68
  77. package/dist/server/modules/payment/types.d.ts +0 -9
  78. package/dist/server/modules/quotation/types.d.ts +0 -50
  79. package/dist/server/modules/resource/types.d.ts +0 -121
  80. package/dist/server/modules/schedule/types.d.ts +0 -1
  81. package/dist/server/modules/schedule/utils.d.ts +0 -32
  82. package/dist/server/types.d.ts +0 -66
  83. package/dist/server/utils/index.d.ts +0 -5
  84. package/dist/server/utils/schedule.d.ts +0 -14
  85. package/dist/server/utils/time.d.ts +0 -18
  86. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
  87. package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  88. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  89. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
  90. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  91. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  92. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  93. package/dist/solution/PlaceOrder/index.d.ts +0 -0
  94. package/dist/solution/RegisterAndLogin/config.d.ts +0 -93
  95. package/dist/solution/RegisterAndLogin/types.d.ts +0 -445
  96. package/dist/solution/RegisterAndLogin/utils.d.ts +0 -103
  97. package/dist/store/createStore.d.ts +0 -3
  98. package/dist/types/index.d.ts +0 -132
  99. package/dist/utils/os-private-payload.d.ts +0 -5
  100. package/dist/utils/payment-number.d.ts +0 -9
  101. package/dist/utils/task.d.ts +0 -40
  102. package/dist/utils/watch.d.ts +0 -102
  103. package/lib/apis/picoding.d.ts +0 -0
  104. package/lib/effects/index.d.ts +0 -19
  105. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  106. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
  107. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  108. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  109. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -173
  110. package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -70
  111. package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -224
  112. package/lib/model/strategy/adapter/promotion/type.d.ts +0 -535
  113. package/lib/model/strategy/adapter/type.d.ts +0 -28
  114. package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
  115. package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  116. package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -192
  117. package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  118. package/lib/model/strategy/engine.d.ts +0 -119
  119. package/lib/model/strategy/type.d.ts +0 -245
  120. package/lib/modules/Account/types.d.ts +0 -56
  121. package/lib/modules/BookingContext/types.d.ts +0 -104
  122. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  123. package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
  124. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  125. package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
  126. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  127. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  128. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  129. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  130. package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  131. package/lib/modules/Customer/constants.d.ts +0 -7
  132. package/lib/modules/Date/types.d.ts +0 -84
  133. package/lib/modules/Date/utils.d.ts +0 -36
  134. package/lib/modules/FulfillmentTiming/index.d.ts +0 -11
  135. package/lib/modules/FulfillmentTiming/types.d.ts +0 -67
  136. package/lib/modules/Order/payment-utils.d.ts +0 -26
  137. package/lib/modules/Order/pickupTiming.d.ts +0 -46
  138. package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  139. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
  140. package/lib/modules/Order/utils/weighedProduct.d.ts +0 -12
  141. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
  142. package/lib/modules/Payment/mx51.d.ts +0 -0
  143. package/lib/modules/Payment/types.d.ts +0 -943
  144. package/lib/modules/Payment/utils.d.ts +0 -19
  145. package/lib/modules/Quotation/types.d.ts +0 -61
  146. package/lib/modules/Resource/types.d.ts +0 -50
  147. package/lib/modules/Resource/utils.d.ts +0 -23
  148. package/lib/modules/ResourcePlanner/localClock.d.ts +0 -33
  149. package/lib/modules/SalesSummary/types.d.ts +0 -69
  150. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  151. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  152. package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
  153. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
  154. package/lib/modules/Schedule/type.d.ts +0 -157
  155. package/lib/modules/Schedule/types.d.ts +0 -201
  156. package/lib/modules/Schedule/utils.d.ts +0 -67
  157. package/lib/modules/Step/tyeps.d.ts +0 -20
  158. package/lib/modules/SurchargeList/types.d.ts +0 -15
  159. package/lib/plugins/app.d.ts +0 -10
  160. package/lib/plugins/shopStore.d.ts +0 -4
  161. package/lib/plugins/user.d.ts +0 -7
  162. package/lib/server/modules/floor-plan/types.d.ts +0 -43
  163. package/lib/server/modules/menu/types.d.ts +0 -68
  164. package/lib/server/modules/payment/types.d.ts +0 -9
  165. package/lib/server/modules/quotation/types.d.ts +0 -50
  166. package/lib/server/modules/resource/types.d.ts +0 -121
  167. package/lib/server/modules/schedule/types.d.ts +0 -1
  168. package/lib/server/modules/schedule/utils.d.ts +0 -32
  169. package/lib/server/types.d.ts +0 -66
  170. package/lib/server/utils/index.d.ts +0 -5
  171. package/lib/server/utils/schedule.d.ts +0 -14
  172. package/lib/server/utils/time.d.ts +0 -18
  173. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
  174. package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  175. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  176. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
  177. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  178. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  179. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  180. package/lib/solution/PlaceOrder/index.d.ts +0 -0
  181. package/lib/solution/RegisterAndLogin/config.d.ts +0 -93
  182. package/lib/solution/RegisterAndLogin/types.d.ts +0 -445
  183. package/lib/solution/RegisterAndLogin/utils.d.ts +0 -103
  184. package/lib/store/createStore.d.ts +0 -3
  185. package/lib/types/index.d.ts +0 -132
  186. package/lib/utils/os-private-payload.d.ts +0 -5
  187. package/lib/utils/payment-number.d.ts +0 -9
  188. package/lib/utils/task.d.ts +0 -40
  189. package/lib/utils/watch.d.ts +0 -102
@@ -1,173 +0,0 @@
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';
@@ -1,70 +0,0 @@
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;
@@ -1,224 +0,0 @@
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
- };