@pisell/pisellos 2.2.260 → 2.2.262
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/dataVariant/adapter.d.ts +1 -0
- package/dist/model/strategy/adapter/dataVariant/adapter.js +15 -0
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +2 -0
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +25 -0
- package/dist/model/strategy/adapter/dataVariant/examples.js +1 -6
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +2 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +23 -13
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +32 -1
- package/dist/modules/Discount/index.d.ts +5 -2
- package/dist/modules/Discount/index.js +30 -7
- package/dist/modules/Discount/types.d.ts +4 -0
- package/dist/modules/Order/index.d.ts +45 -2
- package/dist/modules/Order/index.js +1552 -926
- package/dist/modules/Order/types.d.ts +36 -2
- package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
- package/dist/modules/Order/utils.d.ts +8 -3
- package/dist/modules/Order/utils.js +136 -56
- package/dist/modules/Rules/index.d.ts +4 -10
- package/dist/modules/Rules/index.js +63 -12
- package/dist/modules/Rules/types.d.ts +12 -2
- package/dist/modules/SalesSummary/index.d.ts +7 -3
- package/dist/modules/SalesSummary/index.js +67 -39
- package/dist/modules/SalesSummary/types.d.ts +1 -0
- package/dist/modules/SalesSummary/utils.js +2 -1
- package/dist/modules/SurchargeList/index.d.ts +6 -4
- package/dist/modules/SurchargeList/index.js +62 -39
- package/dist/modules/SurchargeList/types.d.ts +6 -2
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +1365 -911
- package/dist/server/modules/order/index.d.ts +32 -7
- package/dist/server/modules/order/index.js +551 -464
- package/dist/server/modules/order/types.d.ts +4 -0
- package/dist/server/modules/products/index.d.ts +5 -1
- package/dist/server/modules/products/index.js +384 -315
- package/dist/server/modules/products/types.d.ts +4 -0
- package/dist/solution/BaseSales/index.d.ts +42 -2
- package/dist/solution/BaseSales/index.js +1416 -775
- package/dist/solution/BaseSales/types.d.ts +7 -1
- package/dist/solution/BaseSales/types.js +3 -2
- package/dist/solution/BaseSales/utils/cartPromotion.js +19 -7
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +6 -8
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +20 -4
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +8 -0
- package/dist/solution/BookingTicket/index.js +212 -31
- package/dist/solution/ShopDiscount/index.js +15 -14
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +1 -0
- package/lib/model/strategy/adapter/dataVariant/adapter.js +10 -0
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +20 -1
- package/lib/model/strategy/adapter/dataVariant/examples.js +0 -2
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +2 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +16 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +23 -2
- package/lib/modules/Discount/index.d.ts +5 -2
- package/lib/modules/Discount/index.js +23 -3
- package/lib/modules/Discount/types.d.ts +4 -0
- package/lib/modules/Order/index.d.ts +45 -2
- package/lib/modules/Order/index.js +720 -116
- package/lib/modules/Order/types.d.ts +36 -2
- package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/lib/modules/Order/utils/bundleDiscountHydration.js +139 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +415 -0
- package/lib/modules/Order/utils.d.ts +8 -3
- package/lib/modules/Order/utils.js +104 -18
- package/lib/modules/Rules/index.d.ts +4 -10
- package/lib/modules/Rules/index.js +61 -9
- package/lib/modules/Rules/types.d.ts +12 -2
- package/lib/modules/SalesSummary/index.d.ts +7 -3
- package/lib/modules/SalesSummary/index.js +28 -11
- package/lib/modules/SalesSummary/types.d.ts +1 -0
- package/lib/modules/SalesSummary/utils.js +2 -0
- package/lib/modules/SurchargeList/index.d.ts +6 -4
- package/lib/modules/SurchargeList/index.js +41 -21
- package/lib/modules/SurchargeList/types.d.ts +6 -2
- package/lib/server/index.d.ts +8 -0
- package/lib/server/index.js +336 -11
- package/lib/server/modules/order/index.d.ts +32 -7
- package/lib/server/modules/order/index.js +298 -189
- package/lib/server/modules/order/types.d.ts +4 -0
- package/lib/server/modules/products/index.d.ts +5 -1
- package/lib/server/modules/products/index.js +21 -0
- package/lib/server/modules/products/types.d.ts +4 -0
- package/lib/solution/BaseSales/index.d.ts +42 -2
- package/lib/solution/BaseSales/index.js +535 -108
- package/lib/solution/BaseSales/types.d.ts +7 -1
- package/lib/solution/BaseSales/types.js +2 -1
- package/lib/solution/BaseSales/utils/cartPromotion.js +13 -1
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -5
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +14 -6
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +8 -0
- package/lib/solution/BookingTicket/index.js +134 -8
- package/lib/solution/ShopDiscount/index.js +2 -1
- package/package.json +1 -1
|
@@ -136,12 +136,23 @@ function resolveProductTitle(product, booking, sourceProduct) {
|
|
|
136
136
|
const metadata = product.metadata || {};
|
|
137
137
|
return (sourceProduct == null ? void 0 : sourceProduct.title) ?? (sourceProduct == null ? void 0 : sourceProduct.name) ?? metadata.product_title ?? metadata.product_name ?? ((_a = booking == null ? void 0 : booking.product) == null ? void 0 : _a.title) ?? ((_b = booking == null ? void 0 : booking.detail) == null ? void 0 : _b.product_title) ?? "";
|
|
138
138
|
}
|
|
139
|
+
function resolveProductCover(product, booking, sourceProduct) {
|
|
140
|
+
return (sourceProduct == null ? void 0 : sourceProduct.cover) ?? product.product_cover ?? "";
|
|
141
|
+
}
|
|
139
142
|
function resolveMainProductPrice(product, fallback) {
|
|
140
143
|
const metadata = product.metadata || {};
|
|
141
144
|
const value = metadata.main_product_original_price ?? metadata.source_product_price;
|
|
142
145
|
const parsed = Number(value);
|
|
143
146
|
return Number.isFinite(parsed) ? parsed : fallback;
|
|
144
147
|
}
|
|
148
|
+
function mapOrderBundleToOtherBundle(bundle) {
|
|
149
|
+
return bundle.map((item) => {
|
|
150
|
+
return {
|
|
151
|
+
...item,
|
|
152
|
+
original_price: item.original_price ?? item.bundle_selling_price ?? item.price
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
}
|
|
145
156
|
function synthesizeProductResourceFromBooking(booking) {
|
|
146
157
|
const rows = booking == null ? void 0 : booking.resources;
|
|
147
158
|
if (!Array.isArray(rows) || rows.length === 0)
|
|
@@ -187,11 +198,14 @@ function buildCacheItemFromOrderLine(input) {
|
|
|
187
198
|
const capacity = resolveCapacityFromBooking(booking);
|
|
188
199
|
const holderId = ((_a = booking.metadata) == null ? void 0 : _a.holder_id) ?? booking.holder_id;
|
|
189
200
|
const productTitle = resolveProductTitle(product, booking, sourceProduct);
|
|
201
|
+
const productCover = resolveProductCover(product, booking, sourceProduct);
|
|
190
202
|
const productOptionString = (0, import_orderLineDisplay.buildProductOptionStringFromOrderLine)(product);
|
|
191
203
|
const other = {
|
|
192
204
|
product_variant_id: product.product_variant_id ?? 0,
|
|
193
205
|
option: (0, import_utils.getProductSkuOptions)(product),
|
|
194
|
-
bundle:
|
|
206
|
+
bundle: mapOrderBundleToOtherBundle(
|
|
207
|
+
Array.isArray(product.product_bundle) ? product.product_bundle : []
|
|
208
|
+
)
|
|
195
209
|
};
|
|
196
210
|
const extend = {
|
|
197
211
|
start_date: startDate ? (0, import_dayjs.default)(startDate) : void 0,
|
|
@@ -204,6 +218,7 @@ function buildCacheItemFromOrderLine(input) {
|
|
|
204
218
|
sub_type: booking.sub_type,
|
|
205
219
|
quantity: product.num ?? 1,
|
|
206
220
|
product_name: productTitle,
|
|
221
|
+
product_cover: productCover,
|
|
207
222
|
note: product.note ?? ((_b = booking == null ? void 0 : booking.detail) == null ? void 0 : _b.note) ?? "",
|
|
208
223
|
price: mainProductPrice,
|
|
209
224
|
total: selling,
|
|
@@ -136,6 +136,7 @@ function buildNormalProductCacheItemFromOrderLine(input) {
|
|
|
136
136
|
product_id: resolvedId,
|
|
137
137
|
_id: uid,
|
|
138
138
|
title: (sourceProduct == null ? void 0 : sourceProduct.title) ?? product.product_title ?? "",
|
|
139
|
+
cover: (sourceProduct == null ? void 0 : sourceProduct.cover) ?? product.product_cover ?? "",
|
|
139
140
|
price: (sourceProduct == null ? void 0 : sourceProduct.price) ?? sourcePrice,
|
|
140
141
|
selling_price: product.selling_price,
|
|
141
142
|
original_price: product.original_price,
|
|
@@ -48,7 +48,7 @@ export interface BookingResourceInput {
|
|
|
48
48
|
capacity?: number;
|
|
49
49
|
like_status?: string;
|
|
50
50
|
metadata?: Record<string, any>;
|
|
51
|
-
children?:
|
|
51
|
+
children?: BookingResourceInput[];
|
|
52
52
|
}
|
|
53
53
|
/** custom / package 人数维度快照,与 info2 `_extend.capacity` / `metadata.capacity` 对齐。 */
|
|
54
54
|
export interface BookingCapacityMetadataItem {
|
|
@@ -88,6 +88,24 @@ function resolveDurationMinutes(value) {
|
|
|
88
88
|
const n = Number(value);
|
|
89
89
|
return Number.isNaN(n) ? void 0 : n;
|
|
90
90
|
}
|
|
91
|
+
function normalizeChildResource(child, parentFormId) {
|
|
92
|
+
const item = {
|
|
93
|
+
form_id: (child == null ? void 0 : child.form_id) ?? parentFormId,
|
|
94
|
+
relation_type: (child == null ? void 0 : child.relation_type) || "form",
|
|
95
|
+
relation_id: (child == null ? void 0 : child.relation_id) ?? (child == null ? void 0 : child.id),
|
|
96
|
+
capacity: child == null ? void 0 : child.capacity,
|
|
97
|
+
like_status: (child == null ? void 0 : child.like_status) || "common"
|
|
98
|
+
};
|
|
99
|
+
if ((child == null ? void 0 : child.metadata) !== void 0) {
|
|
100
|
+
item.metadata = { ...child.metadata };
|
|
101
|
+
}
|
|
102
|
+
if (Array.isArray(child == null ? void 0 : child.children)) {
|
|
103
|
+
item.children = child.children.map(
|
|
104
|
+
(nestedChild) => normalizeChildResource(nestedChild, item.form_id)
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return item;
|
|
108
|
+
}
|
|
91
109
|
function flattenResources(cacheItem) {
|
|
92
110
|
var _a;
|
|
93
111
|
const resourceMap = ((_a = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _a.resource) || {};
|
|
@@ -107,8 +125,11 @@ function flattenResources(cacheItem) {
|
|
|
107
125
|
if ((r == null ? void 0 : r.metadata) !== void 0) {
|
|
108
126
|
item.metadata = { ...r.metadata };
|
|
109
127
|
}
|
|
110
|
-
if ((r == null ? void 0 : r.children)
|
|
111
|
-
item.children = r.children
|
|
128
|
+
if (Array.isArray(r == null ? void 0 : r.children)) {
|
|
129
|
+
item.children = r.children.map(
|
|
130
|
+
(child) => normalizeChildResource(child, item.form_id)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
112
133
|
result.push(item);
|
|
113
134
|
});
|
|
114
135
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { Discount, DiscountModuleAPI, DiscountWithReason } from './types';
|
|
3
|
+
import { Discount, DiscountModuleAPI, DiscountWithReason, DiscountPrepareConfigResult } from './types';
|
|
4
4
|
export declare class DiscountModule extends BaseModule implements Module, DiscountModuleAPI {
|
|
5
5
|
protected defaultName: string;
|
|
6
6
|
protected defaultVersion: string;
|
|
@@ -16,15 +16,18 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
16
16
|
getDiscountList(): Discount[];
|
|
17
17
|
setOriginalDiscountList(originalDiscountList: Discount[]): Promise<void>;
|
|
18
18
|
getOriginalDiscountList(): Discount[];
|
|
19
|
+
private normalizePositiveNumberIds;
|
|
19
20
|
loadPrepareConfig(params: {
|
|
20
21
|
action?: 'create' | 'edit';
|
|
21
22
|
with_good_pass: 0 | 1;
|
|
22
23
|
with_discount_card: 0 | 1;
|
|
23
24
|
customer_id: number;
|
|
24
25
|
with_wallet_pass_holder: 0 | 1;
|
|
26
|
+
with_available_wallet_flag?: 0 | 1;
|
|
27
|
+
with_available_wallet_pass_flag?: 0 | 1;
|
|
25
28
|
request_timezone: string;
|
|
26
29
|
order_id?: number | string;
|
|
27
|
-
}): Promise<
|
|
30
|
+
}): Promise<DiscountPrepareConfigResult>;
|
|
28
31
|
batchSearch(code: string, options?: {
|
|
29
32
|
customerId?: number;
|
|
30
33
|
orderId?: number;
|
|
@@ -91,23 +91,43 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
|
|
|
91
91
|
getOriginalDiscountList() {
|
|
92
92
|
return this.store.originalDiscountList || [];
|
|
93
93
|
}
|
|
94
|
+
normalizePositiveNumberIds(values) {
|
|
95
|
+
const ids = values.map((value) => Number(value)).filter((value) => Number.isFinite(value) && value > 0);
|
|
96
|
+
return Array.from(new Set(ids));
|
|
97
|
+
}
|
|
94
98
|
async loadPrepareConfig(params) {
|
|
95
|
-
var _a, _b;
|
|
99
|
+
var _a, _b, _c, _d, _e;
|
|
96
100
|
if (typeof params.order_id === "string" && params.order_id.startsWith("LOCAL_")) {
|
|
97
101
|
params.order_id = void 0;
|
|
98
102
|
}
|
|
99
103
|
const prepareConfig = await this.request.post(
|
|
100
104
|
`/order/prepare/config`,
|
|
101
|
-
|
|
105
|
+
{
|
|
106
|
+
...params,
|
|
107
|
+
with_available_wallet_flag: params.with_available_wallet_flag ?? 1,
|
|
108
|
+
with_available_wallet_pass_flag: params.with_available_wallet_pass_flag ?? 1
|
|
109
|
+
}
|
|
102
110
|
);
|
|
103
111
|
const rawDiscountList = [
|
|
104
112
|
...((_a = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _a.good_pass_list) || [],
|
|
105
113
|
...((_b = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _b.discount_card_list) || []
|
|
106
114
|
];
|
|
115
|
+
const availableWalletList = [
|
|
116
|
+
...((_c = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _c.avaiable_wallet_list) || [],
|
|
117
|
+
...((_d = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _d.available_wallet_list) || []
|
|
118
|
+
];
|
|
119
|
+
const availableWalletPassList = ((_e = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _e.available_wallet_pass_list) || [];
|
|
120
|
+
const availableWalletIds = this.normalizePositiveNumberIds([
|
|
121
|
+
...availableWalletList.map((item) => item == null ? void 0 : item.wallet_id),
|
|
122
|
+
...availableWalletPassList.map((item) => item == null ? void 0 : item.product_id)
|
|
123
|
+
]);
|
|
107
124
|
const goodPassList = this.filterEnabledDiscountList(
|
|
108
125
|
rawDiscountList
|
|
109
126
|
) || [];
|
|
110
|
-
return
|
|
127
|
+
return {
|
|
128
|
+
discountList: goodPassList,
|
|
129
|
+
availableWalletIds
|
|
130
|
+
};
|
|
111
131
|
}
|
|
112
132
|
async batchSearch(code, options) {
|
|
113
133
|
const { customerId, orderId } = options || {};
|
|
@@ -68,6 +68,10 @@ export interface DiscountWithReason {
|
|
|
68
68
|
discountList: Discount[];
|
|
69
69
|
unavailableReasonKey: DiscountFilterRejectKey | null;
|
|
70
70
|
}
|
|
71
|
+
export interface DiscountPrepareConfigResult {
|
|
72
|
+
discountList: Discount[];
|
|
73
|
+
availableWalletIds: number[];
|
|
74
|
+
}
|
|
71
75
|
interface ExtensionData {
|
|
72
76
|
id: number;
|
|
73
77
|
shop_id: number;
|
|
@@ -75,6 +75,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
75
75
|
apply?: boolean;
|
|
76
76
|
}): Promise<Discount[]>;
|
|
77
77
|
getDiscountList(): Discount[];
|
|
78
|
+
getAvailableWalletIds(): number[];
|
|
79
|
+
private syncScannedDiscountsToOriginalDiscountList;
|
|
78
80
|
private ensureEditDiscountConfigForProductChange;
|
|
79
81
|
scanCode(code: string, customerId?: number): Promise<{
|
|
80
82
|
isAvailable: boolean;
|
|
@@ -84,7 +86,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
84
86
|
unavailableReasonKey?: string | null;
|
|
85
87
|
scannedDiscountList?: Discount[];
|
|
86
88
|
}>;
|
|
87
|
-
applyDiscount(
|
|
89
|
+
applyDiscount(options?: {
|
|
90
|
+
reapplyBookingDiscountProductUids?: string[];
|
|
91
|
+
}): void;
|
|
88
92
|
/**
|
|
89
93
|
* 注入促销评估器。
|
|
90
94
|
*
|
|
@@ -152,12 +156,24 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
152
156
|
private extractOrderIdFromSubmitResult;
|
|
153
157
|
private calculatePaymentEffectiveAmount;
|
|
154
158
|
private calculatePaymentTotal;
|
|
159
|
+
private calculateOrderPaidPaymentTotal;
|
|
155
160
|
private getDepositAmount;
|
|
156
161
|
private normalizeDepositAmount;
|
|
162
|
+
private getLastOrderDepositSnapshot;
|
|
163
|
+
private getLastOrderSubmitSnapshot;
|
|
157
164
|
private applyDepositAmountToSummary;
|
|
165
|
+
private applyLastOrderDepositSnapshot;
|
|
158
166
|
private isDepositOrder;
|
|
159
167
|
private getOrderExpectedAmount;
|
|
160
168
|
private isDepositCovered;
|
|
169
|
+
getPaymentCompletion(payments?: OrderPaymentSource[]): {
|
|
170
|
+
isFullyPaid: boolean;
|
|
171
|
+
isOrderFullyPaid: boolean;
|
|
172
|
+
isDepositFullyPaid: boolean;
|
|
173
|
+
paymentStage: 'deposit' | 'normal';
|
|
174
|
+
depositAmount: string;
|
|
175
|
+
orderExpectedAmount: string;
|
|
176
|
+
};
|
|
161
177
|
private calculateDepositPaidAmount;
|
|
162
178
|
private resolveNextOrderPaymentType;
|
|
163
179
|
private normalizePaymentSource;
|
|
@@ -169,6 +185,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
169
185
|
private calculatePaidPaymentSummary;
|
|
170
186
|
private calculatePaymentServiceFee;
|
|
171
187
|
private calculatePaymentGapAmount;
|
|
188
|
+
private calculatePaymentOrderAmount;
|
|
172
189
|
private calculatePaymentRoundingAmount;
|
|
173
190
|
private formatSummaryMetadataMoney;
|
|
174
191
|
private syncSummaryProductMetadata;
|
|
@@ -186,6 +203,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
186
203
|
private clearManualDepositOverride;
|
|
187
204
|
private getOriginalSalesSnapshot;
|
|
188
205
|
private isSnapshotPayableAmountUnchanged;
|
|
206
|
+
private hasShopDiscountChangedFromSnapshot;
|
|
189
207
|
private restoreOriginalSnapshotIfProductsUnchanged;
|
|
190
208
|
private clearPersistedAmountFieldsForFullRecalc;
|
|
191
209
|
private getPaymentTargetAmount;
|
|
@@ -219,6 +237,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
219
237
|
* const ids = this.collectBookingHolderRecords(booking);
|
|
220
238
|
*/
|
|
221
239
|
private collectBookingHolderRecords;
|
|
240
|
+
private setProductHolderFromBooking;
|
|
241
|
+
private syncLinkedBookingHoldersToProducts;
|
|
222
242
|
/**
|
|
223
243
|
* 按 form_record 顺序读取 booking holder 的主字段名称。
|
|
224
244
|
*
|
|
@@ -260,6 +280,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
260
280
|
updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
|
|
261
281
|
private buildTempOrderCustomer;
|
|
262
282
|
private isCustomerBoundDiscount;
|
|
283
|
+
private shouldKeepCustomerBoundDiscountAfterCustomerChange;
|
|
263
284
|
private productHasCustomerBoundDiscount;
|
|
264
285
|
private shouldSkipDiscountCalculation;
|
|
265
286
|
private clearCustomerBoundDiscounts;
|
|
@@ -301,13 +322,27 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
301
322
|
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
|
|
302
323
|
/** 从当前订单支付项中移除指定支付项。 */
|
|
303
324
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
325
|
+
private confirmPendingVoucherPaymentsInList;
|
|
326
|
+
private discardPendingVoucherPaymentsFromList;
|
|
327
|
+
private prepareVoucherPaymentsForSubmit;
|
|
328
|
+
private applyPaymentLifecycleChange;
|
|
329
|
+
confirmPendingVoucherPayments(options?: {
|
|
330
|
+
persist?: boolean;
|
|
331
|
+
recalculateSummary?: boolean;
|
|
332
|
+
}): OrderPaymentData[];
|
|
333
|
+
discardPendingVoucherPayments(options?: {
|
|
334
|
+
persist?: boolean;
|
|
335
|
+
recalculateSummary?: boolean;
|
|
336
|
+
}): OrderPaymentData[];
|
|
304
337
|
/**
|
|
305
338
|
* 覆盖当前订单中的 wallet pass 支付项。
|
|
306
339
|
*
|
|
307
340
|
* 判断口径与 PaymentModal 保持一致:voucher_id 存在且不为 0 的支付项
|
|
308
341
|
* 视为 wallet pass;其它支付项保持不变。
|
|
309
342
|
*/
|
|
310
|
-
updateVoucherOrderPayments(payments: OrderPaymentSource[]
|
|
343
|
+
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
344
|
+
status?: 'paid' | 'payment_pending';
|
|
345
|
+
}): OrderPaymentData[];
|
|
311
346
|
private shouldMergeProductToOrder;
|
|
312
347
|
private hasOrderProductLineNote;
|
|
313
348
|
/**
|
|
@@ -407,6 +442,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
407
442
|
payments?: OrderPaymentSource[];
|
|
408
443
|
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
409
444
|
smallTicketDataFlag?: number;
|
|
445
|
+
confirmPendingVoucherPayments?: boolean;
|
|
410
446
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
411
447
|
}): Promise<T>;
|
|
412
448
|
submitTempOrderAsync<T = any>(params?: {
|
|
@@ -418,6 +454,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
418
454
|
payments?: OrderPaymentSource[];
|
|
419
455
|
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
420
456
|
smallTicketDataFlag?: number;
|
|
457
|
+
confirmPendingVoucherPayments?: boolean;
|
|
421
458
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
422
459
|
}): Promise<T>;
|
|
423
460
|
private runSubmitTempOrder;
|
|
@@ -488,6 +525,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
488
525
|
* this.normalizeHydratedBookingHolder({ metadata: { holder: { form_record: [1] } } });
|
|
489
526
|
*/
|
|
490
527
|
private normalizeHydratedBookingHolder;
|
|
528
|
+
/**
|
|
529
|
+
* 匿名 booking 没有服务端行 ID 时,商品侧已有的 booking_uid 就是唯一可用的强引用。
|
|
530
|
+
* 在统一规范化生成 UUID 前先复用它;已落库 booking 仍按 schedule_event_id 派生稳定 UID。
|
|
531
|
+
*/
|
|
532
|
+
private seedAnonymousBookingUidsFromProducts;
|
|
491
533
|
private normalizeTempOrderForRuntime;
|
|
492
534
|
private hydrateLinkedBookingIdentity;
|
|
493
535
|
private pickHydratedDisplayText;
|
|
@@ -497,5 +539,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
497
539
|
private normalizeHydratedOrderProduct;
|
|
498
540
|
getLastOrderInfo(): Record<string, any> | undefined;
|
|
499
541
|
getOrderInfo(order_id: number): Promise<any>;
|
|
542
|
+
getVouchers(): any[];
|
|
500
543
|
}
|
|
501
544
|
export type { UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';
|