@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
|
@@ -38,12 +38,14 @@ __export(utils_exports, {
|
|
|
38
38
|
createEmptySummary: () => import_utils2.createEmptySummary,
|
|
39
39
|
createUuidV4: () => createUuidV4,
|
|
40
40
|
ensureManualProductDiscountList: () => import_manualProductDiscount.ensureManualProductDiscountList,
|
|
41
|
+
ensureProductSku: () => ensureProductSku,
|
|
41
42
|
findManualProductDiscountItem: () => import_manualProductDiscount.findManualProductDiscountItem,
|
|
42
43
|
formatDateTime: () => formatDateTime,
|
|
43
44
|
formatV1Product: () => formatV1Product,
|
|
44
45
|
generateDuration: () => generateDuration,
|
|
45
46
|
getAllDiscountList: () => getAllDiscountList,
|
|
46
47
|
getOrderProductLineUid: () => getOrderProductLineUid,
|
|
48
|
+
getProductSkuOptions: () => getProductSkuOptions,
|
|
47
49
|
hasAssignedHolderId: () => hasAssignedHolderId,
|
|
48
50
|
indexOrderProductsByUid: () => indexOrderProductsByUid,
|
|
49
51
|
isEmptyOrderProductDisplayValue: () => isEmptyOrderProductDisplayValue,
|
|
@@ -56,6 +58,7 @@ __export(utils_exports, {
|
|
|
56
58
|
normalizeBookingIsAll: () => normalizeBookingIsAll,
|
|
57
59
|
normalizeBookingSubType: () => normalizeBookingSubType,
|
|
58
60
|
normalizeOrderProductDiscountList: () => normalizeOrderProductDiscountList,
|
|
61
|
+
normalizeProductSkuOptions: () => normalizeProductSkuOptions,
|
|
59
62
|
normalizeSubmitBooking: () => normalizeSubmitBooking,
|
|
60
63
|
normalizeSubmitCollectPaxValue: () => normalizeSubmitCollectPaxValue,
|
|
61
64
|
resolveEffectivePerUnitDiscount: () => resolveEffectivePerUnitDiscount,
|
|
@@ -91,12 +94,36 @@ function composeLinePrice(params) {
|
|
|
91
94
|
}
|
|
92
95
|
return total.toDecimalPlaces(2).toFixed(2);
|
|
93
96
|
}
|
|
97
|
+
function normalizeProductSkuOptions(options) {
|
|
98
|
+
if (!Array.isArray(options))
|
|
99
|
+
return [];
|
|
100
|
+
return options.map((option) => {
|
|
101
|
+
const normalized = {
|
|
102
|
+
...option && typeof option === "object" ? option : {}
|
|
103
|
+
};
|
|
104
|
+
const addPrice = normalized.add_price ?? normalized.price;
|
|
105
|
+
if (addPrice !== void 0)
|
|
106
|
+
normalized.add_price = addPrice;
|
|
107
|
+
delete normalized.price;
|
|
108
|
+
return normalized;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function ensureProductSku(product) {
|
|
112
|
+
const rawSku = (product == null ? void 0 : product.product_sku) && typeof product.product_sku === "object" ? product.product_sku : {};
|
|
113
|
+
return {
|
|
114
|
+
...rawSku,
|
|
115
|
+
option: normalizeProductSkuOptions(rawSku.option)
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function getProductSkuOptions(product) {
|
|
119
|
+
return ensureProductSku(product).option;
|
|
120
|
+
}
|
|
94
121
|
function sumOptionUnitPrice(options) {
|
|
95
122
|
let total = new import_decimal.default(0);
|
|
96
123
|
if (!Array.isArray(options))
|
|
97
124
|
return total;
|
|
98
125
|
for (const opt of options) {
|
|
99
|
-
const price = new import_decimal.default(Number(opt == null ? void 0 : opt.price) || 0);
|
|
126
|
+
const price = new import_decimal.default(Number((opt == null ? void 0 : opt.add_price) ?? (opt == null ? void 0 : opt.price)) || 0);
|
|
100
127
|
const num = new import_decimal.default(Number(opt == null ? void 0 : opt.num) || 0);
|
|
101
128
|
total = total.plus(price.times(num));
|
|
102
129
|
}
|
|
@@ -184,7 +211,7 @@ function resolveEffectivePerUnitDiscount(product) {
|
|
|
184
211
|
if (hasPromoDiscountItem)
|
|
185
212
|
return fromList;
|
|
186
213
|
const metadata = (product == null ? void 0 : product.metadata) || {};
|
|
187
|
-
const optionSum = sumOptionUnitPrice(product
|
|
214
|
+
const optionSum = sumOptionUnitPrice(getProductSkuOptions(product)).toNumber();
|
|
188
215
|
if (metadata.source_product_price != null && metadata.main_product_selling_price != null) {
|
|
189
216
|
const source = Number(metadata.source_product_price);
|
|
190
217
|
const selling = Number(metadata.main_product_selling_price) - optionSum;
|
|
@@ -246,7 +273,7 @@ function createDefaultOrderRulesHooks() {
|
|
|
246
273
|
getProduct: (product) => {
|
|
247
274
|
var _a, _b, _c, _d, _e, _f;
|
|
248
275
|
const metadataAny = product.metadata || {};
|
|
249
|
-
const optionSum = sumOptionUnitPrice(product
|
|
276
|
+
const optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
|
|
250
277
|
let sourcePrice;
|
|
251
278
|
if (metadataAny.source_product_price !== void 0) {
|
|
252
279
|
sourcePrice = String(metadataAny.source_product_price);
|
|
@@ -274,7 +301,7 @@ function createDefaultOrderRulesHooks() {
|
|
|
274
301
|
// 不透明 identity 契约下,normalizeOrderProduct / hydrate 已保证唯一值存在;
|
|
275
302
|
// 留 fingerprint 分支仅作 Rules 单测里直接传裸 product 时的兜底。
|
|
276
303
|
_id: ((_a = product.metadata) == null ? void 0 : _a.unique_identification_number) ? `${product.product_id}_${product.product_variant_id}_${product.metadata.unique_identification_number}` : `${product.product_id}_${product.product_variant_id}_${(0, import_utils.buildProductLineFingerprint)(
|
|
277
|
-
product
|
|
304
|
+
getProductSkuOptions(product),
|
|
278
305
|
product.product_bundle
|
|
279
306
|
)}`,
|
|
280
307
|
// Rules 内部 getProductTotalPrice / getProductOriginTotalPrice 会各自再叠加 bundle + option,
|
|
@@ -306,7 +333,7 @@ function createDefaultOrderRulesHooks() {
|
|
|
306
333
|
const nextNum = Number(values.quantity ?? product.num ?? 1) || 1;
|
|
307
334
|
const metadataAny = product.metadata || {};
|
|
308
335
|
const existedSource = metadataAny.source_product_price ?? product.selling_price ?? "0";
|
|
309
|
-
const nextOptions = product
|
|
336
|
+
const nextOptions = getProductSkuOptions(product);
|
|
310
337
|
const optionSum = sumOptionUnitPrice(nextOptions);
|
|
311
338
|
const nextSourceSellingPrice = values.main_product_selling_price !== void 0 ? String(values.main_product_selling_price) : values.price !== void 0 ? String(values.price) : values.total !== void 0 ? toUnitPriceString(values.total, nextNum) : String(existedSource);
|
|
312
339
|
const nextSourceOriginalPrice = values.original_price !== void 0 ? String(values.original_price) : String(existedSource);
|
|
@@ -415,6 +442,7 @@ function formatSubmitOptionItems(options) {
|
|
|
415
442
|
return [];
|
|
416
443
|
return options.map((d) => {
|
|
417
444
|
const option = {
|
|
445
|
+
...d && typeof d === "object" ? d : {},
|
|
418
446
|
num: d == null ? void 0 : d.num,
|
|
419
447
|
option_group_item_id: d == null ? void 0 : d.option_group_item_id,
|
|
420
448
|
option_group_id: d == null ? void 0 : d.option_group_id
|
|
@@ -422,6 +450,7 @@ function formatSubmitOptionItems(options) {
|
|
|
422
450
|
const addPrice = (d == null ? void 0 : d.add_price) ?? (d == null ? void 0 : d.price);
|
|
423
451
|
if (addPrice !== void 0)
|
|
424
452
|
option.add_price = String(addPrice);
|
|
453
|
+
delete option.price;
|
|
425
454
|
return option;
|
|
426
455
|
});
|
|
427
456
|
}
|
|
@@ -485,7 +514,6 @@ function normalizeSubmitProduct(product) {
|
|
|
485
514
|
const { unique_identification_number: _runtimeUid, ...submitProduct } = product;
|
|
486
515
|
const {
|
|
487
516
|
num,
|
|
488
|
-
product_option_item: productOptionItem,
|
|
489
517
|
surcharge_fee: _productSurchargeFee,
|
|
490
518
|
discount_amount: _deprecatedDiscountAmount,
|
|
491
519
|
discount_type: _deprecatedDiscountType,
|
|
@@ -494,6 +522,7 @@ function normalizeSubmitProduct(product) {
|
|
|
494
522
|
discount_per: _deprecatedDiscountPer,
|
|
495
523
|
...productRest
|
|
496
524
|
} = submitProduct;
|
|
525
|
+
delete productRest[`product_${"option"}_item`];
|
|
497
526
|
const rawMetadata = submitProduct.metadata || {};
|
|
498
527
|
const bookingUid = rawMetadata.booking_uid;
|
|
499
528
|
const cleanMetadata = {};
|
|
@@ -527,9 +556,7 @@ function normalizeSubmitProduct(product) {
|
|
|
527
556
|
}
|
|
528
557
|
const productSku = {
|
|
529
558
|
...submitProduct.product_sku && typeof submitProduct.product_sku === "object" ? submitProduct.product_sku : {},
|
|
530
|
-
option: formatSubmitOptionItems(
|
|
531
|
-
(productOptionItem == null ? void 0 : productOptionItem.length) ? productOptionItem : (_a = submitProduct.product_sku) == null ? void 0 : _a.option
|
|
532
|
-
)
|
|
559
|
+
option: formatSubmitOptionItems((_a = submitProduct.product_sku) == null ? void 0 : _a.option)
|
|
533
560
|
};
|
|
534
561
|
return {
|
|
535
562
|
...productRest,
|
|
@@ -872,7 +899,8 @@ function mergeOrderProductDisplayFields(previous, next) {
|
|
|
872
899
|
"product_cover",
|
|
873
900
|
"cover",
|
|
874
901
|
"variant_title",
|
|
875
|
-
"product_sku"
|
|
902
|
+
"product_sku",
|
|
903
|
+
"payment_price"
|
|
876
904
|
];
|
|
877
905
|
displayFields.forEach((field) => {
|
|
878
906
|
if (isEmptyOrderProductDisplayValue(merged[field]) && !isEmptyOrderProductDisplayValue(previous[field])) {
|
|
@@ -919,12 +947,14 @@ function indexOrderProductsByUid(products) {
|
|
|
919
947
|
createEmptySummary,
|
|
920
948
|
createUuidV4,
|
|
921
949
|
ensureManualProductDiscountList,
|
|
950
|
+
ensureProductSku,
|
|
922
951
|
findManualProductDiscountItem,
|
|
923
952
|
formatDateTime,
|
|
924
953
|
formatV1Product,
|
|
925
954
|
generateDuration,
|
|
926
955
|
getAllDiscountList,
|
|
927
956
|
getOrderProductLineUid,
|
|
957
|
+
getProductSkuOptions,
|
|
928
958
|
hasAssignedHolderId,
|
|
929
959
|
indexOrderProductsByUid,
|
|
930
960
|
isEmptyOrderProductDisplayValue,
|
|
@@ -937,6 +967,7 @@ function indexOrderProductsByUid(products) {
|
|
|
937
967
|
normalizeBookingIsAll,
|
|
938
968
|
normalizeBookingSubType,
|
|
939
969
|
normalizeOrderProductDiscountList,
|
|
970
|
+
normalizeProductSkuOptions,
|
|
940
971
|
normalizeSubmitBooking,
|
|
941
972
|
normalizeSubmitCollectPaxValue,
|
|
942
973
|
resolveEffectivePerUnitDiscount,
|
|
@@ -8,7 +8,9 @@ export interface SalesSummaryProduct {
|
|
|
8
8
|
original_price: string;
|
|
9
9
|
tax_fee: string;
|
|
10
10
|
is_charge_tax?: number;
|
|
11
|
-
|
|
11
|
+
product_sku?: Record<string, any> & {
|
|
12
|
+
option?: any[];
|
|
13
|
+
};
|
|
12
14
|
discount_list?: any[];
|
|
13
15
|
product_bundle?: any[];
|
|
14
16
|
metadata?: Record<string, any>;
|
|
@@ -35,6 +35,7 @@ __export(utils_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(utils_exports);
|
|
36
36
|
var import_decimal = __toESM(require("decimal.js"));
|
|
37
37
|
var import_utils = require("../Summary/utils");
|
|
38
|
+
var import_utils2 = require("../Order/utils");
|
|
38
39
|
function toDecimal(value) {
|
|
39
40
|
return new import_decimal.default(value || 0);
|
|
40
41
|
}
|
|
@@ -75,6 +76,7 @@ function buildSurchargeServiceItems(products) {
|
|
|
75
76
|
var _a, _b;
|
|
76
77
|
const quantity = getSafeNum(product.num);
|
|
77
78
|
const unitTotal = getUnitPaymentTotal(product);
|
|
79
|
+
const options = (0, import_utils2.getProductSkuOptions)(product);
|
|
78
80
|
return {
|
|
79
81
|
id: product.product_id,
|
|
80
82
|
num: quantity,
|
|
@@ -86,12 +88,12 @@ function buildSurchargeServiceItems(products) {
|
|
|
86
88
|
product: {
|
|
87
89
|
discount_list: product.discount_list || [],
|
|
88
90
|
product_bundle: product.product_bundle || [],
|
|
89
|
-
|
|
91
|
+
product_sku: product.product_sku || { option: options }
|
|
90
92
|
}
|
|
91
93
|
},
|
|
92
94
|
bundle: product.product_bundle || [],
|
|
93
|
-
option:
|
|
94
|
-
options
|
|
95
|
+
option: options,
|
|
96
|
+
options,
|
|
95
97
|
relation_details: [],
|
|
96
98
|
metadata: product.metadata || {},
|
|
97
99
|
start_date: ((_a = product.metadata) == null ? void 0 : _a.start_date) || "",
|
|
@@ -18,7 +18,10 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
18
18
|
private resourceIdIndex;
|
|
19
19
|
private logger;
|
|
20
20
|
private storage;
|
|
21
|
-
private orderSQLiteSaveQueue;
|
|
21
|
+
private orderSQLiteSaveQueue; /** 按 storageKey 记录最近一次 SQLite 写入来源与时间,用于去重 */
|
|
22
|
+
private recentSqliteWriteByStorageKey;
|
|
23
|
+
/** 最近一次 SSE 全量拉取完成时间 */
|
|
24
|
+
private lastServerFullFetchAtMs;
|
|
22
25
|
constructor(name?: string, version?: string);
|
|
23
26
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
24
27
|
/**
|
|
@@ -33,6 +36,35 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
33
36
|
* @param metadata 日志元数据
|
|
34
37
|
*/
|
|
35
38
|
private logError;
|
|
39
|
+
/**
|
|
40
|
+
* 记录订单最近一次 SQLite 写入,供 pubsub 回声去重使用。
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* this.recordRecentSqliteWrite('upsertOrdersFromRemote', orders)
|
|
44
|
+
*/
|
|
45
|
+
private recordRecentSqliteWrite;
|
|
46
|
+
/**
|
|
47
|
+
* 过滤 pubsub 触发的冗余 SQLite patch(业务 API 刚写入过的 update 回声)。
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const { toWrite, skipped } = this.filterRedundantPatchOrders('pubsub.bodyUpsert', orders, mergeActions)
|
|
51
|
+
*/
|
|
52
|
+
private filterRedundantPatchOrders;
|
|
53
|
+
/**
|
|
54
|
+
* 过滤 pubsub HTTP 增量拉取 ids:本地刚由业务 API 写入的单可跳过 HTTP。
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* const ids = this.filterRedundantHttpRefreshIds([99331, 99332])
|
|
58
|
+
*/
|
|
59
|
+
private filterRedundantHttpRefreshIds;
|
|
60
|
+
/**
|
|
61
|
+
* 解析 pubsub 消息会走哪条同步分支,便于对照为何触发 HTTP 重拉或 body 直写。
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* this.resolveSyncMessageRoute(msg)
|
|
65
|
+
* // => { route: 'httpRefresh.batchIds', ... }
|
|
66
|
+
*/
|
|
67
|
+
private resolveSyncMessageRoute;
|
|
36
68
|
private getOrderSyncThrottleMs;
|
|
37
69
|
preload(): Promise<void>;
|
|
38
70
|
getOrders(): OrderData[];
|
|
@@ -120,6 +152,14 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
120
152
|
private normalizeOrderSyncPayload;
|
|
121
153
|
private uniqueOrderIds;
|
|
122
154
|
private getIdKey;
|
|
155
|
+
/**
|
|
156
|
+
* 解析订单 SQLite 主键,规则与宿主 OrderDataSource.getOrderStorageKey 一致。
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* const key = this.getOrderStorageKey({ order_id: 1001, external_sale_number: 'S-1001' })
|
|
160
|
+
* // => 'S-1001'
|
|
161
|
+
*/
|
|
162
|
+
private getOrderStorageKey;
|
|
123
163
|
/**
|
|
124
164
|
* 当前订单拉取窗口:
|
|
125
165
|
* - 优先使用 createdAtQuery.sales_time_between(已按营业日边界初始化)
|
|
@@ -132,22 +172,35 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
132
172
|
private setStorageItem;
|
|
133
173
|
private loadOrdersFromSQLite;
|
|
134
174
|
/**
|
|
135
|
-
* 串行执行订单 SQLite
|
|
175
|
+
* 串行执行订单 SQLite 写入任务,避免快照替换与增量 upsert 并发交错。
|
|
136
176
|
*
|
|
137
177
|
* @example
|
|
138
178
|
* await this.runInOrderSQLiteSaveQueue(async () => {
|
|
139
|
-
* await this.dbManager.
|
|
140
|
-
* await this.dbManager.bulkAdd(INDEXDB_STORE_NAME, orders)
|
|
179
|
+
* await this.dbManager.bulkUpdate(INDEXDB_STORE_NAME, orders)
|
|
141
180
|
* })
|
|
142
181
|
*/
|
|
143
182
|
private runInOrderSQLiteSaveQueue;
|
|
144
183
|
/**
|
|
145
|
-
*
|
|
184
|
+
* 批量增量 upsert 订单到 SQLite,不清空表;用于 pubsub / HTTP 增量合并。
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* await this.patchOrdersInSQLite(freshOrders)
|
|
188
|
+
*/
|
|
189
|
+
private patchOrdersInSQLite;
|
|
190
|
+
/**
|
|
191
|
+
* 单条 upsert 订单到 SQLite;用于 overwriteExistingOrder 等单条覆盖场景。
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* await this.updateOrderInSQLite(freshOrder)
|
|
195
|
+
*/
|
|
196
|
+
private updateOrderInSQLite;
|
|
197
|
+
/**
|
|
198
|
+
* 全量快照替换 orders 表(clear + bulkAdd),用于 SSE 全量拉取与营业日窗口裁剪。
|
|
146
199
|
*
|
|
147
200
|
* @example
|
|
148
|
-
* await this.
|
|
201
|
+
* await this.replaceOrdersSnapshotInSQLite(orderList)
|
|
149
202
|
*/
|
|
150
|
-
private
|
|
203
|
+
private replaceOrdersSnapshotInSQLite;
|
|
151
204
|
/**
|
|
152
205
|
* 清空订单模块的内存数据和本地 SQLite 订单表。
|
|
153
206
|
*
|