@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
@@ -40,11 +40,11 @@ export declare enum RoundingRule {
40
40
  /** 标准舍入(中点向上) */
41
41
  Standard = "standard_rounding",
42
42
  /** 标准舍入(中点向下) */
43
- StandardDown = "standard_down",
43
+ StandardDown = "standard_rounding_midpoint_down",
44
44
  /** 总是向上舍入 */
45
- AlwaysUp = "always_up",
45
+ AlwaysUp = "round_up",
46
46
  /** 总是向下舍入 */
47
- AlwaysDown = "always_down"
47
+ AlwaysDown = "round_down"
48
48
  }
49
49
  /**
50
50
  * 舍入结果
@@ -87,30 +87,12 @@ export interface PaymentMethod {
87
87
  /** 其他配置信息 */
88
88
  [key: string]: any;
89
89
  }
90
- /** 支付项扩展元数据 */
91
- export interface PaymentItemMetadata {
92
- /** 钱箱 ID */
93
- shop_wallet_pass_id?: string;
94
- /** 三方支付交易流水号 */
95
- unique_payment_number?: string;
96
- /** 刷卡机设备快照;PaymentModule 不解析内部字段 */
97
- card_reader_snapshot?: Record<string, unknown>;
98
- /** rounding 规则 */
99
- rounding_rule?: any;
100
- /** 实付金额(现金支付时的实际给出金额) */
101
- actual_paid_amount?: number;
102
- /** 找零金额(现金支付时的找零金额) */
103
- change_given_amount?: number;
104
- [key: string]: unknown;
105
- }
106
90
  /**
107
91
  * 支付项
108
92
  */
109
93
  export interface PaymentItem {
110
94
  /** 当前支付项的唯一 ID */
111
95
  uuid: string;
112
- /** 支付项稳定唯一号 */
113
- payment_number?: string;
114
96
  /** 当前支付方式付出去多少钱 */
115
97
  amount: string;
116
98
  /** 支付类型,跟支付列表上对应的支付方式保持一致 */
@@ -128,7 +110,18 @@ export interface PaymentItem {
128
110
  /** Wallet Pass 本次使用值 */
129
111
  wallet_pass_use_value?: string | number | null;
130
112
  /** 拓展参数字段 */
131
- metadata?: PaymentItemMetadata;
113
+ metadata?: {
114
+ /** 钱箱 ID */
115
+ shop_wallet_pass_id?: string;
116
+ /** 唯一支付号 */
117
+ unique_payment_number?: string;
118
+ /** rouding规则 */
119
+ rounding_rule?: any;
120
+ /** 实付金额(现金支付时的实际给出金额) */
121
+ actual_paid_amount?: number;
122
+ /** 找零金额(现金支付时的找零金额) */
123
+ change_given_amount?: number;
124
+ };
132
125
  /** rouding金额 */
133
126
  rounding_amount?: string;
134
127
  /** 三方支付手续费 */
@@ -235,10 +228,6 @@ export interface UpdateOrderParams {
235
228
  * 支付项输入类型(允许 amount 为数字)
236
229
  */
237
230
  export interface PaymentItemInput {
238
- /** 调用方已有的支付项运行态 UUID;存在时复用为 payment_number 的唯一号段 */
239
- uuid?: string;
240
- /** 支付项稳定唯一号 */
241
- payment_number?: string;
242
231
  /** 当前支付方式付出去多少钱 */
243
232
  amount: string | number;
244
233
  /** 支付类型,跟支付列表上对应的支付方式保持一致 */
@@ -267,7 +256,18 @@ export interface PaymentItemInput {
267
256
  /** 订单支付类型 */
268
257
  order_payment_type?: 'normal' | 'deposit';
269
258
  /** 扩展参数字段 */
270
- metadata?: PaymentItemMetadata;
259
+ metadata?: {
260
+ /** 钱箱 ID */
261
+ shop_wallet_pass_id?: string;
262
+ /** 唯一支付号 */
263
+ unique_payment_number?: string;
264
+ /** rounding规则 */
265
+ rounding_rule?: any;
266
+ /** 实付金额(现金支付时的实际给出金额) */
267
+ actual_paid_amount?: number;
268
+ /** 找零金额(现金支付时的找零金额) */
269
+ change_given_amount?: number;
270
+ };
271
271
  /** 支付项创建时间 (格式: YYYY-MM-DD HH:mm:ss, 可选,不传则自动生成) */
272
272
  created_at?: string;
273
273
  /** 支付项更新时间 (格式: YYYY-MM-DD HH:mm:ss, 可选,不传则自动生成) */
@@ -302,8 +302,6 @@ export interface PaymentUpdateFields {
302
302
  voucher_id?: string;
303
303
  /** 该支付项是否已经同步给后端服务器(只有网络请求成功后才为true) */
304
304
  isSynced?: boolean;
305
- /** 支付项扩展元数据;更新时与原 metadata 浅合并 */
306
- metadata?: PaymentItemMetadata;
307
305
  /** 同步错误信息(业务错误时记录错误信息,用于区分"未同步"和"同步失败") */
308
306
  syncError?: {
309
307
  error: string;
@@ -51,9 +51,9 @@ var TaskRunStatus = /* @__PURE__ */ ((TaskRunStatus2) => {
51
51
  })(TaskRunStatus || {});
52
52
  var RoundingRule = /* @__PURE__ */ ((RoundingRule2) => {
53
53
  RoundingRule2["Standard"] = "standard_rounding";
54
- RoundingRule2["StandardDown"] = "standard_down";
55
- RoundingRule2["AlwaysUp"] = "always_up";
56
- RoundingRule2["AlwaysDown"] = "always_down";
54
+ RoundingRule2["StandardDown"] = "standard_rounding_midpoint_down";
55
+ RoundingRule2["AlwaysUp"] = "round_up";
56
+ RoundingRule2["AlwaysDown"] = "round_down";
57
57
  return RoundingRule2;
58
58
  })(RoundingRule || {});
59
59
  var RoundingInterval = /* @__PURE__ */ ((RoundingInterval2) => {
@@ -57,7 +57,6 @@ declare class Server {
57
57
  private readonly BOOKING_REMOTE_CACHE_MAX_ENTRIES;
58
58
  private salesSearchSubscribers;
59
59
  private deviceTaskActionsRegistered;
60
- private localPaymentUpdateQueues;
61
60
  private floorPlanQuerySubscribers;
62
61
  private moduleRegistry;
63
62
  constructor(core: PisellCore);
@@ -121,8 +120,6 @@ declare class Server {
121
120
  private handleSyncSalesTask;
122
121
  private runCheckoutSync;
123
122
  private omitCheckoutSyncMode;
124
- private buildRemoteCheckoutData;
125
- private mergeCheckoutSyncPayments;
126
123
  private persistSyncedCheckoutOrder;
127
124
  /**
128
125
  * 将普通层 QuotationModule 的报价单计算能力桥接到 Server Products 模块。
@@ -456,18 +453,6 @@ declare class Server {
456
453
  */
457
454
  private handleUpdateLocalOrder;
458
455
  private handleOrderSalesCheckout;
459
- private handleOrderSalesDraft;
460
- private createLocalPaymentOperationId;
461
- private buildLocalPaymentOrderLogContext;
462
- private isValidLocalPaymentDecimal;
463
- private getInvalidLocalPaymentSurchargeFields;
464
- private buildLocalPaymentSurchargeUpdate;
465
- private handleGetLocalPayment;
466
- private handleUpdateLocalPayment;
467
- private runLocalPaymentUpdateInQueue;
468
- private processLocalPaymentUpdate;
469
- private processSuccessfulLocalPayment;
470
- private sanitizeLocalRecoveryOrder;
471
456
  private handleOrderCheckout;
472
457
  private getDeviceTaskPlugin;
473
458
  private getIdGeneratorPlugin;
@@ -495,7 +480,6 @@ declare class Server {
495
480
  private syncMachinecodeRedeemStatusToLocalOrder;
496
481
  private handleOrderCheckoutSubmit;
497
482
  private handleSyncCheckoutSubmit;
498
- private handleOrderDraftSubmit;
499
483
  private handlePendingSyncCheckoutOrder;
500
484
  private buildPendingSyncCheckoutOrder;
501
485
  private shouldBuildSmallTicketData;