@pisell/pisellos 2.2.220 → 2.2.221
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/modules/Payment/index.d.ts +3 -0
- package/dist/modules/Payment/index.js +6 -4
- package/dist/server/modules/order/index.js +11 -5
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/Checkout/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +10 -9
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/Payment/index.d.ts +3 -0
- package/lib/modules/Payment/index.js +3 -1
- package/lib/server/modules/order/index.js +7 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +1 -2
- package/package.json +1 -1
|
@@ -61,6 +61,7 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
61
61
|
/**
|
|
62
62
|
* 获取订单列表
|
|
63
63
|
*/
|
|
64
|
+
/** @deprecated */
|
|
64
65
|
getOrderListAsync(): Promise<PaymentOrder[]>;
|
|
65
66
|
/**
|
|
66
67
|
* 根据订单UUID获取支付订单(新方法)
|
|
@@ -160,10 +161,12 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
160
161
|
/**
|
|
161
162
|
* 确保支付模块所需的数据库表已创建
|
|
162
163
|
*/
|
|
164
|
+
/** @deprecated */
|
|
163
165
|
private ensurePaymentTables;
|
|
164
166
|
/**
|
|
165
167
|
* 获取部分支付的订单
|
|
166
168
|
*/
|
|
169
|
+
/** @deprecated */
|
|
167
170
|
getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
|
|
168
171
|
/**
|
|
169
172
|
* 智能金额舍入
|
|
@@ -197,9 +197,8 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
197
197
|
this.logger = this.app.logger;
|
|
198
198
|
|
|
199
199
|
// 确保支付模块所需的对象存储已创建
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
case 15:
|
|
200
|
+
// await this.ensurePaymentTables();
|
|
201
|
+
|
|
203
202
|
this.registerNetworkHandlers();
|
|
204
203
|
|
|
205
204
|
// // 预连接数据库
|
|
@@ -207,7 +206,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
207
206
|
|
|
208
207
|
console.log('[PaymentModule] 初始化完成');
|
|
209
208
|
this.logInfo('PaymentModule initialized successfully');
|
|
210
|
-
case
|
|
209
|
+
case 16:
|
|
211
210
|
case "end":
|
|
212
211
|
return _context.stop();
|
|
213
212
|
}
|
|
@@ -376,6 +375,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
376
375
|
/**
|
|
377
376
|
* 获取订单列表
|
|
378
377
|
*/
|
|
378
|
+
/** @deprecated */
|
|
379
379
|
)
|
|
380
380
|
}, {
|
|
381
381
|
key: "getOrderListAsync",
|
|
@@ -1848,6 +1848,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1848
1848
|
/**
|
|
1849
1849
|
* 确保支付模块所需的数据库表已创建
|
|
1850
1850
|
*/
|
|
1851
|
+
/** @deprecated */
|
|
1851
1852
|
)
|
|
1852
1853
|
}, {
|
|
1853
1854
|
key: "ensurePaymentTables",
|
|
@@ -1893,6 +1894,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1893
1894
|
/**
|
|
1894
1895
|
* 获取部分支付的订单
|
|
1895
1896
|
*/
|
|
1897
|
+
/** @deprecated */
|
|
1896
1898
|
)
|
|
1897
1899
|
}, {
|
|
1898
1900
|
key: "getPartiallyPaidOrdersAsync",
|
|
@@ -1625,7 +1625,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1625
1625
|
case 0:
|
|
1626
1626
|
this.logInfo('mergeOrdersToStore-开始', {
|
|
1627
1627
|
freshOrderCount: freshOrders.length,
|
|
1628
|
-
storeOrderCountBefore: this.store.list.length
|
|
1628
|
+
storeOrderCountBefore: this.store.list.length,
|
|
1629
|
+
source: source
|
|
1629
1630
|
});
|
|
1630
1631
|
this.logDuplicateOrders("".concat(source, ".beforeMerge"), this.store.list);
|
|
1631
1632
|
normalizedFreshOrders = [];
|
|
@@ -1712,20 +1713,25 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1712
1713
|
updateCount = Object.values(mergeActions).filter(function (v) {
|
|
1713
1714
|
return v === 'update';
|
|
1714
1715
|
}).length;
|
|
1716
|
+
this.logInfo('mergeOrdersToStore-合并完成', {
|
|
1717
|
+
insertCount: insertCount,
|
|
1718
|
+
updateCount: updateCount,
|
|
1719
|
+
storeOrderCountAfter: this.store.list.length
|
|
1720
|
+
});
|
|
1715
1721
|
this.store.list = this.compactOrderListByIdentity(updatedList, "".concat(source, ".store")).list;
|
|
1716
1722
|
this.syncOrdersMap();
|
|
1717
|
-
_context16.next =
|
|
1723
|
+
_context16.next = 61;
|
|
1718
1724
|
return this.patchOrdersInSQLite(patchedOrders, source, mergeActions);
|
|
1719
|
-
case
|
|
1725
|
+
case 61:
|
|
1720
1726
|
this.logInfo('mergeOrdersToStore-结束', {
|
|
1721
1727
|
uniqueFreshCount: uniqueFreshCount,
|
|
1722
1728
|
storeOrderCountAfter: this.store.list.length,
|
|
1723
1729
|
insertCount: insertCount,
|
|
1724
1730
|
updateCount: updateCount
|
|
1725
1731
|
});
|
|
1726
|
-
_context16.next =
|
|
1732
|
+
_context16.next = 64;
|
|
1727
1733
|
return this.emitOrdersChanged(patchedOrders, source);
|
|
1728
|
-
case
|
|
1734
|
+
case 64:
|
|
1729
1735
|
case "end":
|
|
1730
1736
|
return _context16.stop();
|
|
1731
1737
|
}
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 | 2 | 1 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -310,7 +310,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
310
310
|
* 获取当前的客户搜索条件
|
|
311
311
|
* @returns 当前搜索条件
|
|
312
312
|
*/
|
|
313
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
313
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
314
314
|
/**
|
|
315
315
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
316
316
|
* @returns 客户状态
|
|
@@ -117,20 +117,20 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
117
117
|
_context.next = 15;
|
|
118
118
|
return this.initializeSubModules(core, options);
|
|
119
119
|
case 15:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
// 预加载支付方式(利用缓存机制)
|
|
121
|
+
// await this.preloadPaymentMethods();
|
|
122
|
+
|
|
123
|
+
// 清理过期的已同步订单数据
|
|
124
|
+
// await this.cleanupExpiredOrdersAsync();
|
|
125
|
+
|
|
126
126
|
console.log('[Checkout] 初始化完成');
|
|
127
|
-
_context.next =
|
|
127
|
+
_context.next = 18;
|
|
128
128
|
return this.core.effects.emit("".concat(this.name, ":onCheckoutInitialized"), {
|
|
129
129
|
timestamp: Date.now()
|
|
130
130
|
});
|
|
131
|
-
case
|
|
131
|
+
case 18:
|
|
132
132
|
this.logInfo('CheckoutModule initialized successfully');
|
|
133
|
-
case
|
|
133
|
+
case 19:
|
|
134
134
|
case "end":
|
|
135
135
|
return _context.stop();
|
|
136
136
|
}
|
|
@@ -2868,6 +2868,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2868
2868
|
*
|
|
2869
2869
|
* 删除本地 IndexDB 中超过指定天数且已同步到后端的订单数据
|
|
2870
2870
|
*/
|
|
2871
|
+
/** @deprecated */
|
|
2871
2872
|
)
|
|
2872
2873
|
}, {
|
|
2873
2874
|
key: "cleanupExpiredOrdersAsync",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
+
var promotion_exports = {};
|
|
31
|
+
__export(promotion_exports, {
|
|
32
|
+
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
34
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
35
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
36
|
+
default: () => import_adapter2.default
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
39
|
+
var import_evaluator = require("./evaluator");
|
|
40
|
+
var import_adapter = require("./adapter");
|
|
41
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
42
|
+
var import_examples = require("./examples");
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
46
|
+
PromotionAdapter,
|
|
47
|
+
PromotionEvaluator,
|
|
48
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
49
|
+
});
|
|
@@ -61,6 +61,7 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
61
61
|
/**
|
|
62
62
|
* 获取订单列表
|
|
63
63
|
*/
|
|
64
|
+
/** @deprecated */
|
|
64
65
|
getOrderListAsync(): Promise<PaymentOrder[]>;
|
|
65
66
|
/**
|
|
66
67
|
* 根据订单UUID获取支付订单(新方法)
|
|
@@ -160,10 +161,12 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
160
161
|
/**
|
|
161
162
|
* 确保支付模块所需的数据库表已创建
|
|
162
163
|
*/
|
|
164
|
+
/** @deprecated */
|
|
163
165
|
private ensurePaymentTables;
|
|
164
166
|
/**
|
|
165
167
|
* 获取部分支付的订单
|
|
166
168
|
*/
|
|
169
|
+
/** @deprecated */
|
|
167
170
|
getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
|
|
168
171
|
/**
|
|
169
172
|
* 智能金额舍入
|
|
@@ -123,7 +123,6 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
123
123
|
this.app = appPlugin.getApp();
|
|
124
124
|
this.dbManager = this.app.dbManager;
|
|
125
125
|
this.logger = this.app.logger;
|
|
126
|
-
await this.ensurePaymentTables();
|
|
127
126
|
this.registerNetworkHandlers();
|
|
128
127
|
console.log("[PaymentModule] 初始化完成");
|
|
129
128
|
this.logInfo("PaymentModule initialized successfully");
|
|
@@ -235,6 +234,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
235
234
|
/**
|
|
236
235
|
* 获取订单列表
|
|
237
236
|
*/
|
|
237
|
+
/** @deprecated */
|
|
238
238
|
async getOrderListAsync() {
|
|
239
239
|
try {
|
|
240
240
|
return await this.dbManager.getAll("order");
|
|
@@ -992,6 +992,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
992
992
|
/**
|
|
993
993
|
* 确保支付模块所需的数据库表已创建
|
|
994
994
|
*/
|
|
995
|
+
/** @deprecated */
|
|
995
996
|
async ensurePaymentTables() {
|
|
996
997
|
try {
|
|
997
998
|
await this.dbManager.getAll("pay_method");
|
|
@@ -1013,6 +1014,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
1013
1014
|
/**
|
|
1014
1015
|
* 获取部分支付的订单
|
|
1015
1016
|
*/
|
|
1017
|
+
/** @deprecated */
|
|
1016
1018
|
async getPartiallyPaidOrdersAsync() {
|
|
1017
1019
|
try {
|
|
1018
1020
|
const allOrders = await this.dbManager.getAll("order");
|
|
@@ -953,7 +953,8 @@ var OrderModule = class extends import_BaseModule.BaseModule {
|
|
|
953
953
|
async mergeOrdersToStore(freshOrders, source) {
|
|
954
954
|
this.logInfo("mergeOrdersToStore-开始", {
|
|
955
955
|
freshOrderCount: freshOrders.length,
|
|
956
|
-
storeOrderCountBefore: this.store.list.length
|
|
956
|
+
storeOrderCountBefore: this.store.list.length,
|
|
957
|
+
source
|
|
957
958
|
});
|
|
958
959
|
this.logDuplicateOrders(`${source}.beforeMerge`, this.store.list);
|
|
959
960
|
const normalizedFreshOrders = [];
|
|
@@ -990,6 +991,11 @@ var OrderModule = class extends import_BaseModule.BaseModule {
|
|
|
990
991
|
}
|
|
991
992
|
const insertCount = Object.values(mergeActions).filter((v) => v === "insert").length;
|
|
992
993
|
const updateCount = Object.values(mergeActions).filter((v) => v === "update").length;
|
|
994
|
+
this.logInfo("mergeOrdersToStore-合并完成", {
|
|
995
|
+
insertCount,
|
|
996
|
+
updateCount,
|
|
997
|
+
storeOrderCountAfter: this.store.list.length
|
|
998
|
+
});
|
|
993
999
|
this.store.list = this.compactOrderListByIdentity(updatedList, `${source}.store`).list;
|
|
994
1000
|
this.syncOrdersMap();
|
|
995
1001
|
await this.patchOrdersInSQLite(patchedOrders, source, mergeActions);
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 | 2 | 1 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -310,7 +310,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
310
310
|
* 获取当前的客户搜索条件
|
|
311
311
|
* @returns 当前搜索条件
|
|
312
312
|
*/
|
|
313
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
313
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
314
314
|
/**
|
|
315
315
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
316
316
|
* @returns 客户状态
|
|
@@ -80,8 +80,6 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
80
80
|
currentCustomer: void 0
|
|
81
81
|
};
|
|
82
82
|
await this.initializeSubModules(core, options);
|
|
83
|
-
await this.preloadPaymentMethods();
|
|
84
|
-
await this.cleanupExpiredOrdersAsync();
|
|
85
83
|
console.log("[Checkout] 初始化完成");
|
|
86
84
|
await this.core.effects.emit(`${this.name}:onCheckoutInitialized`, {
|
|
87
85
|
timestamp: Date.now()
|
|
@@ -1900,6 +1898,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1900
1898
|
*
|
|
1901
1899
|
* 删除本地 IndexDB 中超过指定天数且已同步到后端的订单数据
|
|
1902
1900
|
*/
|
|
1901
|
+
/** @deprecated */
|
|
1903
1902
|
async cleanupExpiredOrdersAsync() {
|
|
1904
1903
|
var _a, _b, _c;
|
|
1905
1904
|
try {
|