@pisell/pisellos 2.3.38 → 2.3.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.d.ts +0 -2
- package/dist/core/index.js +0 -7
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/dist/model/strategy/adapter/promotion/adapter.js +0 -23
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/dist/model/strategy/adapter/promotion/evaluator.js +6 -279
- package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/dist/model/strategy/adapter/promotion/examples.js +0 -99
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/dist/model/strategy/adapter/promotion/type.js +0 -45
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -5
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +3 -6
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.d.ts +0 -2
- package/dist/modules/OpenData/index.js +2 -10
- package/dist/modules/Order/index.d.ts +11 -28
- package/dist/modules/Order/index.js +509 -750
- package/dist/modules/Order/types.d.ts +10 -33
- package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +41 -13
- package/dist/modules/Payment/index.d.ts +0 -2
- package/dist/modules/Payment/index.js +50 -79
- package/dist/modules/Payment/types.d.ts +28 -99
- package/dist/modules/Payment/types.js +3 -20
- package/dist/modules/Payment/walletpass.d.ts +1 -25
- package/dist/modules/Payment/walletpass.js +157 -707
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -14
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +0 -1
- package/dist/modules/Rules/index.js +96 -89
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +14 -16
- package/dist/server/index.js +1148 -1930
- package/dist/server/modules/order/index.d.ts +4 -54
- package/dist/server/modules/order/index.js +695 -1595
- package/dist/server/modules/order/types.d.ts +3 -11
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +20 -109
- package/dist/solution/BaseSales/index.js +481 -1797
- package/dist/solution/BaseSales/types.d.ts +0 -52
- package/dist/solution/BaseSales/types.js +1 -2
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +31 -90
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/dist/solution/BookingByStep/index.d.ts +17 -2
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.d.ts +4 -8
- package/dist/solution/BookingTicket/index.js +51 -134
- package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -6
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +82 -172
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
- package/dist/solution/Sales/index.d.ts +0 -1
- package/dist/solution/Sales/index.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1148 -756
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +66 -25
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1176 -860
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -1
- package/lib/core/index.d.ts +0 -2
- package/lib/core/index.js +0 -4
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/lib/model/strategy/adapter/promotion/adapter.js +0 -20
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/lib/model/strategy/adapter/promotion/evaluator.js +0 -235
- package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/lib/model/strategy/adapter/promotion/examples.js +0 -91
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +0 -2
- package/lib/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/lib/model/strategy/adapter/promotion/type.js +0 -2
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +1 -2
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -2
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.d.ts +0 -2
- package/lib/modules/OpenData/index.js +1 -6
- package/lib/modules/Order/index.d.ts +11 -28
- package/lib/modules/Order/index.js +86 -196
- package/lib/modules/Order/types.d.ts +10 -33
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +40 -16
- package/lib/modules/Payment/index.d.ts +0 -2
- package/lib/modules/Payment/index.js +13 -34
- package/lib/modules/Payment/types.d.ts +28 -99
- package/lib/modules/Payment/types.js +3 -4
- package/lib/modules/Payment/walletpass.d.ts +1 -25
- package/lib/modules/Payment/walletpass.js +21 -470
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +40 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.d.ts +0 -1
- package/lib/modules/Rules/index.js +40 -47
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +14 -16
- package/lib/server/index.js +83 -675
- package/lib/server/modules/order/index.d.ts +4 -54
- package/lib/server/modules/order/index.js +66 -679
- package/lib/server/modules/order/types.d.ts +3 -11
- package/lib/solution/BaseSales/index.d.ts +20 -109
- package/lib/solution/BaseSales/index.js +70 -881
- package/lib/solution/BaseSales/types.d.ts +0 -52
- package/lib/solution/BaseSales/types.js +1 -2
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/lib/solution/BaseSales/utils/cartPromotion.js +12 -63
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/lib/solution/BookingByStep/index.d.ts +17 -2
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.d.ts +4 -8
- package/lib/solution/BookingTicket/index.js +19 -64
- package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -4
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +4 -36
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/Sales/index.d.ts +0 -1
- package/lib/solution/Sales/index.js +3 -5
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -190
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +31 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1076 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +328 -123
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/payment-utils.js +0 -225
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
- package/dist/solution/BookingTicket/utils/weighingProductSku.js +0 -45
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/payment-number.js +0 -69
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/payment-utils.js +0 -224
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +0 -63
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/payment-number.js +0 -64
|
@@ -213,12 +213,10 @@ export interface OrderBookingItem {
|
|
|
213
213
|
[key: string]: unknown;
|
|
214
214
|
}[];
|
|
215
215
|
}
|
|
216
|
-
/** 支付记录 metadata */
|
|
216
|
+
/** 支付记录 metadata,常含 unique_payment_number */
|
|
217
217
|
export interface OrderPaymentMetadata {
|
|
218
|
-
/**
|
|
218
|
+
/** 设备端本地支付唯一标识 */
|
|
219
219
|
unique_payment_number?: string;
|
|
220
|
-
/** 刷卡机设备快照;server 不解析内部字段,仅透传并持久化 */
|
|
221
|
-
card_reader_snapshot?: Record<string, unknown>;
|
|
222
220
|
[key: string]: unknown;
|
|
223
221
|
}
|
|
224
222
|
/**
|
|
@@ -227,8 +225,6 @@ export interface OrderPaymentMetadata {
|
|
|
227
225
|
export interface OrderPaymentItem {
|
|
228
226
|
/** 支付记录 ID;存量/更新时传。来源:OrderPayment.id */
|
|
229
227
|
order_payment_id?: number | null;
|
|
230
|
-
/** 支付项稳定唯一号;历史支付项允许缺失 */
|
|
231
|
-
payment_number?: string;
|
|
232
228
|
/** 支付方式 ID(设备端从本地支付方式配置取详情)。来源:OrderPayment.custom_payment_id */
|
|
233
229
|
custom_payment_id?: number;
|
|
234
230
|
/** 支付方式编码。来源:OrderPayment.payment_method */
|
|
@@ -253,13 +249,11 @@ export interface OrderPaymentItem {
|
|
|
253
249
|
created_at?: string | null;
|
|
254
250
|
/** 手续费配置。来源:OrderPayment.service_charge */
|
|
255
251
|
service_charge?: Record<string, unknown> | null;
|
|
256
|
-
/** 已计算的支付手续费。来源:OrderPayment.service_fee */
|
|
257
|
-
service_fee?: OrderMoneyString;
|
|
258
252
|
/** Wallet Pass 使用单位 */
|
|
259
253
|
wallet_pass_usage_unit?: unknown[] | null;
|
|
260
254
|
/** Wallet Pass 使用值 */
|
|
261
255
|
wallet_pass_use_value?: number | null;
|
|
262
|
-
/**
|
|
256
|
+
/** 元数据;含 unique_payment_number。来源:OrderPayment.metadata */
|
|
263
257
|
metadata?: OrderPaymentMetadata | null;
|
|
264
258
|
}
|
|
265
259
|
/**
|
|
@@ -419,8 +413,6 @@ export interface OrderData {
|
|
|
419
413
|
create_date?: string;
|
|
420
414
|
/** 本地待同步标记:1 表示需要后续同步到云端 */
|
|
421
415
|
need_sync?: 0 | 1 | number;
|
|
422
|
-
/** 本地草稿标记:1 表示仅为 POS 可恢复草稿,不代表已提交云端 */
|
|
423
|
-
is_draft_order?: 0 | 1 | number;
|
|
424
416
|
/** 兼容:部分场景仍使用顶层 total_amount */
|
|
425
417
|
total_amount?: OrderMoneyString | number;
|
|
426
418
|
/** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
|
-
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData,
|
|
5
|
+
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } 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';
|
|
9
9
|
export * from './types';
|
|
10
10
|
import { ProductList } from '../../modules/ProductList';
|
|
11
11
|
import { PaymentModule } from '../../modules/Payment';
|
|
12
|
-
import type { PaymentMethod
|
|
12
|
+
import type { PaymentMethod } from '../../modules/Payment/types';
|
|
13
13
|
import type { SalesSummaryModule } from '../../modules/SalesSummary';
|
|
14
14
|
import type { ScheduleModule } from '../../modules/Schedule';
|
|
15
15
|
import { QuotationModule } from '../../modules/Quotation';
|
|
@@ -24,19 +24,6 @@ export interface BaseSalesState {
|
|
|
24
24
|
schedule?: ScheduleModule;
|
|
25
25
|
quotation?: QuotationModule;
|
|
26
26
|
}
|
|
27
|
-
export interface BaseSalesUpdateOrderPaymentOptions extends OrderPaymentUpdateOptions {
|
|
28
|
-
persistDraft?: boolean;
|
|
29
|
-
submitWhenPaid?: boolean;
|
|
30
|
-
forceSubmitIfPaid?: boolean;
|
|
31
|
-
/** 草稿恢复时,允许将新回调字段合并进已 paid 的支付项。 */
|
|
32
|
-
applyUpdatesWhenPaid?: boolean;
|
|
33
|
-
smallTicketDataFlag?: number;
|
|
34
|
-
}
|
|
35
|
-
export interface BaseSalesUpdateOrderPaymentResult extends OrderPaymentUpdateResult {
|
|
36
|
-
draftResult?: unknown;
|
|
37
|
-
draftError?: unknown;
|
|
38
|
-
syncResult?: SyncPaymentsToOrderResult<any>;
|
|
39
|
-
}
|
|
40
27
|
export type BaseSalesPrintLocalOrderReceiptParams = string | number;
|
|
41
28
|
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
42
29
|
protected defaultName: string;
|
|
@@ -48,11 +35,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
48
35
|
protected store: BaseSalesState;
|
|
49
36
|
protected otherParams: Record<string, any>;
|
|
50
37
|
protected cacheId: string | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* 由已在初始化阶段解析过设备短号的业务解决方案写入。
|
|
53
|
-
* 未设置时,支付编号仍按原逻辑实时读取设备信息。
|
|
54
|
-
*/
|
|
55
|
-
protected paymentNumberDevicePrefix: string | null;
|
|
56
38
|
/**
|
|
57
39
|
* window / request 暴露为 public:现存外部工具(如 BookingTicket Scan)通过
|
|
58
40
|
* `solution.window` / `solution.request` 直接访问插件,保持原有契约不破坏。
|
|
@@ -69,7 +51,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
69
51
|
private autoPaymentSyncTimer;
|
|
70
52
|
private salesDetailLoadInFlightCount;
|
|
71
53
|
private salesDetailLoadSequence;
|
|
72
|
-
private walletAssetsRefreshSequence;
|
|
73
54
|
private salesDetailHydrateQueue;
|
|
74
55
|
private serverOrderChangeUnsubscribe;
|
|
75
56
|
private serverOrderChangeHydrateInFlight;
|
|
@@ -147,13 +128,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
147
128
|
*/
|
|
148
129
|
protected readSessionCacheData(): Record<string, any>;
|
|
149
130
|
protected getAppData<T>(key: string): T | undefined;
|
|
150
|
-
/**
|
|
151
|
-
* 复用业务解决方案初始化时已解析的支付设备短号。
|
|
152
|
-
* 空值会清除缓存,使后续支付恢复实时读取设备信息的兼容路径。
|
|
153
|
-
*/
|
|
154
|
-
protected setPaymentNumberDevicePrefix(prefix: unknown): void;
|
|
155
|
-
private getPaymentNumberDevicePrefixSync;
|
|
156
|
-
private getPaymentNumberDevicePrefixAsync;
|
|
157
131
|
private syncAppDataToTempOrder;
|
|
158
132
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
159
133
|
destroy(): Promise<void>;
|
|
@@ -266,13 +240,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
266
240
|
confirmPendingVoucherPayments?: boolean;
|
|
267
241
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
268
242
|
}): Promise<T>;
|
|
269
|
-
saveSalesOrderDraft<T = any>(params?: {
|
|
270
|
-
platform?: string;
|
|
271
|
-
businessCode?: string;
|
|
272
|
-
channel?: string;
|
|
273
|
-
type?: string;
|
|
274
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
275
|
-
}): Promise<T>;
|
|
276
243
|
submitTempOrderAsync<T = any>(params?: {
|
|
277
244
|
payments?: OrderPaymentSource[];
|
|
278
245
|
paymentStatus?: BaseSalesPaymentStatus;
|
|
@@ -280,6 +247,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
280
247
|
confirmPendingVoucherPayments?: boolean;
|
|
281
248
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
282
249
|
}): Promise<T>;
|
|
250
|
+
/**
|
|
251
|
+
* 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
|
|
252
|
+
* otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
|
|
253
|
+
*/
|
|
254
|
+
protected shouldUseCheckoutSyncTask(): boolean;
|
|
255
|
+
/** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
|
|
256
|
+
protected getDefaultCheckoutSmallTicketDataFlag(): number | undefined;
|
|
283
257
|
printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
|
|
284
258
|
private getSubmitPaymentStatus;
|
|
285
259
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
@@ -291,62 +265,22 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
291
265
|
private queueLatestAutoPaymentSync;
|
|
292
266
|
private scheduleQueuedAutoPaymentSyncFlush;
|
|
293
267
|
private flushQueuedAutoPaymentSync;
|
|
294
|
-
/**
|
|
295
|
-
* 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
|
|
296
|
-
*/
|
|
268
|
+
/** 追加单个支付项到当前订单。 */
|
|
297
269
|
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
298
|
-
/**
|
|
299
|
-
* 创建新支付项时优先使用业务解决方案初始化阶段缓存的设备短号;
|
|
300
|
-
* 未缓存的通用 BaseSales 保持实时读取设备信息的兼容语义。
|
|
301
|
-
*/
|
|
302
|
-
addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
|
|
303
|
-
private addOrderPaymentWithDevicePrefix;
|
|
304
270
|
/** 更新当前订单中的指定支付项。 */
|
|
305
|
-
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any
|
|
271
|
+
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
|
|
306
272
|
/** 删除当前订单中的指定支付项。 */
|
|
307
273
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
308
274
|
/** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
|
|
309
275
|
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
310
276
|
status?: 'paid' | 'payment_pending';
|
|
311
277
|
}): OrderPaymentData[];
|
|
312
|
-
updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
|
|
313
|
-
status?: 'paid' | 'payment_pending';
|
|
314
|
-
}): Promise<OrderPaymentData[]>;
|
|
315
278
|
confirmPendingVoucherPayments(): OrderPaymentData[];
|
|
316
279
|
discardPendingVoucherPayments(): OrderPaymentData[];
|
|
317
280
|
private getWalletProductList;
|
|
318
|
-
private buildWalletInitBusinessData;
|
|
319
281
|
initWalletData(params?: {
|
|
320
282
|
order_wait_pay_amount?: number;
|
|
321
283
|
}): Promise<import("../../modules/Payment").WalletInitializationResult>;
|
|
322
|
-
private getCommittedWalletAssets;
|
|
323
|
-
private publishWalletAssetsState;
|
|
324
|
-
private syncSelectedWalletAssets;
|
|
325
|
-
/** 读取购物车与 Shared Checkout 共用的钱包资产状态。 */
|
|
326
|
-
getWalletAssetsState(): WalletAssetsState;
|
|
327
|
-
/** 导出 Shared Checkout 跨运行时恢复所需的钱包状态与搜索缓存。 */
|
|
328
|
-
exportWalletAssetsSnapshot(): WalletAssetsSnapshot;
|
|
329
|
-
/**
|
|
330
|
-
* 恢复 Shared Checkout 钱包快照,并把选择重新同步为订单 pending payment。
|
|
331
|
-
*/
|
|
332
|
-
importWalletAssetsSnapshot(snapshot: WalletAssetsSnapshot): Promise<WalletAssetsState>;
|
|
333
|
-
/**
|
|
334
|
-
* 基于当前订单快照刷新钱包资产。商品变化保留并重验选择;客户变化强制清空。
|
|
335
|
-
*/
|
|
336
|
-
refreshWalletAssets(params?: {
|
|
337
|
-
order_wait_pay_amount?: number;
|
|
338
|
-
preserveSelection?: boolean;
|
|
339
|
-
}): Promise<WalletAssetsState>;
|
|
340
|
-
/** 选择或取消单张钱包资产,并立即同步 pending wallet payments。 */
|
|
341
|
-
selectWalletAsset(params: {
|
|
342
|
-
assetId: WalletAssetId;
|
|
343
|
-
selected: boolean;
|
|
344
|
-
source?: WalletAssetSelectionSource;
|
|
345
|
-
}): Promise<WalletAssetsState>;
|
|
346
|
-
/** 扫码精确查券;仅可用资产会被自动选中。 */
|
|
347
|
-
scanWalletAsset(code: string): Promise<ScanWalletAssetResult>;
|
|
348
|
-
/** 清空全部未确认钱包选择,已支付钱包项由 Order 模块继续保留。 */
|
|
349
|
-
clearWalletAssetSelection(): Promise<WalletAssetsState>;
|
|
350
284
|
/**
|
|
351
285
|
* 更新当前订单客户字段。
|
|
352
286
|
*
|
|
@@ -363,39 +297,16 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
363
297
|
getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
|
|
364
298
|
/** 同步读取初始化时缓存的支付方式列表。 */
|
|
365
299
|
getPaymentMethods(): PaymentMethod[];
|
|
366
|
-
|
|
367
|
-
private getPendingWalletPaymentAmount;
|
|
368
|
-
/** 读取现金 action 所需的支付方式、待付金额和快捷金额。 */
|
|
369
|
-
getCashPaymentConfig(): Promise<BaseSalesCashPaymentConfig>;
|
|
370
|
-
/**
|
|
371
|
-
* 确认足额覆盖订单的 pending Wallet 支付并提交订单。
|
|
372
|
-
*
|
|
373
|
-
* Order 模块在构造提交参数时将 pending voucher 转为 paid;只有提交成功后
|
|
374
|
-
* 才同步 Wallet committed 状态。失败时恢复调用前 payments,允许用户重试。
|
|
375
|
-
*/
|
|
376
|
-
confirmWalletPayment<T = Record<string, any>>(): Promise<BaseSalesConfirmWalletPaymentResult<T>>;
|
|
377
|
-
/**
|
|
378
|
-
* 购物车现金直付:写入现金记录并等待支付同步完成。
|
|
379
|
-
* 同步失败会恢复调用前 payments(包含 Wallet pending 状态)。
|
|
380
|
-
*/
|
|
381
|
-
payCash(params: BaseSalesPayCashParams): Promise<BaseSalesPayCashResult>;
|
|
382
|
-
/**
|
|
383
|
-
* 提交一次已由支付设备确认成功的非 Wallet 支付。
|
|
384
|
-
*
|
|
385
|
-
* 与 addOrderPayment 不同,本入口不会启动后台 fire-and-forget 同步;调用方会等待
|
|
386
|
-
* 本次 payment、当前 pending Wallet 以及订单提交共同完成。任何同步失败都会恢复
|
|
387
|
-
* 调用前的 payments 与 payment_status,便于 UI 安全解锁并重试。
|
|
388
|
-
*/
|
|
389
|
-
commitPaymentMethodPayment(params: BaseSalesCommitPaymentMethodParams): Promise<BaseSalesCommitPaymentMethodResult>;
|
|
390
|
-
/**
|
|
391
|
-
* 按当前店铺的现金舍入配置计算金额,供现金支付 UI 使用。
|
|
392
|
-
*
|
|
393
|
-
* 舍入开关取自 CASHMANUAL 支付方式;舍入规则取自
|
|
394
|
-
* otherParams.order_rounding_setting,金额算法统一由 PaymentModule 维护。
|
|
395
|
-
*/
|
|
300
|
+
/** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
|
|
396
301
|
roundAmount(params: {
|
|
397
302
|
amount: string | number;
|
|
398
|
-
|
|
303
|
+
interval?: string | number;
|
|
304
|
+
rule?: 'standard_rounding' | 'standard_down' | 'always_up' | 'always_down' | string;
|
|
305
|
+
}): {
|
|
306
|
+
originalAmount: string;
|
|
307
|
+
roundedAmount: string;
|
|
308
|
+
roundingDifference: string;
|
|
309
|
+
};
|
|
399
310
|
/**
|
|
400
311
|
* 发送支付链接。
|
|
401
312
|
*
|