@pisell/pisellos 2.2.147 → 2.2.149

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 (247) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/apis/picoding.js +1 -0
  3. package/dist/model/strategy/adapter/index.d.ts +2 -0
  4. package/dist/model/strategy/adapter/index.js +3 -1
  5. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
  6. package/dist/model/strategy/adapter/itemRule/adapter.js +483 -0
  7. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  8. package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
  9. package/dist/model/strategy/adapter/itemRule/examples.d.ts +79 -0
  10. package/dist/model/strategy/adapter/itemRule/examples.js +382 -0
  11. package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
  12. package/dist/model/strategy/adapter/itemRule/index.js +5 -0
  13. package/dist/model/strategy/adapter/itemRule/type.d.ts +225 -0
  14. package/dist/model/strategy/adapter/itemRule/type.js +101 -0
  15. package/dist/modules/Cart/types.d.ts +2 -0
  16. package/dist/modules/Cart/utils/cartProduct.js +22 -1
  17. package/dist/modules/Cart/utils/changePrice.js +6 -0
  18. package/dist/modules/Date/index.d.ts +1 -1
  19. package/dist/modules/Date/index.js +16 -8
  20. package/dist/modules/Date/types.d.ts +3 -1
  21. package/dist/modules/OpenData/index.d.ts +24 -0
  22. package/dist/modules/OpenData/index.js +173 -0
  23. package/dist/modules/OpenData/types.d.ts +73 -0
  24. package/dist/modules/OpenData/types.js +1 -0
  25. package/dist/modules/OpenData/utils.d.ts +2 -0
  26. package/dist/modules/OpenData/utils.js +75 -0
  27. package/dist/modules/Order/index.d.ts +171 -1
  28. package/dist/modules/Order/index.js +2052 -112
  29. package/dist/modules/Order/types.d.ts +441 -20
  30. package/dist/modules/Order/types.js +23 -0
  31. package/dist/modules/Order/utils.d.ts +120 -0
  32. package/dist/modules/Order/utils.js +653 -2
  33. package/dist/modules/Product/utils.js +2 -2
  34. package/dist/modules/ProductList/index.js +2 -1
  35. package/dist/modules/Quotation/index.d.ts +8 -1
  36. package/dist/modules/Quotation/index.js +40 -10
  37. package/dist/modules/Quotation/types.d.ts +5 -0
  38. package/dist/modules/Rules/index.d.ts +3 -1
  39. package/dist/modules/Rules/index.js +136 -50
  40. package/dist/modules/Rules/types.d.ts +6 -0
  41. package/dist/modules/Rules/types.js +8 -0
  42. package/dist/modules/SalesSummary/index.d.ts +70 -0
  43. package/dist/modules/SalesSummary/index.js +175 -0
  44. package/dist/modules/SalesSummary/types.d.ts +64 -0
  45. package/dist/modules/SalesSummary/types.js +1 -0
  46. package/dist/modules/SalesSummary/utils.d.ts +34 -0
  47. package/dist/modules/SalesSummary/utils.js +488 -0
  48. package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
  49. package/dist/modules/ScanOrderLogger/index.js +161 -0
  50. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  51. package/dist/modules/ScanOrderLogger/providers/feishu.js +203 -0
  52. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  53. package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
  54. package/dist/modules/ScanOrderLogger/types.d.ts +52 -0
  55. package/dist/modules/ScanOrderLogger/types.js +1 -0
  56. package/dist/modules/Schedule/getDateIsInSchedule.js +7 -7
  57. package/dist/modules/Schedule/index.d.ts +4 -13
  58. package/dist/modules/Schedule/index.js +6 -23
  59. package/dist/modules/Schedule/utils.d.ts +1 -1
  60. package/dist/modules/Summary/index.d.ts +3 -0
  61. package/dist/modules/Summary/index.js +134 -15
  62. package/dist/modules/Summary/types.d.ts +7 -0
  63. package/dist/modules/Summary/utils.d.ts +104 -1
  64. package/dist/modules/Summary/utils.js +1116 -13
  65. package/dist/modules/index.d.ts +4 -0
  66. package/dist/modules/index.js +5 -1
  67. package/dist/server/index.d.ts +41 -4
  68. package/dist/server/index.js +900 -405
  69. package/dist/server/modules/order/index.d.ts +10 -2
  70. package/dist/server/modules/order/index.js +251 -196
  71. package/dist/server/modules/products/index.d.ts +26 -0
  72. package/dist/server/modules/products/index.js +618 -338
  73. package/dist/server/modules/products/types.d.ts +5 -1
  74. package/dist/solution/BaseSales/index.d.ts +175 -0
  75. package/dist/solution/BaseSales/index.js +1293 -0
  76. package/dist/solution/BaseSales/types.d.ts +305 -0
  77. package/dist/solution/BaseSales/types.js +38 -0
  78. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
  79. package/dist/solution/BaseSales/utils/parseSalesResponse.js +159 -0
  80. package/dist/solution/BaseSales/utils.d.ts +40 -0
  81. package/dist/solution/BaseSales/utils.js +222 -0
  82. package/dist/solution/BookingByStep/index.d.ts +14 -0
  83. package/dist/solution/BookingByStep/index.js +699 -212
  84. package/dist/solution/BookingByStep/types.d.ts +3 -1
  85. package/dist/solution/BookingByStep/types.js +5 -1
  86. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  87. package/dist/solution/BookingByStep/utils/resources.js +6 -1
  88. package/dist/solution/BookingTicket/index.d.ts +113 -15
  89. package/dist/solution/BookingTicket/index.js +534 -196
  90. package/dist/solution/BookingTicket/types.d.ts +69 -6
  91. package/dist/solution/BookingTicket/types.js +40 -9
  92. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
  93. package/dist/solution/BookingTicket/utils/bookingStatus.js +66 -0
  94. package/dist/solution/BookingTicket/utils/cartView.d.ts +26 -0
  95. package/dist/solution/BookingTicket/utils/cartView.js +84 -0
  96. package/dist/solution/Sales/index.d.ts +1 -0
  97. package/dist/solution/Sales/index.js +1 -0
  98. package/dist/solution/ScanOrder/index.d.ts +146 -0
  99. package/dist/solution/ScanOrder/index.js +3029 -0
  100. package/dist/solution/ScanOrder/types.d.ts +305 -0
  101. package/dist/solution/ScanOrder/types.js +35 -0
  102. package/dist/solution/ScanOrder/utils.d.ts +167 -0
  103. package/dist/solution/ScanOrder/utils.js +768 -0
  104. package/dist/solution/ShopDiscount/index.d.ts +2 -0
  105. package/dist/solution/ShopDiscount/index.js +9 -5
  106. package/dist/solution/ShopDiscount/types.d.ts +4 -0
  107. package/dist/solution/VenueBooking/index.d.ts +197 -0
  108. package/dist/solution/VenueBooking/index.js +3411 -0
  109. package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  110. package/dist/solution/VenueBooking/types.d.ts +153 -0
  111. package/dist/solution/VenueBooking/types.js +21 -0
  112. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  113. package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
  114. package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
  115. package/dist/solution/VenueBooking/utils/resource.js +130 -0
  116. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
  117. package/dist/solution/VenueBooking/utils/slotMerge.js +224 -0
  118. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  119. package/dist/solution/VenueBooking/utils/timeSlot.js +453 -0
  120. package/dist/solution/VenueBooking/utils.d.ts +1 -0
  121. package/dist/solution/VenueBooking/utils.js +1 -0
  122. package/dist/solution/index.d.ts +3 -0
  123. package/dist/solution/index.js +4 -1
  124. package/lib/apis/picoding.d.ts +0 -0
  125. package/lib/apis/picoding.js +0 -0
  126. package/lib/model/strategy/adapter/index.d.ts +2 -0
  127. package/lib/model/strategy/adapter/index.js +6 -0
  128. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
  129. package/lib/model/strategy/adapter/itemRule/adapter.js +377 -0
  130. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  131. package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
  132. package/lib/model/strategy/adapter/itemRule/examples.d.ts +79 -0
  133. package/lib/model/strategy/adapter/itemRule/examples.js +316 -0
  134. package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
  135. package/lib/model/strategy/adapter/itemRule/index.js +60 -0
  136. package/lib/model/strategy/adapter/itemRule/type.d.ts +225 -0
  137. package/lib/model/strategy/adapter/itemRule/type.js +46 -0
  138. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  139. package/lib/modules/Cart/types.d.ts +2 -0
  140. package/lib/modules/Cart/utils/cartProduct.js +17 -1
  141. package/lib/modules/Cart/utils/changePrice.js +5 -0
  142. package/lib/modules/Date/index.d.ts +1 -1
  143. package/lib/modules/Date/index.js +7 -1
  144. package/lib/modules/Date/types.d.ts +3 -1
  145. package/lib/modules/OpenData/index.d.ts +24 -0
  146. package/lib/modules/OpenData/index.js +119 -0
  147. package/lib/modules/OpenData/types.d.ts +73 -0
  148. package/lib/modules/OpenData/types.js +17 -0
  149. package/lib/modules/OpenData/utils.d.ts +2 -0
  150. package/lib/modules/OpenData/utils.js +111 -0
  151. package/lib/modules/Order/index.d.ts +171 -1
  152. package/lib/modules/Order/index.js +1396 -5
  153. package/lib/modules/Order/types.d.ts +441 -20
  154. package/lib/modules/Order/types.js +1 -0
  155. package/lib/modules/Order/utils.d.ts +120 -0
  156. package/lib/modules/Order/utils.js +562 -2
  157. package/lib/modules/Product/utils.js +2 -2
  158. package/lib/modules/ProductList/index.js +2 -1
  159. package/lib/modules/Quotation/index.d.ts +8 -1
  160. package/lib/modules/Quotation/index.js +33 -4
  161. package/lib/modules/Quotation/types.d.ts +5 -0
  162. package/lib/modules/Rules/index.d.ts +3 -1
  163. package/lib/modules/Rules/index.js +46 -6
  164. package/lib/modules/Rules/types.d.ts +6 -0
  165. package/lib/modules/Rules/types.js +11 -2
  166. package/lib/modules/SalesSummary/index.d.ts +70 -0
  167. package/lib/modules/SalesSummary/index.js +106 -0
  168. package/lib/modules/SalesSummary/types.d.ts +64 -0
  169. package/lib/modules/SalesSummary/types.js +17 -0
  170. package/lib/modules/SalesSummary/utils.d.ts +34 -0
  171. package/lib/modules/SalesSummary/utils.js +430 -0
  172. package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
  173. package/lib/modules/ScanOrderLogger/index.js +135 -0
  174. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  175. package/lib/modules/ScanOrderLogger/providers/feishu.js +148 -0
  176. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  177. package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
  178. package/lib/modules/ScanOrderLogger/types.d.ts +52 -0
  179. package/lib/modules/ScanOrderLogger/types.js +17 -0
  180. package/lib/modules/Schedule/getDateIsInSchedule.js +5 -5
  181. package/lib/modules/Schedule/index.d.ts +4 -13
  182. package/lib/modules/Schedule/index.js +4 -15
  183. package/lib/modules/Schedule/utils.d.ts +1 -1
  184. package/lib/modules/Summary/index.d.ts +3 -0
  185. package/lib/modules/Summary/index.js +61 -2
  186. package/lib/modules/Summary/types.d.ts +7 -0
  187. package/lib/modules/Summary/utils.d.ts +104 -1
  188. package/lib/modules/Summary/utils.js +659 -8
  189. package/lib/modules/index.d.ts +4 -0
  190. package/lib/modules/index.js +9 -1
  191. package/lib/server/index.d.ts +41 -4
  192. package/lib/server/index.js +272 -10
  193. package/lib/server/modules/order/index.d.ts +10 -2
  194. package/lib/server/modules/order/index.js +31 -4
  195. package/lib/server/modules/products/index.d.ts +26 -0
  196. package/lib/server/modules/products/index.js +174 -22
  197. package/lib/server/modules/products/types.d.ts +5 -1
  198. package/lib/solution/BaseSales/index.d.ts +175 -0
  199. package/lib/solution/BaseSales/index.js +655 -0
  200. package/lib/solution/BaseSales/types.d.ts +305 -0
  201. package/lib/solution/BaseSales/types.js +40 -0
  202. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
  203. package/lib/solution/BaseSales/utils/parseSalesResponse.js +160 -0
  204. package/lib/solution/BaseSales/utils.d.ts +40 -0
  205. package/lib/solution/BaseSales/utils.js +200 -0
  206. package/lib/solution/BookingByStep/index.d.ts +14 -0
  207. package/lib/solution/BookingByStep/index.js +469 -91
  208. package/lib/solution/BookingByStep/types.d.ts +3 -1
  209. package/lib/solution/BookingByStep/types.js +10 -0
  210. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  211. package/lib/solution/BookingByStep/utils/resources.js +5 -2
  212. package/lib/solution/BookingTicket/index.d.ts +113 -15
  213. package/lib/solution/BookingTicket/index.js +253 -61
  214. package/lib/solution/BookingTicket/types.d.ts +69 -6
  215. package/lib/solution/BookingTicket/types.js +16 -14
  216. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
  217. package/lib/solution/BookingTicket/utils/bookingStatus.js +65 -0
  218. package/lib/solution/BookingTicket/utils/cartView.d.ts +26 -0
  219. package/lib/solution/BookingTicket/utils/cartView.js +103 -0
  220. package/lib/solution/Sales/index.d.ts +1 -0
  221. package/lib/solution/ScanOrder/index.d.ts +146 -0
  222. package/lib/solution/ScanOrder/index.js +1820 -0
  223. package/lib/solution/ScanOrder/types.d.ts +305 -0
  224. package/lib/solution/ScanOrder/types.js +36 -0
  225. package/lib/solution/ScanOrder/utils.d.ts +167 -0
  226. package/lib/solution/ScanOrder/utils.js +639 -0
  227. package/lib/solution/ShopDiscount/index.d.ts +2 -0
  228. package/lib/solution/ShopDiscount/index.js +9 -4
  229. package/lib/solution/ShopDiscount/types.d.ts +4 -0
  230. package/lib/solution/VenueBooking/index.d.ts +197 -0
  231. package/lib/solution/VenueBooking/index.js +1892 -0
  232. package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  233. package/lib/solution/VenueBooking/types.d.ts +153 -0
  234. package/lib/solution/VenueBooking/types.js +44 -0
  235. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  236. package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
  237. package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
  238. package/lib/solution/VenueBooking/utils/resource.js +91 -0
  239. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
  240. package/lib/solution/VenueBooking/utils/slotMerge.js +225 -0
  241. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  242. package/lib/solution/VenueBooking/utils/timeSlot.js +339 -0
  243. package/lib/solution/VenueBooking/utils.d.ts +1 -0
  244. package/lib/solution/VenueBooking/utils.js +69 -0
  245. package/lib/solution/index.d.ts +3 -0
  246. package/lib/solution/index.js +7 -1
  247. package/package.json +1 -1
@@ -1,13 +1,29 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { OrderModuleAPI, CommitOrderParams, CheckoutOrderParams, CancelOrderParams, ChangeBookingStatusParams } from './types';
3
+ import { OrderModuleAPI, CommitOrderParams, UpdateProductInOrderParams, CheckoutOrderParams, CancelOrderParams, ChangeBookingStatusParams } from './types';
4
4
  import { CartItem } from '../Cart/types';
5
+ import { type SubmitPayloadEnhancer } from './utils';
6
+ import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView } from './types';
7
+ import type { ICustomer } from '../AccountList/types';
8
+ import type { Discount } from '../Discount/types';
9
+ import { UnavailableReason } from '../Rules/types';
5
10
  export declare class OrderModule extends BaseModule implements Module, OrderModuleAPI {
6
11
  protected defaultName: string;
7
12
  protected defaultVersion: string;
8
13
  private store;
9
14
  private request;
10
15
  private logger;
16
+ private dbManager;
17
+ private window;
18
+ private cacheId;
19
+ private salesSummaryModuleName;
20
+ private rulesHooksOverride?;
21
+ private otherParams?;
22
+ /**
23
+ * Populate `savedAmount` on each discount based on product-level discount details.
24
+ * Only selected discounts get a non-zero value.
25
+ */
26
+ static populateSavedAmounts(productList: Array<Record<string, any>>, discountList: Array<Record<string, any>>): void;
11
27
  constructor(name?: string, version?: string);
12
28
  initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
13
29
  /**
@@ -22,6 +38,138 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
22
38
  * 记录错误日志
23
39
  */
24
40
  private logError;
41
+ private registerDiscountModules;
42
+ private createDefaultRulesHooks;
43
+ loadDiscountConfig(params: {
44
+ customerId: number;
45
+ action?: 'create';
46
+ }): Promise<void>;
47
+ getDiscountList(): Discount[];
48
+ scanCode(code: string, customerId?: number): Promise<{
49
+ isAvailable: boolean;
50
+ discountList: Discount[];
51
+ type: 'server' | 'clientCalc';
52
+ unavailableReason?: UnavailableReason;
53
+ }>;
54
+ applyDiscount(): void;
55
+ initTempOrder(params: {
56
+ cacheId?: string;
57
+ salesSummaryModuleName?: string;
58
+ }): void;
59
+ private getTempOrderStorageKey;
60
+ private restoreTempOrderFromStorage;
61
+ persistTempOrder(): void;
62
+ private createDefaultTempOrderInstance;
63
+ private createExternalSaleNumber;
64
+ private ensureExternalSaleNumber;
65
+ private ensureRequestUniqueIdempotencyToken;
66
+ hasLocalDatabase(): boolean;
67
+ private buildLocalOrderRecord;
68
+ getLocalOrderByOrderId(orderId: number | string): Promise<Record<string, any> | null>;
69
+ getLocalOrderByOrderNumber(orderNumber: string): Promise<Record<string, any> | null>;
70
+ getLocalOrderByExternalSaleNumber(externalSaleNumber: string): Promise<Record<string, any> | null>;
71
+ saveDraft(): Promise<void>;
72
+ private hydrateTempOrderFromLocalRecord;
73
+ private extractOrderIdFromSubmitResult;
74
+ private calculatePaymentTotal;
75
+ private calculatePaidPaymentSummary;
76
+ private calculatePaymentServiceFee;
77
+ private getPaymentTargetAmount;
78
+ ensureTempOrder(): OrderTempOrder;
79
+ restoreOrder(): OrderTempOrder;
80
+ getTempOrder(): OrderTempOrder | null;
81
+ getOrderIdentity(): OrderIdentitySnapshot | null;
82
+ getOrderSyncState(): OrderSyncState;
83
+ getOrderAmountSnapshot(): OrderAmountSnapshot | null;
84
+ getOrderSnapshot(): OrderSnapshot | null;
85
+ addNewOrder(): Promise<OrderTempOrder>;
86
+ getOrderProducts(): OrderProduct[];
87
+ private getProductUid;
88
+ private ensureExtend;
89
+ private captureProductRuntime;
90
+ private createLinkedProductAndBooking;
91
+ private getSalesSummary;
92
+ recalculateSummary(options?: {
93
+ createIfMissing?: boolean;
94
+ }): Promise<OrderSummary | null>;
95
+ getOrderSummary(): Promise<OrderSummary>;
96
+ updateTempOrderNote(note: string): string;
97
+ getTempOrderNote(): string;
98
+ updateTempOrderShopDiscount(amount: string | number): string;
99
+ updateTempOrderBuzzer(buzzer: string): string;
100
+ updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
101
+ /**
102
+ * 更新当前 tempOrder 的客户协议字段。
103
+ *
104
+ * PaymentModal 只需要修改订单里的客户字段;如果外部还有客户模块需要同步,
105
+ * 应由调用方通过回调处理,不能把外部 UI 状态写进 tempOrder。
106
+ */
107
+ updateTempOrderCustomer(customer: UpdateTempOrderCustomerInput): OrderSnapshot['customer'];
108
+ setOrderCustomer(patch: OrderCustomerPatch | null, snapshot?: ICustomer | null): void;
109
+ getOrderCustomer(): OrderCustomerView | null;
110
+ getOrderCustomerSnapshot(): ICustomer | null;
111
+ clearOrderCustomer(): void;
112
+ private emitOrderCustomerChange;
113
+ /**
114
+ * 读取当前订单的 Sales 协议支付项。
115
+ *
116
+ * 这里返回的是 tempOrder.payments,而不是旧 PaymentModule 的本地
117
+ * payment order / tender session。Sales checkout 以该数组为提交事实来源。
118
+ */
119
+ getOrderPayments(): OrderPaymentData[];
120
+ /**
121
+ * 用一组支付来源覆盖当前订单支付项。
122
+ *
123
+ * 入参允许来自 PaymentModule 的 PaymentItem,内部统一映射为 Sales 协议:
124
+ * uuid -> metadata.unique_payment_number,id -> custom_payment_id,
125
+ * isSynced 等运行态字段不会进入 tempOrder.payments。
126
+ */
127
+ setOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
128
+ /** 追加单个支付项,并立即持久化当前 tempOrder。 */
129
+ addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
130
+ /**
131
+ * 按支付唯一号、后端支付 ID、自定义支付方式 ID 或旧 uuid 更新支付项。
132
+ *
133
+ * 该方法服务 PaymentModal 的 void / 编辑场景;更新 metadata 时会做浅合并,
134
+ * 避免覆盖 unique_payment_number、现金实付/找零等已有元数据。
135
+ */
136
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
137
+ /** 从当前订单支付项中移除指定支付项。 */
138
+ deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
139
+ /**
140
+ * 覆盖当前订单中的 wallet pass 支付项。
141
+ *
142
+ * 判断口径与 PaymentModal 保持一致:voucher_id 存在且不为 0 的支付项
143
+ * 视为 wallet pass;其它支付项保持不变。
144
+ */
145
+ updateVoucherOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
146
+ addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput): Promise<OrderProduct[]>;
147
+ private hasGoodPassDiscount;
148
+ updateProductInOrder(params: UpdateProductInOrderParams): Promise<OrderProduct[]>;
149
+ removeProductFromOrder(identity: OrderProductIdentity): Promise<OrderProduct[]>;
150
+ /**
151
+ * 提交当前 Sales tempOrder。
152
+ *
153
+ * smallTicketDataFlag 用于 B 端 checkout 小票数据返回。PaymentModal 在支付提交时
154
+ * 应传 1,确保 /order/sales/checkout 返回打印所需数据。
155
+ */
156
+ submitTempOrder<T = any>(params?: {
157
+ cacheId?: string;
158
+ platform?: string;
159
+ businessCode?: string;
160
+ channel?: string;
161
+ type?: string;
162
+ payments?: OrderPaymentSource[];
163
+ paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
164
+ smallTicketDataFlag?: number;
165
+ enhancePayload?: SubmitPayloadEnhancer;
166
+ }): Promise<T>;
167
+ private markLocalOrderSynced;
168
+ private isSubmitResponseRejected;
169
+ private isSubmitErrorResponse;
170
+ private extractSubmitErrorResponse;
171
+ private logSubmitBackendRejected;
172
+ syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
25
173
  createOrder(params: CommitOrderParams['query']): {
26
174
  type: "virtual" | "appointment_booking";
27
175
  platform: string;
@@ -52,4 +200,26 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
52
200
  * @returns 后端返回的订单数据(包含订单ID等)
53
201
  */
54
202
  createOrderByCheckout(params: CheckoutOrderParams): Promise<any>;
203
+ submitSalesOrder<T = any>(params: SubmitSalesOrderParams): Promise<T>;
204
+ /**
205
+ * 发送支付链接邮件。
206
+ *
207
+ * 调用前必须已经有远端 order_id。BaseSales 会在需要时先提交本地订单,
208
+ * OrderModule 只负责校验 order_ids 并调用 /order/batch-email。
209
+ */
210
+ sendCustomerPayLink<T = any>(params: SendCustomerPayLinkParams): Promise<T>;
211
+ getOrderInfoByRemote(order_id: number): Promise<any>;
212
+ /**
213
+ * 把 sqlite / 后端返回的订单记录直接恢复为 tempOrder。
214
+ *
215
+ * 数据源应尽量返回 tempOrder 所需结构;这里仅做 SDK 运行必须字段兜底,
216
+ * 例如数组字段、商品行唯一值、价格 metadata、summary 派生状态和 _extend。
217
+ */
218
+ hydrateTempOrderFromRecord(record: Record<string, any>, options?: {
219
+ recalcOnHydrate?: boolean;
220
+ }): Promise<OrderTempOrder>;
221
+ private normalizeHydratedOrderProduct;
222
+ getLastOrderInfo(): Record<string, any> | undefined;
223
+ getOrderInfo(order_id: number): Promise<any>;
55
224
  }
225
+ export type { UpdateProductInOrderParams } from './types';