@pisell/pisellos 2.3.170 → 2.3.172
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/inventory/index.d.ts +92 -0
- package/dist/inventory/index.js +509 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +5 -4
- package/dist/modules/Discount/index.js +1 -0
- package/dist/modules/Discount/types.d.ts +4 -0
- package/dist/modules/Order/index.d.ts +25 -3
- package/dist/modules/Order/index.js +1791 -1318
- package/dist/modules/Order/types.d.ts +7 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
- package/dist/modules/Payment/walletpass.js +32 -6
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +33 -12
- package/dist/modules/Rules/index.d.ts +5 -10
- package/dist/modules/Rules/index.js +197 -107
- package/dist/modules/Rules/promotionSelection.d.ts +14 -0
- package/dist/modules/Rules/promotionSelection.js +390 -0
- package/dist/modules/Rules/types.d.ts +9 -0
- package/dist/server/modules/order/index.d.ts +6 -0
- package/dist/server/modules/order/index.js +782 -447
- package/dist/solution/BaseSales/index.d.ts +16 -1
- package/dist/solution/BaseSales/index.js +1545 -1339
- package/dist/solution/BaseSales/utils/cartPromotion.js +5 -2
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.js +200 -108
- package/dist/solution/BookingTicket/types.d.ts +14 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +94 -58
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +117 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.js +69 -49
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.js +6 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +12 -0
- package/lib/inventory/index.d.ts +92 -0
- package/lib/inventory/index.js +287 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +5 -4
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/Discount/index.js +1 -0
- package/lib/modules/Discount/types.d.ts +4 -0
- package/lib/modules/Order/index.d.ts +25 -3
- package/lib/modules/Order/index.js +203 -38
- package/lib/modules/Order/types.d.ts +7 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
- package/lib/modules/Payment/walletpass.js +23 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +15 -0
- package/lib/modules/Rules/index.d.ts +5 -10
- package/lib/modules/Rules/index.js +68 -22
- package/lib/modules/Rules/promotionSelection.d.ts +14 -0
- package/lib/modules/Rules/promotionSelection.js +230 -0
- package/lib/modules/Rules/types.d.ts +9 -0
- package/lib/server/modules/order/index.d.ts +6 -0
- package/lib/server/modules/order/index.js +226 -29
- package/lib/solution/BaseSales/index.d.ts +16 -1
- package/lib/solution/BaseSales/index.js +108 -14
- package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.js +38 -2
- package/lib/solution/BookingTicket/types.d.ts +14 -2
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +14 -2
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +71 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.js +14 -3
- package/lib/utils/platform.d.ts +2 -0
- package/lib/utils/platform.js +7 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InventoryController, type CheckoutRuntimeSnapshot } from '../../inventory';
|
|
1
2
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
3
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
4
|
import { type LocalEftposFinalization } from '../../modules/Order/localEftposState';
|
|
@@ -52,6 +53,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
52
53
|
protected appPlugin: AppPlugin;
|
|
53
54
|
protected store: BaseSalesState;
|
|
54
55
|
protected otherParams: Record<string, any>;
|
|
56
|
+
getInventory(): InventoryController | undefined;
|
|
57
|
+
prepareCheckout(signal?: AbortSignal): Promise<CheckoutRuntimeSnapshot | undefined>;
|
|
55
58
|
protected cacheId: string | undefined;
|
|
56
59
|
/**
|
|
57
60
|
* 由已在初始化阶段解析过设备短号的业务解决方案写入。
|
|
@@ -194,6 +197,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
194
197
|
* 可覆盖此方法并把未识别的 name 委托给 `super.createSubModule(name)`。
|
|
195
198
|
*/
|
|
196
199
|
protected createSubModule(moduleName: string): Module | null;
|
|
200
|
+
private inventoryOrderHooks?;
|
|
197
201
|
protected getSubModuleHooks(moduleName: string): any;
|
|
198
202
|
/**
|
|
199
203
|
* 构造传给 BaseSales 子模块的完整运行态参数,保证初始化和后续同步语义一致。
|
|
@@ -231,7 +235,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
231
235
|
private isActiveVirtualSettlementOrder;
|
|
232
236
|
private isHistoricalVirtualSettlementOrder;
|
|
233
237
|
private syncAppDataToTempOrder;
|
|
238
|
+
private initialization?;
|
|
239
|
+
/** Hosts can await readiness without changing Core's synchronous registration API. */
|
|
240
|
+
whenInitialized(): Promise<void>;
|
|
234
241
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
242
|
+
private initializeSalesRuntime;
|
|
235
243
|
destroy(): Promise<void>;
|
|
236
244
|
/**
|
|
237
245
|
* 加载销售订单到统一 tempOrder 工作区。
|
|
@@ -340,7 +348,9 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
340
348
|
discountList: Discount[];
|
|
341
349
|
originalDiscountList?: Discount[];
|
|
342
350
|
}): Promise<void>;
|
|
343
|
-
scanPromotionCode(code: string, customerId?: number
|
|
351
|
+
scanPromotionCode(code: string, customerId?: number, options?: {
|
|
352
|
+
productVouchersOnly?: boolean;
|
|
353
|
+
}): Promise<BaseSalesScanCodeResult>;
|
|
344
354
|
setDiscountSelected(params: {
|
|
345
355
|
discountId: number;
|
|
346
356
|
isSelected: boolean;
|
|
@@ -525,6 +535,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
525
535
|
private hasSmartPricingStrategies;
|
|
526
536
|
shouldRecalculateProductBookingPricesForContextChange(params: BaseSalesPriceRecalculationContextChange): boolean;
|
|
527
537
|
calculateProductBookingPrices(paramsList: BaseSalesCalculateProductBookingPriceParams[]): Promise<BaseSalesProductBookingPriceResult[]>;
|
|
538
|
+
setProductVoucherGroups(groups: Array<{
|
|
539
|
+
key: string;
|
|
540
|
+
discountIds: Array<number | string>;
|
|
541
|
+
}>): void;
|
|
542
|
+
validateProductVoucherSelection(): void;
|
|
528
543
|
addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
529
544
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
530
545
|
updateOrderProducts(paramsList: UpdateOrderProductParams[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
|