@pisell/pisellos 2.3.28 → 2.3.30
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/Order/index.d.ts +32 -8
- package/dist/modules/Order/index.js +883 -521
- package/dist/modules/Order/payment-utils.d.ts +23 -0
- package/dist/modules/Order/payment-utils.js +203 -0
- package/dist/modules/Order/types.d.ts +33 -1
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
- package/dist/modules/Order/utils.d.ts +2 -1
- package/dist/modules/Order/utils.js +6 -12
- package/dist/modules/Payment/index.d.ts +2 -0
- package/dist/modules/Payment/index.js +78 -49
- package/dist/modules/Payment/types.d.ts +26 -24
- package/dist/modules/Payment/types.js +2 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/server/index.d.ts +14 -0
- package/dist/server/index.js +1826 -1000
- package/dist/server/modules/order/index.d.ts +47 -4
- package/dist/server/modules/order/index.js +1415 -711
- package/dist/server/modules/order/types.d.ts +11 -3
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +40 -4
- package/dist/solution/BaseSales/index.js +1268 -749
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +9 -4
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +6 -8
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +13 -1
- package/dist/solution/BookingTicket/index.js +2 -1
- package/dist/utils/payment-number.d.ts +9 -0
- package/dist/utils/payment-number.js +69 -0
- package/lib/modules/Order/index.d.ts +32 -8
- package/lib/modules/Order/index.js +270 -64
- package/lib/modules/Order/payment-utils.d.ts +23 -0
- package/lib/modules/Order/payment-utils.js +193 -0
- package/lib/modules/Order/types.d.ts +33 -1
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +415 -0
- package/lib/modules/Order/utils.d.ts +2 -1
- package/lib/modules/Order/utils.js +6 -14
- package/lib/modules/Payment/index.d.ts +2 -0
- package/lib/modules/Payment/index.js +33 -12
- package/lib/modules/Payment/types.d.ts +26 -24
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/server/index.d.ts +14 -0
- package/lib/server/index.js +604 -8
- package/lib/server/modules/order/index.d.ts +47 -4
- package/lib/server/modules/order/index.js +578 -116
- package/lib/server/modules/order/types.d.ts +11 -3
- package/lib/solution/BaseSales/index.d.ts +40 -4
- package/lib/solution/BaseSales/index.js +363 -37
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +9 -4
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -5
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +13 -1
- package/lib/solution/BookingTicket/index.js +2 -1
- package/lib/utils/payment-number.d.ts +9 -0
- package/lib/utils/payment-number.js +64 -0
- package/package.json +1 -1
|
@@ -213,10 +213,12 @@ export interface OrderBookingItem {
|
|
|
213
213
|
[key: string]: unknown;
|
|
214
214
|
}[];
|
|
215
215
|
}
|
|
216
|
-
/** 支付记录 metadata
|
|
216
|
+
/** 支付记录 metadata */
|
|
217
217
|
export interface OrderPaymentMetadata {
|
|
218
|
-
/**
|
|
218
|
+
/** 三方支付交易流水号 */
|
|
219
219
|
unique_payment_number?: string;
|
|
220
|
+
/** 刷卡机设备快照;server 不解析内部字段,仅透传并持久化 */
|
|
221
|
+
card_reader_snapshot?: Record<string, unknown>;
|
|
220
222
|
[key: string]: unknown;
|
|
221
223
|
}
|
|
222
224
|
/**
|
|
@@ -225,6 +227,8 @@ export interface OrderPaymentMetadata {
|
|
|
225
227
|
export interface OrderPaymentItem {
|
|
226
228
|
/** 支付记录 ID;存量/更新时传。来源:OrderPayment.id */
|
|
227
229
|
order_payment_id?: number | null;
|
|
230
|
+
/** 支付项稳定唯一号;历史支付项允许缺失 */
|
|
231
|
+
payment_number?: string;
|
|
228
232
|
/** 支付方式 ID(设备端从本地支付方式配置取详情)。来源:OrderPayment.custom_payment_id */
|
|
229
233
|
custom_payment_id?: number;
|
|
230
234
|
/** 支付方式编码。来源:OrderPayment.payment_method */
|
|
@@ -249,11 +253,13 @@ export interface OrderPaymentItem {
|
|
|
249
253
|
created_at?: string | null;
|
|
250
254
|
/** 手续费配置。来源:OrderPayment.service_charge */
|
|
251
255
|
service_charge?: Record<string, unknown> | null;
|
|
256
|
+
/** 已计算的支付手续费。来源:OrderPayment.service_fee */
|
|
257
|
+
service_fee?: OrderMoneyString;
|
|
252
258
|
/** Wallet Pass 使用单位 */
|
|
253
259
|
wallet_pass_usage_unit?: unknown[] | null;
|
|
254
260
|
/** Wallet Pass 使用值 */
|
|
255
261
|
wallet_pass_use_value?: number | null;
|
|
256
|
-
/**
|
|
262
|
+
/** 元数据;三方支付成功后可含 unique_payment_number */
|
|
257
263
|
metadata?: OrderPaymentMetadata | null;
|
|
258
264
|
}
|
|
259
265
|
/**
|
|
@@ -413,6 +419,8 @@ export interface OrderData {
|
|
|
413
419
|
create_date?: string;
|
|
414
420
|
/** 本地待同步标记:1 表示需要后续同步到云端 */
|
|
415
421
|
need_sync?: 0 | 1 | number;
|
|
422
|
+
/** 本地草稿标记:1 表示仅为 POS 可恢复草稿,不代表已提交云端 */
|
|
423
|
+
is_draft_order?: 0 | 1 | number;
|
|
416
424
|
/** 兼容:部分场景仍使用顶层 total_amount */
|
|
417
425
|
total_amount?: OrderMoneyString | number;
|
|
418
426
|
/** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
|
|
@@ -2,7 +2,7 @@ import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
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, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from '../../modules/Order/types';
|
|
5
|
+
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, 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';
|
|
@@ -24,6 +24,19 @@ 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
|
+
}
|
|
27
40
|
export type BaseSalesPrintLocalOrderReceiptParams = string | number;
|
|
28
41
|
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
29
42
|
protected defaultName: string;
|
|
@@ -49,9 +62,12 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
49
62
|
private queuedAutoPaymentSync;
|
|
50
63
|
private autoPaymentSyncFlushing;
|
|
51
64
|
private autoPaymentSyncTimer;
|
|
52
|
-
private
|
|
65
|
+
private salesDetailLoadInFlightCount;
|
|
66
|
+
private salesDetailLoadSequence;
|
|
67
|
+
private salesDetailHydrateQueue;
|
|
53
68
|
private serverOrderChangeUnsubscribe;
|
|
54
69
|
private serverOrderChangeHydrateInFlight;
|
|
70
|
+
private queuedServerOrderChanges;
|
|
55
71
|
private serverOrderChangeSyncEnabled;
|
|
56
72
|
constructor(name?: string, version?: string);
|
|
57
73
|
/**
|
|
@@ -75,8 +91,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
75
91
|
private logError;
|
|
76
92
|
private isCurrentSalesOrderRecord;
|
|
77
93
|
setServerOrderChangeSyncEnabled(enabled: boolean): void;
|
|
94
|
+
private queueLatestServerOrderChange;
|
|
95
|
+
private drainQueuedServerOrderChanges;
|
|
78
96
|
private syncCurrentSalesDetailFromServerOrderChange;
|
|
79
97
|
private registerServerOrderChangeSync;
|
|
98
|
+
private hydrateLatestLoadedSalesDetail;
|
|
80
99
|
private hydrateOrderPaymentNames;
|
|
81
100
|
get payment(): PaymentModule | undefined;
|
|
82
101
|
private getCurrentOrderCustomerId;
|
|
@@ -122,6 +141,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
122
141
|
*/
|
|
123
142
|
protected readSessionCacheData(): Record<string, any>;
|
|
124
143
|
protected getAppData<T>(key: string): T | undefined;
|
|
144
|
+
private getPaymentNumberDevicePrefixSync;
|
|
145
|
+
private getPaymentNumberDevicePrefixAsync;
|
|
125
146
|
private syncAppDataToTempOrder;
|
|
126
147
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
127
148
|
destroy(): Promise<void>;
|
|
@@ -232,6 +253,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
232
253
|
confirmPendingVoucherPayments?: boolean;
|
|
233
254
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
234
255
|
}): Promise<T>;
|
|
256
|
+
saveSalesOrderDraft<T = any>(params?: {
|
|
257
|
+
platform?: string;
|
|
258
|
+
businessCode?: string;
|
|
259
|
+
channel?: string;
|
|
260
|
+
type?: string;
|
|
261
|
+
enhancePayload?: SubmitPayloadEnhancer;
|
|
262
|
+
}): Promise<T>;
|
|
235
263
|
submitTempOrderAsync<T = any>(params?: {
|
|
236
264
|
payments?: OrderPaymentSource[];
|
|
237
265
|
paymentStatus?: BaseSalesPaymentStatus;
|
|
@@ -250,16 +278,24 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
250
278
|
private queueLatestAutoPaymentSync;
|
|
251
279
|
private scheduleQueuedAutoPaymentSyncFlush;
|
|
252
280
|
private flushQueuedAutoPaymentSync;
|
|
253
|
-
/**
|
|
281
|
+
/**
|
|
282
|
+
* 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
|
|
283
|
+
*/
|
|
254
284
|
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
285
|
+
/** 创建新支付项时读取最新设备短号,不缓存运行时设备信息。 */
|
|
286
|
+
addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
|
|
287
|
+
private addOrderPaymentWithDevicePrefix;
|
|
255
288
|
/** 更新当前订单中的指定支付项。 */
|
|
256
|
-
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any
|
|
289
|
+
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>, options?: BaseSalesUpdateOrderPaymentOptions): Promise<BaseSalesUpdateOrderPaymentResult>;
|
|
257
290
|
/** 删除当前订单中的指定支付项。 */
|
|
258
291
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
259
292
|
/** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
|
|
260
293
|
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
261
294
|
status?: 'paid' | 'payment_pending';
|
|
262
295
|
}): OrderPaymentData[];
|
|
296
|
+
updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
|
|
297
|
+
status?: 'paid' | 'payment_pending';
|
|
298
|
+
}): Promise<OrderPaymentData[]>;
|
|
263
299
|
confirmPendingVoucherPayments(): OrderPaymentData[];
|
|
264
300
|
discardPendingVoucherPayments(): OrderPaymentData[];
|
|
265
301
|
private getWalletProductList;
|