@pisell/pisellos 2.3.127 → 2.3.128
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 +9 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +0 -2
- package/dist/model/strategy/adapter/walletPass/evaluator.js +2 -4
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +19 -58
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +12 -24
- package/dist/modules/Customer/index.js +3 -6
- package/dist/modules/Customer/types.d.ts +0 -2
- package/dist/modules/Discount/index.d.ts +2 -2
- package/dist/modules/Discount/index.js +151 -37
- package/dist/modules/Discount/types.d.ts +5 -36
- package/dist/modules/Order/index.d.ts +2 -7
- package/dist/modules/Order/index.js +331 -480
- package/dist/modules/Order/utils/orderCollectionIdentity.js +12 -16
- package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/dist/modules/Order/utils/weighedProduct.js +94 -0
- package/dist/modules/Order/utils.d.ts +1 -1
- package/dist/modules/Order/utils.js +65 -104
- package/dist/modules/Payment/types.d.ts +1 -21
- package/dist/modules/Payment/types.js +0 -2
- package/dist/modules/Payment/walletpass.d.ts +1 -1
- package/dist/modules/Payment/walletpass.js +47 -80
- package/dist/modules/Rules/index.d.ts +2 -2
- package/dist/modules/Rules/index.js +190 -482
- package/dist/modules/Rules/types.d.ts +2 -4
- package/dist/server/modules/order/types.d.ts +0 -2
- package/dist/server/utils/small-ticket.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +2 -3
- package/dist/solution/BaseSales/index.js +77 -44
- package/dist/solution/BaseSales/types.d.ts +7 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +126 -141
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +40 -25
- package/dist/solution/BaseSales/utils.js +3 -2
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +3 -2
- package/dist/solution/BookingTicket/index.js +63 -60
- package/dist/solution/BookingTicket/types.d.ts +1 -5
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -2
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +147 -338
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +4 -8
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -6
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +6 -19
- package/dist/solution/ScanOrder/utils.js +3 -2
- package/dist/solution/ShopDiscount/index.d.ts +0 -2
- package/dist/solution/ShopDiscount/index.js +42 -99
- package/dist/solution/ShopDiscount/utils.d.ts +2 -4
- package/dist/solution/ShopDiscount/utils.js +23 -43
- package/dist/solution/UnifiedBookingSales/index.js +2 -2
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +0 -2
- package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -2
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +6 -35
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -13
- package/lib/modules/Customer/index.js +1 -5
- package/lib/modules/Customer/types.d.ts +0 -2
- package/lib/modules/Discount/index.d.ts +2 -2
- package/lib/modules/Discount/index.js +129 -23
- package/lib/modules/Discount/types.d.ts +5 -36
- package/lib/modules/Order/index.d.ts +2 -7
- package/lib/modules/Order/index.js +109 -222
- package/lib/modules/Order/utils/orderCollectionIdentity.js +11 -14
- package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/lib/modules/Order/utils/weighedProduct.js +89 -0
- package/lib/modules/Order/utils.d.ts +1 -1
- package/lib/modules/Order/utils.js +6 -41
- package/lib/modules/Payment/types.d.ts +1 -21
- package/lib/modules/Payment/types.js +0 -1
- package/lib/modules/Payment/walletpass.d.ts +1 -1
- package/lib/modules/Payment/walletpass.js +9 -29
- package/lib/modules/Rules/index.d.ts +2 -2
- package/lib/modules/Rules/index.js +114 -359
- package/lib/modules/Rules/types.d.ts +2 -4
- package/lib/server/modules/order/types.d.ts +0 -2
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BaseSales/index.d.ts +2 -3
- package/lib/solution/BaseSales/index.js +17 -11
- package/lib/solution/BaseSales/types.d.ts +7 -3
- package/lib/solution/BaseSales/utils/cartPromotion.js +4 -12
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -9
- package/lib/solution/BaseSales/utils.js +2 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +3 -2
- package/lib/solution/BookingTicket/index.js +33 -36
- package/lib/solution/BookingTicket/types.d.ts +1 -5
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -2
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +42 -174
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +4 -8
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -6
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +3 -11
- package/lib/solution/ScanOrder/utils.js +2 -1
- package/lib/solution/ShopDiscount/index.d.ts +0 -2
- package/lib/solution/ShopDiscount/index.js +9 -55
- package/lib/solution/ShopDiscount/utils.d.ts +2 -4
- package/lib/solution/ShopDiscount/utils.js +25 -42
- package/lib/solution/UnifiedBookingSales/index.js +2 -2
- package/package.json +1 -1
- package/dist/modules/Discount/availability.d.ts +0 -7
- package/dist/modules/Discount/availability.js +0 -49
- package/dist/modules/Discount/entitlementPass.d.ts +0 -34
- package/dist/modules/Discount/entitlementPass.js +0 -147
- package/lib/modules/Discount/availability.d.ts +0 -7
- package/lib/modules/Discount/availability.js +0 -43
- package/lib/modules/Discount/entitlementPass.d.ts +0 -34
- package/lib/modules/Discount/entitlementPass.js +0 -141
|
@@ -44,10 +44,7 @@ interface ApplicableProductDetails {
|
|
|
44
44
|
original_amount: string;
|
|
45
45
|
num: number;
|
|
46
46
|
metadata?: {
|
|
47
|
-
encoded?: string;
|
|
48
47
|
product_discount_difference?: number;
|
|
49
|
-
/** 月卡扣除本单新增使用后的剩余次数;不限次数时为 null。 */
|
|
50
|
-
balance?: number | null;
|
|
51
48
|
};
|
|
52
49
|
discount?: {
|
|
53
50
|
fixed_amount?: number;
|
|
@@ -66,13 +63,6 @@ interface UsageCreditsValue {
|
|
|
66
63
|
max_per_week: number;
|
|
67
64
|
max_per_month: number;
|
|
68
65
|
}
|
|
69
|
-
export type IncludedUses = {
|
|
70
|
-
type: 'limited';
|
|
71
|
-
value: number;
|
|
72
|
-
} | {
|
|
73
|
-
type: 'unlimited';
|
|
74
|
-
value: null;
|
|
75
|
-
};
|
|
76
66
|
export type DiscountFilterRejectKey = 'total_credits' | 'per_user_limit' | 'max_per_day' | 'max_per_week' | 'max_per_month';
|
|
77
67
|
export interface DiscountWithReason {
|
|
78
68
|
discountList: Discount[];
|
|
@@ -117,37 +107,30 @@ interface ExtensionData {
|
|
|
117
107
|
}
|
|
118
108
|
export interface Discount {
|
|
119
109
|
id: number;
|
|
120
|
-
shop_id?: number;
|
|
121
110
|
product_name: string;
|
|
122
111
|
encoded: string;
|
|
123
112
|
code: string;
|
|
124
113
|
tag: string;
|
|
125
|
-
expire_time?: string
|
|
126
|
-
expire_date?: string | null;
|
|
127
|
-
end_time?: string | null;
|
|
114
|
+
expire_time?: string;
|
|
128
115
|
product_id: number;
|
|
129
116
|
relation_type: string;
|
|
130
117
|
par_value: string;
|
|
131
118
|
used_par_value: string;
|
|
132
119
|
limit_status: string;
|
|
133
120
|
limited_relation_product_data: Limitedrelationproductdata;
|
|
134
|
-
balance
|
|
135
|
-
available_num?: number;
|
|
136
|
-
available_products_info?: any[];
|
|
121
|
+
balance: string;
|
|
137
122
|
format_title: Formattitle;
|
|
138
123
|
metadata?: {
|
|
139
|
-
encoded?: string;
|
|
140
124
|
discount_card_type?: 'fixed_amount' | 'percent';
|
|
141
125
|
custom_product_bundle_map_id?: string;
|
|
142
126
|
validity_type?: "custom_schedule_validity" | "fixed_validity";
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
holder?: {
|
|
127
|
+
discount_calculation_mode: 'item_level' | 'order_level';
|
|
128
|
+
holder: {
|
|
146
129
|
type: "customer" | "custom";
|
|
147
130
|
};
|
|
148
131
|
};
|
|
149
132
|
product: Product;
|
|
150
|
-
type
|
|
133
|
+
type: "product" | 'good_pass';
|
|
151
134
|
resource_id?: number;
|
|
152
135
|
savedAmount?: number;
|
|
153
136
|
isEditMode?: boolean;
|
|
@@ -180,17 +163,9 @@ export interface Discount {
|
|
|
180
163
|
applicableProductIds?: number[];
|
|
181
164
|
applicableProductDetails: ApplicableProductDetails[];
|
|
182
165
|
appliedProductDetails: ApplicableProductDetails[];
|
|
183
|
-
/** Entitlement Pass 编辑订单时已经提交的使用明细。 */
|
|
184
|
-
committedAppliedProductDetails?: ApplicableProductDetails[];
|
|
185
166
|
isDisabledForProductUsed?: boolean;
|
|
186
167
|
amount?: number;
|
|
187
168
|
customer_id?: number | string | null;
|
|
188
|
-
holder?: {
|
|
189
|
-
holder_type?: 'customer' | 'form' | string;
|
|
190
|
-
holder_id?: number | string | Array<number | string>;
|
|
191
|
-
created_at?: string | null;
|
|
192
|
-
[key: string]: any;
|
|
193
|
-
};
|
|
194
169
|
extension_data?: ExtensionData[];
|
|
195
170
|
total_order_behavior_count?: number;
|
|
196
171
|
today_order_behavior_count?: number;
|
|
@@ -205,12 +180,6 @@ export interface Discount {
|
|
|
205
180
|
start_time?: string;
|
|
206
181
|
discount_rule_uncheck_flag?: boolean;
|
|
207
182
|
usageLimitFailKey?: string | null;
|
|
208
|
-
/** 本次规则计算的不可用原因;可用性恢复后清除。 */
|
|
209
|
-
reason?: string;
|
|
210
|
-
reasonCode?: string;
|
|
211
|
-
unified_messages?: {
|
|
212
|
-
title?: string | Record<string, string>;
|
|
213
|
-
};
|
|
214
183
|
unified_available_status?: number | undefined | null;
|
|
215
184
|
}
|
|
216
185
|
export interface DiscountState {
|
|
@@ -110,7 +110,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
110
110
|
}>;
|
|
111
111
|
applyDiscount(options?: {
|
|
112
112
|
reapplyBookingDiscountProductUids?: string[];
|
|
113
|
-
|
|
113
|
+
reapplyWeighedDiscountProductUids?: string[];
|
|
114
114
|
}): void;
|
|
115
115
|
/**
|
|
116
116
|
* 注入促销评估器。
|
|
@@ -489,12 +489,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
489
489
|
}>, options?: {
|
|
490
490
|
skipEditDiscountConfigRefresh?: boolean;
|
|
491
491
|
}): Promise<OrderProduct[]>;
|
|
492
|
-
private getFullCoveragePassDiscounts;
|
|
493
|
-
private hasEntitlementPassDiscount;
|
|
494
492
|
private hasGoodPassDiscount;
|
|
495
|
-
private isPersistedProductLine;
|
|
496
|
-
private isRuntimeEntitlementAppend;
|
|
497
|
-
private hasSameEntitlementMergePriceConfig;
|
|
498
493
|
private getBundleRuntimeIdentity;
|
|
499
494
|
private preservePersistedBundlePriceFields;
|
|
500
495
|
private applyOrderProductUpdateToTempOrder;
|
|
@@ -584,7 +579,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
584
579
|
generateIdempotencyToken(): string;
|
|
585
580
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
586
581
|
createOrder(params: CommitOrderParams['query']): {
|
|
587
|
-
type: "
|
|
582
|
+
type: "appointment_booking" | "virtual";
|
|
588
583
|
platform: string;
|
|
589
584
|
sales_channel: string;
|
|
590
585
|
order_sales_channel: string;
|