@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.
Files changed (82) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/inventory/index.d.ts +92 -0
  4. package/dist/inventory/index.js +509 -0
  5. package/dist/model/strategy/adapter/promotion/evaluator.js +5 -4
  6. package/dist/modules/Discount/index.js +1 -0
  7. package/dist/modules/Discount/types.d.ts +4 -0
  8. package/dist/modules/Order/index.d.ts +25 -3
  9. package/dist/modules/Order/index.js +1791 -1318
  10. package/dist/modules/Order/types.d.ts +7 -0
  11. package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
  12. package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
  13. package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
  14. package/dist/modules/Payment/walletpass.js +32 -6
  15. package/dist/modules/Product/index.d.ts +1 -1
  16. package/dist/modules/ProductList/index.js +33 -12
  17. package/dist/modules/Rules/index.d.ts +5 -10
  18. package/dist/modules/Rules/index.js +197 -107
  19. package/dist/modules/Rules/promotionSelection.d.ts +14 -0
  20. package/dist/modules/Rules/promotionSelection.js +390 -0
  21. package/dist/modules/Rules/types.d.ts +9 -0
  22. package/dist/server/modules/order/index.d.ts +6 -0
  23. package/dist/server/modules/order/index.js +782 -447
  24. package/dist/solution/BaseSales/index.d.ts +16 -1
  25. package/dist/solution/BaseSales/index.js +1545 -1339
  26. package/dist/solution/BaseSales/utils/cartPromotion.js +5 -2
  27. package/dist/solution/BookingByStep/index.d.ts +2 -2
  28. package/dist/solution/BookingTicket/index.js +200 -108
  29. package/dist/solution/BookingTicket/types.d.ts +14 -2
  30. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  31. package/dist/solution/BookingTicket/utils/addProductDecision.js +4 -3
  32. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +94 -58
  33. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
  34. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +117 -0
  35. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  36. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  37. package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
  38. package/dist/solution/UnifiedBookingSales/index.js +69 -49
  39. package/dist/utils/platform.d.ts +2 -0
  40. package/dist/utils/platform.js +6 -0
  41. package/lib/index.d.ts +1 -0
  42. package/lib/index.js +12 -0
  43. package/lib/inventory/index.d.ts +92 -0
  44. package/lib/inventory/index.js +287 -0
  45. package/lib/model/strategy/adapter/promotion/evaluator.js +5 -4
  46. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  47. package/lib/modules/Discount/index.js +1 -0
  48. package/lib/modules/Discount/types.d.ts +4 -0
  49. package/lib/modules/Order/index.d.ts +25 -3
  50. package/lib/modules/Order/index.js +203 -38
  51. package/lib/modules/Order/types.d.ts +7 -0
  52. package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
  53. package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
  54. package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
  55. package/lib/modules/Payment/walletpass.js +23 -1
  56. package/lib/modules/Product/index.d.ts +1 -1
  57. package/lib/modules/ProductList/index.js +15 -0
  58. package/lib/modules/Rules/index.d.ts +5 -10
  59. package/lib/modules/Rules/index.js +68 -22
  60. package/lib/modules/Rules/promotionSelection.d.ts +14 -0
  61. package/lib/modules/Rules/promotionSelection.js +230 -0
  62. package/lib/modules/Rules/types.d.ts +9 -0
  63. package/lib/server/modules/order/index.d.ts +6 -0
  64. package/lib/server/modules/order/index.js +226 -29
  65. package/lib/solution/BaseSales/index.d.ts +16 -1
  66. package/lib/solution/BaseSales/index.js +108 -14
  67. package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
  68. package/lib/solution/BookingByStep/index.d.ts +2 -2
  69. package/lib/solution/BookingTicket/index.js +38 -2
  70. package/lib/solution/BookingTicket/types.d.ts +14 -2
  71. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  72. package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -3
  73. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +14 -2
  74. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
  75. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +71 -0
  76. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  77. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  78. package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
  79. package/lib/solution/UnifiedBookingSales/index.js +14 -3
  80. package/lib/utils/platform.d.ts +2 -0
  81. package/lib/utils/platform.js +7 -0
  82. 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): Promise<BaseSalesScanCodeResult>;
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[]>;