@pisell/pisellos 2.2.265 → 2.2.267

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 (66) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -3
  3. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -3
  4. package/dist/modules/Order/index.d.ts +8 -27
  5. package/dist/modules/Order/index.js +490 -743
  6. package/dist/modules/Order/types.d.ts +1 -33
  7. package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
  8. package/dist/modules/Order/utils.js +5 -8
  9. package/dist/modules/Payment/index.d.ts +0 -2
  10. package/dist/modules/Payment/index.js +50 -79
  11. package/dist/modules/Payment/types.d.ts +27 -29
  12. package/dist/modules/Payment/types.js +3 -5
  13. package/dist/server/index.d.ts +0 -16
  14. package/dist/server/index.js +1036 -1933
  15. package/dist/server/modules/order/index.d.ts +4 -49
  16. package/dist/server/modules/order/index.js +695 -1574
  17. package/dist/server/modules/order/types.d.ts +3 -11
  18. package/dist/server/modules/order/types.js +1 -1
  19. package/dist/solution/BaseSales/index.d.ts +11 -42
  20. package/dist/solution/BaseSales/index.js +385 -676
  21. package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
  22. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  23. package/dist/solution/BookingTicket/index.d.ts +1 -1
  24. package/dist/solution/BookingTicket/index.js +1 -2
  25. package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -0
  26. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  27. package/dist/solution/BookingTicket/utils/weighingProductSku.js +45 -0
  28. package/dist/solution/Sales/index.d.ts +0 -1
  29. package/dist/solution/Sales/index.js +2 -10
  30. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  31. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
  32. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
  33. package/lib/modules/Order/index.d.ts +8 -27
  34. package/lib/modules/Order/index.js +69 -184
  35. package/lib/modules/Order/types.d.ts +1 -33
  36. package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
  37. package/lib/modules/Order/utils.js +3 -5
  38. package/lib/modules/Payment/index.d.ts +0 -2
  39. package/lib/modules/Payment/index.js +13 -34
  40. package/lib/modules/Payment/types.d.ts +27 -29
  41. package/lib/modules/Payment/types.js +3 -3
  42. package/lib/server/index.d.ts +0 -16
  43. package/lib/server/index.js +18 -670
  44. package/lib/server/modules/order/index.d.ts +4 -49
  45. package/lib/server/modules/order/index.js +66 -657
  46. package/lib/server/modules/order/types.d.ts +3 -11
  47. package/lib/solution/BaseSales/index.d.ts +11 -42
  48. package/lib/solution/BaseSales/index.js +35 -214
  49. package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
  50. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  51. package/lib/solution/BookingTicket/index.d.ts +1 -1
  52. package/lib/solution/BookingTicket/index.js +1 -2
  53. package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -0
  54. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  55. package/lib/solution/BookingTicket/utils/weighingProductSku.js +63 -0
  56. package/lib/solution/Sales/index.d.ts +0 -1
  57. package/lib/solution/Sales/index.js +3 -5
  58. package/package.json +2 -2
  59. package/dist/modules/Order/payment-utils.d.ts +0 -26
  60. package/dist/modules/Order/payment-utils.js +0 -225
  61. package/dist/utils/payment-number.d.ts +0 -9
  62. package/dist/utils/payment-number.js +0 -69
  63. package/lib/modules/Order/payment-utils.d.ts +0 -26
  64. package/lib/modules/Order/payment-utils.js +0 -224
  65. package/lib/utils/payment-number.d.ts +0 -9
  66. package/lib/utils/payment-number.js +0 -64
@@ -213,12 +213,10 @@ export interface OrderBookingItem {
213
213
  [key: string]: unknown;
214
214
  }[];
215
215
  }
216
- /** 支付记录 metadata */
216
+ /** 支付记录 metadata,常含 unique_payment_number */
217
217
  export interface OrderPaymentMetadata {
218
- /** 三方支付交易流水号 */
218
+ /** 设备端本地支付唯一标识 */
219
219
  unique_payment_number?: string;
220
- /** 刷卡机设备快照;server 不解析内部字段,仅透传并持久化 */
221
- card_reader_snapshot?: Record<string, unknown>;
222
220
  [key: string]: unknown;
223
221
  }
224
222
  /**
@@ -227,8 +225,6 @@ export interface OrderPaymentMetadata {
227
225
  export interface OrderPaymentItem {
228
226
  /** 支付记录 ID;存量/更新时传。来源:OrderPayment.id */
229
227
  order_payment_id?: number | null;
230
- /** 支付项稳定唯一号;历史支付项允许缺失 */
231
- payment_number?: string;
232
228
  /** 支付方式 ID(设备端从本地支付方式配置取详情)。来源:OrderPayment.custom_payment_id */
233
229
  custom_payment_id?: number;
234
230
  /** 支付方式编码。来源:OrderPayment.payment_method */
@@ -253,13 +249,11 @@ export interface OrderPaymentItem {
253
249
  created_at?: string | null;
254
250
  /** 手续费配置。来源:OrderPayment.service_charge */
255
251
  service_charge?: Record<string, unknown> | null;
256
- /** 已计算的支付手续费。来源:OrderPayment.service_fee */
257
- service_fee?: OrderMoneyString;
258
252
  /** Wallet Pass 使用单位 */
259
253
  wallet_pass_usage_unit?: unknown[] | null;
260
254
  /** Wallet Pass 使用值 */
261
255
  wallet_pass_use_value?: number | null;
262
- /** 元数据;三方支付成功后可含 unique_payment_number */
256
+ /** 元数据;含 unique_payment_number。来源:OrderPayment.metadata */
263
257
  metadata?: OrderPaymentMetadata | null;
264
258
  }
265
259
  /**
@@ -419,8 +413,6 @@ export interface OrderData {
419
413
  create_date?: string;
420
414
  /** 本地待同步标记:1 表示需要后续同步到云端 */
421
415
  need_sync?: 0 | 1 | number;
422
- /** 本地草稿标记:1 表示仅为 POS 可恢复草稿,不代表已提交云端 */
423
- is_draft_order?: 0 | 1 | number;
424
416
  /** 兼容:部分场景仍使用顶层 total_amount */
425
417
  total_amount?: OrderMoneyString | number;
426
418
  /** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
@@ -72,7 +72,7 @@
72
72
  // 3.5 payments
73
73
  // ─────────────────────────────────────────────────────────────────
74
74
 
75
- /** 支付记录 metadata */
75
+ /** 支付记录 metadata,常含 unique_payment_number */
76
76
 
77
77
  /**
78
78
  * 支付记录(3.5 payments)
@@ -2,14 +2,14 @@ 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, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from '../../modules/Order/types';
5
+ import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, 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';
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 } 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';
@@ -24,19 +24,6 @@ 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
- }
40
27
  export type BaseSalesPrintLocalOrderReceiptParams = string | number;
41
28
  export declare class BaseSalesImpl extends BaseModule implements Module {
42
29
  protected defaultName: string;
@@ -141,8 +128,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
141
128
  */
142
129
  protected readSessionCacheData(): Record<string, any>;
143
130
  protected getAppData<T>(key: string): T | undefined;
144
- private getPaymentNumberDevicePrefixSync;
145
- private getPaymentNumberDevicePrefixAsync;
146
131
  private syncAppDataToTempOrder;
147
132
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
148
133
  destroy(): Promise<void>;
@@ -255,13 +240,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
255
240
  confirmPendingVoucherPayments?: boolean;
256
241
  enhancePayload?: SubmitPayloadEnhancer;
257
242
  }): Promise<T>;
258
- saveSalesOrderDraft<T = any>(params?: {
259
- platform?: string;
260
- businessCode?: string;
261
- channel?: string;
262
- type?: string;
263
- enhancePayload?: SubmitPayloadEnhancer;
264
- }): Promise<T>;
265
243
  submitTempOrderAsync<T = any>(params?: {
266
244
  payments?: OrderPaymentSource[];
267
245
  paymentStatus?: BaseSalesPaymentStatus;
@@ -280,24 +258,16 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
280
258
  private queueLatestAutoPaymentSync;
281
259
  private scheduleQueuedAutoPaymentSyncFlush;
282
260
  private flushQueuedAutoPaymentSync;
283
- /**
284
- * 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
285
- */
261
+ /** 追加单个支付项到当前订单。 */
286
262
  addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
287
- /** 创建新支付项时读取最新设备短号,不缓存运行时设备信息。 */
288
- addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
289
- private addOrderPaymentWithDevicePrefix;
290
263
  /** 更新当前订单中的指定支付项。 */
291
- updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>, options?: BaseSalesUpdateOrderPaymentOptions): Promise<BaseSalesUpdateOrderPaymentResult>;
264
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
292
265
  /** 删除当前订单中的指定支付项。 */
293
266
  deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
294
267
  /** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
295
268
  updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
296
269
  status?: 'paid' | 'payment_pending';
297
270
  }): OrderPaymentData[];
298
- updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
299
- status?: 'paid' | 'payment_pending';
300
- }): Promise<OrderPaymentData[]>;
301
271
  confirmPendingVoucherPayments(): OrderPaymentData[];
302
272
  discardPendingVoucherPayments(): OrderPaymentData[];
303
273
  private getWalletProductList;
@@ -320,16 +290,15 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
320
290
  getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
321
291
  /** 同步读取初始化时缓存的支付方式列表。 */
322
292
  getPaymentMethods(): PaymentMethod[];
323
- /** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
293
+ /**
294
+ * 按当前店铺的现金舍入配置计算金额,供现金支付 UI 使用。
295
+ *
296
+ * 舍入开关取自 CASHMANUAL 支付方式;舍入规则取自
297
+ * otherParams.order_rounding_setting,金额算法统一由 PaymentModule 维护。
298
+ */
324
299
  roundAmount(params: {
325
300
  amount: string | number;
326
- interval?: string | number;
327
- rule?: 'standard_rounding' | 'standard_down' | 'always_up' | 'always_down' | string;
328
- }): {
329
- originalAmount: string;
330
- roundedAmount: string;
331
- roundingDifference: string;
332
- };
301
+ }): Promise<RoundingResult>;
333
302
  /**
334
303
  * 发送支付链接。
335
304
  *