@pisell/pisellos 2.3.40 → 2.3.41

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 (230) 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 +5 -3
  14. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -3
  15. package/dist/modules/Discount/index.d.ts +0 -1
  16. package/dist/modules/Discount/index.js +11 -40
  17. package/dist/modules/Discount/types.d.ts +0 -1
  18. package/dist/modules/OpenData/index.d.ts +2 -0
  19. package/dist/modules/OpenData/index.js +10 -2
  20. package/dist/modules/Order/index.d.ts +29 -12
  21. package/dist/modules/Order/index.js +750 -509
  22. package/dist/modules/Order/payment-utils.d.ts +26 -0
  23. package/dist/modules/Order/payment-utils.js +225 -0
  24. package/dist/modules/Order/types.d.ts +33 -10
  25. package/dist/modules/Order/utils/orderCollectionIdentity.js +7 -2
  26. package/dist/modules/Order/utils.d.ts +0 -10
  27. package/dist/modules/Order/utils.js +13 -41
  28. package/dist/modules/Payment/index.d.ts +2 -0
  29. package/dist/modules/Payment/index.js +79 -50
  30. package/dist/modules/Payment/types.d.ts +99 -28
  31. package/dist/modules/Payment/types.js +20 -3
  32. package/dist/modules/Payment/walletpass.d.ts +25 -1
  33. package/dist/modules/Payment/walletpass.js +707 -157
  34. package/dist/modules/Product/types.d.ts +0 -1
  35. package/dist/modules/ProductList/index.js +14 -33
  36. package/dist/modules/Quotation/index.d.ts +1 -1
  37. package/dist/modules/Quotation/index.js +2 -2
  38. package/dist/modules/Rules/index.d.ts +1 -0
  39. package/dist/modules/Rules/index.js +89 -96
  40. package/dist/modules/SalesSummary/index.js +13 -12
  41. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  42. package/dist/modules/ScanOrderLogger/index.js +2 -15
  43. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  44. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  45. package/dist/modules/Schedule/index.d.ts +1 -3
  46. package/dist/modules/Schedule/index.js +16 -21
  47. package/dist/modules/Summary/utils.js +13 -38
  48. package/dist/modules/index.d.ts +0 -2
  49. package/dist/modules/index.js +1 -3
  50. package/dist/plugins/window.d.ts +0 -1
  51. package/dist/server/index.d.ts +16 -14
  52. package/dist/server/index.js +1925 -1143
  53. package/dist/server/modules/order/index.d.ts +54 -4
  54. package/dist/server/modules/order/index.js +1600 -700
  55. package/dist/server/modules/order/types.d.ts +11 -3
  56. package/dist/server/modules/order/types.js +1 -1
  57. package/dist/solution/BaseSales/index.d.ts +109 -20
  58. package/dist/solution/BaseSales/index.js +1800 -480
  59. package/dist/solution/BaseSales/types.d.ts +52 -0
  60. package/dist/solution/BaseSales/types.js +2 -1
  61. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  62. package/dist/solution/BaseSales/utils/cartPromotion.js +90 -31
  63. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  64. package/dist/solution/BookingByStep/index.d.ts +2 -17
  65. package/dist/solution/BookingByStep/index.js +215 -294
  66. package/dist/solution/BookingByStep/types.d.ts +1 -2
  67. package/dist/solution/BookingByStep/types.js +1 -3
  68. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  69. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  70. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  71. package/dist/solution/BookingTicket/index.d.ts +8 -4
  72. package/dist/solution/BookingTicket/index.js +134 -51
  73. package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -0
  74. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
  75. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +172 -82
  76. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  77. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  78. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  79. package/dist/solution/BookingTicket/utils/weighingProductSku.js +45 -0
  80. package/dist/solution/Sales/index.d.ts +1 -0
  81. package/dist/solution/Sales/index.js +10 -2
  82. package/dist/solution/ScanOrder/index.d.ts +14 -26
  83. package/dist/solution/ScanOrder/index.js +756 -1148
  84. package/dist/solution/ScanOrder/types.d.ts +1 -21
  85. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  86. package/dist/solution/ScanOrder/utils.js +25 -66
  87. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  88. package/dist/solution/ShopDiscount/index.js +87 -125
  89. package/dist/solution/VenueBooking/index.d.ts +11 -39
  90. package/dist/solution/VenueBooking/index.js +860 -1176
  91. package/dist/solution/VenueBooking/types.d.ts +0 -3
  92. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  93. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  94. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  95. package/dist/solution/index.d.ts +0 -1
  96. package/dist/solution/index.js +1 -2
  97. package/dist/types/index.d.ts +1 -1
  98. package/dist/utils/payment-number.d.ts +9 -0
  99. package/dist/utils/payment-number.js +69 -0
  100. package/lib/core/index.d.ts +2 -0
  101. package/lib/core/index.js +4 -0
  102. package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  103. package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
  104. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  105. package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
  106. package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
  107. package/lib/model/strategy/adapter/promotion/examples.js +91 -0
  108. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  109. package/lib/model/strategy/adapter/promotion/index.js +2 -0
  110. package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
  111. package/lib/model/strategy/adapter/promotion/type.js +2 -0
  112. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
  113. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
  114. package/lib/modules/Discount/index.d.ts +0 -1
  115. package/lib/modules/Discount/index.js +0 -9
  116. package/lib/modules/Discount/types.d.ts +0 -1
  117. package/lib/modules/OpenData/index.d.ts +2 -0
  118. package/lib/modules/OpenData/index.js +6 -1
  119. package/lib/modules/Order/index.d.ts +29 -12
  120. package/lib/modules/Order/index.js +196 -86
  121. package/lib/modules/Order/payment-utils.d.ts +26 -0
  122. package/lib/modules/Order/payment-utils.js +224 -0
  123. package/lib/modules/Order/types.d.ts +33 -10
  124. package/lib/modules/Order/utils/orderCollectionIdentity.js +3 -0
  125. package/lib/modules/Order/utils.d.ts +0 -10
  126. package/lib/modules/Order/utils.js +16 -40
  127. package/lib/modules/Payment/index.d.ts +2 -0
  128. package/lib/modules/Payment/index.js +34 -13
  129. package/lib/modules/Payment/types.d.ts +99 -28
  130. package/lib/modules/Payment/types.js +4 -3
  131. package/lib/modules/Payment/walletpass.d.ts +25 -1
  132. package/lib/modules/Payment/walletpass.js +470 -21
  133. package/lib/modules/Product/types.d.ts +0 -1
  134. package/lib/modules/ProductList/index.js +31 -40
  135. package/lib/modules/Quotation/index.d.ts +1 -1
  136. package/lib/modules/Quotation/index.js +2 -2
  137. package/lib/modules/Rules/index.d.ts +1 -0
  138. package/lib/modules/Rules/index.js +47 -40
  139. package/lib/modules/SalesSummary/index.js +7 -6
  140. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  141. package/lib/modules/ScanOrderLogger/index.js +1 -13
  142. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  143. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  144. package/lib/modules/Schedule/index.d.ts +1 -3
  145. package/lib/modules/Schedule/index.js +8 -10
  146. package/lib/modules/Summary/utils.js +1 -21
  147. package/lib/modules/index.d.ts +0 -2
  148. package/lib/modules/index.js +1 -5
  149. package/lib/plugins/window.d.ts +0 -1
  150. package/lib/server/index.d.ts +16 -14
  151. package/lib/server/index.js +675 -83
  152. package/lib/server/modules/order/index.d.ts +54 -4
  153. package/lib/server/modules/order/index.js +679 -66
  154. package/lib/server/modules/order/types.d.ts +11 -3
  155. package/lib/solution/BaseSales/index.d.ts +109 -20
  156. package/lib/solution/BaseSales/index.js +883 -70
  157. package/lib/solution/BaseSales/types.d.ts +52 -0
  158. package/lib/solution/BaseSales/types.js +2 -1
  159. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  160. package/lib/solution/BaseSales/utils/cartPromotion.js +63 -12
  161. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  162. package/lib/solution/BookingByStep/index.d.ts +2 -17
  163. package/lib/solution/BookingByStep/index.js +18 -60
  164. package/lib/solution/BookingByStep/types.d.ts +1 -2
  165. package/lib/solution/BookingByStep/types.js +0 -5
  166. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  167. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  168. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  169. package/lib/solution/BookingTicket/index.d.ts +8 -4
  170. package/lib/solution/BookingTicket/index.js +64 -19
  171. package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -0
  172. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
  173. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +36 -4
  174. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  175. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  176. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  177. package/lib/solution/BookingTicket/utils/weighingProductSku.js +63 -0
  178. package/lib/solution/Sales/index.d.ts +1 -0
  179. package/lib/solution/Sales/index.js +5 -3
  180. package/lib/solution/ScanOrder/index.d.ts +14 -26
  181. package/lib/solution/ScanOrder/index.js +190 -449
  182. package/lib/solution/ScanOrder/types.d.ts +1 -21
  183. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  184. package/lib/solution/ScanOrder/utils.js +0 -31
  185. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  186. package/lib/solution/ShopDiscount/index.js +0 -14
  187. package/lib/solution/VenueBooking/index.d.ts +11 -39
  188. package/lib/solution/VenueBooking/index.js +123 -328
  189. package/lib/solution/VenueBooking/types.d.ts +0 -3
  190. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  191. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  192. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  193. package/lib/solution/index.d.ts +0 -1
  194. package/lib/solution/index.js +1 -3
  195. package/lib/types/index.d.ts +1 -1
  196. package/lib/utils/payment-number.d.ts +9 -0
  197. package/lib/utils/payment-number.js +64 -0
  198. package/package.json +1 -1
  199. package/dist/modules/Holder/index.d.ts +0 -48
  200. package/dist/modules/Holder/index.js +0 -640
  201. package/dist/modules/Holder/types.d.ts +0 -123
  202. package/dist/modules/Holder/types.js +0 -1
  203. package/dist/modules/Holder/utils.d.ts +0 -13
  204. package/dist/modules/Holder/utils.js +0 -34
  205. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  206. package/dist/modules/ResourcePlanner/index.js +0 -181
  207. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  208. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  209. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  210. package/dist/modules/ResourcePlanner/types.js +0 -1
  211. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  212. package/dist/solution/UnifiedBookingSales/index.js +0 -1871
  213. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  214. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  215. package/lib/modules/Holder/index.d.ts +0 -48
  216. package/lib/modules/Holder/index.js +0 -402
  217. package/lib/modules/Holder/types.d.ts +0 -123
  218. package/lib/modules/Holder/types.js +0 -17
  219. package/lib/modules/Holder/utils.d.ts +0 -13
  220. package/lib/modules/Holder/utils.js +0 -71
  221. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  222. package/lib/modules/ResourcePlanner/index.js +0 -148
  223. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  224. package/lib/modules/ResourcePlanner/planner.js +0 -933
  225. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  226. package/lib/modules/ResourcePlanner/types.js +0 -17
  227. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  228. package/lib/solution/UnifiedBookingSales/index.js +0 -1076
  229. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  230. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -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 以便筛选与数据源扩展 */
@@ -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)
@@ -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, 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';
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, WalletAssetId, 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;
@@ -128,6 +147,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
128
147
  */
129
148
  protected readSessionCacheData(): Record<string, any>;
130
149
  protected getAppData<T>(key: string): T | undefined;
150
+ /**
151
+ * 复用业务解决方案初始化时已解析的支付设备短号。
152
+ * 空值会清除缓存,使后续支付恢复实时读取设备信息的兼容路径。
153
+ */
154
+ protected setPaymentNumberDevicePrefix(prefix: unknown): void;
155
+ private getPaymentNumberDevicePrefixSync;
156
+ private getPaymentNumberDevicePrefixAsync;
131
157
  private syncAppDataToTempOrder;
132
158
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
133
159
  destroy(): Promise<void>;
@@ -240,6 +266,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
240
266
  confirmPendingVoucherPayments?: boolean;
241
267
  enhancePayload?: SubmitPayloadEnhancer;
242
268
  }): Promise<T>;
269
+ saveSalesOrderDraft<T = any>(params?: {
270
+ platform?: string;
271
+ businessCode?: string;
272
+ channel?: string;
273
+ type?: string;
274
+ enhancePayload?: SubmitPayloadEnhancer;
275
+ }): Promise<T>;
243
276
  submitTempOrderAsync<T = any>(params?: {
244
277
  payments?: OrderPaymentSource[];
245
278
  paymentStatus?: BaseSalesPaymentStatus;
@@ -247,13 +280,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
247
280
  confirmPendingVoucherPayments?: boolean;
248
281
  enhancePayload?: SubmitPayloadEnhancer;
249
282
  }): Promise<T>;
250
- /**
251
- * 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
252
- * otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
253
- */
254
- protected shouldUseCheckoutSyncTask(): boolean;
255
- /** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
256
- protected getDefaultCheckoutSmallTicketDataFlag(): number | undefined;
257
283
  printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
258
284
  private getSubmitPaymentStatus;
259
285
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
@@ -265,22 +291,62 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
265
291
  private queueLatestAutoPaymentSync;
266
292
  private scheduleQueuedAutoPaymentSyncFlush;
267
293
  private flushQueuedAutoPaymentSync;
268
- /** 追加单个支付项到当前订单。 */
294
+ /**
295
+ * 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
296
+ */
269
297
  addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
298
+ /**
299
+ * 创建新支付项时优先使用业务解决方案初始化阶段缓存的设备短号;
300
+ * 未缓存的通用 BaseSales 保持实时读取设备信息的兼容语义。
301
+ */
302
+ addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
303
+ private addOrderPaymentWithDevicePrefix;
270
304
  /** 更新当前订单中的指定支付项。 */
271
- updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
305
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>, options?: BaseSalesUpdateOrderPaymentOptions): Promise<BaseSalesUpdateOrderPaymentResult>;
272
306
  /** 删除当前订单中的指定支付项。 */
273
307
  deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
274
308
  /** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
275
309
  updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
276
310
  status?: 'paid' | 'payment_pending';
277
311
  }): OrderPaymentData[];
312
+ updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
313
+ status?: 'paid' | 'payment_pending';
314
+ }): Promise<OrderPaymentData[]>;
278
315
  confirmPendingVoucherPayments(): OrderPaymentData[];
279
316
  discardPendingVoucherPayments(): OrderPaymentData[];
280
317
  private getWalletProductList;
318
+ private buildWalletInitBusinessData;
281
319
  initWalletData(params?: {
282
320
  order_wait_pay_amount?: number;
283
321
  }): Promise<import("../../modules/Payment").WalletInitializationResult>;
322
+ private getCommittedWalletAssets;
323
+ private publishWalletAssetsState;
324
+ private syncSelectedWalletAssets;
325
+ /** 读取购物车与 Shared Checkout 共用的钱包资产状态。 */
326
+ getWalletAssetsState(): WalletAssetsState;
327
+ /** 导出 Shared Checkout 跨运行时恢复所需的钱包状态与搜索缓存。 */
328
+ exportWalletAssetsSnapshot(): WalletAssetsSnapshot;
329
+ /**
330
+ * 恢复 Shared Checkout 钱包快照,并把选择重新同步为订单 pending payment。
331
+ */
332
+ importWalletAssetsSnapshot(snapshot: WalletAssetsSnapshot): Promise<WalletAssetsState>;
333
+ /**
334
+ * 基于当前订单快照刷新钱包资产。商品变化保留并重验选择;客户变化强制清空。
335
+ */
336
+ refreshWalletAssets(params?: {
337
+ order_wait_pay_amount?: number;
338
+ preserveSelection?: boolean;
339
+ }): Promise<WalletAssetsState>;
340
+ /** 选择或取消单张钱包资产,并立即同步 pending wallet payments。 */
341
+ selectWalletAsset(params: {
342
+ assetId: WalletAssetId;
343
+ selected: boolean;
344
+ source?: WalletAssetSelectionSource;
345
+ }): Promise<WalletAssetsState>;
346
+ /** 扫码精确查券;仅可用资产会被自动选中。 */
347
+ scanWalletAsset(code: string): Promise<ScanWalletAssetResult>;
348
+ /** 清空全部未确认钱包选择,已支付钱包项由 Order 模块继续保留。 */
349
+ clearWalletAssetSelection(): Promise<WalletAssetsState>;
284
350
  /**
285
351
  * 更新当前订单客户字段。
286
352
  *
@@ -297,16 +363,39 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
297
363
  getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
298
364
  /** 同步读取初始化时缓存的支付方式列表。 */
299
365
  getPaymentMethods(): PaymentMethod[];
300
- /** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
366
+ private findCashPaymentMethod;
367
+ private getPendingWalletPaymentAmount;
368
+ /** 读取现金 action 所需的支付方式、待付金额和快捷金额。 */
369
+ getCashPaymentConfig(): Promise<BaseSalesCashPaymentConfig>;
370
+ /**
371
+ * 确认足额覆盖订单的 pending Wallet 支付并提交订单。
372
+ *
373
+ * Order 模块在构造提交参数时将 pending voucher 转为 paid;只有提交成功后
374
+ * 才同步 Wallet committed 状态。失败时恢复调用前 payments,允许用户重试。
375
+ */
376
+ confirmWalletPayment<T = Record<string, any>>(): Promise<BaseSalesConfirmWalletPaymentResult<T>>;
377
+ /**
378
+ * 购物车现金直付:写入现金记录并等待支付同步完成。
379
+ * 同步失败会恢复调用前 payments(包含 Wallet pending 状态)。
380
+ */
381
+ payCash(params: BaseSalesPayCashParams): Promise<BaseSalesPayCashResult>;
382
+ /**
383
+ * 提交一次已由支付设备确认成功的非 Wallet 支付。
384
+ *
385
+ * 与 addOrderPayment 不同,本入口不会启动后台 fire-and-forget 同步;调用方会等待
386
+ * 本次 payment、当前 pending Wallet 以及订单提交共同完成。任何同步失败都会恢复
387
+ * 调用前的 payments 与 payment_status,便于 UI 安全解锁并重试。
388
+ */
389
+ commitPaymentMethodPayment(params: BaseSalesCommitPaymentMethodParams): Promise<BaseSalesCommitPaymentMethodResult>;
390
+ /**
391
+ * 按当前店铺的现金舍入配置计算金额,供现金支付 UI 使用。
392
+ *
393
+ * 舍入开关取自 CASHMANUAL 支付方式;舍入规则取自
394
+ * otherParams.order_rounding_setting,金额算法统一由 PaymentModule 维护。
395
+ */
301
396
  roundAmount(params: {
302
397
  amount: string | number;
303
- interval?: string | number;
304
- rule?: 'standard_rounding' | 'standard_down' | 'always_up' | 'always_down' | string;
305
- }): {
306
- originalAmount: string;
307
- roundedAmount: string;
308
- roundingDifference: string;
309
- };
398
+ }): Promise<RoundingResult>;
310
399
  /**
311
400
  * 发送支付链接。
312
401
  *