@pisell/pisellos 2.3.37 → 2.3.38
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 +2 -0
- package/dist/core/index.js +7 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
- package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/dist/model/strategy/adapter/promotion/examples.js +99 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/dist/model/strategy/adapter/promotion/type.js +45 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -3
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -3
- package/dist/modules/OpenData/index.d.ts +2 -0
- package/dist/modules/OpenData/index.js +8 -0
- package/dist/modules/Order/index.js +21 -14
- package/dist/modules/Order/utils.js +2 -1
- package/dist/modules/Payment/index.js +1 -1
- package/dist/modules/Payment/types.d.ts +73 -4
- package/dist/modules/Payment/types.js +18 -3
- package/dist/modules/Payment/walletpass.d.ts +25 -1
- package/dist/modules/Payment/walletpass.js +707 -157
- package/dist/modules/Rules/index.d.ts +1 -0
- package/dist/modules/Rules/index.js +75 -49
- package/dist/server/index.js +19 -18
- package/dist/server/modules/order/index.d.ts +5 -0
- package/dist/server/modules/order/index.js +52 -31
- package/dist/solution/BaseSales/index.d.ts +77 -11
- package/dist/solution/BaseSales/index.js +1322 -297
- package/dist/solution/BaseSales/types.d.ts +52 -0
- package/dist/solution/BaseSales/types.js +2 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/dist/solution/BaseSales/utils/cartPromotion.js +90 -31
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +7 -3
- package/dist/solution/BookingTicket/index.js +130 -48
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +172 -82
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.js +45 -0
- package/dist/solution/ScanOrder/index.js +31 -20
- package/dist/solution/VenueBooking/index.js +30 -19
- package/dist/types/index.d.ts +1 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/lib/model/strategy/adapter/promotion/examples.js +91 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/lib/model/strategy/adapter/promotion/type.js +2 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
- package/lib/modules/OpenData/index.d.ts +2 -0
- package/lib/modules/OpenData/index.js +5 -0
- package/lib/modules/Order/index.js +10 -4
- package/lib/modules/Order/utils.js +6 -1
- package/lib/modules/Payment/index.js +1 -1
- package/lib/modules/Payment/types.d.ts +73 -4
- package/lib/modules/Payment/types.js +4 -3
- package/lib/modules/Payment/walletpass.d.ts +25 -1
- package/lib/modules/Payment/walletpass.js +470 -21
- package/lib/modules/Rules/index.d.ts +1 -0
- package/lib/modules/Rules/index.js +30 -7
- package/lib/server/index.js +5 -3
- package/lib/server/modules/order/index.d.ts +5 -0
- package/lib/server/modules/order/index.js +24 -2
- package/lib/solution/BaseSales/index.d.ts +77 -11
- package/lib/solution/BaseSales/index.js +682 -39
- package/lib/solution/BaseSales/types.d.ts +52 -0
- package/lib/solution/BaseSales/types.js +2 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.js +63 -12
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +7 -3
- package/lib/solution/BookingTicket/index.js +60 -8
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +36 -4
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +63 -0
- package/lib/solution/ScanOrder/index.js +8 -0
- package/lib/solution/VenueBooking/index.js +8 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
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 } from './types';
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
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';
|
|
@@ -9,7 +9,7 @@ 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 } from '../../modules/Payment/types';
|
|
12
|
+
import type { PaymentMethod, RoundingResult, WalletAssetId, WalletAssetsSnapshot, WalletAssetsState, WalletAssetSelectionSource, ScanWalletAssetResult } 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';
|
|
@@ -48,6 +48,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
48
48
|
protected store: BaseSalesState;
|
|
49
49
|
protected otherParams: Record<string, any>;
|
|
50
50
|
protected cacheId: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* 由已在初始化阶段解析过设备短号的业务解决方案写入。
|
|
53
|
+
* 未设置时,支付编号仍按原逻辑实时读取设备信息。
|
|
54
|
+
*/
|
|
55
|
+
protected paymentNumberDevicePrefix: string | null;
|
|
51
56
|
/**
|
|
52
57
|
* window / request 暴露为 public:现存外部工具(如 BookingTicket Scan)通过
|
|
53
58
|
* `solution.window` / `solution.request` 直接访问插件,保持原有契约不破坏。
|
|
@@ -64,6 +69,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
64
69
|
private autoPaymentSyncTimer;
|
|
65
70
|
private salesDetailLoadInFlightCount;
|
|
66
71
|
private salesDetailLoadSequence;
|
|
72
|
+
private walletAssetsRefreshSequence;
|
|
67
73
|
private salesDetailHydrateQueue;
|
|
68
74
|
private serverOrderChangeUnsubscribe;
|
|
69
75
|
private serverOrderChangeHydrateInFlight;
|
|
@@ -141,6 +147,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
141
147
|
*/
|
|
142
148
|
protected readSessionCacheData(): Record<string, any>;
|
|
143
149
|
protected getAppData<T>(key: string): T | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* 复用业务解决方案初始化时已解析的支付设备短号。
|
|
152
|
+
* 空值会清除缓存,使后续支付恢复实时读取设备信息的兼容路径。
|
|
153
|
+
*/
|
|
154
|
+
protected setPaymentNumberDevicePrefix(prefix: unknown): void;
|
|
144
155
|
private getPaymentNumberDevicePrefixSync;
|
|
145
156
|
private getPaymentNumberDevicePrefixAsync;
|
|
146
157
|
private syncAppDataToTempOrder;
|
|
@@ -284,7 +295,10 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
284
295
|
* 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
|
|
285
296
|
*/
|
|
286
297
|
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
287
|
-
/**
|
|
298
|
+
/**
|
|
299
|
+
* 创建新支付项时优先使用业务解决方案初始化阶段缓存的设备短号;
|
|
300
|
+
* 未缓存的通用 BaseSales 保持实时读取设备信息的兼容语义。
|
|
301
|
+
*/
|
|
288
302
|
addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
|
|
289
303
|
private addOrderPaymentWithDevicePrefix;
|
|
290
304
|
/** 更新当前订单中的指定支付项。 */
|
|
@@ -301,9 +315,38 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
301
315
|
confirmPendingVoucherPayments(): OrderPaymentData[];
|
|
302
316
|
discardPendingVoucherPayments(): OrderPaymentData[];
|
|
303
317
|
private getWalletProductList;
|
|
318
|
+
private buildWalletInitBusinessData;
|
|
304
319
|
initWalletData(params?: {
|
|
305
320
|
order_wait_pay_amount?: number;
|
|
306
321
|
}): 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>;
|
|
307
350
|
/**
|
|
308
351
|
* 更新当前订单客户字段。
|
|
309
352
|
*
|
|
@@ -320,16 +363,39 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
320
363
|
getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
|
|
321
364
|
/** 同步读取初始化时缓存的支付方式列表。 */
|
|
322
365
|
getPaymentMethods(): PaymentMethod[];
|
|
323
|
-
|
|
366
|
+
private findCashPaymentMethod;
|
|
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
|
+
*/
|
|
324
396
|
roundAmount(params: {
|
|
325
397
|
amount: string | number;
|
|
326
|
-
|
|
327
|
-
rule?: 'standard_rounding' | 'standard_down' | 'always_up' | 'always_down' | string;
|
|
328
|
-
}): {
|
|
329
|
-
originalAmount: string;
|
|
330
|
-
roundedAmount: string;
|
|
331
|
-
roundingDifference: string;
|
|
332
|
-
};
|
|
398
|
+
}): Promise<RoundingResult>;
|
|
333
399
|
/**
|
|
334
400
|
* 发送支付链接。
|
|
335
401
|
*
|