@pisell/pisellos 2.2.152 → 2.2.154
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/core/index.js +1 -0
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/Cart/utils/cartProduct.js +1 -1
- package/dist/modules/Discount/index.d.ts +6 -2
- package/dist/modules/Discount/index.js +14 -8
- package/dist/modules/Order/index.d.ts +2 -0
- package/dist/modules/Order/index.js +234 -161
- package/dist/modules/Order/types.d.ts +19 -0
- package/dist/modules/Order/utils.js +7 -6
- package/dist/modules/Payment/index.d.ts +4 -0
- package/dist/modules/Payment/index.js +567 -505
- package/dist/modules/Payment/types.d.ts +29 -9
- package/dist/modules/SalesSummary/index.d.ts +7 -5
- package/dist/modules/SalesSummary/index.js +35 -11
- package/dist/plugins/app.d.ts +2 -0
- package/dist/server/index.d.ts +2 -5
- package/dist/server/index.js +58 -66
- package/dist/server/modules/index.d.ts +1 -1
- package/dist/server/modules/products/index.d.ts +12 -1
- package/dist/server/modules/products/index.js +169 -78
- package/dist/server/modules/products/types.d.ts +11 -0
- package/dist/server/modules/products/types.js +4 -0
- package/dist/server/utils/product.js +2 -2
- package/dist/solution/BaseSales/index.d.ts +26 -2
- package/dist/solution/BaseSales/index.js +342 -112
- package/dist/solution/BaseSales/types.d.ts +4 -4
- package/dist/solution/BaseSales/types.js +4 -4
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +62 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +116 -0
- package/dist/solution/BaseSales/utils.js +3 -3
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +11 -13
- package/dist/solution/BookingTicket/index.js +23 -37
- package/dist/solution/BookingTicket/types.d.ts +9 -6
- package/dist/solution/BookingTicket/types.js +6 -3
- package/dist/solution/BookingTicket/utils/cartView.d.ts +7 -12
- package/dist/solution/BookingTicket/utils/cartView.js +52 -14
- package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
- package/dist/solution/Sales/index.d.ts +3 -0
- package/dist/solution/Sales/index.js +85 -43
- package/dist/solution/Sales/types.d.ts +3 -0
- package/dist/solution/ScanOrder/types.d.ts +4 -4
- package/dist/solution/ScanOrder/types.js +4 -4
- package/dist/solution/ScanOrder/utils.js +3 -3
- package/dist/solution/ShopDiscount/index.d.ts +2 -1
- package/dist/solution/ShopDiscount/index.js +32 -20
- package/dist/solution/ShopDiscount/types.d.ts +1 -0
- package/lib/core/index.js +1 -0
- package/lib/modules/Cart/utils/cartProduct.js +1 -1
- package/lib/modules/Discount/index.d.ts +6 -2
- package/lib/modules/Discount/index.js +3 -1
- package/lib/modules/Order/index.d.ts +2 -0
- package/lib/modules/Order/index.js +40 -8
- package/lib/modules/Order/types.d.ts +19 -0
- package/lib/modules/Order/utils.js +4 -2
- package/lib/modules/Payment/index.d.ts +4 -0
- package/lib/modules/Payment/index.js +26 -2
- package/lib/modules/Payment/types.d.ts +29 -9
- package/lib/modules/SalesSummary/index.d.ts +7 -5
- package/lib/modules/SalesSummary/index.js +29 -9
- package/lib/plugins/app.d.ts +2 -0
- package/lib/server/index.d.ts +2 -5
- package/lib/server/index.js +38 -58
- package/lib/server/modules/index.d.ts +1 -1
- package/lib/server/modules/products/index.d.ts +12 -1
- package/lib/server/modules/products/index.js +69 -9
- package/lib/server/modules/products/types.d.ts +11 -0
- package/lib/server/utils/product.js +2 -2
- package/lib/solution/BaseSales/index.d.ts +26 -2
- package/lib/solution/BaseSales/index.js +169 -3
- package/lib/solution/BaseSales/types.d.ts +4 -4
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +62 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +155 -0
- package/lib/solution/BaseSales/utils.js +3 -3
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +11 -13
- package/lib/solution/BookingTicket/index.js +17 -27
- package/lib/solution/BookingTicket/types.d.ts +9 -6
- package/lib/solution/BookingTicket/utils/cartView.d.ts +7 -12
- package/lib/solution/BookingTicket/utils/cartView.js +44 -18
- package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +58 -0
- package/lib/solution/Sales/index.d.ts +3 -0
- package/lib/solution/Sales/index.js +50 -15
- package/lib/solution/Sales/types.d.ts +3 -0
- package/lib/solution/ScanOrder/types.d.ts +4 -4
- package/lib/solution/ScanOrder/utils.js +3 -3
- package/lib/solution/ShopDiscount/index.d.ts +2 -1
- package/lib/solution/ShopDiscount/index.js +10 -4
- package/lib/solution/ShopDiscount/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -186,6 +186,25 @@ export interface UpdateProductInOrderParams {
|
|
|
186
186
|
product_bundle?: any[];
|
|
187
187
|
}
|
|
188
188
|
export type AddProductBookingInput = Record<string, any>;
|
|
189
|
+
export interface OrderProductMergeDecisionContext {
|
|
190
|
+
incomingProduct: Partial<OrderProduct> & OrderProductIdentity;
|
|
191
|
+
normalizedIncoming: OrderProduct;
|
|
192
|
+
matchedProduct: OrderProduct;
|
|
193
|
+
matchedIndex: number;
|
|
194
|
+
incomingFingerprint: string;
|
|
195
|
+
existedFingerprint: string;
|
|
196
|
+
tempOrder: OrderTempOrder;
|
|
197
|
+
booking?: AddProductBookingInput;
|
|
198
|
+
defaultShouldMerge: boolean;
|
|
199
|
+
}
|
|
200
|
+
export type OrderProductMergeDecisionResult = boolean | {
|
|
201
|
+
shouldMerge: boolean;
|
|
202
|
+
reason?: string;
|
|
203
|
+
[key: string]: any;
|
|
204
|
+
};
|
|
205
|
+
export interface OrderHooksConfig {
|
|
206
|
+
onBeforeMergeProductToOrder?: (context: OrderProductMergeDecisionContext) => OrderProductMergeDecisionResult | Promise<OrderProductMergeDecisionResult>;
|
|
207
|
+
}
|
|
189
208
|
/**
|
|
190
209
|
* 订单信息
|
|
191
210
|
*/
|
|
@@ -306,16 +306,14 @@ function normalizeSubmitPlatform(platform) {
|
|
|
306
306
|
return value;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
//
|
|
310
|
-
// tempOrder / UI 运行时一律使用 product_option_item_id。仅保留后端契约字段,
|
|
311
|
-
// 与 src/modules/Cart/utils/cartProduct.ts#formatOptionsToOrigin 形状一致。
|
|
309
|
+
// 后端 checkout 协议字段 option_group_item_id;tempOrder 内部也保持同一字段名。
|
|
312
310
|
function formatSubmitOptionItems(options) {
|
|
313
311
|
if (!Array.isArray(options)) return [];
|
|
314
312
|
return options.map(function (d) {
|
|
315
|
-
var _d$
|
|
313
|
+
var _d$add_price;
|
|
316
314
|
var option = {
|
|
317
315
|
num: d === null || d === void 0 ? void 0 : d.num,
|
|
318
|
-
option_group_item_id:
|
|
316
|
+
option_group_item_id: d === null || d === void 0 ? void 0 : d.option_group_item_id,
|
|
319
317
|
option_group_id: d === null || d === void 0 ? void 0 : d.option_group_id
|
|
320
318
|
};
|
|
321
319
|
var addPrice = (_d$add_price = d === null || d === void 0 ? void 0 : d.add_price) !== null && _d$add_price !== void 0 ? _d$add_price : d === null || d === void 0 ? void 0 : d.price;
|
|
@@ -602,7 +600,10 @@ export function buildSubmitPayload(params) {
|
|
|
602
600
|
delivery_type: tempOrder.delivery_type || 'nil',
|
|
603
601
|
schedule_date: scheduleDate,
|
|
604
602
|
created_at: tempOrder.created_at || formatDateTime(now),
|
|
605
|
-
bookings: (tempOrder.bookings || []).
|
|
603
|
+
bookings: (tempOrder.bookings || []).filter(function (booking) {
|
|
604
|
+
var _parent_id;
|
|
605
|
+
return Number((_parent_id = booking.parent_id) !== null && _parent_id !== void 0 ? _parent_id : 0) !== 0;
|
|
606
|
+
}).map(function (booking) {
|
|
606
607
|
return normalizeSubmitBooking(booking);
|
|
607
608
|
}),
|
|
608
609
|
payments: tempOrder.payments || [],
|
|
@@ -25,6 +25,9 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
25
25
|
private dbManager;
|
|
26
26
|
private logger;
|
|
27
27
|
private voucherUpdateLockByOrderUuid;
|
|
28
|
+
private payMethodMemoryCache;
|
|
29
|
+
private payMethodListInFlight;
|
|
30
|
+
private isRefreshingPaymentMethods;
|
|
28
31
|
protected otherParams: any;
|
|
29
32
|
cash: CashPayment;
|
|
30
33
|
eftpos: EftposPayment;
|
|
@@ -59,6 +62,7 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
59
62
|
* 获取支付方式列表
|
|
60
63
|
*/
|
|
61
64
|
getPayMethodListAsync(): Promise<PaymentMethod[]>;
|
|
65
|
+
private loadPayMethodListAsync;
|
|
62
66
|
/**
|
|
63
67
|
* 后台刷新支付方式列表
|
|
64
68
|
*/
|