@pisell/pisellos 2.2.315 → 2.2.316
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/evaluator.js +89 -104
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +28 -4
- package/dist/modules/Holder/utils.d.ts +2 -0
- package/dist/modules/Holder/utils.js +32 -2
- package/dist/modules/OpenData/contactInfo.d.ts +20 -0
- package/dist/modules/OpenData/contactInfo.js +70 -0
- package/dist/modules/OpenData/index.d.ts +1 -0
- package/dist/modules/OpenData/index.js +1 -0
- package/dist/modules/OpenData/types.d.ts +9 -0
- package/dist/modules/Order/holderRelations.d.ts +14 -0
- package/dist/modules/Order/holderRelations.js +154 -0
- package/dist/modules/Order/index.d.ts +2 -2
- package/dist/modules/Order/index.js +89 -44
- package/dist/modules/Order/types.d.ts +19 -1
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
- package/dist/modules/Order/utils/discountProductLineIdentity.js +142 -7
- package/dist/modules/Order/utils/orderCollectionIdentity.js +24 -10
- package/dist/modules/Order/utils.d.ts +2 -1
- package/dist/modules/Order/utils.js +36 -10
- package/dist/modules/Rules/index.js +62 -61
- package/dist/server/index.js +36 -28
- package/dist/server/modules/order/index.d.ts +4 -0
- package/dist/server/modules/order/index.js +255 -190
- package/dist/server/modules/order/types.d.ts +3 -0
- package/dist/server/modules/products/index.d.ts +28 -7
- package/dist/server/modules/products/index.js +1297 -770
- package/dist/server/modules/products/replication.d.ts +8 -0
- package/dist/server/modules/products/replication.js +69 -0
- package/dist/server/modules/products/types.d.ts +12 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/shared/receipt/small-ticket.js +24 -12
- package/dist/shared/receipt/templateVisibility.d.ts +3 -0
- package/dist/shared/receipt/templateVisibility.js +6 -2
- package/dist/shared/sales/loadSalesOrderSnapshot.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +4 -0
- package/dist/solution/BaseSales/index.js +1116 -935
- package/dist/solution/BaseSales/types.d.ts +2 -1
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +7 -3
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +14 -4
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +15 -1
- package/dist/solution/BookingTicket/index.js +784 -501
- package/dist/solution/ScanOrder/index.js +65 -31
- package/dist/solution/ScanOrder/types.d.ts +3 -0
- package/dist/solution/UnifiedBookingSales/index.js +1 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +9 -14
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +17 -1
- package/lib/modules/Holder/utils.d.ts +2 -0
- package/lib/modules/Holder/utils.js +27 -1
- package/lib/modules/OpenData/contactInfo.d.ts +20 -0
- package/lib/modules/OpenData/contactInfo.js +56 -0
- package/lib/modules/OpenData/index.d.ts +1 -0
- package/lib/modules/OpenData/index.js +12 -0
- package/lib/modules/OpenData/types.d.ts +9 -0
- package/lib/modules/Order/holderRelations.d.ts +14 -0
- package/lib/modules/Order/holderRelations.js +98 -0
- package/lib/modules/Order/index.d.ts +2 -2
- package/lib/modules/Order/index.js +44 -12
- package/lib/modules/Order/types.d.ts +19 -1
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
- package/lib/modules/Order/utils/discountProductLineIdentity.js +51 -2
- package/lib/modules/Order/utils/orderCollectionIdentity.js +5 -0
- package/lib/modules/Order/utils.d.ts +2 -1
- package/lib/modules/Order/utils.js +28 -6
- package/lib/modules/Rules/index.js +2 -1
- package/lib/server/index.js +8 -2
- package/lib/server/modules/order/index.d.ts +4 -0
- package/lib/server/modules/order/index.js +46 -4
- package/lib/server/modules/order/types.d.ts +3 -0
- package/lib/server/modules/products/index.d.ts +28 -7
- package/lib/server/modules/products/index.js +226 -63
- package/lib/server/modules/products/replication.d.ts +8 -0
- package/lib/server/modules/products/replication.js +30 -0
- package/lib/server/modules/products/types.d.ts +12 -1
- package/lib/server/modules/products/types.js +3 -0
- package/lib/shared/receipt/small-ticket.js +22 -13
- package/lib/shared/receipt/templateVisibility.d.ts +3 -0
- package/lib/shared/receipt/templateVisibility.js +6 -2
- package/lib/shared/sales/loadSalesOrderSnapshot.js +1 -1
- package/lib/solution/BaseSales/index.d.ts +4 -0
- package/lib/solution/BaseSales/index.js +68 -2
- package/lib/solution/BaseSales/types.d.ts +2 -1
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +16 -8
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +15 -1
- package/lib/solution/BookingTicket/index.js +132 -3
- package/lib/solution/ScanOrder/index.js +59 -20
- package/lib/solution/ScanOrder/types.d.ts +3 -0
- package/lib/solution/UnifiedBookingSales/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ScheduleEventResource } from '../resource/types';
|
|
2
|
+
import type { OrderHolderRelation } from '../../../modules/Order/types';
|
|
2
3
|
/**
|
|
3
4
|
* Order 模块主键类型(对齐标准 Sales 协议的 order_id)
|
|
4
5
|
*/
|
|
@@ -448,6 +449,8 @@ export interface OrderData {
|
|
|
448
449
|
contacts_info?: unknown[];
|
|
449
450
|
/** 订单级主体参数 */
|
|
450
451
|
holder?: Record<string, unknown> | null;
|
|
452
|
+
/** 非预约商品 Holder 关系完整快照;缺席表示本次回包未提供 */
|
|
453
|
+
holder_relations?: OrderHolderRelation[];
|
|
451
454
|
/** 订单前端扩展快照 */
|
|
452
455
|
order_meta_list?: {
|
|
453
456
|
point_cards_snapshot?: Array<{
|
|
@@ -3,6 +3,7 @@ import { BaseModule } from '../../../modules/BaseModule';
|
|
|
3
3
|
import { ProductData } from '../../../modules/Product/types';
|
|
4
4
|
import type { RouteDefinition } from '../../types';
|
|
5
5
|
import { ProductIdScope, type ProductSnapshot, ProductFormatter, ProductFormatterContext } from './types';
|
|
6
|
+
import type { CommittedProducts, ReplicatedProducts } from './types';
|
|
6
7
|
/**
|
|
7
8
|
* Products 模块 - 用于获取和管理完整的商品详细数据
|
|
8
9
|
* 相比 ProductList 模块,Products 会获取所有详细信息并缓存
|
|
@@ -40,6 +41,26 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
40
41
|
private productIndexDBSaveQueue;
|
|
41
42
|
/** 最近一次智能定价评估提取的 schedule 变价时间点(HH:mm),供 Server 订阅定时刷新使用 */
|
|
42
43
|
private lastScheduleTimePoints;
|
|
44
|
+
private committedProductState?;
|
|
45
|
+
private productReplicationSourceGeneration;
|
|
46
|
+
private productPersistenceFailed;
|
|
47
|
+
private runtimeSyncMode;
|
|
48
|
+
private runtimeSyncGeneration;
|
|
49
|
+
private requestReplicaRefresh?;
|
|
50
|
+
private replicaApplyQueue;
|
|
51
|
+
private productSyncQueue;
|
|
52
|
+
private replicaPriceDirtyIds;
|
|
53
|
+
/** Installed after initial preload; initial cache/network loading stays unchanged. */
|
|
54
|
+
setRuntimeSyncMode(mode: 'normal' | 'memoryReplica', requestRefresh?: (trigger: string) => Promise<void>): Promise<void>;
|
|
55
|
+
isMemoryReplica(): boolean;
|
|
56
|
+
/** Read persisted data once on the main screen to establish a committed baseline. */
|
|
57
|
+
enableProductReplicationSource(): Promise<void>;
|
|
58
|
+
/** Release the extra catalog without changing the normal product store or persistence. */
|
|
59
|
+
disableProductReplicationSource(): void;
|
|
60
|
+
getCommittedProductSnapshot(): CommittedProducts | null;
|
|
61
|
+
private recordProductCommit;
|
|
62
|
+
applyReplicatedProducts(change: ReplicatedProducts): Promise<void>;
|
|
63
|
+
private refreshFromReplica;
|
|
43
64
|
constructor(name?: string, version?: string);
|
|
44
65
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
45
66
|
/**
|
|
@@ -230,7 +251,10 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
230
251
|
* 根据 ID 列表删除商品(用于 pubsub 同步删除场景)
|
|
231
252
|
* 同时更新 store.list、store.map、IndexDB 和价格缓存
|
|
232
253
|
*/
|
|
233
|
-
removeProductsByIds(ids: number[]
|
|
254
|
+
removeProductsByIds(ids: number[], options?: {
|
|
255
|
+
skipIndexDB?: boolean;
|
|
256
|
+
skipEmit?: boolean;
|
|
257
|
+
}): Promise<void>;
|
|
234
258
|
/**
|
|
235
259
|
* 重新从服务器加载全量商品列表并更新本地 store
|
|
236
260
|
* 用于 pubsub 同步 create / update / batch_update 场景
|
|
@@ -261,13 +285,8 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
261
285
|
* await this.replaceProductsSnapshotInIndexDB(list, 'loadProductsByServer')
|
|
262
286
|
*/
|
|
263
287
|
private replaceProductsSnapshotInIndexDB;
|
|
264
|
-
/**
|
|
265
|
-
* 增量 upsert 商品到 IndexDB,不清空表;用于 pubsub 批次合并后的变更商品。
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* await this.patchProductsInIndexDB(changedProducts, 'pubsub.processProductSyncMessages', mergeActions)
|
|
269
|
-
*/
|
|
270
288
|
private patchProductsInIndexDB;
|
|
289
|
+
private persistProductDelta;
|
|
271
290
|
/**
|
|
272
291
|
* 同步更新商品 Map 缓存
|
|
273
292
|
* 将 list 中的商品同步到 map,以 id 为 key
|
|
@@ -309,6 +328,7 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
309
328
|
* Server 层监听该事件后对变更商品增量执行 prepareProductsWithPrice 并更新缓存
|
|
310
329
|
*/
|
|
311
330
|
private processProductSyncMessages;
|
|
331
|
+
private processProductSyncBatch;
|
|
312
332
|
/**
|
|
313
333
|
* 通过 SSE 按 ids 增量拉取商品数据
|
|
314
334
|
* 请求 GET /shop/core/stream?type=product&ids={ids}
|
|
@@ -342,6 +362,7 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
342
362
|
* 销毁同步资源(取消 pubsub 订阅、清除定时器)
|
|
343
363
|
*/
|
|
344
364
|
destroyProductSync(): void;
|
|
365
|
+
destroy(): void;
|
|
345
366
|
/**
|
|
346
367
|
* 获取模块的路由定义
|
|
347
368
|
* Products 模块暂不提供路由,由 Server 层统一处理
|