@pisell/pisellos 2.2.174 → 2.2.175
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/modules/Customer/index.d.ts +0 -6
- package/dist/modules/Customer/index.js +83 -129
- package/dist/modules/Customer/types.d.ts +0 -2
- package/dist/modules/Discount/index.d.ts +4 -2
- package/dist/modules/Discount/index.js +93 -8
- package/dist/modules/Discount/types.d.ts +7 -1
- package/dist/modules/Order/index.d.ts +17 -33
- package/dist/modules/Order/index.js +395 -757
- package/dist/modules/Order/types.d.ts +17 -58
- package/dist/modules/Order/types.js +0 -2
- package/dist/modules/Order/utils.d.ts +1 -39
- package/dist/modules/Order/utils.js +31 -220
- package/dist/modules/Quotation/index.d.ts +1 -0
- package/dist/modules/Quotation/index.js +21 -23
- package/dist/modules/Rules/index.d.ts +0 -4
- package/dist/modules/Rules/index.js +10 -26
- package/dist/modules/SalesSummary/index.js +2 -4
- package/dist/modules/Schedule/index.js +2 -6
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +1 -2
- package/dist/server/index.js +6 -10
- package/dist/server/modules/order/utils/filterOrders.js +6 -20
- package/dist/server/modules/products/index.d.ts +1 -1
- package/dist/server/modules/products/index.js +113 -130
- package/dist/server/modules/schedule/index.js +6 -13
- package/dist/solution/BaseSales/index.d.ts +7 -53
- package/dist/solution/BaseSales/index.js +340 -1165
- package/dist/solution/BaseSales/types.d.ts +1 -67
- package/dist/solution/BaseSales/types.js +1 -3
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +16 -68
- package/dist/solution/BaseSales/utils.js +8 -46
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -133
- package/dist/solution/BookingTicket/index.js +175 -776
- package/dist/solution/BookingTicket/types.d.ts +0 -2
- package/dist/solution/BookingTicket/types.js +0 -3
- package/dist/solution/ScanOrder/index.d.ts +3 -9
- package/dist/solution/ScanOrder/index.js +128 -231
- package/dist/solution/ScanOrder/utils.js +8 -46
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +23 -18
- package/dist/solution/VenueBooking/index.d.ts +9 -5
- package/dist/solution/VenueBooking/index.js +55 -103
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/lib/modules/Customer/index.d.ts +0 -6
- package/lib/modules/Customer/index.js +11 -26
- package/lib/modules/Customer/types.d.ts +0 -2
- package/lib/modules/Discount/index.d.ts +4 -2
- package/lib/modules/Discount/index.js +63 -8
- package/lib/modules/Discount/types.d.ts +7 -1
- package/lib/modules/Order/index.d.ts +17 -33
- package/lib/modules/Order/index.js +148 -402
- package/lib/modules/Order/types.d.ts +17 -58
- package/lib/modules/Order/utils.d.ts +1 -39
- package/lib/modules/Order/utils.js +22 -198
- package/lib/modules/Quotation/index.d.ts +1 -0
- package/lib/modules/Quotation/index.js +15 -18
- package/lib/modules/Rules/index.d.ts +0 -4
- package/lib/modules/Rules/index.js +14 -22
- package/lib/modules/SalesSummary/index.js +2 -4
- package/lib/modules/Schedule/index.js +1 -3
- package/lib/modules/index.d.ts +0 -1
- package/lib/modules/index.js +1 -3
- package/lib/server/index.js +0 -2
- package/lib/server/modules/order/utils/filterOrders.js +4 -12
- package/lib/server/modules/products/index.d.ts +1 -1
- package/lib/server/modules/products/index.js +20 -30
- package/lib/server/modules/schedule/index.js +1 -2
- package/lib/solution/BaseSales/index.d.ts +7 -53
- package/lib/solution/BaseSales/index.js +22 -530
- package/lib/solution/BaseSales/types.d.ts +1 -67
- package/lib/solution/BaseSales/types.js +1 -3
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +12 -71
- package/lib/solution/BaseSales/utils.js +6 -46
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -133
- package/lib/solution/BookingTicket/index.js +8 -349
- package/lib/solution/BookingTicket/types.d.ts +0 -2
- package/lib/solution/BookingTicket/types.js +0 -6
- package/lib/solution/ScanOrder/index.d.ts +3 -9
- package/lib/solution/ScanOrder/index.js +66 -147
- package/lib/solution/ScanOrder/utils.js +6 -46
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +4 -2
- package/lib/solution/VenueBooking/index.d.ts +9 -5
- package/lib/solution/VenueBooking/index.js +14 -50
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/package.json +2 -2
- package/dist/modules/BookingContext/index.d.ts +0 -37
- package/dist/modules/BookingContext/index.js +0 -436
- package/dist/modules/BookingContext/types.d.ts +0 -102
- package/dist/modules/BookingContext/types.js +0 -51
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -193
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -137
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -75
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -215
- package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/dist/modules/BookingContext/utils/flexible.js +0 -56
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
- package/dist/modules/BookingContext/utils/index.d.ts +0 -11
- package/dist/modules/BookingContext/utils/index.js +0 -11
- package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/dist/modules/BookingContext/utils/noResource.js +0 -77
- package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/dist/modules/BookingContext/utils/productExtend.js +0 -339
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
- package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
- package/dist/modules/BookingContext/utils/resources.js +0 -486
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/dist/modules/Order/utils/manualProductDiscount.js +0 -212
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -113
- package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
- package/lib/modules/BookingContext/index.d.ts +0 -37
- package/lib/modules/BookingContext/index.js +0 -297
- package/lib/modules/BookingContext/types.d.ts +0 -102
- package/lib/modules/BookingContext/types.js +0 -34
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -207
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -141
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -75
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -198
- package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/lib/modules/BookingContext/utils/flexible.js +0 -80
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
- package/lib/modules/BookingContext/utils/index.d.ts +0 -11
- package/lib/modules/BookingContext/utils/index.js +0 -43
- package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/lib/modules/BookingContext/utils/noResource.js +0 -90
- package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/lib/modules/BookingContext/utils/productExtend.js +0 -283
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
- package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
- package/lib/modules/BookingContext/utils/resources.js +0 -377
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/lib/modules/Order/utils/manualProductDiscount.js +0 -207
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -113
- package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
|
@@ -2,12 +2,9 @@ import { CartItem } from '../Cart/types';
|
|
|
2
2
|
import type { DiscountModule } from '../Discount';
|
|
3
3
|
import type { RulesModule } from '../Rules';
|
|
4
4
|
import type { Discount } from '../Discount/types';
|
|
5
|
-
import type { UnavailableReason } from '../Rules/types';
|
|
6
5
|
import type { SubmitPayloadEnhancer } from './utils';
|
|
7
6
|
import type { PaymentItem } from '../Payment/types';
|
|
8
7
|
import type { ICustomer } from '../AccountList/types';
|
|
9
|
-
import type { OrderProductDiscountItem } from '../../server/modules/order/types';
|
|
10
|
-
export type { OrderProductDiscountItem } from '../../server/modules/order/types';
|
|
11
8
|
export declare enum OrderHooks {
|
|
12
9
|
OnOrderCreate = "order:onOrderCreate",
|
|
13
10
|
OnOrderUpdate = "order:onOrderUpdate",
|
|
@@ -51,13 +48,6 @@ export interface OrderCustomerChangePayload {
|
|
|
51
48
|
patch: OrderCustomerView;
|
|
52
49
|
snapshot: ICustomer | null;
|
|
53
50
|
}
|
|
54
|
-
export interface OrderScanCodeResult {
|
|
55
|
-
isAvailable: boolean;
|
|
56
|
-
discountList: Discount[];
|
|
57
|
-
scannedDiscountList: Discount[];
|
|
58
|
-
type: 'server' | 'clientCalc';
|
|
59
|
-
unavailableReason?: UnavailableReason;
|
|
60
|
-
}
|
|
61
51
|
export interface OrderProductIdentity {
|
|
62
52
|
product_id: number | null;
|
|
63
53
|
product_variant_id: number;
|
|
@@ -76,7 +66,7 @@ export interface OrderProduct extends OrderProductIdentity {
|
|
|
76
66
|
original_price: string;
|
|
77
67
|
tax_fee: string;
|
|
78
68
|
is_charge_tax: number;
|
|
79
|
-
discount_list:
|
|
69
|
+
discount_list: any[];
|
|
80
70
|
product_bundle: any[];
|
|
81
71
|
booking_uid?: string;
|
|
82
72
|
metadata: Record<string, any>;
|
|
@@ -113,11 +103,11 @@ export interface OrderSummary {
|
|
|
113
103
|
export interface OrderTempOrder {
|
|
114
104
|
order_id: number | null;
|
|
115
105
|
external_sale_number: string;
|
|
116
|
-
order_number: string
|
|
117
|
-
shop_order_number: string
|
|
118
|
-
shop_full_order_number: string
|
|
106
|
+
order_number: string;
|
|
107
|
+
shop_order_number: string;
|
|
108
|
+
shop_full_order_number: string;
|
|
119
109
|
type: string;
|
|
120
|
-
business_code
|
|
110
|
+
business_code: string;
|
|
121
111
|
platform: string;
|
|
122
112
|
sales_channel: string;
|
|
123
113
|
order_sales_channel: string;
|
|
@@ -151,7 +141,7 @@ export interface OrderTempOrder {
|
|
|
151
141
|
bookings: any[];
|
|
152
142
|
payments: any[];
|
|
153
143
|
surcharges: any[];
|
|
154
|
-
discount_list
|
|
144
|
+
discount_list: any[];
|
|
155
145
|
relation_forms: any[];
|
|
156
146
|
contacts: any[];
|
|
157
147
|
contacts_info: Record<string, any> | null;
|
|
@@ -167,7 +157,7 @@ export interface OrderSubmitProduct extends Omit<OrderProduct, 'unique_identific
|
|
|
167
157
|
payment_price: string;
|
|
168
158
|
product_sku: Record<string, any>;
|
|
169
159
|
}
|
|
170
|
-
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer' | '
|
|
160
|
+
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer' | 'shop_full_order_number'> {
|
|
171
161
|
platform: string;
|
|
172
162
|
request_unique_idempotency_token?: string;
|
|
173
163
|
form_record_ids?: Array<{
|
|
@@ -186,32 +176,16 @@ export interface OrderState {
|
|
|
186
176
|
discount: DiscountModule | null;
|
|
187
177
|
rules: RulesModule | null;
|
|
188
178
|
}
|
|
189
|
-
export interface ReplaceTempOrderOptions {
|
|
190
|
-
recalculateSummary?: boolean;
|
|
191
|
-
persist?: boolean;
|
|
192
|
-
saveDraft?: boolean;
|
|
193
|
-
}
|
|
194
|
-
export type AddProductBookingInput = Record<string, any>;
|
|
195
179
|
/** 更新购物车行:仅传 SKU 时命中同 SKU 第一行;多行同 SKU 须传 unique_identification_number / 选项指纹等 */
|
|
196
|
-
export interface
|
|
180
|
+
export interface UpdateProductInOrderParams {
|
|
197
181
|
product_id: number | null;
|
|
198
182
|
product_variant_id: number;
|
|
199
183
|
updates: Partial<OrderProduct>;
|
|
200
184
|
unique_identification_number?: string;
|
|
201
|
-
identity_key?: string;
|
|
202
185
|
product_option_item?: any[];
|
|
203
186
|
product_bundle?: any[];
|
|
204
|
-
booking?: AddProductBookingInput;
|
|
205
|
-
}
|
|
206
|
-
/** 仅更新购物车行数量;行定位语义与 updateOrderProduct / removeProductFromOrder 保持一致 */
|
|
207
|
-
export interface UpdateOrderProductQuantityParams extends OrderProductIdentity {
|
|
208
|
-
num: number;
|
|
209
|
-
identity_key?: string;
|
|
210
|
-
}
|
|
211
|
-
export interface UpdateOrderBookingParams {
|
|
212
|
-
unique_identification_number: string;
|
|
213
|
-
updates: AddProductBookingInput;
|
|
214
187
|
}
|
|
188
|
+
export type AddProductBookingInput = Record<string, any>;
|
|
215
189
|
export interface OrderProductMergeDecisionContext {
|
|
216
190
|
incomingProduct: Partial<OrderProduct> & OrderProductIdentity;
|
|
217
191
|
normalizedIncoming: OrderProduct;
|
|
@@ -262,11 +236,10 @@ export interface SubmitSalesOrderParams {
|
|
|
262
236
|
query: {
|
|
263
237
|
order_id: number | null;
|
|
264
238
|
external_sale_number: string;
|
|
265
|
-
order_number: string
|
|
266
|
-
shop_order_number: string
|
|
267
|
-
shop_full_order_number: string | null;
|
|
239
|
+
order_number: string;
|
|
240
|
+
shop_order_number: string;
|
|
268
241
|
type: string;
|
|
269
|
-
business_code
|
|
242
|
+
business_code: string;
|
|
270
243
|
platform: string;
|
|
271
244
|
request_unique_idempotency_token?: string;
|
|
272
245
|
sales_channel: string;
|
|
@@ -298,6 +271,7 @@ export interface SubmitSalesOrderParams {
|
|
|
298
271
|
bookings: OrderSubmitBooking[];
|
|
299
272
|
payments: any[];
|
|
300
273
|
surcharges?: any[];
|
|
274
|
+
discount_list: any[];
|
|
301
275
|
relation_forms: any[];
|
|
302
276
|
form_record_ids?: OrderSubmitFormRecord[];
|
|
303
277
|
contacts: any[];
|
|
@@ -376,7 +350,6 @@ export interface SyncPaymentsToOrderParams {
|
|
|
376
350
|
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
377
351
|
submitWhenPaid?: boolean;
|
|
378
352
|
smallTicketDataFlag?: number;
|
|
379
|
-
channel?: string;
|
|
380
353
|
}
|
|
381
354
|
export interface SyncPaymentsToOrderResult<T = any> {
|
|
382
355
|
isFullyPaid: boolean;
|
|
@@ -473,7 +446,6 @@ export interface OrderModuleAPI {
|
|
|
473
446
|
}) => void;
|
|
474
447
|
getTempOrder: () => OrderTempOrder | null;
|
|
475
448
|
ensureTempOrder: () => OrderTempOrder;
|
|
476
|
-
replaceTempOrder: (tempOrder: OrderTempOrder, options?: ReplaceTempOrderOptions) => Promise<OrderTempOrder>;
|
|
477
449
|
addNewOrder: () => Promise<OrderTempOrder>;
|
|
478
450
|
restoreOrder: () => OrderTempOrder;
|
|
479
451
|
getOrderProducts: () => OrderProduct[];
|
|
@@ -486,26 +458,15 @@ export interface OrderModuleAPI {
|
|
|
486
458
|
getOrderSyncState: () => OrderSyncState;
|
|
487
459
|
getOrderAmountSnapshot: () => OrderAmountSnapshot | null;
|
|
488
460
|
getTempOrderNote: () => string;
|
|
489
|
-
updateTempOrderNote:
|
|
490
|
-
(note: string): string;
|
|
491
|
-
(note: string, sync: true): Promise<string>;
|
|
492
|
-
(note: string, sync: boolean): string | Promise<string>;
|
|
493
|
-
};
|
|
461
|
+
updateTempOrderNote: (note: string) => string;
|
|
494
462
|
updateTempOrderShopDiscount: (amount: string | number) => string;
|
|
495
463
|
updateTempOrderCustomer: (customer: UpdateTempOrderCustomerInput) => OrderSnapshot['customer'];
|
|
496
464
|
updateTempOrderBuzzer: (buzzer: string) => string;
|
|
497
465
|
updateTempOrderContactsInfo: (contactsInfo: Record<string, any> | null) => Record<string, any> | null;
|
|
498
466
|
addProductToOrder: (product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput) => Promise<OrderProduct[]>;
|
|
499
|
-
|
|
500
|
-
updateOrderProductQuantity: (params: UpdateOrderProductQuantityParams) => Promise<OrderProduct[]>;
|
|
501
|
-
updateOrderBooking: (params: UpdateOrderBookingParams) => any[];
|
|
467
|
+
updateProductInOrder: (params: UpdateProductInOrderParams) => Promise<OrderProduct[]>;
|
|
502
468
|
removeProductFromOrder: (identity: OrderProductIdentity) => Promise<OrderProduct[]>;
|
|
503
|
-
/** @deprecated no-op;OrderModule 不再负责 tempOrder localStorage 持久化。 */
|
|
504
469
|
persistTempOrder: () => void;
|
|
505
|
-
/** @deprecated no-op;OrderModule 不再负责 tempOrder localStorage 持久化。 */
|
|
506
|
-
setEnableTempOrderPersist: (enabled: boolean) => void;
|
|
507
|
-
/** @deprecated 固定返回 false;OrderModule 不再负责 tempOrder localStorage 持久化。 */
|
|
508
|
-
isTempOrderPersistEnabled: () => boolean;
|
|
509
470
|
submitTempOrder: <T = any>(params?: {
|
|
510
471
|
cacheId?: string;
|
|
511
472
|
platform?: string;
|
|
@@ -555,10 +516,8 @@ export interface OrderModuleAPI {
|
|
|
555
516
|
clearOrderCustomer: () => void;
|
|
556
517
|
loadDiscountConfig: (params: {
|
|
557
518
|
customerId: number;
|
|
558
|
-
action?: 'create'
|
|
559
|
-
|
|
560
|
-
apply?: boolean;
|
|
561
|
-
}) => Promise<Discount[]>;
|
|
519
|
+
action?: 'create';
|
|
520
|
+
}) => Promise<void>;
|
|
562
521
|
getDiscountList: () => Discount[];
|
|
563
522
|
applyDiscount: () => void;
|
|
564
523
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Decimal from 'decimal.js';
|
|
2
2
|
import { CartItem } from "../Cart";
|
|
3
|
-
import type {
|
|
3
|
+
import type { OrderSubmitPayload, OrderSubmitProduct, OrderSummary, OrderTempOrder } from './types';
|
|
4
4
|
import type { RulesParamsHooks } from '../Rules/types';
|
|
5
5
|
import type { MapOrderPaymentsOptions, OrderPaymentData, OrderPaymentSource } from './types';
|
|
6
6
|
/**
|
|
@@ -65,26 +65,6 @@ export declare function sumOptionUnitPrice(options?: Array<{
|
|
|
65
65
|
*
|
|
66
66
|
* 导出为纯函数方便单测直接驱动钩子,不依赖 OrderModule 实例。
|
|
67
67
|
*/
|
|
68
|
-
/** Rules calcDiscount 用手动价标记;undefined 表示交给 Rules 用 total/origin_total 推断 */
|
|
69
|
-
export declare function resolveRulesManualDiscountFlag(metadata: Record<string, any> | null | undefined): boolean | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* 商品行折扣只保留后端 OrderProductDiscountItem 协议字段。
|
|
72
|
-
* Rules/券计算过程中的 `_num`、`config` 等运行态字段不应进入 tempOrder 或提交 payload。
|
|
73
|
-
*/
|
|
74
|
-
export declare function normalizeOrderProductDiscountList(discountList?: unknown[] | null): OrderProductDiscountItem[];
|
|
75
|
-
/**
|
|
76
|
-
* 手动改价(price_override)时行级 original_price(composite 单价):
|
|
77
|
-
* 购物车划线价应对齐 metadata.origin._extend.origin_total(改价前单价 composite,如 40),
|
|
78
|
-
* 而非 bundle 子项 catalog 原价合成的 composedOriginalPrice(如 30)。
|
|
79
|
-
*
|
|
80
|
-
* origin_total 与 SkuDetailModal / cacheItem._extend 一致,为单价语义,不再除以 num。
|
|
81
|
-
*/
|
|
82
|
-
export declare function resolveManualOverrideLineOriginalPrice(params: {
|
|
83
|
-
num?: number;
|
|
84
|
-
metadata?: Record<string, any> | null;
|
|
85
|
-
/** 已有行级 original_price(origin 被裁剪时兜底划线价) */
|
|
86
|
-
lineOriginalPrice?: string | number | null;
|
|
87
|
-
}, fallbackCompositeOriginal: string): string;
|
|
88
68
|
export declare function createDefaultOrderRulesHooks(): RulesParamsHooks;
|
|
89
69
|
/**
|
|
90
70
|
* 通过 session 类商品的开始时间结束时间生成商品的时长
|
|
@@ -160,22 +140,4 @@ export declare function formatV1Product(products: OrderSubmitProduct[]): {
|
|
|
160
140
|
session: null;
|
|
161
141
|
unique: string;
|
|
162
142
|
}[];
|
|
163
|
-
/**
|
|
164
|
-
* 判断 holder_id 是否已分配(非空)。
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* hasAssignedHolderId(12); // true
|
|
168
|
-
* hasAssignedHolderId([]); // false
|
|
169
|
-
*/
|
|
170
|
-
export declare function hasAssignedHolderId(value: unknown): boolean;
|
|
171
|
-
/**
|
|
172
|
-
* 清空 tempOrder 购物车行上的 holder 分配(products / bookings / runtime origin)。
|
|
173
|
-
* 移除或更换下单客户时调用,与 booking 页换客户清 holder 行为对齐。
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* clearTempOrderHolderAssignments(tempOrder);
|
|
177
|
-
*/
|
|
178
|
-
export declare function clearTempOrderHolderAssignments(tempOrder: OrderTempOrder): boolean;
|
|
179
143
|
export { createEmptySummary } from '../../solution/ScanOrder/utils';
|
|
180
|
-
export { buildManualProductDiscountItem, ensureManualProductDiscountList, findManualProductDiscountItem, mergeManualProductDiscountIntoList, resolveManualDiscountMessage, resolveManualDiscountOriginTotal, resolveManualDiscountReasonFromSources, resolveSafeProductNum, shouldBuildManualProductDiscount, syncManualProductDiscountProductNum, stripManualProductDiscountItems, } from './utils/manualProductDiscount';
|
|
181
|
-
export type { ManualProductDiscountItem } from './utils/manualProductDiscount';
|
|
@@ -29,49 +29,32 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/modules/Order/utils.ts
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
|
-
buildManualProductDiscountItem: () => import_manualProductDiscount.buildManualProductDiscountItem,
|
|
33
32
|
buildSubmitPayload: () => buildSubmitPayload,
|
|
34
|
-
clearTempOrderHolderAssignments: () => clearTempOrderHolderAssignments,
|
|
35
33
|
composeLinePrice: () => composeLinePrice,
|
|
36
34
|
createDefaultOrderRulesHooks: () => createDefaultOrderRulesHooks,
|
|
37
35
|
createDefaultTempOrder: () => createDefaultTempOrder,
|
|
38
36
|
createEmptySummary: () => import_utils2.createEmptySummary,
|
|
39
37
|
createUuidV4: () => createUuidV4,
|
|
40
|
-
ensureManualProductDiscountList: () => import_manualProductDiscount.ensureManualProductDiscountList,
|
|
41
|
-
findManualProductDiscountItem: () => import_manualProductDiscount.findManualProductDiscountItem,
|
|
42
38
|
formatDateTime: () => formatDateTime,
|
|
43
39
|
formatV1Product: () => formatV1Product,
|
|
44
40
|
generateDuration: () => generateDuration,
|
|
45
41
|
getAllDiscountList: () => getAllDiscountList,
|
|
46
|
-
hasAssignedHolderId: () => hasAssignedHolderId,
|
|
47
42
|
isTempOrder: () => isTempOrder,
|
|
48
43
|
mapPaymentItemToOrderPayment: () => mapPaymentItemToOrderPayment,
|
|
49
44
|
mapPaymentItemsToOrderPayments: () => mapPaymentItemsToOrderPayments,
|
|
50
|
-
mergeManualProductDiscountIntoList: () => import_manualProductDiscount.mergeManualProductDiscountIntoList,
|
|
51
45
|
mergeRelationForms: () => mergeRelationForms,
|
|
52
46
|
normalizeBookingIsAll: () => normalizeBookingIsAll,
|
|
53
47
|
normalizeBookingSubType: () => normalizeBookingSubType,
|
|
54
|
-
normalizeOrderProductDiscountList: () => normalizeOrderProductDiscountList,
|
|
55
48
|
normalizeSubmitBooking: () => normalizeSubmitBooking,
|
|
56
49
|
normalizeSubmitCollectPaxValue: () => normalizeSubmitCollectPaxValue,
|
|
57
|
-
resolveManualDiscountMessage: () => import_manualProductDiscount.resolveManualDiscountMessage,
|
|
58
|
-
resolveManualDiscountOriginTotal: () => import_manualProductDiscount.resolveManualDiscountOriginTotal,
|
|
59
|
-
resolveManualDiscountReasonFromSources: () => import_manualProductDiscount.resolveManualDiscountReasonFromSources,
|
|
60
|
-
resolveManualOverrideLineOriginalPrice: () => resolveManualOverrideLineOriginalPrice,
|
|
61
|
-
resolveRulesManualDiscountFlag: () => resolveRulesManualDiscountFlag,
|
|
62
|
-
resolveSafeProductNum: () => import_manualProductDiscount.resolveSafeProductNum,
|
|
63
50
|
resolveSubmitCollectPax: () => resolveSubmitCollectPax,
|
|
64
|
-
|
|
65
|
-
stripManualProductDiscountItems: () => import_manualProductDiscount.stripManualProductDiscountItems,
|
|
66
|
-
sumOptionUnitPrice: () => sumOptionUnitPrice,
|
|
67
|
-
syncManualProductDiscountProductNum: () => import_manualProductDiscount.syncManualProductDiscountProductNum
|
|
51
|
+
sumOptionUnitPrice: () => sumOptionUnitPrice
|
|
68
52
|
});
|
|
69
53
|
module.exports = __toCommonJS(utils_exports);
|
|
70
54
|
var import_dayjs = __toESM(require("dayjs"));
|
|
71
55
|
var import_decimal = __toESM(require("decimal.js"));
|
|
72
56
|
var import_utils = require("../../solution/ScanOrder/utils");
|
|
73
57
|
var import_utils2 = require("../../solution/ScanOrder/utils");
|
|
74
|
-
var import_manualProductDiscount = require("./utils/manualProductDiscount");
|
|
75
58
|
function composeLinePrice(params) {
|
|
76
59
|
const { mainPrice, bundle, useOriginalBundle } = params;
|
|
77
60
|
let total = new import_decimal.default(Number(mainPrice) || 0);
|
|
@@ -97,78 +80,6 @@ function sumOptionUnitPrice(options) {
|
|
|
97
80
|
}
|
|
98
81
|
return total;
|
|
99
82
|
}
|
|
100
|
-
function resolveRulesManualDiscountFlag(metadata) {
|
|
101
|
-
if (!metadata)
|
|
102
|
-
return void 0;
|
|
103
|
-
if (metadata.is_manual_discount === true || metadata.is_manual_discount === 1) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
const priceOverride = metadata.price_override;
|
|
107
|
-
if (priceOverride !== void 0 && priceOverride !== null && priceOverride !== "") {
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return void 0;
|
|
111
|
-
}
|
|
112
|
-
function normalizeOrderProductDiscountAmount(amount) {
|
|
113
|
-
if (amount === void 0 || amount === null)
|
|
114
|
-
return void 0;
|
|
115
|
-
return String(amount);
|
|
116
|
-
}
|
|
117
|
-
function normalizeOrderProductDiscountList(discountList) {
|
|
118
|
-
if (!Array.isArray(discountList))
|
|
119
|
-
return [];
|
|
120
|
-
return discountList.filter((item) => !!item && typeof item === "object").map((item) => {
|
|
121
|
-
const normalized = {
|
|
122
|
-
discount_id: Number.isFinite(Number(item.discount_id)) ? Number(item.discount_id) : 0
|
|
123
|
-
};
|
|
124
|
-
if (item.order_discount_id === null) {
|
|
125
|
-
normalized.order_discount_id = null;
|
|
126
|
-
} else if (item.order_discount_id !== void 0) {
|
|
127
|
-
const orderDiscountId = Number(item.order_discount_id);
|
|
128
|
-
if (Number.isFinite(orderDiscountId)) {
|
|
129
|
-
normalized.order_discount_id = orderDiscountId;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (item.type !== void 0)
|
|
133
|
-
normalized.type = item.type;
|
|
134
|
-
const amount = normalizeOrderProductDiscountAmount(item.amount);
|
|
135
|
-
if (amount !== void 0)
|
|
136
|
-
normalized.amount = amount;
|
|
137
|
-
if (item.discount && typeof item.discount === "object") {
|
|
138
|
-
normalized.discount = { ...item.discount };
|
|
139
|
-
}
|
|
140
|
-
if (item.metadata === null) {
|
|
141
|
-
normalized.metadata = null;
|
|
142
|
-
} else if (item.metadata && typeof item.metadata === "object") {
|
|
143
|
-
normalized.metadata = { ...item.metadata };
|
|
144
|
-
}
|
|
145
|
-
return normalized;
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
function resolveManualOverrideLineOriginalPrice(params, fallbackCompositeOriginal) {
|
|
149
|
-
var _a, _b;
|
|
150
|
-
const metadata = params.metadata || {};
|
|
151
|
-
const priceOverride = metadata.price_override;
|
|
152
|
-
if (priceOverride === void 0 || priceOverride === null || priceOverride === "") {
|
|
153
|
-
return fallbackCompositeOriginal;
|
|
154
|
-
}
|
|
155
|
-
const refTotal = (_b = (_a = metadata.origin) == null ? void 0 : _a._extend) == null ? void 0 : _b.origin_total;
|
|
156
|
-
if (refTotal !== void 0 && refTotal !== null && refTotal !== "") {
|
|
157
|
-
const parsed = Number(refTotal);
|
|
158
|
-
if (Number.isFinite(parsed)) {
|
|
159
|
-
return new import_decimal.default(parsed).toDecimalPlaces(2).toFixed(2);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
const lineOriginal = params.lineOriginalPrice;
|
|
163
|
-
if (lineOriginal !== void 0 && lineOriginal !== null && lineOriginal !== "") {
|
|
164
|
-
const parsedLine = Number(lineOriginal);
|
|
165
|
-
const parsedFallback = Number(fallbackCompositeOriginal);
|
|
166
|
-
if (Number.isFinite(parsedLine) && Number.isFinite(parsedFallback) && parsedLine > parsedFallback) {
|
|
167
|
-
return new import_decimal.default(parsedLine).toDecimalPlaces(2).toFixed(2);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return fallbackCompositeOriginal;
|
|
171
|
-
}
|
|
172
83
|
function createDefaultOrderRulesHooks() {
|
|
173
84
|
const toUnitPriceString = (totalLike, num) => {
|
|
174
85
|
const effectiveNum = Number(num) > 0 ? Number(num) : 1;
|
|
@@ -176,7 +87,7 @@ function createDefaultOrderRulesHooks() {
|
|
|
176
87
|
};
|
|
177
88
|
return {
|
|
178
89
|
getProduct: (product) => {
|
|
179
|
-
var _a, _b, _c, _d, _e;
|
|
90
|
+
var _a, _b, _c, _d, _e, _f;
|
|
180
91
|
const metadataAny = product.metadata || {};
|
|
181
92
|
const optionSum = sumOptionUnitPrice(product.product_option_item);
|
|
182
93
|
let sourcePrice;
|
|
@@ -203,7 +114,7 @@ function createDefaultOrderRulesHooks() {
|
|
|
203
114
|
id: product.product_id,
|
|
204
115
|
// Rules 引擎用 _id 作为 processedProductsMap 键;必须与购物车行级 identity 一致,
|
|
205
116
|
// 否则同 SKU 不同小料会在 calcDiscount 重组时互相覆盖。
|
|
206
|
-
// 不透明 identity 契约下,normalizeOrderProduct /
|
|
117
|
+
// 不透明 identity 契约下,normalizeOrderProduct / restoreTempOrderFromStorage 已保证唯一值存在;
|
|
207
118
|
// 留 fingerprint 分支仅作 Rules 单测里直接传裸 product 时的兜底。
|
|
208
119
|
_id: ((_a = product.metadata) == null ? void 0 : _a.unique_identification_number) ? `${product.product_id}_${product.product_variant_id}_${product.metadata.unique_identification_number}` : `${product.product_id}_${product.product_variant_id}_${(0, import_utils.buildProductLineFingerprint)(
|
|
209
120
|
product.product_option_item,
|
|
@@ -224,11 +135,9 @@ function createDefaultOrderRulesHooks() {
|
|
|
224
135
|
bundle: product.product_bundle || [],
|
|
225
136
|
booking_id: ((_b = product.metadata) == null ? void 0 : _b.booking_id) || null,
|
|
226
137
|
isClient: false,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
holder_id: (_c = product.metadata) == null ? void 0 : _c.holder_id,
|
|
231
|
-
startDate: ((_d = product.metadata) == null ? void 0 : _d.start_date) || ((_e = product.metadata) == null ? void 0 : _e.startDate)
|
|
138
|
+
isManualDiscount: ((_c = product.metadata) == null ? void 0 : _c.is_manual_discount) || false,
|
|
139
|
+
holder_id: (_d = product.metadata) == null ? void 0 : _d.holder_id,
|
|
140
|
+
startDate: ((_e = product.metadata) == null ? void 0 : _e.start_date) || ((_f = product.metadata) == null ? void 0 : _f.startDate)
|
|
232
141
|
};
|
|
233
142
|
},
|
|
234
143
|
setProduct: (product, values) => {
|
|
@@ -251,14 +160,10 @@ function createDefaultOrderRulesHooks() {
|
|
|
251
160
|
bundle: nextBundle,
|
|
252
161
|
useOriginalBundle: true
|
|
253
162
|
});
|
|
254
|
-
const finalOriginalPrice = resolveManualOverrideLineOriginalPrice(
|
|
255
|
-
{ num: nextNum, metadata: metadataAny, lineOriginalPrice: product.original_price },
|
|
256
|
-
composedOriginalPrice
|
|
257
|
-
);
|
|
258
163
|
return {
|
|
259
164
|
...product,
|
|
260
165
|
selling_price: composedSellingPrice,
|
|
261
|
-
original_price:
|
|
166
|
+
original_price: composedOriginalPrice,
|
|
262
167
|
discount_list: values.discount_list ?? product.discount_list,
|
|
263
168
|
num: values.quantity ?? product.num,
|
|
264
169
|
product_bundle: nextBundle,
|
|
@@ -416,11 +321,6 @@ function normalizeSubmitProduct(product) {
|
|
|
416
321
|
num,
|
|
417
322
|
product_option_item: productOptionItem,
|
|
418
323
|
surcharge_fee: _productSurchargeFee,
|
|
419
|
-
discount_amount: _deprecatedDiscountAmount,
|
|
420
|
-
discount_type: _deprecatedDiscountType,
|
|
421
|
-
discountway: _deprecatedDiscountway,
|
|
422
|
-
product_discount_reason: _deprecatedProductDiscountReason,
|
|
423
|
-
discount_per: _deprecatedDiscountPer,
|
|
424
324
|
...productRest
|
|
425
325
|
} = submitProduct;
|
|
426
326
|
const rawMetadata = submitProduct.metadata || {};
|
|
@@ -465,7 +365,7 @@ function normalizeSubmitProduct(product) {
|
|
|
465
365
|
...bookingUid ? { booking_uid: bookingUid } : {},
|
|
466
366
|
product_quantity: toBundleNumber(num ?? submitProduct.product_quantity, 1),
|
|
467
367
|
product_sku: productSku,
|
|
468
|
-
discount_list:
|
|
368
|
+
discount_list: submitProduct.discount_list || [],
|
|
469
369
|
product_bundle: formatSubmitBundleItems(submitProduct.product_bundle),
|
|
470
370
|
metadata: cleanMetadata,
|
|
471
371
|
// 出站兼容:后端消费 payment_price 字段,这里从 selling_price 直接派生。
|
|
@@ -525,23 +425,22 @@ function createDefaultTempOrder(params) {
|
|
|
525
425
|
return {
|
|
526
426
|
order_id: null,
|
|
527
427
|
external_sale_number: "",
|
|
528
|
-
order_number:
|
|
529
|
-
shop_order_number:
|
|
530
|
-
shop_full_order_number:
|
|
531
|
-
type: "",
|
|
532
|
-
business_code:
|
|
428
|
+
order_number: "",
|
|
429
|
+
shop_order_number: "",
|
|
430
|
+
shop_full_order_number: "",
|
|
431
|
+
type: "appointment_booking",
|
|
432
|
+
business_code: "appointment_booking",
|
|
533
433
|
platform: "h5",
|
|
534
434
|
sales_channel: "my_pisel",
|
|
535
435
|
order_sales_channel: "online_store",
|
|
536
436
|
status: "normal",
|
|
537
437
|
payment_status: "payment_processing",
|
|
538
438
|
shipping_status: "unfulfilled",
|
|
539
|
-
customer_id:
|
|
439
|
+
customer_id: null,
|
|
540
440
|
customer_name: "",
|
|
541
441
|
country_calling_code: "",
|
|
542
442
|
phone: "",
|
|
543
443
|
email: "",
|
|
544
|
-
customer: null,
|
|
545
444
|
is_price_include_tax: 1,
|
|
546
445
|
tax_title: "",
|
|
547
446
|
tax_country_code: "",
|
|
@@ -560,6 +459,7 @@ function createDefaultTempOrder(params) {
|
|
|
560
459
|
bookings: [],
|
|
561
460
|
payments: [],
|
|
562
461
|
surcharges: [],
|
|
462
|
+
discount_list: [],
|
|
563
463
|
relation_forms: [],
|
|
564
464
|
contacts: [],
|
|
565
465
|
contacts_info: null,
|
|
@@ -571,7 +471,6 @@ function createDefaultTempOrder(params) {
|
|
|
571
471
|
};
|
|
572
472
|
}
|
|
573
473
|
function buildSubmitPayload(params) {
|
|
574
|
-
var _a;
|
|
575
474
|
const {
|
|
576
475
|
tempOrder,
|
|
577
476
|
cacheId,
|
|
@@ -597,7 +496,7 @@ function buildSubmitPayload(params) {
|
|
|
597
496
|
shop_service_type: _shopServiceType,
|
|
598
497
|
start_time: _startTime,
|
|
599
498
|
customer: _customer,
|
|
600
|
-
|
|
499
|
+
shop_full_order_number: _shopFullOrderNumber,
|
|
601
500
|
tax_fee: _rootTaxFee,
|
|
602
501
|
total_amount: _totalAmount,
|
|
603
502
|
total_refund_amount: _totalRefundAmount,
|
|
@@ -605,25 +504,12 @@ function buildSubmitPayload(params) {
|
|
|
605
504
|
holder_id: _holderId,
|
|
606
505
|
...tempOrderRest
|
|
607
506
|
} = tempOrder;
|
|
608
|
-
let submitType = type ?? tempOrder.type;
|
|
609
|
-
if (!submitType) {
|
|
610
|
-
if ((_a = tempOrder == null ? void 0 : tempOrder.bookings) == null ? void 0 : _a.length) {
|
|
611
|
-
submitType = "appointment_booking";
|
|
612
|
-
} else {
|
|
613
|
-
submitType = "virtual";
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
507
|
const payload = {
|
|
617
508
|
...tempOrderRest,
|
|
618
|
-
customer_id: tempOrder.customer_id ?? 1,
|
|
619
|
-
customer_name: tempOrder.customer_name || "Select a customer",
|
|
620
|
-
order_number: null,
|
|
621
|
-
shop_order_number: null,
|
|
622
|
-
shop_full_order_number: null,
|
|
623
509
|
platform: normalizeSubmitPlatform(platform),
|
|
624
510
|
request_unique_idempotency_token: tempOrder.request_unique_idempotency_token || `${tempOrder.external_sale_number}_${now.getTime()}`,
|
|
625
|
-
type:
|
|
626
|
-
business_code: businessCode ?? tempOrder.business_code,
|
|
511
|
+
type: type ?? tempOrder.type ?? "table-order",
|
|
512
|
+
business_code: businessCode ?? tempOrder.business_code ?? "table-order",
|
|
627
513
|
sales_channel: tempOrder.sales_channel || "my_pisel",
|
|
628
514
|
order_sales_channel: channel ?? tempOrder.order_sales_channel ?? "online_store",
|
|
629
515
|
status: tempOrder.status || "normal",
|
|
@@ -638,11 +524,12 @@ function buildSubmitPayload(params) {
|
|
|
638
524
|
note: tempOrder.note || "",
|
|
639
525
|
delivery_type: tempOrder.delivery_type || "nil",
|
|
640
526
|
schedule_date: scheduleDate,
|
|
641
|
-
|
|
527
|
+
created_at: tempOrder.created_at || formatDateTime(now),
|
|
642
528
|
bookings: (tempOrder.bookings || []).filter(
|
|
643
|
-
(booking) => Number(booking.parent_id) !== 0
|
|
529
|
+
(booking) => Number(booking.parent_id ?? 0) !== 0
|
|
644
530
|
).map((booking) => normalizeSubmitBooking(booking)),
|
|
645
531
|
payments: tempOrder.payments || [],
|
|
532
|
+
// discount_list: tempOrder.discount_list || [],
|
|
646
533
|
relation_forms: tempOrder.relation_forms || [],
|
|
647
534
|
// contacts: tempOrder.contacts || [],
|
|
648
535
|
contacts_info: tempOrder.contacts_info && !Array.isArray(tempOrder.contacts_info) ? tempOrder.contacts_info : null,
|
|
@@ -723,89 +610,26 @@ function formatV1Product(products) {
|
|
|
723
610
|
};
|
|
724
611
|
});
|
|
725
612
|
}
|
|
726
|
-
function hasAssignedHolderId(value) {
|
|
727
|
-
if (value === void 0 || value === null || value === "")
|
|
728
|
-
return false;
|
|
729
|
-
if (Array.isArray(value))
|
|
730
|
-
return value.length > 0;
|
|
731
|
-
return true;
|
|
732
|
-
}
|
|
733
|
-
function clearTempOrderHolderAssignments(tempOrder) {
|
|
734
|
-
var _a;
|
|
735
|
-
let changed = false;
|
|
736
|
-
const resetHolderField = (target, key = "holder_id") => {
|
|
737
|
-
if (!hasAssignedHolderId(target[key]))
|
|
738
|
-
return;
|
|
739
|
-
target[key] = null;
|
|
740
|
-
changed = true;
|
|
741
|
-
};
|
|
742
|
-
for (const product of tempOrder.products || []) {
|
|
743
|
-
if (product.metadata && typeof product.metadata === "object") {
|
|
744
|
-
resetHolderField(product.metadata);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
for (const booking of tempOrder.bookings || []) {
|
|
748
|
-
const bookingRecord = booking;
|
|
749
|
-
if (booking.metadata && typeof booking.metadata === "object") {
|
|
750
|
-
resetHolderField(booking.metadata);
|
|
751
|
-
}
|
|
752
|
-
if (bookingRecord.holder !== void 0 && bookingRecord.holder !== null) {
|
|
753
|
-
delete bookingRecord.holder;
|
|
754
|
-
changed = true;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
const productsByUid = (_a = tempOrder._extend) == null ? void 0 : _a.productsByUid;
|
|
758
|
-
if (productsByUid && typeof productsByUid === "object") {
|
|
759
|
-
for (const entry of Object.values(productsByUid)) {
|
|
760
|
-
const origin = entry == null ? void 0 : entry.origin;
|
|
761
|
-
if (!origin || typeof origin !== "object")
|
|
762
|
-
continue;
|
|
763
|
-
if (origin.metadata && typeof origin.metadata === "object") {
|
|
764
|
-
resetHolderField(origin.metadata);
|
|
765
|
-
}
|
|
766
|
-
if (origin._extend && typeof origin._extend === "object") {
|
|
767
|
-
resetHolderField(origin._extend);
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
return changed;
|
|
772
|
-
}
|
|
773
613
|
// Annotate the CommonJS export names for ESM import in node:
|
|
774
614
|
0 && (module.exports = {
|
|
775
|
-
buildManualProductDiscountItem,
|
|
776
615
|
buildSubmitPayload,
|
|
777
|
-
clearTempOrderHolderAssignments,
|
|
778
616
|
composeLinePrice,
|
|
779
617
|
createDefaultOrderRulesHooks,
|
|
780
618
|
createDefaultTempOrder,
|
|
781
619
|
createEmptySummary,
|
|
782
620
|
createUuidV4,
|
|
783
|
-
ensureManualProductDiscountList,
|
|
784
|
-
findManualProductDiscountItem,
|
|
785
621
|
formatDateTime,
|
|
786
622
|
formatV1Product,
|
|
787
623
|
generateDuration,
|
|
788
624
|
getAllDiscountList,
|
|
789
|
-
hasAssignedHolderId,
|
|
790
625
|
isTempOrder,
|
|
791
626
|
mapPaymentItemToOrderPayment,
|
|
792
627
|
mapPaymentItemsToOrderPayments,
|
|
793
|
-
mergeManualProductDiscountIntoList,
|
|
794
628
|
mergeRelationForms,
|
|
795
629
|
normalizeBookingIsAll,
|
|
796
630
|
normalizeBookingSubType,
|
|
797
|
-
normalizeOrderProductDiscountList,
|
|
798
631
|
normalizeSubmitBooking,
|
|
799
632
|
normalizeSubmitCollectPaxValue,
|
|
800
|
-
resolveManualDiscountMessage,
|
|
801
|
-
resolveManualDiscountOriginTotal,
|
|
802
|
-
resolveManualDiscountReasonFromSources,
|
|
803
|
-
resolveManualOverrideLineOriginalPrice,
|
|
804
|
-
resolveRulesManualDiscountFlag,
|
|
805
|
-
resolveSafeProductNum,
|
|
806
633
|
resolveSubmitCollectPax,
|
|
807
|
-
|
|
808
|
-
stripManualProductDiscountItems,
|
|
809
|
-
sumOptionUnitPrice,
|
|
810
|
-
syncManualProductDiscountProductNum
|
|
634
|
+
sumOptionUnitPrice
|
|
811
635
|
});
|
|
@@ -47,6 +47,7 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
47
47
|
customer_id?: number | string;
|
|
48
48
|
}): Map<string, string | null>;
|
|
49
49
|
setScheduleResolver(resolver: (id: number) => ScheduleItem | undefined): void;
|
|
50
|
+
private filterQuotationsByCustomer;
|
|
50
51
|
private isQuotationVisibleForCustomer;
|
|
51
52
|
private hasValidCustomerId;
|
|
52
53
|
private isQuotationActiveAt;
|