@pisell/pisellos 2.2.264 → 2.2.265

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 (152) hide show
  1. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  2. package/dist/model/strategy/adapter/dataVariant/adapter.js +167 -0
  3. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +89 -0
  4. package/dist/model/strategy/adapter/dataVariant/evaluator.js +780 -0
  5. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  6. package/dist/model/strategy/adapter/dataVariant/examples.js +277 -0
  7. package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  8. package/dist/model/strategy/adapter/dataVariant/index.js +4 -0
  9. package/dist/model/strategy/adapter/dataVariant/type.d.ts +148 -0
  10. package/dist/model/strategy/adapter/dataVariant/type.js +54 -0
  11. package/dist/model/strategy/adapter/index.d.ts +4 -0
  12. package/dist/model/strategy/adapter/index.js +5 -1
  13. package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -4
  14. package/dist/model/strategy/adapter/promotion/adapter.js +0 -23
  15. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
  16. package/dist/model/strategy/adapter/promotion/evaluator.js +6 -279
  17. package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -86
  18. package/dist/model/strategy/adapter/promotion/examples.js +0 -99
  19. package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
  20. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  21. package/dist/model/strategy/adapter/promotion/type.d.ts +2 -90
  22. package/dist/model/strategy/adapter/promotion/type.js +0 -45
  23. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +16 -10
  24. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
  25. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
  26. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +32 -1
  27. package/dist/modules/Discount/index.d.ts +5 -2
  28. package/dist/modules/Discount/index.js +30 -7
  29. package/dist/modules/Discount/types.d.ts +4 -0
  30. package/dist/modules/Order/index.d.ts +41 -10
  31. package/dist/modules/Order/index.js +1370 -808
  32. package/dist/modules/Order/payment-utils.d.ts +26 -0
  33. package/dist/modules/Order/payment-utils.js +225 -0
  34. package/dist/modules/Order/types.d.ts +49 -1
  35. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  36. package/dist/modules/Order/utils/orderCollectionIdentity.js +410 -0
  37. package/dist/modules/Order/utils.d.ts +4 -3
  38. package/dist/modules/Order/utils.js +62 -66
  39. package/dist/modules/Payment/index.d.ts +2 -0
  40. package/dist/modules/Payment/index.js +78 -49
  41. package/dist/modules/Payment/types.d.ts +26 -24
  42. package/dist/modules/Payment/types.js +2 -0
  43. package/dist/modules/Product/types.d.ts +22 -0
  44. package/dist/modules/ProductList/index.d.ts +1 -1
  45. package/dist/modules/ProductList/index.js +4 -2
  46. package/dist/modules/ProductList/types.d.ts +2 -0
  47. package/dist/modules/Rules/index.d.ts +2 -9
  48. package/dist/modules/Rules/index.js +69 -43
  49. package/dist/modules/Rules/types.d.ts +10 -1
  50. package/dist/server/index.d.ts +71 -0
  51. package/dist/server/index.js +2504 -1187
  52. package/dist/server/modules/order/index.d.ts +56 -5
  53. package/dist/server/modules/order/index.js +1718 -834
  54. package/dist/server/modules/order/types.d.ts +15 -3
  55. package/dist/server/modules/order/types.js +1 -1
  56. package/dist/server/modules/products/index.d.ts +31 -8
  57. package/dist/server/modules/products/index.js +549 -390
  58. package/dist/server/modules/products/types.d.ts +18 -0
  59. package/dist/solution/BaseSales/index.d.ts +54 -4
  60. package/dist/solution/BaseSales/index.js +1448 -788
  61. package/dist/solution/BaseSales/types.d.ts +6 -1
  62. package/dist/solution/BaseSales/types.js +1 -1
  63. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
  64. package/dist/solution/BaseSales/utils/cartPromotion.js +50 -97
  65. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +9 -4
  66. package/dist/solution/BaseSales/utils/parseSalesResponse.js +6 -8
  67. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +14 -1
  68. package/dist/solution/BookingByStep/index.d.ts +1 -1
  69. package/dist/solution/BookingTicket/index.js +61 -26
  70. package/dist/solution/BookingTicket/types.d.ts +2 -0
  71. package/dist/solution/Sales/index.d.ts +1 -0
  72. package/dist/solution/Sales/index.js +10 -2
  73. package/dist/solution/ScanOrder/index.js +20 -31
  74. package/dist/solution/ShopDiscount/index.js +15 -14
  75. package/dist/solution/VenueBooking/index.js +19 -30
  76. package/dist/utils/payment-number.d.ts +9 -0
  77. package/dist/utils/payment-number.js +69 -0
  78. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  79. package/lib/model/strategy/adapter/dataVariant/adapter.js +149 -0
  80. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +89 -0
  81. package/lib/model/strategy/adapter/dataVariant/evaluator.js +583 -0
  82. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  83. package/lib/model/strategy/adapter/dataVariant/examples.js +293 -0
  84. package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  85. package/lib/model/strategy/adapter/dataVariant/index.js +38 -0
  86. package/lib/model/strategy/adapter/dataVariant/type.d.ts +148 -0
  87. package/lib/model/strategy/adapter/dataVariant/type.js +31 -0
  88. package/lib/model/strategy/adapter/index.d.ts +4 -0
  89. package/lib/model/strategy/adapter/index.js +13 -2
  90. package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -4
  91. package/lib/model/strategy/adapter/promotion/adapter.js +0 -20
  92. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
  93. package/lib/model/strategy/adapter/promotion/evaluator.js +0 -235
  94. package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -86
  95. package/lib/model/strategy/adapter/promotion/examples.js +0 -91
  96. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  97. package/lib/model/strategy/adapter/promotion/index.js +0 -2
  98. package/lib/model/strategy/adapter/promotion/type.d.ts +2 -90
  99. package/lib/model/strategy/adapter/promotion/type.js +0 -2
  100. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -0
  101. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -0
  102. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
  103. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +23 -2
  104. package/lib/modules/Discount/index.d.ts +5 -2
  105. package/lib/modules/Discount/index.js +23 -3
  106. package/lib/modules/Discount/types.d.ts +4 -0
  107. package/lib/modules/Order/index.d.ts +41 -10
  108. package/lib/modules/Order/index.js +505 -119
  109. package/lib/modules/Order/payment-utils.d.ts +26 -0
  110. package/lib/modules/Order/payment-utils.js +224 -0
  111. package/lib/modules/Order/types.d.ts +49 -1
  112. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  113. package/lib/modules/Order/utils/orderCollectionIdentity.js +418 -0
  114. package/lib/modules/Order/utils.d.ts +4 -3
  115. package/lib/modules/Order/utils.js +27 -26
  116. package/lib/modules/Payment/index.d.ts +2 -0
  117. package/lib/modules/Payment/index.js +33 -12
  118. package/lib/modules/Payment/types.d.ts +26 -24
  119. package/lib/modules/Product/types.d.ts +22 -0
  120. package/lib/modules/ProductList/index.d.ts +1 -1
  121. package/lib/modules/ProductList/index.js +4 -2
  122. package/lib/modules/ProductList/types.d.ts +2 -0
  123. package/lib/modules/Rules/index.d.ts +2 -9
  124. package/lib/modules/Rules/index.js +61 -29
  125. package/lib/modules/Rules/types.d.ts +10 -1
  126. package/lib/server/index.d.ts +71 -0
  127. package/lib/server/index.js +1002 -52
  128. package/lib/server/modules/order/index.d.ts +56 -5
  129. package/lib/server/modules/order/index.js +798 -148
  130. package/lib/server/modules/order/types.d.ts +15 -3
  131. package/lib/server/modules/products/index.d.ts +31 -8
  132. package/lib/server/modules/products/index.js +134 -35
  133. package/lib/server/modules/products/types.d.ts +18 -0
  134. package/lib/solution/BaseSales/index.d.ts +54 -4
  135. package/lib/solution/BaseSales/index.js +475 -50
  136. package/lib/solution/BaseSales/types.d.ts +6 -1
  137. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
  138. package/lib/solution/BaseSales/utils/cartPromotion.js +25 -64
  139. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +9 -4
  140. package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -5
  141. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -0
  142. package/lib/solution/BookingByStep/index.d.ts +1 -1
  143. package/lib/solution/BookingTicket/index.js +35 -9
  144. package/lib/solution/BookingTicket/types.d.ts +2 -0
  145. package/lib/solution/Sales/index.d.ts +1 -0
  146. package/lib/solution/Sales/index.js +5 -3
  147. package/lib/solution/ScanOrder/index.js +0 -8
  148. package/lib/solution/ShopDiscount/index.js +2 -1
  149. package/lib/solution/VenueBooking/index.js +0 -8
  150. package/lib/utils/payment-number.d.ts +9 -0
  151. package/lib/utils/payment-number.js +64 -0
  152. package/package.json +1 -1
@@ -88,6 +88,24 @@ function resolveDurationMinutes(value) {
88
88
  const n = Number(value);
89
89
  return Number.isNaN(n) ? void 0 : n;
90
90
  }
91
+ function normalizeChildResource(child, parentFormId) {
92
+ const item = {
93
+ form_id: (child == null ? void 0 : child.form_id) ?? parentFormId,
94
+ relation_type: (child == null ? void 0 : child.relation_type) || "form",
95
+ relation_id: (child == null ? void 0 : child.relation_id) ?? (child == null ? void 0 : child.id),
96
+ capacity: child == null ? void 0 : child.capacity,
97
+ like_status: (child == null ? void 0 : child.like_status) || "common"
98
+ };
99
+ if ((child == null ? void 0 : child.metadata) !== void 0) {
100
+ item.metadata = { ...child.metadata };
101
+ }
102
+ if (Array.isArray(child == null ? void 0 : child.children)) {
103
+ item.children = child.children.map(
104
+ (nestedChild) => normalizeChildResource(nestedChild, item.form_id)
105
+ );
106
+ }
107
+ return item;
108
+ }
91
109
  function flattenResources(cacheItem) {
92
110
  var _a;
93
111
  const resourceMap = ((_a = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _a.resource) || {};
@@ -107,8 +125,11 @@ function flattenResources(cacheItem) {
107
125
  if ((r == null ? void 0 : r.metadata) !== void 0) {
108
126
  item.metadata = { ...r.metadata };
109
127
  }
110
- if ((r == null ? void 0 : r.children) !== void 0)
111
- item.children = r.children;
128
+ if (Array.isArray(r == null ? void 0 : r.children)) {
129
+ item.children = r.children.map(
130
+ (child) => normalizeChildResource(child, item.form_id)
131
+ );
132
+ }
112
133
  result.push(item);
113
134
  });
114
135
  });
@@ -1,6 +1,6 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { Discount, DiscountModuleAPI, DiscountWithReason } from './types';
3
+ import { Discount, DiscountModuleAPI, DiscountWithReason, DiscountPrepareConfigResult } from './types';
4
4
  export declare class DiscountModule extends BaseModule implements Module, DiscountModuleAPI {
5
5
  protected defaultName: string;
6
6
  protected defaultVersion: string;
@@ -16,15 +16,18 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
16
16
  getDiscountList(): Discount[];
17
17
  setOriginalDiscountList(originalDiscountList: Discount[]): Promise<void>;
18
18
  getOriginalDiscountList(): Discount[];
19
+ private normalizePositiveNumberIds;
19
20
  loadPrepareConfig(params: {
20
21
  action?: 'create' | 'edit';
21
22
  with_good_pass: 0 | 1;
22
23
  with_discount_card: 0 | 1;
23
24
  customer_id: number;
24
25
  with_wallet_pass_holder: 0 | 1;
26
+ with_available_wallet_flag?: 0 | 1;
27
+ with_available_wallet_pass_flag?: 0 | 1;
25
28
  request_timezone: string;
26
29
  order_id?: number | string;
27
- }): Promise<Discount[]>;
30
+ }): Promise<DiscountPrepareConfigResult>;
28
31
  batchSearch(code: string, options?: {
29
32
  customerId?: number;
30
33
  orderId?: number;
@@ -91,23 +91,43 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
91
91
  getOriginalDiscountList() {
92
92
  return this.store.originalDiscountList || [];
93
93
  }
94
+ normalizePositiveNumberIds(values) {
95
+ const ids = values.map((value) => Number(value)).filter((value) => Number.isFinite(value) && value > 0);
96
+ return Array.from(new Set(ids));
97
+ }
94
98
  async loadPrepareConfig(params) {
95
- var _a, _b;
99
+ var _a, _b, _c, _d, _e;
96
100
  if (typeof params.order_id === "string" && params.order_id.startsWith("LOCAL_")) {
97
101
  params.order_id = void 0;
98
102
  }
99
103
  const prepareConfig = await this.request.post(
100
104
  `/order/prepare/config`,
101
- params
105
+ {
106
+ ...params,
107
+ with_available_wallet_flag: params.with_available_wallet_flag ?? 1,
108
+ with_available_wallet_pass_flag: params.with_available_wallet_pass_flag ?? 1
109
+ }
102
110
  );
103
111
  const rawDiscountList = [
104
112
  ...((_a = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _a.good_pass_list) || [],
105
113
  ...((_b = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _b.discount_card_list) || []
106
114
  ];
115
+ const availableWalletList = [
116
+ ...((_c = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _c.avaiable_wallet_list) || [],
117
+ ...((_d = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _d.available_wallet_list) || []
118
+ ];
119
+ const availableWalletPassList = ((_e = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _e.available_wallet_pass_list) || [];
120
+ const availableWalletIds = this.normalizePositiveNumberIds([
121
+ ...availableWalletList.map((item) => item == null ? void 0 : item.wallet_id),
122
+ ...availableWalletPassList.map((item) => item == null ? void 0 : item.product_id)
123
+ ]);
107
124
  const goodPassList = this.filterEnabledDiscountList(
108
125
  rawDiscountList
109
126
  ) || [];
110
- return goodPassList;
127
+ return {
128
+ discountList: goodPassList,
129
+ availableWalletIds
130
+ };
111
131
  }
112
132
  async batchSearch(code, options) {
113
133
  const { customerId, orderId } = options || {};
@@ -68,6 +68,10 @@ export interface DiscountWithReason {
68
68
  discountList: Discount[];
69
69
  unavailableReasonKey: DiscountFilterRejectKey | null;
70
70
  }
71
+ export interface DiscountPrepareConfigResult {
72
+ discountList: Discount[];
73
+ availableWalletIds: number[];
74
+ }
71
75
  interface ExtensionData {
72
76
  id: number;
73
77
  shop_id: number;
@@ -3,7 +3,7 @@ import { BaseModule } from '../BaseModule';
3
3
  import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CheckoutOrderParams, CancelOrderParams, ChangeBookingStatusParams } from './types';
4
4
  import { CartItem } from '../Cart/types';
5
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, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from './types';
6
+ import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from './types';
7
7
  import type { ICustomer } from '../AccountList/types';
8
8
  import type { Discount } from '../Discount/types';
9
9
  import { UnavailableReason } from '../Rules/types';
@@ -14,6 +14,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
14
14
  private request;
15
15
  private logger;
16
16
  private window;
17
+ private appPlugin;
17
18
  private cacheId;
18
19
  private salesSummaryModuleName;
19
20
  private rulesHooksOverride?;
@@ -75,6 +76,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
75
76
  apply?: boolean;
76
77
  }): Promise<Discount[]>;
77
78
  getDiscountList(): Discount[];
79
+ getAvailableWalletIds(): number[];
80
+ private syncScannedDiscountsToOriginalDiscountList;
78
81
  private ensureEditDiscountConfigForProductChange;
79
82
  scanCode(code: string, customerId?: number): Promise<{
80
83
  isAvailable: boolean;
@@ -84,7 +87,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
84
87
  unavailableReasonKey?: string | null;
85
88
  scannedDiscountList?: Discount[];
86
89
  }>;
87
- applyDiscount(): void;
90
+ applyDiscount(options?: {
91
+ reapplyBookingDiscountProductUids?: string[];
92
+ }): void;
88
93
  /**
89
94
  * 注入促销评估器。
90
95
  *
@@ -152,6 +157,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
152
157
  private extractOrderIdFromSubmitResult;
153
158
  private calculatePaymentEffectiveAmount;
154
159
  private calculatePaymentTotal;
160
+ private calculateOrderPaidPaymentTotal;
155
161
  private getDepositAmount;
156
162
  private normalizeDepositAmount;
157
163
  private getLastOrderDepositSnapshot;
@@ -171,6 +177,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
171
177
  };
172
178
  private calculateDepositPaidAmount;
173
179
  private resolveNextOrderPaymentType;
180
+ private getPaymentNumberAppData;
181
+ private getPaymentNumberDevicePrefixSync;
182
+ private getPaymentNumberDevicePrefixAsync;
174
183
  private normalizePaymentSource;
175
184
  private updateTempOrderPaymentStatus;
176
185
  private shouldKeepPaymentStatusAfterAmountRecalc;
@@ -180,6 +189,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
180
189
  private calculatePaidPaymentSummary;
181
190
  private calculatePaymentServiceFee;
182
191
  private calculatePaymentGapAmount;
192
+ private calculatePaymentOrderAmount;
183
193
  private calculatePaymentRoundingAmount;
184
194
  private formatSummaryMetadataMoney;
185
195
  private syncSummaryProductMetadata;
@@ -274,6 +284,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
274
284
  updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
275
285
  private buildTempOrderCustomer;
276
286
  private isCustomerBoundDiscount;
287
+ private shouldKeepCustomerBoundDiscountAfterCustomerChange;
277
288
  private productHasCustomerBoundDiscount;
278
289
  private shouldSkipDiscountCalculation;
279
290
  private clearCustomerBoundDiscounts;
@@ -300,19 +311,20 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
300
311
  * 用一组支付来源覆盖当前订单支付项。
301
312
  *
302
313
  * 入参允许来自 PaymentModule 的 PaymentItem,内部统一映射为 Sales 协议:
303
- * uuid -> metadata.unique_payment_number,id -> custom_payment_id,
314
+ * 新支付来源的 uuid 会作为 payment_number 的唯一号段,id -> custom_payment_id,
304
315
  * isSynced 等运行态字段不会进入 tempOrder.payments。
305
316
  */
306
317
  setOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
307
- /** 追加单个支付项,并立即持久化当前 tempOrder。 */
318
+ /** 同步兼容入口:按调用当下的 device_id 或 LOCAL 生成支付编号。 */
308
319
  addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
320
+ /** 异步入口:创建支付项时读取最新 IoT 设备短号。 */
321
+ addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
322
+ private addOrderPaymentWithDevicePrefix;
309
323
  /**
310
- * 按支付唯一号、后端支付 ID、自定义支付方式 ID 或旧 uuid 更新支付项。
311
- *
312
- * 该方法服务 PaymentModal 的 void / 编辑场景;更新 metadata 时会做浅合并,
313
- * 避免覆盖 unique_payment_number、现金实付/找零等已有元数据。
324
+ * 默认按支付唯一号精确更新;仅显式指定 legacy 时兼容历史支付标识。
325
+ * metadata 与 transactions 会分别合并,避免覆盖支付会话号和已有交易记录。
314
326
  */
315
- updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
327
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>, options?: OrderPaymentUpdateOptions): Promise<OrderPaymentUpdateResult>;
316
328
  /** 从当前订单支付项中移除指定支付项。 */
317
329
  deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
318
330
  private confirmPendingVoucherPaymentsInList;
@@ -335,7 +347,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
335
347
  */
336
348
  updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
337
349
  status?: 'paid' | 'payment_pending';
350
+ devicePrefix?: string;
338
351
  }): OrderPaymentData[];
352
+ updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
353
+ status?: 'paid' | 'payment_pending';
354
+ }): Promise<OrderPaymentData[]>;
339
355
  private shouldMergeProductToOrder;
340
356
  private hasOrderProductLineNote;
341
357
  /**
@@ -420,6 +436,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
420
436
  type?: string;
421
437
  }): import("./types").OrderSubmitPayload;
422
438
  applyLocalPrintOrderNumbers(order?: Record<string, any> | null): Promise<OrderTempOrder>;
439
+ saveTempOrderAsDraft<T = any>(params?: {
440
+ cacheId?: string;
441
+ platform?: string;
442
+ businessCode?: string;
443
+ channel?: string;
444
+ type?: string;
445
+ enhancePayload?: SubmitPayloadEnhancer;
446
+ }): Promise<T>;
423
447
  /**
424
448
  * 提交当前 Sales tempOrder。
425
449
  *
@@ -461,7 +485,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
461
485
  generateIdempotencyToken(): string;
462
486
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
463
487
  createOrder(params: CommitOrderParams['query']): {
464
- type: "appointment_booking" | "virtual";
488
+ type: "virtual" | "appointment_booking";
465
489
  platform: string;
466
490
  sales_channel: string;
467
491
  order_sales_channel: string;
@@ -518,7 +542,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
518
542
  * this.normalizeHydratedBookingHolder({ metadata: { holder: { form_record: [1] } } });
519
543
  */
520
544
  private normalizeHydratedBookingHolder;
545
+ /**
546
+ * 匿名 booking 没有服务端行 ID 时,商品侧已有的 booking_uid 就是唯一可用的强引用。
547
+ * 在统一规范化生成 UUID 前先复用它;已落库 booking 仍按 schedule_event_id 派生稳定 UID。
548
+ */
549
+ private seedAnonymousBookingUidsFromProducts;
521
550
  private normalizeTempOrderForRuntime;
551
+ private isSyntheticDraftOrderIdForRuntime;
552
+ private withoutSyntheticDraftOrderIdForRuntime;
522
553
  private hydrateLinkedBookingIdentity;
523
554
  private pickHydratedDisplayText;
524
555
  private formatHydratedNamePair;