@pisell/pisellos 2.2.148 → 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 +246 -193
  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 +26 -1
  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
@@ -23,7 +23,8 @@ export interface FormattedProductData extends ProductData {
23
23
  export interface LoadProductsPriceParams {
24
24
  ids: number[];
25
25
  schedule_date: string;
26
- customer_id?: number;
26
+ schedule_datetime?: string;
27
+ customer_id?: number | string;
27
28
  }
28
29
  /**
29
30
  * 加载报价单商品价格返回数据
@@ -47,6 +48,7 @@ export interface LoadProductsPriceData {
47
48
  bundle_product_id: number;
48
49
  bundle_variant_id: number;
49
50
  price: number;
51
+ base_price?: number | string;
50
52
  price_type: string;
51
53
  price_type_ext: string;
52
54
  }[];
@@ -107,6 +109,8 @@ export interface ProductSyncMessage {
107
109
  */
108
110
  export interface ProductFormatterContext {
109
111
  schedule_date: string;
112
+ schedule_datetime?: string;
113
+ customer_id?: number | string;
110
114
  priceData?: LoadProductsPriceData[];
111
115
  scheduleModule?: any;
112
116
  locale?: string;
@@ -0,0 +1,175 @@
1
+ import { Module, ModuleOptions, PisellCore } from '../../types';
2
+ import { BaseModule } from '../../modules/BaseModule';
3
+ import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesScanCodeResult } from './types';
4
+ import { OrderModule } from '../../modules/Order';
5
+ import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateProductInOrderParams } from '../../modules/Order/types';
6
+ import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
7
+ import type { Discount } from '../../modules/Discount/types';
8
+ import { RequestPlugin, WindowPlugin } from '../../plugins';
9
+ export * from './types';
10
+ import { ProductList } from '../../modules/ProductList';
11
+ import type { SalesSummaryModule } from '../../modules/SalesSummary';
12
+ import type { ScheduleModule } from '../../modules/Schedule';
13
+ import type { ISalesDetail, ISalesDetailHeader, ISalesBooking, ISalesPayment, ISalesSurcharge } from './utils/parseSalesResponse';
14
+ export interface BaseSalesState {
15
+ order?: OrderModule;
16
+ products?: ProductList;
17
+ salesSummary?: SalesSummaryModule;
18
+ schedule?: ScheduleModule;
19
+ }
20
+ export declare class BaseSalesImpl extends BaseModule implements Module {
21
+ protected defaultName: string;
22
+ protected defaultVersion: string;
23
+ isSolution: boolean;
24
+ protected initializeOptions: ModuleOptions;
25
+ protected store: BaseSalesState;
26
+ protected otherParams: Record<string, any>;
27
+ protected cacheId: string | undefined;
28
+ /**
29
+ * window / request 暴露为 public:现存外部工具(如 BookingTicket Scan)通过
30
+ * `solution.window` / `solution.request` 直接访问插件,保持原有契约不破坏。
31
+ */
32
+ window: WindowPlugin;
33
+ request: RequestPlugin;
34
+ protected currentSalesDetail: ISalesDetail | null;
35
+ constructor(name?: string, version?: string);
36
+ /**
37
+ * 子类可覆盖此方法以追加/收敛要注册的子模块。
38
+ * 默认包含通用销售模块:products / order / salesSummary / schedule。
39
+ */
40
+ protected getRegisteredModuleNames(): readonly string[];
41
+ /**
42
+ * 工厂入口:根据子模块名实例化对应模块。
43
+ * 默认使用 BookingByStep 公共 `createModule`。子类若需引入额外类型(如 customer),
44
+ * 可覆盖此方法并把未识别的 name 委托给 `super.createSubModule(name)`。
45
+ */
46
+ protected createSubModule(moduleName: string): Module | null;
47
+ /**
48
+ * 读取 sessionStorage[this.name][cacheId],作为子模块 initialState 的来源。
49
+ * sessionStorage 损坏时静默忽略,按空状态注册。
50
+ */
51
+ protected readSessionCacheData(): Record<string, any>;
52
+ initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
53
+ destroy(): Promise<void>;
54
+ /**
55
+ * 加载销售订单到统一 tempOrder 工作区。
56
+ * 有 app.sqlite 时优先读取本地记录;本地未命中或 forceRemote=true 时再拉云端。
57
+ *
58
+ * 子类可在 `super.loadSalesDetail` 之后基于返回的 `sales` 做业务侧装配
59
+ * (比如把 `sales.customer` 写入 CustomerModule、emit 业务 hook 等)。
60
+ */
61
+ loadSalesDetail(orderIdOrParams: number | string | LoadSalesDetailParams): Promise<ISalesDetail>;
62
+ /** 获取当前已加载的销售详情(只读快照)。未加载过则返回 null。 */
63
+ getSalesOrder(): ISalesDetail | null;
64
+ /** 获取销售详情顶部业务字段(订单号/状态/金额等通用字段集合)。 */
65
+ getOrderHeader(): ISalesDetailHeader | null;
66
+ /** 获取所有 booking(含 root + children),按服务端原始顺序输出。 */
67
+ getBookings(): ISalesBooking[];
68
+ /** 获取根 booking(is_next === 0 / is_root === 1),多个时取第一个。 */
69
+ getRootBooking(): ISalesBooking | null;
70
+ /** 按 product_uid 反查 booking 列表(用于商品行 ↔ booking 映射)。 */
71
+ getChildBookingsByProductUid(productUid: string): ISalesBooking[];
72
+ /** 获取支付列表(已支付/退款等明细)。 */
73
+ getPayments(): ISalesPayment[];
74
+ /** 获取附加费用(运费/服务费/税费等)。 */
75
+ getSurcharges(): ISalesSurcharge[];
76
+ getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
77
+ getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
78
+ getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
79
+ getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
80
+ getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
81
+ getTempOrderNote(): string;
82
+ updateTempOrderNote(note: string): string;
83
+ updateOrderShopDiscount(amount: string | number): string;
84
+ private ensureTempOrder;
85
+ addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
86
+ saveDraft(): Promise<void>;
87
+ restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
88
+ getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
89
+ getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
90
+ getDiscountList(): Discount[];
91
+ scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
92
+ setDiscountSelected(params: {
93
+ discountId: number;
94
+ isSelected: boolean;
95
+ }): Promise<void>;
96
+ submitScanOrder<T = any>(params?: {
97
+ payments?: OrderPaymentSource[];
98
+ paymentStatus?: BaseSalesPaymentStatus;
99
+ smallTicketDataFlag?: number;
100
+ enhancePayload?: SubmitPayloadEnhancer;
101
+ }): Promise<T>;
102
+ /**
103
+ * 提交当前 Sales 订单。
104
+ *
105
+ * PaymentModal 场景通过 smallTicketDataFlag=1 请求 B 端小票数据;
106
+ * payments 会交给 OrderModule 统一映射为 Sales 协议支付项。
107
+ */
108
+ submitSalesOrder<T = any>(params?: {
109
+ payments?: OrderPaymentSource[];
110
+ paymentStatus?: BaseSalesPaymentStatus;
111
+ smallTicketDataFlag?: number;
112
+ enhancePayload?: SubmitPayloadEnhancer;
113
+ }): Promise<T>;
114
+ syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
115
+ /** 读取当前 BaseSales 订单上下文中的 Sales 协议支付项。 */
116
+ getOrderPayments(): OrderPaymentData[];
117
+ /** 覆盖当前订单支付项,内部由 OrderModule 清洗为 Sales 协议字段。 */
118
+ setOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
119
+ /** 追加单个支付项到当前订单。 */
120
+ addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
121
+ /** 更新当前订单中的指定支付项。 */
122
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
123
+ /** 删除当前订单中的指定支付项。 */
124
+ deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
125
+ /** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
126
+ updateVoucherOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
127
+ /**
128
+ * 更新当前订单客户字段。
129
+ *
130
+ * 这是 PaymentModal 客户切换的订单事实入口;外部客户模块同步应由
131
+ * 调用方通过 onCustomerChange 回调完成。
132
+ */
133
+ updateOrderCustomer(customer: UpdateTempOrderCustomerInput): {
134
+ customerId: number | null;
135
+ customerName: string;
136
+ phone: string;
137
+ email: string;
138
+ };
139
+ /** 获取可用支付方式列表,供 PaymentModal 渲染支付选项。 */
140
+ getPaymentMethodsAsync(): Promise<any[]>;
141
+ /** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
142
+ roundAmount(params: {
143
+ amount: string | number;
144
+ interval?: string | number;
145
+ rule?: 'standard_rounding' | 'standard_down' | 'always_up' | 'always_down' | string;
146
+ }): {
147
+ originalAmount: string;
148
+ roundedAmount: string;
149
+ roundingDifference: string;
150
+ };
151
+ /**
152
+ * 发送支付链接。
153
+ *
154
+ * 如果没有 orderIds 或显式 submitBeforeSend,会先提交当前本地订单到云端;
155
+ * 只有成功拿到远端 order_id 后才调用 OrderModule 发送邮件。
156
+ */
157
+ sendCustomerPayLink<T = any>(params: Omit<SendCustomerPayLinkParams, 'orderIds' | 'order_ids'> & {
158
+ orderIds?: Array<number | string>;
159
+ order_ids?: Array<number | string>;
160
+ submitBeforeSend?: boolean;
161
+ }): Promise<T>;
162
+ addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
163
+ updateProductInOrder(params: UpdateProductInOrderParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
164
+ /**
165
+ * 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
166
+ * 多行同 SKU 时必须传入与删除/更新一致的 unique_identification_number。
167
+ */
168
+ setOrderProductLineNote(identity: BaseSalesOrderProductIdentity, note: string): Promise<import("../../modules/Order/types").OrderProduct[]>;
169
+ removeProductFromOrder(identity: BaseSalesOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
170
+ getProductList(): Promise<any>;
171
+ getOtherParams(): Record<string, any>;
172
+ setOtherParams(params: Record<string, any>, { cover }?: {
173
+ cover?: boolean;
174
+ }): Promise<void>;
175
+ }