@pisell/pisellos 2.2.263 → 2.2.264
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/index.d.ts +0 -4
- package/dist/model/strategy/adapter/index.js +1 -5
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
- package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/dist/model/strategy/adapter/promotion/examples.js +99 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/dist/model/strategy/adapter/promotion/type.js +45 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +10 -16
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -2
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +1 -32
- package/dist/modules/Discount/index.d.ts +2 -5
- package/dist/modules/Discount/index.js +7 -30
- package/dist/modules/Discount/types.d.ts +0 -4
- package/dist/modules/Order/index.d.ts +2 -14
- package/dist/modules/Order/index.js +736 -1035
- package/dist/modules/Order/types.d.ts +0 -16
- package/dist/modules/Order/utils.d.ts +3 -4
- package/dist/modules/Order/utils.js +61 -54
- package/dist/modules/Product/types.d.ts +0 -22
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +2 -4
- package/dist/modules/ProductList/types.d.ts +0 -2
- package/dist/modules/Rules/index.d.ts +9 -2
- package/dist/modules/Rules/index.js +43 -69
- package/dist/modules/Rules/types.d.ts +1 -10
- package/dist/server/index.d.ts +0 -55
- package/dist/server/index.js +753 -1173
- package/dist/server/modules/order/index.d.ts +4 -10
- package/dist/server/modules/order/index.js +399 -404
- package/dist/server/modules/order/types.d.ts +0 -4
- package/dist/server/modules/products/index.d.ts +8 -31
- package/dist/server/modules/products/index.js +390 -549
- package/dist/server/modules/products/types.d.ts +0 -18
- package/dist/solution/BaseSales/index.d.ts +1 -21
- package/dist/solution/BaseSales/index.js +789 -1136
- package/dist/solution/BaseSales/types.d.ts +1 -6
- package/dist/solution/BaseSales/types.js +1 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/dist/solution/BaseSales/utils/cartPromotion.js +97 -50
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +8 -6
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -14
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +25 -59
- package/dist/solution/BookingTicket/types.d.ts +0 -2
- package/dist/solution/ScanOrder/index.js +31 -20
- package/dist/solution/ShopDiscount/index.js +14 -15
- package/dist/solution/VenueBooking/index.js +30 -19
- package/lib/model/strategy/adapter/index.d.ts +0 -4
- package/lib/model/strategy/adapter/index.js +2 -13
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/lib/model/strategy/adapter/promotion/examples.js +91 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/lib/model/strategy/adapter/promotion/type.js +2 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -5
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -1
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +2 -23
- package/lib/modules/Discount/index.d.ts +2 -5
- package/lib/modules/Discount/index.js +3 -23
- package/lib/modules/Discount/types.d.ts +0 -4
- package/lib/modules/Order/index.d.ts +2 -14
- package/lib/modules/Order/index.js +60 -326
- package/lib/modules/Order/types.d.ts +0 -16
- package/lib/modules/Order/utils.d.ts +3 -4
- package/lib/modules/Order/utils.js +23 -22
- package/lib/modules/Product/types.d.ts +0 -22
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +2 -4
- package/lib/modules/ProductList/types.d.ts +0 -2
- package/lib/modules/Rules/index.d.ts +9 -2
- package/lib/modules/Rules/index.js +29 -61
- package/lib/modules/Rules/types.d.ts +1 -10
- package/lib/server/index.d.ts +0 -55
- package/lib/server/index.js +34 -332
- package/lib/server/modules/order/index.d.ts +4 -10
- package/lib/server/modules/order/index.js +139 -198
- package/lib/server/modules/order/types.d.ts +0 -4
- package/lib/server/modules/products/index.d.ts +8 -31
- package/lib/server/modules/products/index.js +35 -134
- package/lib/server/modules/products/types.d.ts +0 -18
- package/lib/solution/BaseSales/index.d.ts +1 -21
- package/lib/solution/BaseSales/index.js +72 -313
- package/lib/solution/BaseSales/types.d.ts +1 -6
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.js +64 -25
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +5 -4
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +0 -8
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +8 -33
- package/lib/solution/BookingTicket/types.d.ts +0 -2
- package/lib/solution/ScanOrder/index.js +8 -0
- package/lib/solution/ShopDiscount/index.js +1 -2
- package/lib/solution/VenueBooking/index.js +8 -0
- package/package.json +1 -1
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -780
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -148
- package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +0 -53
- package/dist/modules/Order/utils/orderCollectionIdentity.js +0 -405
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -583
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -148
- package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +0 -53
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -415
|
@@ -63,8 +63,6 @@ export interface OrderProductBundleItem {
|
|
|
63
63
|
bundle_group_id?: number;
|
|
64
64
|
/** 套餐商品 ID */
|
|
65
65
|
bundle_id?: number;
|
|
66
|
-
/** 套餐子商品封面图 */
|
|
67
|
-
cover?: string | null;
|
|
68
66
|
/** 套餐商品规格 ID */
|
|
69
67
|
bundle_variant_id?: number;
|
|
70
68
|
/** 数量 */
|
|
@@ -106,8 +104,6 @@ export interface OrderProductLineItem {
|
|
|
106
104
|
num: number;
|
|
107
105
|
/** 商品标题快照;本地待同步订单会补齐为多语言对象。 */
|
|
108
106
|
product_title?: OrderProductTitleSnapshot | string | null;
|
|
109
|
-
/** 商品封面图 */
|
|
110
|
-
product_cover?: string | null;
|
|
111
107
|
/** 多规格 ID。来源:Detail.product_variant_id */
|
|
112
108
|
product_variant_id?: number;
|
|
113
109
|
/**
|
|
@@ -2,7 +2,7 @@ import { Module, PisellCore } from '../../../types';
|
|
|
2
2
|
import { BaseModule } from '../../../modules/BaseModule';
|
|
3
3
|
import { ProductData } from '../../../modules/Product/types';
|
|
4
4
|
import type { RouteDefinition } from '../../types';
|
|
5
|
-
import { ProductIdScope,
|
|
5
|
+
import { ProductIdScope, ProductFormatter, ProductFormatterContext } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* Products 模块 - 用于获取和管理完整的商品详细数据
|
|
8
8
|
* 相比 ProductList 模块,Products 会获取所有详细信息并缓存
|
|
@@ -18,8 +18,7 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
18
18
|
private productsPriceCache;
|
|
19
19
|
private readonly CACHE_MAX_DAYS;
|
|
20
20
|
private formatters;
|
|
21
|
-
private
|
|
22
|
-
private isLegacyPriceFormatterEnabled;
|
|
21
|
+
private isPriceFormatterRegistered;
|
|
23
22
|
private quotationPriceBridge?;
|
|
24
23
|
private quotationBridgeChannel?;
|
|
25
24
|
private quotationBridgeLoadedKey?;
|
|
@@ -37,8 +36,6 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
37
36
|
private lastPreloadCompletedAtMs;
|
|
38
37
|
/** IndexDB 写入串行队列,避免快照与 patch 并发交错 */
|
|
39
38
|
private productIndexDBSaveQueue;
|
|
40
|
-
/** 最近一次智能定价评估提取的 schedule 变价时间点(HH:mm),供 Server 订阅定时刷新使用 */
|
|
41
|
-
private lastScheduleTimePoints;
|
|
42
39
|
constructor(name?: string, version?: string);
|
|
43
40
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
44
41
|
/**
|
|
@@ -111,10 +108,6 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
111
108
|
*/
|
|
112
109
|
private prepareProductsWithPrice;
|
|
113
110
|
private getProductsPriceCacheKey;
|
|
114
|
-
/**
|
|
115
|
-
* 稳定序列化策略上下文,避免对象 key 顺序不同导致缓存 key 抖动。
|
|
116
|
-
*/
|
|
117
|
-
private stringifyStable;
|
|
118
111
|
private normalizeProductIds;
|
|
119
112
|
/**
|
|
120
113
|
* 按轻量范围返回商品 ID,不做 structuredClone。
|
|
@@ -129,26 +122,14 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
129
122
|
*/
|
|
130
123
|
private applyFormatters;
|
|
131
124
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* 智能定价默认替代报价单逻辑;报价单 formatter 仅在 enableLegacyPriceFormatter=true 时启用。
|
|
125
|
+
* 注册内置的价格格式化器
|
|
126
|
+
* 这个格式化器负责将价格数据应用到商品上
|
|
135
127
|
* @private
|
|
136
128
|
*/
|
|
137
|
-
private
|
|
138
|
-
/**
|
|
139
|
-
* 是否启用旧报价单价格 formatter。
|
|
140
|
-
*
|
|
141
|
-
* 默认关闭,避免报价单逻辑覆盖智能定价结果。
|
|
142
|
-
*/
|
|
143
|
-
private shouldEnableLegacyPriceFormatter;
|
|
144
|
-
/**
|
|
145
|
-
* 返回最近一次 prepareProductsWithPrice / DataVariant 评估提取的变价时间点(HH:mm)。
|
|
146
|
-
* 供 OS Server 商品 query 订阅定时刷新使用。
|
|
147
|
-
*/
|
|
148
|
-
getLastScheduleTimePoints(): string[];
|
|
129
|
+
private registerBuiltinPriceFormatter;
|
|
149
130
|
/**
|
|
150
131
|
* 注册商品格式化器
|
|
151
|
-
*
|
|
132
|
+
* 格式化器会按注册顺序依次执行(内置价格格式化器始终是第一个)
|
|
152
133
|
* @param formatter 格式化函数
|
|
153
134
|
* @param prepend 是否插入到队列开头(默认 false,追加到末尾)
|
|
154
135
|
* @example
|
|
@@ -163,8 +144,8 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
163
144
|
*/
|
|
164
145
|
registerFormatter(formatter: ProductFormatter, prepend?: boolean): void;
|
|
165
146
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @param keepBuiltin
|
|
147
|
+
* 清空所有格式化器(包括内置价格格式化器)
|
|
148
|
+
* @param keepBuiltin 是否保留内置价格格式化器(默认 true)
|
|
168
149
|
*/
|
|
169
150
|
clearFormatters(keepBuiltin?: boolean): void;
|
|
170
151
|
/**
|
|
@@ -204,10 +185,6 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
204
185
|
* 获取商品列表(深拷贝,供外部安全使用)
|
|
205
186
|
*/
|
|
206
187
|
getProducts(): Promise<ProductData[]>;
|
|
207
|
-
/**
|
|
208
|
-
* 批量获取商品轻量快照,供订单详情等响应补齐展示协议字段。
|
|
209
|
-
*/
|
|
210
|
-
getProductSnapshotsByIds(ids: number[]): Promise<Record<string, ProductSnapshot>>;
|
|
211
188
|
/**
|
|
212
189
|
* 内部获取商品列表的直接引用(无拷贝)
|
|
213
190
|
* 仅供内部 formatter 流程使用,因为 formatter 会创建新对象
|