@pisell/pisellos 2.2.148 → 2.2.150
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/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +1 -0
- package/dist/model/strategy/adapter/index.d.ts +2 -0
- package/dist/model/strategy/adapter/index.js +3 -1
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +483 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
- package/dist/model/strategy/adapter/itemRule/examples.d.ts +79 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +382 -0
- package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/dist/model/strategy/adapter/itemRule/index.js +5 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +225 -0
- package/dist/model/strategy/adapter/itemRule/type.js +101 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +22 -1
- package/dist/modules/Cart/utils/changePrice.js +6 -0
- package/dist/modules/Date/index.d.ts +1 -1
- package/dist/modules/Date/index.js +16 -8
- package/dist/modules/Date/types.d.ts +3 -1
- package/dist/modules/OpenData/index.d.ts +24 -0
- package/dist/modules/OpenData/index.js +173 -0
- package/dist/modules/OpenData/types.d.ts +73 -0
- package/dist/modules/OpenData/types.js +1 -0
- package/dist/modules/OpenData/utils.d.ts +2 -0
- package/dist/modules/OpenData/utils.js +75 -0
- package/dist/modules/Order/index.d.ts +171 -1
- package/dist/modules/Order/index.js +2052 -112
- package/dist/modules/Order/types.d.ts +441 -20
- package/dist/modules/Order/types.js +23 -0
- package/dist/modules/Order/utils.d.ts +120 -0
- package/dist/modules/Order/utils.js +653 -2
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.js +2 -1
- package/dist/modules/Quotation/index.d.ts +8 -1
- package/dist/modules/Quotation/index.js +40 -10
- package/dist/modules/Quotation/types.d.ts +5 -0
- package/dist/modules/Rules/index.d.ts +3 -1
- package/dist/modules/Rules/index.js +136 -50
- package/dist/modules/Rules/types.d.ts +6 -0
- package/dist/modules/Rules/types.js +8 -0
- package/dist/modules/SalesSummary/index.d.ts +70 -0
- package/dist/modules/SalesSummary/index.js +175 -0
- package/dist/modules/SalesSummary/types.d.ts +64 -0
- package/dist/modules/SalesSummary/types.js +1 -0
- package/dist/modules/SalesSummary/utils.d.ts +34 -0
- package/dist/modules/SalesSummary/utils.js +488 -0
- package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
- package/dist/modules/ScanOrderLogger/index.js +161 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.js +203 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
- package/dist/modules/ScanOrderLogger/types.d.ts +52 -0
- package/dist/modules/ScanOrderLogger/types.js +1 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +7 -7
- package/dist/modules/Schedule/index.d.ts +4 -13
- package/dist/modules/Schedule/index.js +6 -23
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/index.d.ts +3 -0
- package/dist/modules/Summary/index.js +134 -15
- package/dist/modules/Summary/types.d.ts +7 -0
- package/dist/modules/Summary/utils.d.ts +104 -1
- package/dist/modules/Summary/utils.js +1116 -13
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.js +5 -1
- package/dist/server/index.d.ts +41 -4
- package/dist/server/index.js +900 -405
- package/dist/server/modules/order/index.d.ts +10 -2
- package/dist/server/modules/order/index.js +246 -193
- package/dist/server/modules/products/index.d.ts +26 -0
- package/dist/server/modules/products/index.js +618 -338
- package/dist/server/modules/products/types.d.ts +5 -1
- package/dist/solution/BaseSales/index.d.ts +175 -0
- package/dist/solution/BaseSales/index.js +1293 -0
- package/dist/solution/BaseSales/types.d.ts +305 -0
- package/dist/solution/BaseSales/types.js +38 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +159 -0
- package/dist/solution/BaseSales/utils.d.ts +40 -0
- package/dist/solution/BaseSales/utils.js +222 -0
- package/dist/solution/BookingByStep/index.d.ts +14 -0
- package/dist/solution/BookingByStep/index.js +699 -212
- package/dist/solution/BookingByStep/types.d.ts +3 -1
- package/dist/solution/BookingByStep/types.js +5 -1
- package/dist/solution/BookingByStep/utils/capacity.js +1 -1
- package/dist/solution/BookingByStep/utils/resources.js +6 -1
- package/dist/solution/BookingTicket/index.d.ts +113 -15
- package/dist/solution/BookingTicket/index.js +534 -196
- package/dist/solution/BookingTicket/types.d.ts +69 -6
- package/dist/solution/BookingTicket/types.js +40 -9
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.js +66 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts +26 -0
- package/dist/solution/BookingTicket/utils/cartView.js +84 -0
- package/dist/solution/Sales/index.d.ts +1 -0
- package/dist/solution/Sales/index.js +1 -0
- package/dist/solution/ScanOrder/index.d.ts +146 -0
- package/dist/solution/ScanOrder/index.js +3029 -0
- package/dist/solution/ScanOrder/types.d.ts +305 -0
- package/dist/solution/ScanOrder/types.js +35 -0
- package/dist/solution/ScanOrder/utils.d.ts +167 -0
- package/dist/solution/ScanOrder/utils.js +768 -0
- package/dist/solution/ShopDiscount/index.d.ts +2 -0
- package/dist/solution/ShopDiscount/index.js +9 -5
- package/dist/solution/ShopDiscount/types.d.ts +4 -0
- package/dist/solution/VenueBooking/index.d.ts +197 -0
- package/dist/solution/VenueBooking/index.js +3411 -0
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/dist/solution/VenueBooking/types.d.ts +153 -0
- package/dist/solution/VenueBooking/types.js +21 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
- package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
- package/dist/solution/VenueBooking/utils/resource.js +130 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +224 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +453 -0
- package/dist/solution/VenueBooking/utils.d.ts +1 -0
- package/dist/solution/VenueBooking/utils.js +1 -0
- package/dist/solution/index.d.ts +3 -0
- package/dist/solution/index.js +4 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/model/strategy/adapter/index.d.ts +2 -0
- package/lib/model/strategy/adapter/index.js +6 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +377 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
- package/lib/model/strategy/adapter/itemRule/examples.d.ts +79 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +316 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/lib/model/strategy/adapter/itemRule/index.js +60 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +225 -0
- package/lib/model/strategy/adapter/itemRule/type.js +46 -0
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +17 -1
- package/lib/modules/Cart/utils/changePrice.js +5 -0
- package/lib/modules/Date/index.d.ts +1 -1
- package/lib/modules/Date/index.js +7 -1
- package/lib/modules/Date/types.d.ts +3 -1
- package/lib/modules/OpenData/index.d.ts +24 -0
- package/lib/modules/OpenData/index.js +119 -0
- package/lib/modules/OpenData/types.d.ts +73 -0
- package/lib/modules/OpenData/types.js +17 -0
- package/lib/modules/OpenData/utils.d.ts +2 -0
- package/lib/modules/OpenData/utils.js +111 -0
- package/lib/modules/Order/index.d.ts +171 -1
- package/lib/modules/Order/index.js +1396 -5
- package/lib/modules/Order/types.d.ts +441 -20
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils.d.ts +120 -0
- package/lib/modules/Order/utils.js +562 -2
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.js +2 -1
- package/lib/modules/Quotation/index.d.ts +8 -1
- package/lib/modules/Quotation/index.js +33 -4
- package/lib/modules/Quotation/types.d.ts +5 -0
- package/lib/modules/Rules/index.d.ts +3 -1
- package/lib/modules/Rules/index.js +46 -6
- package/lib/modules/Rules/types.d.ts +6 -0
- package/lib/modules/Rules/types.js +11 -2
- package/lib/modules/SalesSummary/index.d.ts +70 -0
- package/lib/modules/SalesSummary/index.js +106 -0
- package/lib/modules/SalesSummary/types.d.ts +64 -0
- package/lib/modules/SalesSummary/types.js +17 -0
- package/lib/modules/SalesSummary/utils.d.ts +34 -0
- package/lib/modules/SalesSummary/utils.js +430 -0
- package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
- package/lib/modules/ScanOrderLogger/index.js +135 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.js +148 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
- package/lib/modules/ScanOrderLogger/types.d.ts +52 -0
- package/lib/modules/ScanOrderLogger/types.js +17 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +5 -5
- package/lib/modules/Schedule/index.d.ts +4 -13
- package/lib/modules/Schedule/index.js +4 -15
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/index.d.ts +3 -0
- package/lib/modules/Summary/index.js +61 -2
- package/lib/modules/Summary/types.d.ts +7 -0
- package/lib/modules/Summary/utils.d.ts +104 -1
- package/lib/modules/Summary/utils.js +659 -8
- package/lib/modules/index.d.ts +4 -0
- package/lib/modules/index.js +9 -1
- package/lib/server/index.d.ts +41 -4
- package/lib/server/index.js +272 -10
- package/lib/server/modules/order/index.d.ts +10 -2
- package/lib/server/modules/order/index.js +26 -1
- package/lib/server/modules/products/index.d.ts +26 -0
- package/lib/server/modules/products/index.js +174 -22
- package/lib/server/modules/products/types.d.ts +5 -1
- package/lib/solution/BaseSales/index.d.ts +175 -0
- package/lib/solution/BaseSales/index.js +655 -0
- package/lib/solution/BaseSales/types.d.ts +305 -0
- package/lib/solution/BaseSales/types.js +40 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +160 -0
- package/lib/solution/BaseSales/utils.d.ts +40 -0
- package/lib/solution/BaseSales/utils.js +200 -0
- package/lib/solution/BookingByStep/index.d.ts +14 -0
- package/lib/solution/BookingByStep/index.js +469 -91
- package/lib/solution/BookingByStep/types.d.ts +3 -1
- package/lib/solution/BookingByStep/types.js +10 -0
- package/lib/solution/BookingByStep/utils/capacity.js +1 -1
- package/lib/solution/BookingByStep/utils/resources.js +5 -2
- package/lib/solution/BookingTicket/index.d.ts +113 -15
- package/lib/solution/BookingTicket/index.js +253 -61
- package/lib/solution/BookingTicket/types.d.ts +69 -6
- package/lib/solution/BookingTicket/types.js +16 -14
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +65 -0
- package/lib/solution/BookingTicket/utils/cartView.d.ts +26 -0
- package/lib/solution/BookingTicket/utils/cartView.js +103 -0
- package/lib/solution/Sales/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.d.ts +146 -0
- package/lib/solution/ScanOrder/index.js +1820 -0
- package/lib/solution/ScanOrder/types.d.ts +305 -0
- package/lib/solution/ScanOrder/types.js +36 -0
- package/lib/solution/ScanOrder/utils.d.ts +167 -0
- package/lib/solution/ScanOrder/utils.js +639 -0
- package/lib/solution/ShopDiscount/index.d.ts +2 -0
- package/lib/solution/ShopDiscount/index.js +9 -4
- package/lib/solution/ShopDiscount/types.d.ts +4 -0
- package/lib/solution/VenueBooking/index.d.ts +197 -0
- package/lib/solution/VenueBooking/index.js +1892 -0
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/lib/solution/VenueBooking/types.d.ts +153 -0
- package/lib/solution/VenueBooking/types.js +44 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
- package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
- package/lib/solution/VenueBooking/utils/resource.js +91 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +225 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +339 -0
- package/lib/solution/VenueBooking/utils.d.ts +1 -0
- package/lib/solution/VenueBooking/utils.js +69 -0
- package/lib/solution/index.d.ts +3 -0
- package/lib/solution/index.js +7 -1
- package/package.json +1 -1
|
@@ -23,7 +23,8 @@ export interface FormattedProductData extends ProductData {
|
|
|
23
23
|
export interface LoadProductsPriceParams {
|
|
24
24
|
ids: number[];
|
|
25
25
|
schedule_date: string;
|
|
26
|
-
|
|
26
|
+
schedule_datetime?: string;
|
|
27
|
+
customer_id?: number | string;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* 加载报价单商品价格返回数据
|
|
@@ -47,6 +48,7 @@ export interface LoadProductsPriceData {
|
|
|
47
48
|
bundle_product_id: number;
|
|
48
49
|
bundle_variant_id: number;
|
|
49
50
|
price: number;
|
|
51
|
+
base_price?: number | string;
|
|
50
52
|
price_type: string;
|
|
51
53
|
price_type_ext: string;
|
|
52
54
|
}[];
|
|
@@ -107,6 +109,8 @@ export interface ProductSyncMessage {
|
|
|
107
109
|
*/
|
|
108
110
|
export interface ProductFormatterContext {
|
|
109
111
|
schedule_date: string;
|
|
112
|
+
schedule_datetime?: string;
|
|
113
|
+
customer_id?: number | string;
|
|
110
114
|
priceData?: LoadProductsPriceData[];
|
|
111
115
|
scheduleModule?: any;
|
|
112
116
|
locale?: string;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesScanCodeResult } from './types';
|
|
4
|
+
import { OrderModule } from '../../modules/Order';
|
|
5
|
+
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateProductInOrderParams } from '../../modules/Order/types';
|
|
6
|
+
import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
|
|
7
|
+
import type { Discount } from '../../modules/Discount/types';
|
|
8
|
+
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
9
|
+
export * from './types';
|
|
10
|
+
import { ProductList } from '../../modules/ProductList';
|
|
11
|
+
import type { SalesSummaryModule } from '../../modules/SalesSummary';
|
|
12
|
+
import type { ScheduleModule } from '../../modules/Schedule';
|
|
13
|
+
import type { ISalesDetail, ISalesDetailHeader, ISalesBooking, ISalesPayment, ISalesSurcharge } from './utils/parseSalesResponse';
|
|
14
|
+
export interface BaseSalesState {
|
|
15
|
+
order?: OrderModule;
|
|
16
|
+
products?: ProductList;
|
|
17
|
+
salesSummary?: SalesSummaryModule;
|
|
18
|
+
schedule?: ScheduleModule;
|
|
19
|
+
}
|
|
20
|
+
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
21
|
+
protected defaultName: string;
|
|
22
|
+
protected defaultVersion: string;
|
|
23
|
+
isSolution: boolean;
|
|
24
|
+
protected initializeOptions: ModuleOptions;
|
|
25
|
+
protected store: BaseSalesState;
|
|
26
|
+
protected otherParams: Record<string, any>;
|
|
27
|
+
protected cacheId: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* window / request 暴露为 public:现存外部工具(如 BookingTicket Scan)通过
|
|
30
|
+
* `solution.window` / `solution.request` 直接访问插件,保持原有契约不破坏。
|
|
31
|
+
*/
|
|
32
|
+
window: WindowPlugin;
|
|
33
|
+
request: RequestPlugin;
|
|
34
|
+
protected currentSalesDetail: ISalesDetail | null;
|
|
35
|
+
constructor(name?: string, version?: string);
|
|
36
|
+
/**
|
|
37
|
+
* 子类可覆盖此方法以追加/收敛要注册的子模块。
|
|
38
|
+
* 默认包含通用销售模块:products / order / salesSummary / schedule。
|
|
39
|
+
*/
|
|
40
|
+
protected getRegisteredModuleNames(): readonly string[];
|
|
41
|
+
/**
|
|
42
|
+
* 工厂入口:根据子模块名实例化对应模块。
|
|
43
|
+
* 默认使用 BookingByStep 公共 `createModule`。子类若需引入额外类型(如 customer),
|
|
44
|
+
* 可覆盖此方法并把未识别的 name 委托给 `super.createSubModule(name)`。
|
|
45
|
+
*/
|
|
46
|
+
protected createSubModule(moduleName: string): Module | null;
|
|
47
|
+
/**
|
|
48
|
+
* 读取 sessionStorage[this.name][cacheId],作为子模块 initialState 的来源。
|
|
49
|
+
* sessionStorage 损坏时静默忽略,按空状态注册。
|
|
50
|
+
*/
|
|
51
|
+
protected readSessionCacheData(): Record<string, any>;
|
|
52
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
53
|
+
destroy(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* 加载销售订单到统一 tempOrder 工作区。
|
|
56
|
+
* 有 app.sqlite 时优先读取本地记录;本地未命中或 forceRemote=true 时再拉云端。
|
|
57
|
+
*
|
|
58
|
+
* 子类可在 `super.loadSalesDetail` 之后基于返回的 `sales` 做业务侧装配
|
|
59
|
+
* (比如把 `sales.customer` 写入 CustomerModule、emit 业务 hook 等)。
|
|
60
|
+
*/
|
|
61
|
+
loadSalesDetail(orderIdOrParams: number | string | LoadSalesDetailParams): Promise<ISalesDetail>;
|
|
62
|
+
/** 获取当前已加载的销售详情(只读快照)。未加载过则返回 null。 */
|
|
63
|
+
getSalesOrder(): ISalesDetail | null;
|
|
64
|
+
/** 获取销售详情顶部业务字段(订单号/状态/金额等通用字段集合)。 */
|
|
65
|
+
getOrderHeader(): ISalesDetailHeader | null;
|
|
66
|
+
/** 获取所有 booking(含 root + children),按服务端原始顺序输出。 */
|
|
67
|
+
getBookings(): ISalesBooking[];
|
|
68
|
+
/** 获取根 booking(is_next === 0 / is_root === 1),多个时取第一个。 */
|
|
69
|
+
getRootBooking(): ISalesBooking | null;
|
|
70
|
+
/** 按 product_uid 反查 booking 列表(用于商品行 ↔ booking 映射)。 */
|
|
71
|
+
getChildBookingsByProductUid(productUid: string): ISalesBooking[];
|
|
72
|
+
/** 获取支付列表(已支付/退款等明细)。 */
|
|
73
|
+
getPayments(): ISalesPayment[];
|
|
74
|
+
/** 获取附加费用(运费/服务费/税费等)。 */
|
|
75
|
+
getSurcharges(): ISalesSurcharge[];
|
|
76
|
+
getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
|
|
77
|
+
getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
|
|
78
|
+
getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
|
|
79
|
+
getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
|
|
80
|
+
getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
|
|
81
|
+
getTempOrderNote(): string;
|
|
82
|
+
updateTempOrderNote(note: string): string;
|
|
83
|
+
updateOrderShopDiscount(amount: string | number): string;
|
|
84
|
+
private ensureTempOrder;
|
|
85
|
+
addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
86
|
+
saveDraft(): Promise<void>;
|
|
87
|
+
restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
88
|
+
getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
|
|
89
|
+
getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
|
|
90
|
+
getDiscountList(): Discount[];
|
|
91
|
+
scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
|
|
92
|
+
setDiscountSelected(params: {
|
|
93
|
+
discountId: number;
|
|
94
|
+
isSelected: boolean;
|
|
95
|
+
}): Promise<void>;
|
|
96
|
+
submitScanOrder<T = any>(params?: {
|
|
97
|
+
payments?: OrderPaymentSource[];
|
|
98
|
+
paymentStatus?: BaseSalesPaymentStatus;
|
|
99
|
+
smallTicketDataFlag?: number;
|
|
100
|
+
enhancePayload?: SubmitPayloadEnhancer;
|
|
101
|
+
}): Promise<T>;
|
|
102
|
+
/**
|
|
103
|
+
* 提交当前 Sales 订单。
|
|
104
|
+
*
|
|
105
|
+
* PaymentModal 场景通过 smallTicketDataFlag=1 请求 B 端小票数据;
|
|
106
|
+
* payments 会交给 OrderModule 统一映射为 Sales 协议支付项。
|
|
107
|
+
*/
|
|
108
|
+
submitSalesOrder<T = any>(params?: {
|
|
109
|
+
payments?: OrderPaymentSource[];
|
|
110
|
+
paymentStatus?: BaseSalesPaymentStatus;
|
|
111
|
+
smallTicketDataFlag?: number;
|
|
112
|
+
enhancePayload?: SubmitPayloadEnhancer;
|
|
113
|
+
}): Promise<T>;
|
|
114
|
+
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
115
|
+
/** 读取当前 BaseSales 订单上下文中的 Sales 协议支付项。 */
|
|
116
|
+
getOrderPayments(): OrderPaymentData[];
|
|
117
|
+
/** 覆盖当前订单支付项,内部由 OrderModule 清洗为 Sales 协议字段。 */
|
|
118
|
+
setOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
|
|
119
|
+
/** 追加单个支付项到当前订单。 */
|
|
120
|
+
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
121
|
+
/** 更新当前订单中的指定支付项。 */
|
|
122
|
+
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
|
|
123
|
+
/** 删除当前订单中的指定支付项。 */
|
|
124
|
+
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
125
|
+
/** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
|
|
126
|
+
updateVoucherOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
|
|
127
|
+
/**
|
|
128
|
+
* 更新当前订单客户字段。
|
|
129
|
+
*
|
|
130
|
+
* 这是 PaymentModal 客户切换的订单事实入口;外部客户模块同步应由
|
|
131
|
+
* 调用方通过 onCustomerChange 回调完成。
|
|
132
|
+
*/
|
|
133
|
+
updateOrderCustomer(customer: UpdateTempOrderCustomerInput): {
|
|
134
|
+
customerId: number | null;
|
|
135
|
+
customerName: string;
|
|
136
|
+
phone: string;
|
|
137
|
+
email: string;
|
|
138
|
+
};
|
|
139
|
+
/** 获取可用支付方式列表,供 PaymentModal 渲染支付选项。 */
|
|
140
|
+
getPaymentMethodsAsync(): Promise<any[]>;
|
|
141
|
+
/** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
|
|
142
|
+
roundAmount(params: {
|
|
143
|
+
amount: string | number;
|
|
144
|
+
interval?: string | number;
|
|
145
|
+
rule?: 'standard_rounding' | 'standard_down' | 'always_up' | 'always_down' | string;
|
|
146
|
+
}): {
|
|
147
|
+
originalAmount: string;
|
|
148
|
+
roundedAmount: string;
|
|
149
|
+
roundingDifference: string;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* 发送支付链接。
|
|
153
|
+
*
|
|
154
|
+
* 如果没有 orderIds 或显式 submitBeforeSend,会先提交当前本地订单到云端;
|
|
155
|
+
* 只有成功拿到远端 order_id 后才调用 OrderModule 发送邮件。
|
|
156
|
+
*/
|
|
157
|
+
sendCustomerPayLink<T = any>(params: Omit<SendCustomerPayLinkParams, 'orderIds' | 'order_ids'> & {
|
|
158
|
+
orderIds?: Array<number | string>;
|
|
159
|
+
order_ids?: Array<number | string>;
|
|
160
|
+
submitBeforeSend?: boolean;
|
|
161
|
+
}): Promise<T>;
|
|
162
|
+
addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
163
|
+
updateProductInOrder(params: UpdateProductInOrderParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
164
|
+
/**
|
|
165
|
+
* 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
|
|
166
|
+
* 多行同 SKU 时必须传入与删除/更新一致的 unique_identification_number。
|
|
167
|
+
*/
|
|
168
|
+
setOrderProductLineNote(identity: BaseSalesOrderProductIdentity, note: string): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
169
|
+
removeProductFromOrder(identity: BaseSalesOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
170
|
+
getProductList(): Promise<any>;
|
|
171
|
+
getOtherParams(): Record<string, any>;
|
|
172
|
+
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
173
|
+
cover?: boolean;
|
|
174
|
+
}): Promise<void>;
|
|
175
|
+
}
|