@pisell/pisellos 2.2.267 → 2.2.269

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 (121) hide show
  1. package/dist/core/index.d.ts +2 -0
  2. package/dist/core/index.js +7 -0
  3. package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  4. package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
  5. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  6. package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
  7. package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
  8. package/dist/model/strategy/adapter/promotion/examples.js +99 -0
  9. package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
  10. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
  12. package/dist/model/strategy/adapter/promotion/type.js +45 -0
  13. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
  14. package/dist/modules/OpenData/index.d.ts +2 -0
  15. package/dist/modules/OpenData/index.js +8 -0
  16. package/dist/modules/Order/index.d.ts +33 -13
  17. package/dist/modules/Order/index.js +883 -524
  18. package/dist/modules/Order/payment-utils.d.ts +26 -0
  19. package/dist/modules/Order/payment-utils.js +225 -0
  20. package/dist/modules/Order/types.d.ts +56 -4
  21. package/dist/modules/Order/types.js +11 -0
  22. package/dist/modules/Order/utils/orderCollectionIdentity.js +7 -2
  23. package/dist/modules/Order/utils.js +10 -6
  24. package/dist/modules/Payment/index.d.ts +2 -0
  25. package/dist/modules/Payment/index.js +78 -49
  26. package/dist/modules/Payment/types.d.ts +104 -25
  27. package/dist/modules/Payment/types.js +17 -0
  28. package/dist/modules/Payment/walletpass.d.ts +38 -1
  29. package/dist/modules/Payment/walletpass.js +917 -114
  30. package/dist/modules/Rules/index.d.ts +3 -0
  31. package/dist/modules/Rules/index.js +146 -106
  32. package/dist/modules/SalesSummary/utils.js +7 -1
  33. package/dist/server/index.d.ts +16 -0
  34. package/dist/server/index.js +1940 -1043
  35. package/dist/server/modules/index.d.ts +1 -1
  36. package/dist/server/modules/order/index.d.ts +70 -4
  37. package/dist/server/modules/order/index.js +1816 -728
  38. package/dist/server/modules/order/types.d.ts +25 -3
  39. package/dist/server/modules/order/types.js +7 -1
  40. package/dist/solution/BaseSales/index.d.ts +118 -9
  41. package/dist/solution/BaseSales/index.js +1849 -480
  42. package/dist/solution/BaseSales/types.d.ts +55 -1
  43. package/dist/solution/BaseSales/types.js +2 -1
  44. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  45. package/dist/solution/BaseSales/utils/cartPromotion.js +90 -31
  46. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  47. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
  48. package/dist/solution/BookingTicket/index.d.ts +8 -16
  49. package/dist/solution/BookingTicket/index.js +138 -52
  50. package/dist/solution/BookingTicket/types.d.ts +4 -0
  51. package/dist/solution/BookingTicket/utils/cartView.js +44 -32
  52. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
  53. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +173 -83
  54. package/dist/solution/Sales/index.d.ts +2 -0
  55. package/dist/solution/Sales/index.js +26 -4
  56. package/dist/solution/ScanOrder/index.js +31 -20
  57. package/dist/solution/VenueBooking/index.d.ts +1 -0
  58. package/dist/solution/VenueBooking/index.js +30 -19
  59. package/dist/types/index.d.ts +1 -0
  60. package/dist/utils/payment-number.d.ts +9 -0
  61. package/dist/utils/payment-number.js +69 -0
  62. package/lib/core/index.d.ts +2 -0
  63. package/lib/core/index.js +4 -0
  64. package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  65. package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
  66. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  67. package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
  68. package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
  69. package/lib/model/strategy/adapter/promotion/examples.js +91 -0
  70. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  71. package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
  72. package/lib/model/strategy/adapter/promotion/type.js +2 -0
  73. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  74. package/lib/modules/OpenData/index.d.ts +2 -0
  75. package/lib/modules/OpenData/index.js +5 -0
  76. package/lib/modules/Order/index.d.ts +33 -13
  77. package/lib/modules/Order/index.js +306 -79
  78. package/lib/modules/Order/payment-utils.d.ts +26 -0
  79. package/lib/modules/Order/payment-utils.js +224 -0
  80. package/lib/modules/Order/types.d.ts +56 -4
  81. package/lib/modules/Order/utils/orderCollectionIdentity.js +3 -0
  82. package/lib/modules/Order/utils.js +11 -4
  83. package/lib/modules/Payment/index.d.ts +2 -0
  84. package/lib/modules/Payment/index.js +33 -12
  85. package/lib/modules/Payment/types.d.ts +104 -25
  86. package/lib/modules/Payment/types.js +1 -0
  87. package/lib/modules/Payment/walletpass.d.ts +38 -1
  88. package/lib/modules/Payment/walletpass.js +730 -21
  89. package/lib/modules/Rules/index.d.ts +3 -0
  90. package/lib/modules/Rules/index.js +54 -21
  91. package/lib/modules/SalesSummary/utils.js +5 -1
  92. package/lib/server/index.d.ts +16 -0
  93. package/lib/server/index.js +670 -18
  94. package/lib/server/modules/index.d.ts +1 -1
  95. package/lib/server/modules/order/index.d.ts +70 -4
  96. package/lib/server/modules/order/index.js +818 -69
  97. package/lib/server/modules/order/types.d.ts +25 -3
  98. package/lib/server/modules/order/types.js +1 -0
  99. package/lib/solution/BaseSales/index.d.ts +118 -9
  100. package/lib/solution/BaseSales/index.js +902 -38
  101. package/lib/solution/BaseSales/types.d.ts +55 -1
  102. package/lib/solution/BaseSales/types.js +2 -1
  103. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  104. package/lib/solution/BaseSales/utils/cartPromotion.js +63 -12
  105. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  106. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
  107. package/lib/solution/BookingTicket/index.d.ts +8 -16
  108. package/lib/solution/BookingTicket/index.js +63 -9
  109. package/lib/solution/BookingTicket/types.d.ts +4 -0
  110. package/lib/solution/BookingTicket/utils/cartView.js +43 -30
  111. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
  112. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +37 -5
  113. package/lib/solution/Sales/index.d.ts +2 -0
  114. package/lib/solution/Sales/index.js +20 -6
  115. package/lib/solution/ScanOrder/index.js +8 -0
  116. package/lib/solution/VenueBooking/index.d.ts +1 -0
  117. package/lib/solution/VenueBooking/index.js +8 -0
  118. package/lib/types/index.d.ts +1 -0
  119. package/lib/utils/payment-number.d.ts +9 -0
  120. package/lib/utils/payment-number.js +64 -0
  121. package/package.json +1 -1
@@ -213,10 +213,12 @@ export interface OrderBookingItem {
213
213
  [key: string]: unknown;
214
214
  }[];
215
215
  }
216
- /** 支付记录 metadata,常含 unique_payment_number */
216
+ /** 支付记录 metadata */
217
217
  export interface OrderPaymentMetadata {
218
- /** 设备端本地支付唯一标识 */
218
+ /** 三方支付交易流水号 */
219
219
  unique_payment_number?: string;
220
+ /** 刷卡机设备快照;server 不解析内部字段,仅透传并持久化 */
221
+ card_reader_snapshot?: Record<string, unknown>;
220
222
  [key: string]: unknown;
221
223
  }
222
224
  /**
@@ -225,6 +227,8 @@ export interface OrderPaymentMetadata {
225
227
  export interface OrderPaymentItem {
226
228
  /** 支付记录 ID;存量/更新时传。来源:OrderPayment.id */
227
229
  order_payment_id?: number | null;
230
+ /** 支付项稳定唯一号;历史支付项允许缺失 */
231
+ payment_number?: string;
228
232
  /** 支付方式 ID(设备端从本地支付方式配置取详情)。来源:OrderPayment.custom_payment_id */
229
233
  custom_payment_id?: number;
230
234
  /** 支付方式编码。来源:OrderPayment.payment_method */
@@ -249,11 +253,13 @@ export interface OrderPaymentItem {
249
253
  created_at?: string | null;
250
254
  /** 手续费配置。来源:OrderPayment.service_charge */
251
255
  service_charge?: Record<string, unknown> | null;
256
+ /** 已计算的支付手续费。来源:OrderPayment.service_fee */
257
+ service_fee?: OrderMoneyString;
252
258
  /** Wallet Pass 使用单位 */
253
259
  wallet_pass_usage_unit?: unknown[] | null;
254
260
  /** Wallet Pass 使用值 */
255
261
  wallet_pass_use_value?: number | null;
256
- /** 元数据;含 unique_payment_number。来源:OrderPayment.metadata */
262
+ /** 元数据;三方支付成功后可含 unique_payment_number */
257
263
  metadata?: OrderPaymentMetadata | null;
258
264
  }
259
265
  /**
@@ -413,6 +419,8 @@ export interface OrderData {
413
419
  create_date?: string;
414
420
  /** 本地待同步标记:1 表示需要后续同步到云端 */
415
421
  need_sync?: 0 | 1 | number;
422
+ /** 本地草稿标记:1 表示仅为 POS 可恢复草稿,不代表已提交云端 */
423
+ is_draft_order?: 0 | 1 | number;
416
424
  /** 兼容:部分场景仍使用顶层 total_amount */
417
425
  total_amount?: OrderMoneyString | number;
418
426
  /** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
@@ -560,6 +568,19 @@ export interface OrderChangedPayload {
560
568
  /** 触发来源,便于订阅者区分 pubsub / 远端覆盖 / 清空等场景 */
561
569
  source?: string;
562
570
  }
571
+ export type RemoteProductMembershipChangeSource = 'pubsub.bodyUpsert' | 'pubsub.httpRefresh';
572
+ /**
573
+ * 远端订单快照相对本地订单产生商品成员增删时的广播载荷。
574
+ * 只表达商品行成员关系变化,不包含数量、价格、备注等字段级修改。
575
+ */
576
+ export interface RemoteProductMembershipChangedPayload {
577
+ order_id: OrderId;
578
+ source: RemoteProductMembershipChangeSource;
579
+ added_product_keys: string[];
580
+ removed_product_keys: string[];
581
+ previous_product_count: number;
582
+ current_product_count: number;
583
+ }
563
584
  /**
564
585
  * OrderSyncMessage - pubsub 同步消息结构
565
586
  */
@@ -597,5 +618,6 @@ export interface OrderState {
597
618
  export declare enum OrderHooks {
598
619
  onOrdersLoaded = "order:onOrdersLoaded",
599
620
  onOrdersChanged = "order:onOrdersChanged",
621
+ onRemoteProductMembershipChanged = "order:onRemoteProductMembershipChanged",
600
622
  onOrdersSyncCompleted = "order:onOrdersSyncCompleted"
601
623
  }
@@ -72,7 +72,7 @@
72
72
  // 3.5 payments
73
73
  // ─────────────────────────────────────────────────────────────────
74
74
 
75
- /** 支付记录 metadata,常含 unique_payment_number */
75
+ /** 支付记录 metadata */
76
76
 
77
77
  /**
78
78
  * 支付记录(3.5 payments)
@@ -135,6 +135,11 @@
135
135
  * const changedOrders = payload.changedOrders
136
136
  */
137
137
 
138
+ /**
139
+ * 远端订单快照相对本地订单产生商品成员增删时的广播载荷。
140
+ * 只表达商品行成员关系变化,不包含数量、价格、备注等字段级修改。
141
+ */
142
+
138
143
  /**
139
144
  * OrderSyncMessage - pubsub 同步消息结构
140
145
  */
@@ -149,6 +154,7 @@
149
154
  export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
150
155
  OrderHooks["onOrdersLoaded"] = "order:onOrdersLoaded";
151
156
  OrderHooks["onOrdersChanged"] = "order:onOrdersChanged";
157
+ OrderHooks["onRemoteProductMembershipChanged"] = "order:onRemoteProductMembershipChanged";
152
158
  OrderHooks["onOrdersSyncCompleted"] = "order:onOrdersSyncCompleted";
153
159
  return OrderHooks;
154
160
  }({});
@@ -1,15 +1,15 @@
1
1
  import { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../../modules/BaseModule';
3
- import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult } from './types';
3
+ import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } 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, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions } 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, RoundingResult } from '../../modules/Payment/types';
12
+ import type { PaymentMethod, RoundingResult, WalletAssetId, WalletAssetsBehaviorOptions, WalletAssetsSnapshot, WalletAssetsState, WalletAssetSelectionSource, ScanWalletAssetResult } 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,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;
@@ -35,6 +48,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
35
48
  protected store: BaseSalesState;
36
49
  protected otherParams: Record<string, any>;
37
50
  protected cacheId: string | undefined;
51
+ /**
52
+ * 由已在初始化阶段解析过设备短号的业务解决方案写入。
53
+ * 未设置时,支付编号仍按原逻辑实时读取设备信息。
54
+ */
55
+ protected paymentNumberDevicePrefix: string | null;
38
56
  /**
39
57
  * window / request 暴露为 public:现存外部工具(如 BookingTicket Scan)通过
40
58
  * `solution.window` / `solution.request` 直接访问插件,保持原有契约不破坏。
@@ -51,6 +69,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
51
69
  private autoPaymentSyncTimer;
52
70
  private salesDetailLoadInFlightCount;
53
71
  private salesDetailLoadSequence;
72
+ private walletAssetsRefreshSequence;
54
73
  private salesDetailHydrateQueue;
55
74
  private serverOrderChangeUnsubscribe;
56
75
  private serverOrderChangeHydrateInFlight;
@@ -90,6 +109,16 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
90
109
  private applyQuotationScheduleResolver;
91
110
  private loadQuotationForPriceQuery;
92
111
  private getPriceQueryProductId;
112
+ /**
113
+ * Change Time / customer reprice 必须沿用商品列表的渠道口径。
114
+ * SalesSdk Provider 通常将渠道存为 platform,因此不能只读取 otherParams.channel。
115
+ */
116
+ private getPriceQueryChannel;
117
+ /**
118
+ * /product/query 的智能定价评估只读取 strategy_context;
119
+ * application_code 仅作为接口兼容字段,不能替代 channel / business_code。
120
+ */
121
+ private getPriceQueryStrategyContext;
93
122
  private getPriceQuerySchedule;
94
123
  private loadProductsForPriceQuery;
95
124
  private loadProductForPriceQuery;
@@ -128,6 +157,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
128
157
  */
129
158
  protected readSessionCacheData(): Record<string, any>;
130
159
  protected getAppData<T>(key: string): T | undefined;
160
+ /**
161
+ * 复用业务解决方案初始化时已解析的支付设备短号。
162
+ * 空值会清除缓存,使后续支付恢复实时读取设备信息的兼容路径。
163
+ */
164
+ protected setPaymentNumberDevicePrefix(prefix: unknown): void;
165
+ private getPaymentNumberDevicePrefixSync;
166
+ private getPaymentNumberDevicePrefixAsync;
131
167
  private syncAppDataToTempOrder;
132
168
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
133
169
  destroy(): Promise<void>;
@@ -154,7 +190,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
154
190
  /** 获取附加费用(运费/服务费/税费等)。 */
155
191
  getSurcharges(): ISalesSurcharge[];
156
192
  getTempOrder(): OrderTempOrder | null;
157
- replaceTempOrder(tempOrder: OrderTempOrder): Promise<OrderTempOrder>;
193
+ replaceTempOrder(tempOrder: OrderTempOrder, options?: ReplaceTempOrderOptions): Promise<OrderTempOrder>;
158
194
  getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
159
195
  getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
160
196
  getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
@@ -240,6 +276,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
240
276
  confirmPendingVoucherPayments?: boolean;
241
277
  enhancePayload?: SubmitPayloadEnhancer;
242
278
  }): Promise<T>;
279
+ saveSalesOrderDraft<T = any>(params?: {
280
+ platform?: string;
281
+ businessCode?: string;
282
+ channel?: string;
283
+ type?: string;
284
+ enhancePayload?: SubmitPayloadEnhancer;
285
+ }): Promise<T>;
243
286
  submitTempOrderAsync<T = any>(params?: {
244
287
  payments?: OrderPaymentSource[];
245
288
  paymentStatus?: BaseSalesPaymentStatus;
@@ -258,22 +301,64 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
258
301
  private queueLatestAutoPaymentSync;
259
302
  private scheduleQueuedAutoPaymentSyncFlush;
260
303
  private flushQueuedAutoPaymentSync;
261
- /** 追加单个支付项到当前订单。 */
304
+ /**
305
+ * 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
306
+ */
262
307
  addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
308
+ /**
309
+ * 创建新支付项时优先使用业务解决方案初始化阶段缓存的设备短号;
310
+ * 未缓存的通用 BaseSales 保持实时读取设备信息的兼容语义。
311
+ */
312
+ addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
313
+ private addOrderPaymentWithDevicePrefix;
263
314
  /** 更新当前订单中的指定支付项。 */
264
- updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
315
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>, options?: BaseSalesUpdateOrderPaymentOptions): Promise<BaseSalesUpdateOrderPaymentResult>;
265
316
  /** 删除当前订单中的指定支付项。 */
266
317
  deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
267
318
  /** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
268
319
  updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
269
320
  status?: 'paid' | 'payment_pending';
270
321
  }): OrderPaymentData[];
322
+ updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
323
+ status?: 'paid' | 'payment_pending';
324
+ }): Promise<OrderPaymentData[]>;
271
325
  confirmPendingVoucherPayments(): OrderPaymentData[];
272
326
  discardPendingVoucherPayments(): OrderPaymentData[];
273
327
  private getWalletProductList;
328
+ private buildWalletInitBusinessData;
274
329
  initWalletData(params?: {
275
330
  order_wait_pay_amount?: number;
276
331
  }): Promise<import("../../modules/Payment").WalletInitializationResult>;
332
+ private getCommittedWalletAssets;
333
+ private publishWalletAssetsState;
334
+ private syncSelectedWalletAssets;
335
+ /** 读取购物车与 Shared Checkout 共用的钱包资产状态。 */
336
+ getWalletAssetsState(): WalletAssetsState;
337
+ /** 导出 Shared Checkout 跨运行时恢复所需的钱包状态与搜索缓存。 */
338
+ exportWalletAssetsSnapshot(): WalletAssetsSnapshot;
339
+ /** 配置仅影响 Wallet Assets,不改变 Promotion/Voucher 选择流程。 */
340
+ configureWalletAssetsBehavior(options: WalletAssetsBehaviorOptions): void;
341
+ /**
342
+ * 恢复 Shared Checkout 钱包快照,并把选择重新同步为订单 pending payment。
343
+ */
344
+ importWalletAssetsSnapshot(snapshot: WalletAssetsSnapshot): Promise<WalletAssetsState>;
345
+ /**
346
+ * 基于当前订单快照刷新钱包资产。商品变化保留并重验选择;客户变化强制清空。
347
+ */
348
+ refreshWalletAssets(params?: {
349
+ order_wait_pay_amount?: number;
350
+ preserveSelection?: boolean;
351
+ }): Promise<WalletAssetsState>;
352
+ /** 选择或取消单张钱包资产,并立即同步 pending wallet payments。 */
353
+ selectWalletAsset(params: {
354
+ assetId: WalletAssetId;
355
+ selected: boolean;
356
+ source?: WalletAssetSelectionSource;
357
+ }): Promise<WalletAssetsState>;
358
+ /** 扫码精确查券;仅可用资产会被自动选中。 */
359
+ scanWalletAsset(code: string): Promise<ScanWalletAssetResult>;
360
+ /** 清空全部未确认钱包选择,已支付钱包项由 Order 模块继续保留。 */
361
+ clearWalletAssetSelection(): Promise<WalletAssetsState>;
277
362
  /**
278
363
  * 更新当前订单客户字段。
279
364
  *
@@ -290,6 +375,30 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
290
375
  getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
291
376
  /** 同步读取初始化时缓存的支付方式列表。 */
292
377
  getPaymentMethods(): PaymentMethod[];
378
+ private findCashPaymentMethod;
379
+ private getPendingWalletPaymentAmount;
380
+ /** 读取现金 action 所需的支付方式、待付金额和快捷金额。 */
381
+ getCashPaymentConfig(): Promise<BaseSalesCashPaymentConfig>;
382
+ /**
383
+ * 确认足额覆盖订单的 pending Wallet 支付并提交订单。
384
+ *
385
+ * Order 模块在构造提交参数时将 pending voucher 转为 paid;只有提交成功后
386
+ * 才同步 Wallet committed 状态。失败时恢复调用前 payments,允许用户重试。
387
+ */
388
+ confirmWalletPayment<T = Record<string, any>>(): Promise<BaseSalesConfirmWalletPaymentResult<T>>;
389
+ /**
390
+ * 购物车现金直付:写入现金记录并等待支付同步完成。
391
+ * 同步失败会恢复调用前 payments(包含 Wallet pending 状态)。
392
+ */
393
+ payCash(params: BaseSalesPayCashParams): Promise<BaseSalesPayCashResult>;
394
+ /**
395
+ * 提交一次已由支付设备确认成功的非 Wallet 支付。
396
+ *
397
+ * 与 addOrderPayment 不同,本入口不会启动后台 fire-and-forget 同步;调用方会等待
398
+ * 本次 payment、当前 pending Wallet 以及订单提交共同完成。任何同步失败都会恢复
399
+ * 调用前的 payments 与 payment_status,便于 UI 安全解锁并重试。
400
+ */
401
+ commitPaymentMethodPayment(params: BaseSalesCommitPaymentMethodParams): Promise<BaseSalesCommitPaymentMethodResult>;
293
402
  /**
294
403
  * 按当前店铺的现金舍入配置计算金额,供现金支付 UI 使用。
295
404
  *
@@ -315,7 +424,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
315
424
  getQuotationCustomerScopeInfo(): BaseSalesQuotationCustomerScopeInfo;
316
425
  shouldRecalculateProductBookingPricesForContextChange(params: BaseSalesPriceRecalculationContextChange): boolean;
317
426
  calculateProductBookingPrices(paramsList: BaseSalesCalculateProductBookingPriceParams[]): Promise<BaseSalesProductBookingPriceResult[]>;
318
- addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
427
+ addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
319
428
  updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
320
429
  updateOrderProducts(paramsList: UpdateOrderProductParams[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
321
430
  updateOrderProductQuantity(params: BaseSalesUpdateOrderProductQuantityParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
@@ -331,8 +440,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
331
440
  * @example
332
441
  * await baseSales.removeProductsFromOrder([identityA, identityB]);
333
442
  */
334
- removeProductsFromOrder(identities: BaseSalesOrderProductIdentity[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
335
- removeProductFromOrder(identity: BaseSalesOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
443
+ removeProductsFromOrder(identities: BaseSalesOrderProductIdentity[], options?: RemoveProductsFromOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
444
+ removeProductFromOrder(identity: BaseSalesOrderProductIdentity, options?: RemoveProductsFromOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
336
445
  /**
337
446
  * 注入促销评估器到底层 OrderModule。
338
447
  *