@pisell/pisellos 2.2.59 → 2.2.60
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 +2 -0
- package/dist/model/strategy/adapter/index.js +2 -1
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +1206 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +206 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -0
- package/dist/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/dist/model/strategy/adapter/promotion/type.js +209 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -1
- package/dist/model/strategy/engine.d.ts +106 -0
- package/dist/model/strategy/engine.js +611 -0
- package/dist/model/strategy/index.d.ts +2 -93
- package/dist/model/strategy/index.js +6 -549
- package/dist/modules/BaseModule.d.ts +4 -0
- package/dist/modules/BaseModule.js +5 -0
- package/dist/modules/Payment/index.js +5 -5
- package/dist/modules/Rules/index.d.ts +1 -0
- package/dist/modules/Rules/index.js +30 -22
- package/dist/modules/Schedule/index.d.ts +2 -2
- package/dist/modules/Schedule/index.js +0 -2
- package/dist/solution/BookingByStep/index.js +1 -0
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/Checkout/index.js +39 -43
- package/lib/model/strategy/adapter/index.d.ts +2 -0
- package/lib/model/strategy/adapter/index.js +5 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +844 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +206 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/lib/model/strategy/adapter/promotion/type.js +51 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -1
- package/lib/model/strategy/engine.d.ts +106 -0
- package/lib/model/strategy/engine.js +450 -0
- package/lib/model/strategy/index.d.ts +2 -93
- package/lib/model/strategy/index.js +6 -381
- package/lib/modules/BaseModule.d.ts +4 -0
- package/lib/modules/BaseModule.js +3 -0
- package/lib/modules/Payment/index.js +5 -4
- package/lib/modules/Rules/index.d.ts +1 -0
- package/lib/modules/Rules/index.js +25 -23
- package/lib/modules/Schedule/index.d.ts +2 -2
- package/lib/modules/Schedule/index.js +0 -2
- package/lib/solution/BookingByStep/index.js +1 -0
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/Checkout/index.js +5 -6
- package/package.json +1 -1
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
- package/dist/modules/Schedule/getDateIsInSchedule.js +0 -747
- package/lib/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
- package/lib/modules/Schedule/getDateIsInSchedule.js +0 -451
|
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
123
123
|
* 获取当前的客户搜索条件
|
|
124
124
|
* @returns 当前搜索条件
|
|
125
125
|
*/
|
|
126
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
126
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
127
127
|
/**
|
|
128
128
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
129
129
|
* @returns 客户状态
|
|
@@ -507,7 +507,6 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
507
507
|
*/
|
|
508
508
|
async updateLocalOrderAsync(params) {
|
|
509
509
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
510
|
-
this.payment.wallet.clearAllCache();
|
|
511
510
|
this.logInfo("updateLocalOrderAsync called", {
|
|
512
511
|
orderId: params.orderId,
|
|
513
512
|
orderDataType: (_a = params.orderData) == null ? void 0 : _a.type,
|
|
@@ -606,7 +605,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
606
605
|
});
|
|
607
606
|
const syncedPayments = updated2.payment.filter((p) => p.isSynced && p.status !== "voided");
|
|
608
607
|
const syncedAmount2 = syncedPayments.reduce((sum, p) => {
|
|
609
|
-
|
|
608
|
+
const amt = new import_decimal.default(p.amount || "0");
|
|
610
609
|
const rounding = new import_decimal.default(Number(p.rounding_amount) > 0 ? 0 : p.rounding_amount || "0").abs();
|
|
611
610
|
return sum.plus(amt).plus(rounding);
|
|
612
611
|
}, new import_decimal.default(0));
|
|
@@ -1289,7 +1288,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1289
1288
|
});
|
|
1290
1289
|
this.logInfo("代金券支付项批量更新成功");
|
|
1291
1290
|
} catch (error) {
|
|
1292
|
-
this.
|
|
1291
|
+
this.logError("[Checkout] 批量更新代金券支付项失败:", error);
|
|
1293
1292
|
await this.handleError(error, import_types.CheckoutErrorType.PaymentFailed);
|
|
1294
1293
|
throw error;
|
|
1295
1294
|
}
|
|
@@ -2029,9 +2028,9 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
2029
2028
|
*/
|
|
2030
2029
|
calculatePaidAmountFromItems(payments) {
|
|
2031
2030
|
const paidAmount = payments.filter((payment) => payment.status !== "voided").reduce((sum, payment) => {
|
|
2032
|
-
const
|
|
2033
|
-
const roundingAmount = new import_decimal.default(payment.rounding_amount || 0);
|
|
2034
|
-
const effectiveAmount =
|
|
2031
|
+
const amount = new import_decimal.default(payment.amount || "0");
|
|
2032
|
+
const roundingAmount = new import_decimal.default(payment.rounding_amount || "0");
|
|
2033
|
+
const effectiveAmount = amount.add(roundingAmount.isNegative() ? roundingAmount.abs() : 0);
|
|
2035
2034
|
return sum.add(effectiveAmount);
|
|
2036
2035
|
}, new import_decimal.default(0));
|
|
2037
2036
|
return paidAmount.toFixed(2);
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
2
|
-
import { ScheduleItem } from "./types";
|
|
3
|
-
export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
|
|
4
|
-
export type ScheduleTimeSlot = {
|
|
5
|
-
/** 开始时间 HH:mm */
|
|
6
|
-
start_time: string;
|
|
7
|
-
/** 结束时间 HH:mm */
|
|
8
|
-
end_time: string;
|
|
9
|
-
/** 开始日期时间 YYYY-MM-DD HH:mm:ss */
|
|
10
|
-
start_at: dayjs.Dayjs;
|
|
11
|
-
/** 结束日期时间 YYYY-MM-DD HH:mm:ss */
|
|
12
|
-
end_at: dayjs.Dayjs;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* 获取当前日期日程时间点
|
|
16
|
-
* @param date 日期 YYYY-MM-DD
|
|
17
|
-
* @param scheduleList 日程列表
|
|
18
|
-
* @returns 当前日期日程时间点 结构,数组 [{
|
|
19
|
-
*
|
|
20
|
-
* // HH:mm
|
|
21
|
-
* end_time: string,
|
|
22
|
-
* // HH:mm
|
|
23
|
-
* start_time: string,
|
|
24
|
-
* // 日期时间
|
|
25
|
-
* // YYYY-MM-DD HH:mm:ss
|
|
26
|
-
* end_at: Dayjs,
|
|
27
|
-
* // YYYY-MM-DD HH:mm:ss
|
|
28
|
-
* start_at: Dayjs,
|
|
29
|
-
*
|
|
30
|
-
* }]
|
|
31
|
-
*/
|
|
32
|
-
export declare const getScheduleStartEndTimePoints: (date: string, scheduleList: ScheduleItem[]) => ScheduleTimeSlot[];
|