@pisell/pisellos 2.2.190 → 2.2.192
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/index.js +0 -9
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -7
- package/dist/modules/Cart/utils/cartProduct.js +13 -2
- package/dist/modules/Order/index.d.ts +1 -3
- package/dist/modules/Order/index.js +69 -95
- package/dist/modules/Order/types.d.ts +9 -6
- package/dist/modules/Order/utils.d.ts +9 -2
- package/dist/modules/Order/utils.js +36 -13
- package/dist/modules/SalesSummary/types.d.ts +3 -1
- package/dist/modules/SalesSummary/utils.js +7 -3
- package/dist/server/modules/order/index.d.ts +60 -7
- package/dist/server/modules/order/index.js +670 -178
- package/dist/server/modules/order/types.d.ts +0 -2
- package/dist/server/modules/products/index.d.ts +33 -6
- package/dist/server/modules/products/index.js +528 -231
- package/dist/solution/BaseSales/index.js +13 -7
- package/dist/solution/BaseSales/types.d.ts +8 -5
- package/dist/solution/BaseSales/types.js +2 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +7 -7
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +16 -13
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +22 -19
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/ScanOrder/index.js +7 -5
- package/dist/solution/ScanOrder/types.d.ts +8 -5
- package/dist/solution/ScanOrder/types.js +2 -3
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +26 -23
- package/dist/solution/VenueBooking/index.js +5 -3
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
- package/lib/modules/Cart/utils/cartProduct.js +9 -2
- package/lib/modules/Order/index.d.ts +1 -3
- package/lib/modules/Order/index.js +45 -58
- package/lib/modules/Order/types.d.ts +9 -6
- package/lib/modules/Order/utils.d.ts +9 -2
- package/lib/modules/Order/utils.js +41 -10
- package/lib/modules/SalesSummary/types.d.ts +3 -1
- package/lib/modules/SalesSummary/utils.js +5 -3
- package/lib/server/modules/order/index.d.ts +60 -7
- package/lib/server/modules/order/index.js +350 -40
- package/lib/server/modules/order/types.d.ts +0 -2
- package/lib/server/modules/products/index.d.ts +33 -6
- package/lib/server/modules/products/index.js +159 -30
- package/lib/solution/BaseSales/index.js +14 -5
- package/lib/solution/BaseSales/types.d.ts +8 -5
- package/lib/solution/BaseSales/utils/cartPromotion.js +6 -6
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +21 -14
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +11 -7
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/ScanOrder/index.js +4 -4
- package/lib/solution/ScanOrder/types.d.ts +8 -5
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +12 -8
- package/lib/solution/VenueBooking/index.js +2 -2
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/package.json +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -27,6 +27,12 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
27
27
|
private productDataSource;
|
|
28
28
|
private pendingSyncMessages;
|
|
29
29
|
private syncTimer?;
|
|
30
|
+
/** 最近一次 SSE 全量拉取完成时间 */
|
|
31
|
+
private lastServerFullFetchAtMs;
|
|
32
|
+
/** 最近一次 preload 完成时间(含 IndexDB 命中) */
|
|
33
|
+
private lastPreloadCompletedAtMs;
|
|
34
|
+
/** IndexDB 写入串行队列,避免快照与 patch 并发交错 */
|
|
35
|
+
private productIndexDBSaveQueue;
|
|
30
36
|
constructor(name?: string, version?: string);
|
|
31
37
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
32
38
|
/**
|
|
@@ -209,10 +215,28 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
209
215
|
*/
|
|
210
216
|
private loadProductsFromIndexDB;
|
|
211
217
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
218
|
+
* 串行执行商品 IndexDB 写入,避免快照替换与增量 patch 并发交错。
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* await this.runInProductIndexDBSaveQueue(async () => {
|
|
222
|
+
* await this.dbManager.bulkUpdate(INDEXDB_STORE_NAME, products)
|
|
223
|
+
* })
|
|
224
|
+
*/
|
|
225
|
+
private runInProductIndexDBSaveQueue;
|
|
226
|
+
/**
|
|
227
|
+
* 全量快照写入 IndexDB:clear + bulkUpdate,仅用于 SSE/HTTP 全量拉取。
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* await this.replaceProductsSnapshotInIndexDB(list, 'loadProductsByServer')
|
|
214
231
|
*/
|
|
215
|
-
private
|
|
232
|
+
private replaceProductsSnapshotInIndexDB;
|
|
233
|
+
/**
|
|
234
|
+
* 增量 upsert 商品到 IndexDB,不清空表;用于 pubsub 批次合并后的变更商品。
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* await this.patchProductsInIndexDB(changedProducts, 'pubsub.processProductSyncMessages', mergeActions)
|
|
238
|
+
*/
|
|
239
|
+
private patchProductsInIndexDB;
|
|
216
240
|
/**
|
|
217
241
|
* 同步更新商品 Map 缓存
|
|
218
242
|
* 将 list 中的商品同步到 map,以 id 为 key
|
|
@@ -262,14 +286,17 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
262
286
|
/**
|
|
263
287
|
* 将 body 完整数据直接覆盖到本地 store(不调用报价单接口)
|
|
264
288
|
* 已存在的 → 直接替换;不存在的 → 追加
|
|
265
|
-
*
|
|
266
|
-
*
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* await this.applyBodyUpdatesToStore(bodyUpdates, { skipIndexDB: true })
|
|
267
292
|
*/
|
|
268
293
|
private applyBodyUpdatesToStore;
|
|
269
294
|
/**
|
|
270
295
|
* 将增量拉取的商品合并到 store
|
|
271
296
|
* 已存在的 → 替换;新的 → 追加
|
|
272
|
-
*
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* await this.mergeProductsToStore(freshProducts, { skipIndexDB: true })
|
|
273
300
|
*/
|
|
274
301
|
private mergeProductsToStore;
|
|
275
302
|
/**
|