@pisell/pisellos 2.3.29 → 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.
Files changed (98) hide show
  1. package/dist/model/strategy/adapter/index.d.ts +0 -4
  2. package/dist/model/strategy/adapter/index.js +1 -5
  3. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  4. package/dist/modules/Discount/index.d.ts +2 -5
  5. package/dist/modules/Discount/index.js +7 -30
  6. package/dist/modules/Discount/types.d.ts +0 -4
  7. package/dist/modules/Order/index.d.ts +28 -10
  8. package/dist/modules/Order/index.js +747 -498
  9. package/dist/modules/Order/payment-utils.d.ts +23 -0
  10. package/dist/modules/Order/payment-utils.js +203 -0
  11. package/dist/modules/Order/types.d.ts +33 -3
  12. package/dist/modules/Order/utils.js +4 -4
  13. package/dist/modules/Payment/index.d.ts +2 -0
  14. package/dist/modules/Payment/index.js +78 -49
  15. package/dist/modules/Payment/types.d.ts +26 -24
  16. package/dist/modules/Payment/types.js +2 -0
  17. package/dist/modules/Product/index.d.ts +1 -1
  18. package/dist/modules/Product/types.d.ts +0 -22
  19. package/dist/modules/ProductList/index.d.ts +1 -1
  20. package/dist/modules/ProductList/index.js +2 -4
  21. package/dist/modules/ProductList/types.d.ts +0 -2
  22. package/dist/server/index.d.ts +14 -50
  23. package/dist/server/index.js +1975 -1395
  24. package/dist/server/modules/order/index.d.ts +40 -3
  25. package/dist/server/modules/order/index.js +1200 -501
  26. package/dist/server/modules/order/types.d.ts +11 -3
  27. package/dist/server/modules/order/types.js +1 -1
  28. package/dist/server/modules/products/index.d.ts +7 -26
  29. package/dist/server/modules/products/index.js +76 -167
  30. package/dist/server/modules/products/types.d.ts +0 -14
  31. package/dist/solution/BaseSales/index.d.ts +33 -5
  32. package/dist/solution/BaseSales/index.js +622 -345
  33. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  34. package/dist/solution/BookingByStep/index.d.ts +1 -1
  35. package/dist/solution/BookingTicket/index.d.ts +1 -1
  36. package/dist/solution/BookingTicket/index.js +2 -1
  37. package/dist/solution/BookingTicket/types.d.ts +0 -2
  38. package/dist/solution/ShopDiscount/index.js +14 -15
  39. package/dist/utils/payment-number.d.ts +9 -0
  40. package/dist/utils/payment-number.js +69 -0
  41. package/lib/model/strategy/adapter/index.d.ts +0 -4
  42. package/lib/model/strategy/adapter/index.js +2 -13
  43. package/lib/modules/Discount/index.d.ts +2 -5
  44. package/lib/modules/Discount/index.js +3 -23
  45. package/lib/modules/Discount/types.d.ts +0 -4
  46. package/lib/modules/Order/index.d.ts +28 -10
  47. package/lib/modules/Order/index.js +181 -73
  48. package/lib/modules/Order/payment-utils.d.ts +23 -0
  49. package/lib/modules/Order/payment-utils.js +193 -0
  50. package/lib/modules/Order/types.d.ts +33 -3
  51. package/lib/modules/Order/utils.js +2 -3
  52. package/lib/modules/Payment/index.d.ts +2 -0
  53. package/lib/modules/Payment/index.js +33 -12
  54. package/lib/modules/Payment/types.d.ts +26 -24
  55. package/lib/modules/Product/index.d.ts +1 -1
  56. package/lib/modules/Product/types.d.ts +0 -22
  57. package/lib/modules/ProductList/index.d.ts +1 -1
  58. package/lib/modules/ProductList/index.js +2 -4
  59. package/lib/modules/ProductList/types.d.ts +0 -2
  60. package/lib/server/index.d.ts +14 -50
  61. package/lib/server/index.js +633 -214
  62. package/lib/server/modules/order/index.d.ts +40 -3
  63. package/lib/server/modules/order/index.js +434 -31
  64. package/lib/server/modules/order/types.d.ts +11 -3
  65. package/lib/server/modules/products/index.d.ts +7 -26
  66. package/lib/server/modules/products/index.js +35 -114
  67. package/lib/server/modules/products/types.d.ts +0 -14
  68. package/lib/solution/BaseSales/index.d.ts +33 -5
  69. package/lib/solution/BaseSales/index.js +170 -19
  70. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  71. package/lib/solution/BookingByStep/index.d.ts +1 -1
  72. package/lib/solution/BookingTicket/index.d.ts +1 -1
  73. package/lib/solution/BookingTicket/index.js +2 -1
  74. package/lib/solution/BookingTicket/types.d.ts +0 -2
  75. package/lib/solution/ShopDiscount/index.js +1 -2
  76. package/lib/utils/payment-number.d.ts +9 -0
  77. package/lib/utils/payment-number.js +64 -0
  78. package/package.json +1 -1
  79. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  80. package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
  81. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  82. package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -780
  83. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  84. package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
  85. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  86. package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
  87. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  88. package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
  89. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  90. package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
  91. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  92. package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -583
  93. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  94. package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
  95. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  96. package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
  97. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  98. package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
@@ -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;
@@ -128,6 +141,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
128
141
  */
129
142
  protected readSessionCacheData(): Record<string, any>;
130
143
  protected getAppData<T>(key: string): T | undefined;
144
+ private getPaymentNumberDevicePrefixSync;
145
+ private getPaymentNumberDevicePrefixAsync;
131
146
  private syncAppDataToTempOrder;
132
147
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
133
148
  destroy(): Promise<void>;
@@ -193,9 +208,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
193
208
  }): Promise<{
194
209
  productList: Record<string, any>[];
195
210
  discountList: Discount[];
196
- availableWalletIds: number[];
197
211
  }>;
198
- getAvailableWalletIds(): number[];
199
212
  bestDiscount(cb?: (result: any) => void): Promise<{
200
213
  productList: Record<string, any>[];
201
214
  discountList: Discount[];
@@ -240,6 +253,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
240
253
  confirmPendingVoucherPayments?: boolean;
241
254
  enhancePayload?: SubmitPayloadEnhancer;
242
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>;
243
263
  submitTempOrderAsync<T = any>(params?: {
244
264
  payments?: OrderPaymentSource[];
245
265
  paymentStatus?: BaseSalesPaymentStatus;
@@ -258,16 +278,24 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
258
278
  private queueLatestAutoPaymentSync;
259
279
  private scheduleQueuedAutoPaymentSyncFlush;
260
280
  private flushQueuedAutoPaymentSync;
261
- /** 追加单个支付项到当前订单。 */
281
+ /**
282
+ * 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
283
+ */
262
284
  addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
285
+ /** 创建新支付项时读取最新设备短号,不缓存运行时设备信息。 */
286
+ addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
287
+ private addOrderPaymentWithDevicePrefix;
263
288
  /** 更新当前订单中的指定支付项。 */
264
- updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
289
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>, options?: BaseSalesUpdateOrderPaymentOptions): Promise<BaseSalesUpdateOrderPaymentResult>;
265
290
  /** 删除当前订单中的指定支付项。 */
266
291
  deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
267
292
  /** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
268
293
  updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
269
294
  status?: 'paid' | 'payment_pending';
270
295
  }): OrderPaymentData[];
296
+ updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
297
+ status?: 'paid' | 'payment_pending';
298
+ }): Promise<OrderPaymentData[]>;
271
299
  confirmPendingVoucherPayments(): OrderPaymentData[];
272
300
  discardPendingVoucherPayments(): OrderPaymentData[];
273
301
  private getWalletProductList;