@pisell/pisellos 2.2.162 → 2.2.164
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/BookingContext/index.d.ts +37 -0
- package/dist/modules/BookingContext/index.js +436 -0
- package/dist/modules/BookingContext/types.d.ts +102 -0
- package/dist/modules/BookingContext/types.js +51 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +157 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +107 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +65 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +191 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/flexible.js +56 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
- package/dist/modules/BookingContext/utils/index.d.ts +11 -0
- package/dist/modules/BookingContext/utils/index.js +11 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/noResource.js +77 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/dist/modules/BookingContext/utils/productExtend.js +339 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
- package/dist/modules/BookingContext/utils/resources.js +486 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
- package/dist/modules/Customer/index.js +23 -22
- package/dist/modules/Discount/index.js +4 -3
- package/dist/modules/Order/index.d.ts +17 -6
- package/dist/modules/Order/index.js +474 -287
- package/dist/modules/Order/types.d.ts +32 -12
- package/dist/modules/Order/utils.js +9 -8
- package/dist/modules/SalesSummary/index.js +4 -2
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +2 -1
- package/dist/solution/BaseSales/index.d.ts +38 -7
- package/dist/solution/BaseSales/index.js +797 -310
- package/dist/solution/BaseSales/types.d.ts +48 -1
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +159 -0
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +121 -1
- package/dist/solution/BookingTicket/index.js +401 -72
- package/dist/solution/BookingTicket/types.d.ts +2 -0
- package/dist/solution/BookingTicket/types.js +3 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +111 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +326 -0
- package/dist/solution/ScanOrder/index.d.ts +9 -3
- package/dist/solution/ScanOrder/index.js +231 -128
- package/dist/solution/VenueBooking/index.d.ts +4 -2
- package/dist/solution/VenueBooking/index.js +103 -55
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/modules/BookingContext/index.d.ts +37 -0
- package/lib/modules/BookingContext/index.js +297 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +34 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +174 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +115 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +65 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +177 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +80 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +43 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +90 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +283 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +377 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
- package/lib/modules/Customer/index.js +8 -8
- package/lib/modules/Discount/index.js +5 -1
- package/lib/modules/Order/index.d.ts +17 -6
- package/lib/modules/Order/index.js +164 -68
- package/lib/modules/Order/types.d.ts +32 -12
- package/lib/modules/Order/utils.js +8 -6
- package/lib/modules/SalesSummary/index.js +4 -2
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +3 -1
- package/lib/solution/BaseSales/index.d.ts +38 -7
- package/lib/solution/BaseSales/index.js +304 -14
- package/lib/solution/BaseSales/types.d.ts +48 -1
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +201 -0
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +121 -1
- package/lib/solution/BookingTicket/index.js +207 -2
- package/lib/solution/BookingTicket/types.d.ts +2 -0
- package/lib/solution/BookingTicket/types.js +6 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +111 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +300 -0
- package/lib/solution/ScanOrder/index.d.ts +9 -3
- package/lib/solution/ScanOrder/index.js +147 -66
- package/lib/solution/VenueBooking/index.d.ts +4 -2
- package/lib/solution/VenueBooking/index.js +50 -14
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/package.json +1 -1
|
@@ -103,9 +103,9 @@ export interface OrderSummary {
|
|
|
103
103
|
export interface OrderTempOrder {
|
|
104
104
|
order_id: number | null;
|
|
105
105
|
external_sale_number: string;
|
|
106
|
-
order_number: string;
|
|
107
|
-
shop_order_number: string;
|
|
108
|
-
shop_full_order_number: string;
|
|
106
|
+
order_number: string | null;
|
|
107
|
+
shop_order_number: string | null;
|
|
108
|
+
shop_full_order_number: string | null;
|
|
109
109
|
type: string;
|
|
110
110
|
business_code: string;
|
|
111
111
|
platform: string;
|
|
@@ -157,7 +157,7 @@ export interface OrderSubmitProduct extends Omit<OrderProduct, 'unique_identific
|
|
|
157
157
|
payment_price: string;
|
|
158
158
|
product_sku: Record<string, any>;
|
|
159
159
|
}
|
|
160
|
-
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer'
|
|
160
|
+
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer'> {
|
|
161
161
|
platform: string;
|
|
162
162
|
request_unique_idempotency_token?: string;
|
|
163
163
|
form_record_ids?: Array<{
|
|
@@ -176,16 +176,27 @@ export interface OrderState {
|
|
|
176
176
|
discount: DiscountModule | null;
|
|
177
177
|
rules: RulesModule | null;
|
|
178
178
|
}
|
|
179
|
+
export interface ReplaceTempOrderOptions {
|
|
180
|
+
recalculateSummary?: boolean;
|
|
181
|
+
persist?: boolean;
|
|
182
|
+
saveDraft?: boolean;
|
|
183
|
+
}
|
|
184
|
+
export type AddProductBookingInput = Record<string, any>;
|
|
179
185
|
/** 更新购物车行:仅传 SKU 时命中同 SKU 第一行;多行同 SKU 须传 unique_identification_number / 选项指纹等 */
|
|
180
|
-
export interface
|
|
186
|
+
export interface UpdateOrderProductParams {
|
|
181
187
|
product_id: number | null;
|
|
182
188
|
product_variant_id: number;
|
|
183
189
|
updates: Partial<OrderProduct>;
|
|
184
190
|
unique_identification_number?: string;
|
|
191
|
+
identity_key?: string;
|
|
185
192
|
product_option_item?: any[];
|
|
186
193
|
product_bundle?: any[];
|
|
194
|
+
booking?: AddProductBookingInput;
|
|
195
|
+
}
|
|
196
|
+
export interface UpdateOrderBookingParams {
|
|
197
|
+
unique_identification_number: string;
|
|
198
|
+
updates: AddProductBookingInput;
|
|
187
199
|
}
|
|
188
|
-
export type AddProductBookingInput = Record<string, any>;
|
|
189
200
|
export interface OrderProductMergeDecisionContext {
|
|
190
201
|
incomingProduct: Partial<OrderProduct> & OrderProductIdentity;
|
|
191
202
|
normalizedIncoming: OrderProduct;
|
|
@@ -236,8 +247,9 @@ export interface SubmitSalesOrderParams {
|
|
|
236
247
|
query: {
|
|
237
248
|
order_id: number | null;
|
|
238
249
|
external_sale_number: string;
|
|
239
|
-
order_number: string;
|
|
240
|
-
shop_order_number: string;
|
|
250
|
+
order_number: string | null;
|
|
251
|
+
shop_order_number: string | null;
|
|
252
|
+
shop_full_order_number: string | null;
|
|
241
253
|
type: string;
|
|
242
254
|
business_code: string;
|
|
243
255
|
platform: string;
|
|
@@ -446,6 +458,7 @@ export interface OrderModuleAPI {
|
|
|
446
458
|
}) => void;
|
|
447
459
|
getTempOrder: () => OrderTempOrder | null;
|
|
448
460
|
ensureTempOrder: () => OrderTempOrder;
|
|
461
|
+
replaceTempOrder: (tempOrder: OrderTempOrder, options?: ReplaceTempOrderOptions) => Promise<OrderTempOrder>;
|
|
449
462
|
addNewOrder: () => Promise<OrderTempOrder>;
|
|
450
463
|
restoreOrder: () => OrderTempOrder;
|
|
451
464
|
getOrderProducts: () => OrderProduct[];
|
|
@@ -458,13 +471,18 @@ export interface OrderModuleAPI {
|
|
|
458
471
|
getOrderSyncState: () => OrderSyncState;
|
|
459
472
|
getOrderAmountSnapshot: () => OrderAmountSnapshot | null;
|
|
460
473
|
getTempOrderNote: () => string;
|
|
461
|
-
updateTempOrderNote:
|
|
474
|
+
updateTempOrderNote: {
|
|
475
|
+
(note: string): string;
|
|
476
|
+
(note: string, sync: true): Promise<string>;
|
|
477
|
+
(note: string, sync: boolean): string | Promise<string>;
|
|
478
|
+
};
|
|
462
479
|
updateTempOrderShopDiscount: (amount: string | number) => string;
|
|
463
480
|
updateTempOrderCustomer: (customer: UpdateTempOrderCustomerInput) => OrderSnapshot['customer'];
|
|
464
481
|
updateTempOrderBuzzer: (buzzer: string) => string;
|
|
465
482
|
updateTempOrderContactsInfo: (contactsInfo: Record<string, any> | null) => Record<string, any> | null;
|
|
466
483
|
addProductToOrder: (product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput) => Promise<OrderProduct[]>;
|
|
467
|
-
|
|
484
|
+
updateOrderProduct: (params: UpdateOrderProductParams) => Promise<OrderProduct[]>;
|
|
485
|
+
updateOrderBooking: (params: UpdateOrderBookingParams) => any[];
|
|
468
486
|
removeProductFromOrder: (identity: OrderProductIdentity) => Promise<OrderProduct[]>;
|
|
469
487
|
persistTempOrder: () => void;
|
|
470
488
|
submitTempOrder: <T = any>(params?: {
|
|
@@ -516,8 +534,10 @@ export interface OrderModuleAPI {
|
|
|
516
534
|
clearOrderCustomer: () => void;
|
|
517
535
|
loadDiscountConfig: (params: {
|
|
518
536
|
customerId: number;
|
|
519
|
-
action?: 'create';
|
|
520
|
-
|
|
537
|
+
action?: 'create' | 'edit';
|
|
538
|
+
orderId?: number;
|
|
539
|
+
apply?: boolean;
|
|
540
|
+
}) => Promise<Discount[]>;
|
|
521
541
|
getDiscountList: () => Discount[];
|
|
522
542
|
applyDiscount: () => void;
|
|
523
543
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["unique_identification_number"],
|
|
2
2
|
_excluded2 = ["num", "product_option_item", "surcharge_fee"],
|
|
3
|
-
_excluded3 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "
|
|
3
|
+
_excluded3 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id"],
|
|
4
4
|
_excluded4 = ["collect_pax", "table_occupancy_duration"];
|
|
5
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -502,9 +502,9 @@ export function createDefaultTempOrder(params) {
|
|
|
502
502
|
return {
|
|
503
503
|
order_id: null,
|
|
504
504
|
external_sale_number: '',
|
|
505
|
-
order_number:
|
|
506
|
-
shop_order_number:
|
|
507
|
-
shop_full_order_number:
|
|
505
|
+
order_number: null,
|
|
506
|
+
shop_order_number: null,
|
|
507
|
+
shop_full_order_number: null,
|
|
508
508
|
type: 'appointment_booking',
|
|
509
509
|
business_code: 'appointment_booking',
|
|
510
510
|
platform: 'h5',
|
|
@@ -513,7 +513,7 @@ export function createDefaultTempOrder(params) {
|
|
|
513
513
|
status: 'normal',
|
|
514
514
|
payment_status: 'payment_processing',
|
|
515
515
|
shipping_status: 'unfulfilled',
|
|
516
|
-
customer_id:
|
|
516
|
+
customer_id: 0,
|
|
517
517
|
customer_name: '',
|
|
518
518
|
country_calling_code: '',
|
|
519
519
|
phone: '',
|
|
@@ -573,7 +573,6 @@ export function buildSubmitPayload(params) {
|
|
|
573
573
|
_shopServiceType = _ref9.shop_service_type,
|
|
574
574
|
_startTime = _ref9.start_time,
|
|
575
575
|
_customer = _ref9.customer,
|
|
576
|
-
_shopFullOrderNumber = _ref9.shop_full_order_number,
|
|
577
576
|
_rootTaxFee = _ref9.tax_fee,
|
|
578
577
|
_totalAmount = _ref9.total_amount,
|
|
579
578
|
_totalRefundAmount = _ref9.total_refund_amount,
|
|
@@ -581,6 +580,9 @@ export function buildSubmitPayload(params) {
|
|
|
581
580
|
_holderId = _ref9.holder_id,
|
|
582
581
|
tempOrderRest = _objectWithoutProperties(_ref9, _excluded3);
|
|
583
582
|
var payload = _objectSpread(_objectSpread({}, tempOrderRest), {}, {
|
|
583
|
+
order_number: null,
|
|
584
|
+
shop_order_number: null,
|
|
585
|
+
shop_full_order_number: null,
|
|
584
586
|
platform: normalizeSubmitPlatform(platform),
|
|
585
587
|
request_unique_idempotency_token: tempOrder.request_unique_idempotency_token || "".concat(tempOrder.external_sale_number, "_").concat(now.getTime()),
|
|
586
588
|
type: (_ref10 = type !== null && type !== void 0 ? type : tempOrder.type) !== null && _ref10 !== void 0 ? _ref10 : 'table-order',
|
|
@@ -601,8 +603,7 @@ export function buildSubmitPayload(params) {
|
|
|
601
603
|
schedule_date: scheduleDate,
|
|
602
604
|
created_at: tempOrder.created_at || formatDateTime(now),
|
|
603
605
|
bookings: (tempOrder.bookings || []).filter(function (booking) {
|
|
604
|
-
|
|
605
|
-
return Number((_parent_id = booking.parent_id) !== null && _parent_id !== void 0 ? _parent_id : 0) !== 0;
|
|
606
|
+
return Number(booking.parent_id) !== 0;
|
|
606
607
|
}).map(function (booking) {
|
|
607
608
|
return normalizeSubmitBooking(booking);
|
|
608
609
|
}),
|
|
@@ -27,7 +27,8 @@ export * from "./types";
|
|
|
27
27
|
var salesSummaryDataKeys = {
|
|
28
28
|
isPriceIncludeTax: 'is_price_include_tax',
|
|
29
29
|
taxRate: 'tax_rate',
|
|
30
|
-
taxTitle: 'tax_title'
|
|
30
|
+
taxTitle: 'tax_title',
|
|
31
|
+
taxCountryCode: 'tax_country_code'
|
|
31
32
|
};
|
|
32
33
|
export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
33
34
|
_inherits(SalesSummaryModule, _BaseModule);
|
|
@@ -135,7 +136,8 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
135
136
|
return {
|
|
136
137
|
isPriceIncludeTax: this.getAppData(salesSummaryDataKeys.isPriceIncludeTax),
|
|
137
138
|
taxRate: this.getAppData(salesSummaryDataKeys.taxRate),
|
|
138
|
-
taxTitle: this.getAppData(salesSummaryDataKeys.taxTitle)
|
|
139
|
+
taxTitle: this.getAppData(salesSummaryDataKeys.taxTitle),
|
|
140
|
+
taxCountryCode: this.getAppData(salesSummaryDataKeys.taxCountryCode)
|
|
139
141
|
};
|
|
140
142
|
}
|
|
141
143
|
}, {
|
package/dist/modules/index.d.ts
CHANGED
package/dist/modules/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesScanCodeResult } from './types';
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesCalculateProductBookingPriceParams, BaseSalesProductBookingPriceResult, BaseSalesScanCodeResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
|
-
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput,
|
|
5
|
+
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder } from '../../modules/Order/types';
|
|
6
6
|
import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
|
|
7
7
|
import type { Discount } from '../../modules/Discount/types';
|
|
8
8
|
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
@@ -11,6 +11,7 @@ import { ProductList } from '../../modules/ProductList';
|
|
|
11
11
|
import { PaymentModule } from '../../modules/Payment';
|
|
12
12
|
import type { SalesSummaryModule } from '../../modules/SalesSummary';
|
|
13
13
|
import type { ScheduleModule } from '../../modules/Schedule';
|
|
14
|
+
import { QuotationModule } from '../../modules/Quotation';
|
|
14
15
|
import type { ISalesDetail, ISalesDetailHeader, ISalesBooking, ISalesPayment, ISalesSurcharge } from './utils/parseSalesResponse';
|
|
15
16
|
import { type TransformBaseProductToOrderProductParams } from './utils/transformBaseProductToOrderProduct';
|
|
16
17
|
export interface BaseSalesState {
|
|
@@ -19,6 +20,7 @@ export interface BaseSalesState {
|
|
|
19
20
|
payment?: PaymentModule;
|
|
20
21
|
salesSummary?: SalesSummaryModule;
|
|
21
22
|
schedule?: ScheduleModule;
|
|
23
|
+
quotation?: QuotationModule;
|
|
22
24
|
}
|
|
23
25
|
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
24
26
|
protected defaultName: string;
|
|
@@ -26,6 +28,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
26
28
|
isSolution: boolean;
|
|
27
29
|
protected initializeOptions: ModuleOptions;
|
|
28
30
|
private logger;
|
|
31
|
+
private appPlugin;
|
|
29
32
|
protected store: BaseSalesState;
|
|
30
33
|
protected otherParams: Record<string, any>;
|
|
31
34
|
protected cacheId: string | undefined;
|
|
@@ -39,7 +42,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
39
42
|
constructor(name?: string, version?: string);
|
|
40
43
|
/**
|
|
41
44
|
* 子类可覆盖此方法以追加/收敛要注册的子模块。
|
|
42
|
-
* 默认包含通用销售模块:products / order / salesSummary / schedule / payment。
|
|
45
|
+
* 默认包含通用销售模块:products / order / salesSummary / schedule / payment / quotation。
|
|
43
46
|
*/
|
|
44
47
|
protected getRegisteredModuleNames(): readonly string[];
|
|
45
48
|
/**
|
|
@@ -55,6 +58,10 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
55
58
|
*/
|
|
56
59
|
private logError;
|
|
57
60
|
get payment(): PaymentModule | undefined;
|
|
61
|
+
private getCurrentOrderCustomerId;
|
|
62
|
+
private applyQuotationScheduleResolver;
|
|
63
|
+
private loadQuotationForPriceQuery;
|
|
64
|
+
protected getSubmitOrderSalesChannel(): string | undefined;
|
|
58
65
|
/**
|
|
59
66
|
* 工厂入口:根据子模块名实例化对应模块。
|
|
60
67
|
* 默认使用 BookingByStep 公共 `createModule`。子类若需引入额外类型(如 customer),
|
|
@@ -67,6 +74,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
67
74
|
* sessionStorage 损坏时静默忽略,按空状态注册。
|
|
68
75
|
*/
|
|
69
76
|
protected readSessionCacheData(): Record<string, any>;
|
|
77
|
+
private getAppData;
|
|
78
|
+
private syncAppDataToTempOrder;
|
|
70
79
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
71
80
|
destroy(): Promise<void>;
|
|
72
81
|
/**
|
|
@@ -91,27 +100,47 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
91
100
|
getPayments(): ISalesPayment[];
|
|
92
101
|
/** 获取附加费用(运费/服务费/税费等)。 */
|
|
93
102
|
getSurcharges(): ISalesSurcharge[];
|
|
94
|
-
getTempOrder():
|
|
103
|
+
getTempOrder(): OrderTempOrder | null;
|
|
104
|
+
replaceTempOrder(tempOrder: OrderTempOrder): Promise<OrderTempOrder>;
|
|
95
105
|
getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
|
|
96
106
|
getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
|
|
97
107
|
getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
|
|
98
108
|
getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
|
|
99
109
|
getTempOrderNote(): string;
|
|
100
110
|
updateTempOrderNote(note: string): string;
|
|
111
|
+
updateTempOrderNote(note: string, sync: true): Promise<string>;
|
|
112
|
+
updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
|
|
101
113
|
updateTempOrderShopDiscount(amount: string | number): string;
|
|
102
114
|
updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
|
|
103
115
|
private ensureTempOrder;
|
|
104
|
-
addNewOrder(): Promise<
|
|
116
|
+
addNewOrder(): Promise<OrderTempOrder>;
|
|
105
117
|
saveDraft(): Promise<void>;
|
|
106
|
-
restoreOrder(): Promise<
|
|
118
|
+
restoreOrder(): Promise<OrderTempOrder>;
|
|
107
119
|
getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
|
|
108
120
|
getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
|
|
121
|
+
private getHistoricalProductDiscountList;
|
|
122
|
+
private mergeHistoricalDiscountList;
|
|
123
|
+
loadDiscountConfig(params?: {
|
|
124
|
+
customerId?: number;
|
|
125
|
+
action?: 'create' | 'edit';
|
|
126
|
+
}): Promise<{
|
|
127
|
+
productList: Record<string, any>[];
|
|
128
|
+
discountList: Discount[];
|
|
129
|
+
}>;
|
|
130
|
+
bestDiscount(cb?: (result: any) => void): Promise<{
|
|
131
|
+
productList: Record<string, any>[];
|
|
132
|
+
discountList: Discount[];
|
|
133
|
+
}>;
|
|
109
134
|
getDiscountList(): Discount[];
|
|
110
135
|
scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
|
|
111
136
|
setDiscountSelected(params: {
|
|
112
137
|
discountId: number;
|
|
113
138
|
isSelected: boolean;
|
|
114
139
|
}): Promise<void>;
|
|
140
|
+
applyDiscountCalculationResult(result?: {
|
|
141
|
+
productList?: Record<string, any>[];
|
|
142
|
+
discountList?: Discount[];
|
|
143
|
+
}): Promise<void>;
|
|
115
144
|
submitScanOrder<T = any>(params?: {
|
|
116
145
|
payments?: OrderPaymentSource[];
|
|
117
146
|
paymentStatus?: BaseSalesPaymentStatus;
|
|
@@ -183,8 +212,10 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
183
212
|
submitBeforeSend?: boolean;
|
|
184
213
|
}): Promise<T>;
|
|
185
214
|
transformBaseProductToOrderProduct(params: TransformBaseProductToOrderProductParams): import("./utils/transformBaseProductToOrderProduct").BaseProductOrderProductInput | null;
|
|
215
|
+
calculateProductBookingPrice(params: BaseSalesCalculateProductBookingPriceParams): Promise<BaseSalesProductBookingPriceResult>;
|
|
186
216
|
addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
187
|
-
|
|
217
|
+
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
218
|
+
updateOrderBooking(params: UpdateOrderBookingParams): any[];
|
|
188
219
|
/**
|
|
189
220
|
* 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
|
|
190
221
|
* 多行同 SKU 时必须传入与删除/更新一致的 unique_identification_number。
|