@pisell/pisellos 2.3.43 → 2.3.44
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/modules/Order/index.d.ts +2 -1
- package/dist/modules/Order/index.js +73 -28
- package/dist/modules/Order/types.d.ts +2 -0
- package/dist/modules/Payment/walletpass.d.ts +10 -3
- package/dist/modules/Payment/walletpass.js +425 -282
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +61 -57
- package/dist/solution/BaseSales/index.js +6 -3
- package/dist/solution/BaseSales/types.d.ts +3 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +6 -3
- package/dist/solution/BookingTicket/types.d.ts +1 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +3 -3
- package/dist/solution/VenueBooking/index.d.ts +1 -0
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/modules/Order/index.d.ts +2 -1
- package/lib/modules/Order/index.js +46 -7
- package/lib/modules/Order/types.d.ts +2 -0
- package/lib/modules/Payment/walletpass.d.ts +10 -3
- package/lib/modules/Payment/walletpass.js +218 -56
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +8 -3
- package/lib/solution/BaseSales/index.js +1 -0
- package/lib/solution/BaseSales/types.d.ts +3 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +1 -0
- package/lib/solution/BookingTicket/types.d.ts +1 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -2
- package/lib/solution/VenueBooking/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -132,14 +132,15 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
132
132
|
...callbackOrigin || {}
|
|
133
133
|
};
|
|
134
134
|
const matchedVariant = findVariantById(callbackOrigin, productVariantId) ?? findVariantById(sourceProduct, productVariantId) ?? findVariantById(origin, productVariantId);
|
|
135
|
+
const hasPriceOverride = payload.price_override !== void 0 && payload.price_override !== null && payload.price_override !== "";
|
|
136
|
+
const catalogSourcePrice = (matchedVariant == null ? void 0 : matchedVariant.price) ?? (matchedVariant == null ? void 0 : matchedVariant.base_price) ?? (origin == null ? void 0 : origin.price) ?? (origin == null ? void 0 : origin.base_price) ?? (sourceProduct == null ? void 0 : sourceProduct.price) ?? (sourceProduct == null ? void 0 : sourceProduct.selling_price) ?? (sourceProduct == null ? void 0 : sourceProduct.base_price);
|
|
135
137
|
const sourceProductPrice = toPriceString(
|
|
136
|
-
|
|
138
|
+
hasPriceOverride ? catalogSourcePrice ?? payload.price ?? payload.selling_price : payload.price ?? payload.selling_price ?? catalogSourcePrice,
|
|
137
139
|
"0.00"
|
|
138
140
|
);
|
|
139
141
|
const explicitLineTotal = payload.line_total ?? payload.total ?? ((_c = payload._extend) == null ? void 0 : _c.total);
|
|
140
142
|
const hasExplicitLineTotal = Number.isFinite(Number(explicitLineTotal));
|
|
141
143
|
const lineCompositeTotal = toPriceString(explicitLineTotal, sourceProductPrice);
|
|
142
|
-
const hasPriceOverride = payload.price_override !== void 0 && payload.price_override !== null && payload.price_override !== "";
|
|
143
144
|
const productOptionItem = (0, import_utils.normalizeProductSkuOptions)(
|
|
144
145
|
normalizeOptionItems(
|
|
145
146
|
((_d = payload.product_sku) == null ? void 0 : _d.option) ?? payload.option ?? payload.options ?? payload.product_option_item
|
|
@@ -326,7 +326,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
326
326
|
* 获取当前的客户搜索条件
|
|
327
327
|
* @returns 当前搜索条件
|
|
328
328
|
*/
|
|
329
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
329
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
330
330
|
/**
|
|
331
331
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
332
332
|
* @returns 客户状态
|
|
@@ -368,6 +368,7 @@ var BookingTicketImpl = class extends import_BaseSales.BaseSalesImpl {
|
|
|
368
368
|
}
|
|
369
369
|
return {
|
|
370
370
|
isAvailable: raw.isAvailable,
|
|
371
|
+
...raw.isAccepted !== void 0 ? { isAccepted: raw.isAccepted } : {},
|
|
371
372
|
type: raw.type,
|
|
372
373
|
unavailableReason: raw.unavailableReason,
|
|
373
374
|
scannedDiscountList: raw.scannedDiscountList
|
|
@@ -131,7 +131,7 @@ async function applyGlobalScan(host, formatted, bridge) {
|
|
|
131
131
|
return { status: "failed", reason: "no_bridge" };
|
|
132
132
|
}
|
|
133
133
|
const result = await bridge.applyPromotionCode(scanCode);
|
|
134
|
-
if (result == null ? void 0 : result.isAvailable) {
|
|
134
|
+
if ((result == null ? void 0 : result.isAccepted) ?? (result == null ? void 0 : result.isAvailable)) {
|
|
135
135
|
return { status: "success", kind: "promotion" };
|
|
136
136
|
}
|
|
137
137
|
return { status: "failed", reason: "invalid_data" };
|
|
@@ -146,7 +146,7 @@ async function applyGlobalScan(host, formatted, bridge) {
|
|
|
146
146
|
scanCode,
|
|
147
147
|
Number((data == null ? void 0 : data.id) ?? (data == null ? void 0 : data.customer_id)) || void 0
|
|
148
148
|
);
|
|
149
|
-
if (promotionResult == null ? void 0 : promotionResult.isAvailable) {
|
|
149
|
+
if ((promotionResult == null ? void 0 : promotionResult.isAccepted) ?? (promotionResult == null ? void 0 : promotionResult.isAvailable)) {
|
|
150
150
|
return { status: "success", kind: "promotion" };
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -167,6 +167,7 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
167
167
|
private recalculateOrderPricesFromQuotation;
|
|
168
168
|
scanCode(code: string, customerId?: number): Promise<{
|
|
169
169
|
isAvailable: boolean;
|
|
170
|
+
isAccepted?: boolean | undefined;
|
|
170
171
|
discountList: import("../../modules/Discount").Discount[];
|
|
171
172
|
type: "server" | "clientCalc";
|
|
172
173
|
unavailableReason?: import("../../modules/Rules/types").UnavailableReason | undefined;
|