@pisell/pisellos 2.2.256 → 2.2.258

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 (52) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +17 -13
  3. package/dist/modules/Order/index.d.ts +29 -1
  4. package/dist/modules/Order/index.js +508 -241
  5. package/dist/modules/Order/types.d.ts +20 -2
  6. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  7. package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
  8. package/dist/modules/Order/utils.d.ts +4 -0
  9. package/dist/modules/Order/utils.js +114 -28
  10. package/dist/modules/Product/index.d.ts +1 -1
  11. package/dist/modules/Product/types.d.ts +6 -0
  12. package/dist/modules/Rules/index.d.ts +3 -3
  13. package/dist/modules/Rules/index.js +8 -3
  14. package/dist/modules/Rules/types.d.ts +2 -1
  15. package/dist/server/index.d.ts +12 -2
  16. package/dist/server/index.js +1227 -923
  17. package/dist/server/modules/order/index.d.ts +22 -3
  18. package/dist/server/modules/order/index.js +397 -314
  19. package/dist/solution/BaseSales/index.d.ts +16 -2
  20. package/dist/solution/BaseSales/index.js +484 -314
  21. package/dist/solution/BaseSales/types.d.ts +1 -0
  22. package/dist/solution/BaseSales/types.js +2 -1
  23. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +4 -2
  24. package/dist/solution/BookingByStep/index.d.ts +1 -1
  25. package/dist/solution/BookingTicket/index.d.ts +9 -1
  26. package/dist/solution/BookingTicket/index.js +162 -6
  27. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +11 -1
  28. package/lib/modules/Order/index.d.ts +29 -1
  29. package/lib/modules/Order/index.js +340 -57
  30. package/lib/modules/Order/types.d.ts +20 -2
  31. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  32. package/lib/modules/Order/utils/bundleDiscountHydration.js +139 -0
  33. package/lib/modules/Order/utils.d.ts +4 -0
  34. package/lib/modules/Order/utils.js +84 -2
  35. package/lib/modules/Product/index.d.ts +1 -1
  36. package/lib/modules/Product/types.d.ts +6 -0
  37. package/lib/modules/Rules/index.d.ts +3 -3
  38. package/lib/modules/Rules/index.js +4 -3
  39. package/lib/modules/Rules/types.d.ts +2 -1
  40. package/lib/server/index.d.ts +12 -2
  41. package/lib/server/index.js +218 -12
  42. package/lib/server/modules/order/index.d.ts +22 -3
  43. package/lib/server/modules/order/index.js +102 -51
  44. package/lib/solution/BaseSales/index.d.ts +16 -2
  45. package/lib/solution/BaseSales/index.js +143 -31
  46. package/lib/solution/BaseSales/types.d.ts +1 -0
  47. package/lib/solution/BaseSales/types.js +2 -1
  48. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +4 -5
  49. package/lib/solution/BookingByStep/index.d.ts +1 -1
  50. package/lib/solution/BookingTicket/index.d.ts +9 -1
  51. package/lib/solution/BookingTicket/index.js +112 -0
  52. package/package.json +1 -1
@@ -14,6 +14,7 @@ export declare const BaseSalesHookNames: {
14
14
  readonly onCartValidationChanged: "onCartValidationChanged";
15
15
  readonly onPaymentSyncStart: "onPaymentSyncStart";
16
16
  readonly onPaymentSyncEnd: "onPaymentSyncEnd";
17
+ readonly onDepositPaymentSyncEnd: "onDepositPaymentSyncEnd";
17
18
  };
18
19
  export type BaseSalesHookName = typeof BaseSalesHookNames[keyof typeof BaseSalesHookNames];
19
20
  export declare function createBaseSalesHook(moduleName: string, hookName: BaseSalesHookName): string;
@@ -9,7 +9,8 @@ export var BaseSalesHookNames = {
9
9
  onRefresh: 'onRefresh',
10
10
  onCartValidationChanged: 'onCartValidationChanged',
11
11
  onPaymentSyncStart: 'onPaymentSyncStart',
12
- onPaymentSyncEnd: 'onPaymentSyncEnd'
12
+ onPaymentSyncEnd: 'onPaymentSyncEnd',
13
+ onDepositPaymentSyncEnd: 'onDepositPaymentSyncEnd'
13
14
  };
14
15
  export function createBaseSalesHook(moduleName, hookName) {
15
16
  return "".concat(moduleName, ":").concat(hookName);
@@ -105,7 +105,9 @@ export function transformBaseProductToOrderProduct(params) {
105
105
  var origin = _objectSpread(_objectSpread({}, sourceProduct || {}), callbackOrigin || {});
106
106
  var matchedVariant = (_ref15 = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceProduct, productVariantId)) !== null && _ref15 !== void 0 ? _ref15 : findVariantById(origin, productVariantId);
107
107
  var sourceProductPrice = toPriceString((_ref16 = (_ref17 = (_ref18 = (_ref19 = (_ref20 = (_ref21 = (_ref22 = (_payload$price = payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload.selling_price) !== null && _ref22 !== void 0 ? _ref22 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.price) !== null && _ref21 !== void 0 ? _ref21 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.base_price) !== null && _ref20 !== void 0 ? _ref20 : origin === null || origin === void 0 ? void 0 : origin.price) !== null && _ref19 !== void 0 ? _ref19 : origin === null || origin === void 0 ? void 0 : origin.base_price) !== null && _ref18 !== void 0 ? _ref18 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _ref17 !== void 0 ? _ref17 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.selling_price) !== null && _ref16 !== void 0 ? _ref16 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.base_price, '0.00');
108
- var lineCompositeTotal = toPriceString((_ref23 = (_payload$line_total = payload.line_total) !== null && _payload$line_total !== void 0 ? _payload$line_total : payload.total) !== null && _ref23 !== void 0 ? _ref23 : (_payload$_extend = payload._extend) === null || _payload$_extend === void 0 ? void 0 : _payload$_extend.total, sourceProductPrice);
108
+ var explicitLineTotal = (_ref23 = (_payload$line_total = payload.line_total) !== null && _payload$line_total !== void 0 ? _payload$line_total : payload.total) !== null && _ref23 !== void 0 ? _ref23 : (_payload$_extend = payload._extend) === null || _payload$_extend === void 0 ? void 0 : _payload$_extend.total;
109
+ var hasExplicitLineTotal = Number.isFinite(Number(explicitLineTotal));
110
+ var lineCompositeTotal = toPriceString(explicitLineTotal, sourceProductPrice);
109
111
  var hasPriceOverride = payload.price_override !== undefined && payload.price_override !== null && payload.price_override !== '';
110
112
  var productOptionItem = normalizeProductSkuOptions(normalizeOptionItems((_ref24 = (_ref25 = (_payload$product_sku$ = (_payload$product_sku = payload.product_sku) === null || _payload$product_sku === void 0 ? void 0 : _payload$product_sku.option) !== null && _payload$product_sku$ !== void 0 ? _payload$product_sku$ : payload.option) !== null && _ref25 !== void 0 ? _ref25 : payload.options) !== null && _ref24 !== void 0 ? _ref24 : payload.product_option_item));
111
113
  var productBundle = normalizeBundleItems((_payload$bundle = payload.bundle) !== null && _payload$bundle !== void 0 ? _payload$bundle : payload.product_bundle, hasPriceOverride);
@@ -148,7 +150,7 @@ export function transformBaseProductToOrderProduct(params) {
148
150
  mainPrice: 0,
149
151
  bundle: productBundle
150
152
  });
151
- var derivedMainSelling = Number(lineCompositeTotal) - Number(bundleOnlyComposite);
153
+ var derivedMainSelling = hasExplicitLineTotal ? Number(lineCompositeTotal) - Number(bundleOnlyComposite) : Number(mainProductOriginalPrice);
152
154
  var mainProductSellingPrice = toPriceString(Number.isFinite(derivedMainSelling) && derivedMainSelling >= 0 ? derivedMainSelling : Number(mainProductOriginalPrice));
153
155
  var metadata = _objectSpread(_objectSpread({
154
156
  unique: payload.unique,
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
314
+ weekNum: 0 | 5 | 1 | 2 | 3 | 6 | 4;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -322,7 +322,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
322
322
  * 获取当前的客户搜索条件
323
323
  * @returns 当前搜索条件
324
324
  */
325
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
325
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
326
326
  /**
327
327
  * 获取客户列表状态(包含滚动加载相关状态)
328
328
  * @returns 客户状态
@@ -551,6 +551,14 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
551
551
  setOtherParams(params: Record<string, any>, { cover }?: {
552
552
  cover?: boolean;
553
553
  }): Promise<void>;
554
+ private getDeviceTaskPlugin;
555
+ handlePrintWristband(params: {
556
+ voucher_ids: number[];
557
+ }): Promise<void>;
558
+ handleCheckIn(params: {
559
+ voucher_ids: number[];
560
+ is_checkin: boolean;
561
+ }): Promise<any>;
554
562
  /**
555
563
  * 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
556
564
  * 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
@@ -49,6 +49,7 @@ import { buildNormalProductCacheItemFromOrderLine as buildNormalProductCacheItem
49
49
  import { buildProductOptionStringFromOrderLine } from "../../modules/BookingContext/utils/orderLineDisplay";
50
50
  import { applyBookingsStatus, applyChildBookingStatus, resolveScheduleId, resolveStatusAfterTransition, restoreBookingsStatus, restoreChildBookingStatus } from "./utils/bookingStatus";
51
51
  import { resolveBestAddTimePlan as _resolveBestAddTimePlan } from "./utils/resolveBestAddTimePlan";
52
+ import { createUuidV4 } from "../../modules/Order/utils";
52
53
  var OPEN_DATA_SECTION_CODES = ['sale', 'reservation', 'fulfillment', 'menu', 'workflow'];
53
54
  var OPEN_DATA_CACHE_TTL = 5 * 60 * 1000;
54
55
 
@@ -2586,6 +2587,161 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2586
2587
  }
2587
2588
  return setOtherParams;
2588
2589
  }()
2590
+ }, {
2591
+ key: "getDeviceTaskPlugin",
2592
+ value: function getDeviceTaskPlugin() {
2593
+ var _app$getApp;
2594
+ var app = this.core.getPlugin('app');
2595
+ return (app === null || app === void 0 || (_app$getApp = app.getApp()) === null || _app$getApp === void 0 ? void 0 : _app$getApp.getPlugin('deviceTask')) || null;
2596
+ }
2597
+
2598
+ // 打印手环,单个或批量都可以
2599
+ }, {
2600
+ key: "handlePrintWristband",
2601
+ value: function () {
2602
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
2603
+ var _this$getOrderIdentit;
2604
+ var deviceTask, deviceId, idempotencyKey;
2605
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2606
+ while (1) switch (_context32.prev = _context32.next) {
2607
+ case 0:
2608
+ deviceTask = this.getDeviceTaskPlugin();
2609
+ if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
2610
+ _context32.next = 4;
2611
+ break;
2612
+ }
2613
+ this.logger.addLog({
2614
+ type: 'info',
2615
+ title: '[BookingTicket] handlePrintWristband: deviceTask.dispatch 不可用',
2616
+ metadata: {
2617
+ voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2618
+ }
2619
+ });
2620
+ return _context32.abrupt("return");
2621
+ case 4:
2622
+ this.logger.addLog({
2623
+ type: 'info',
2624
+ title: '[BookingTicket] handlePrintWristband',
2625
+ metadata: {
2626
+ voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2627
+ }
2628
+ });
2629
+ _context32.next = 7;
2630
+ return this.getShortNumberOrDeviceId();
2631
+ case 7:
2632
+ deviceId = _context32.sent;
2633
+ idempotencyKey = createUuidV4();
2634
+ deviceTask.dispatch({
2635
+ action: 'print_all',
2636
+ device_id: deviceId,
2637
+ payload: {
2638
+ type: 'WRISTBAND',
2639
+ data: {
2640
+ order_id: (_this$getOrderIdentit = this.getOrderIdentity()) === null || _this$getOrderIdentit === void 0 ? void 0 : _this$getOrderIdentit.orderId,
2641
+ voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2642
+ }
2643
+ },
2644
+ idempotency_key: idempotencyKey,
2645
+ name: 'PRINT_WRISTBAND',
2646
+ source: 'bookingTicket',
2647
+ source_type: 'handlePrintWristband',
2648
+ source_id: idempotencyKey
2649
+ });
2650
+ case 10:
2651
+ case "end":
2652
+ return _context32.stop();
2653
+ }
2654
+ }, _callee32, this);
2655
+ }));
2656
+ function handlePrintWristband(_x23) {
2657
+ return _handlePrintWristband.apply(this, arguments);
2658
+ }
2659
+ return handlePrintWristband;
2660
+ }() // 触发 checkIn
2661
+ }, {
2662
+ key: "handleCheckIn",
2663
+ value: function () {
2664
+ var _handleCheckIn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
2665
+ var _this$store$order5, _this$store$order5$ge, _this$store$order6, _ref20, _tempOrder$order_id2;
2666
+ var voucherIds, voucherIdSet, tempOrder, vouchers, batchMetadata, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
2667
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2668
+ while (1) switch (_context33.prev = _context33.next) {
2669
+ case 0:
2670
+ this.logger.addLog({
2671
+ type: 'info',
2672
+ title: '[BookingTicket] handleCheckIn',
2673
+ metadata: {
2674
+ voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids],
2675
+ is_checkin: params.is_checkin
2676
+ }
2677
+ });
2678
+ voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
2679
+ voucherIdSet = new Set(voucherIds);
2680
+ tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 || (_this$store$order5$ge = _this$store$order5.getTempOrder) === null || _this$store$order5$ge === void 0 ? void 0 : _this$store$order5$ge.call(_this$store$order5);
2681
+ vouchers = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.vouchers) || ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 ? void 0 : _this$store$order6.getVouchers()) || [];
2682
+ batchMetadata = [];
2683
+ hasUpdatedVoucher = false;
2684
+ nextVouchers = vouchers.map(function (voucher) {
2685
+ var _voucher$metadata;
2686
+ if (!voucherIdSet.has(voucher.voucher_id)) return voucher;
2687
+ hasUpdatedVoucher = true;
2688
+ var metadata = _objectSpread(_objectSpread({}, voucher.metadata || {}), {}, {
2689
+ ticket: _objectSpread(_objectSpread({}, ((_voucher$metadata = voucher.metadata) === null || _voucher$metadata === void 0 ? void 0 : _voucher$metadata.ticket) || {}), {}, {
2690
+ is_checkin: params.is_checkin
2691
+ })
2692
+ });
2693
+ batchMetadata.push({
2694
+ voucher_id: voucher.voucher_id,
2695
+ metadata: metadata
2696
+ });
2697
+ return _objectSpread(_objectSpread({}, voucher), {}, {
2698
+ metadata: metadata
2699
+ });
2700
+ });
2701
+ if (!(tempOrder && hasUpdatedVoucher)) {
2702
+ _context33.next = 11;
2703
+ break;
2704
+ }
2705
+ _context33.next = 11;
2706
+ return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
2707
+ vouchers: nextVouchers
2708
+ }));
2709
+ case 11:
2710
+ this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
2711
+ if (!(batchMetadata.length === 0)) {
2712
+ _context33.next = 14;
2713
+ break;
2714
+ }
2715
+ return _context33.abrupt("return", {
2716
+ code: 200,
2717
+ status: true,
2718
+ message: '',
2719
+ data: []
2720
+ });
2721
+ case 14:
2722
+ identity = this.getOrderIdentity();
2723
+ externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
2724
+ orderId = (_ref20 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref20 !== void 0 ? _ref20 : undefined;
2725
+ orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
2726
+ return _context33.abrupt("return", this.request.post('/machinecode/batch-metadata', {
2727
+ data: batchMetadata,
2728
+ order_lookup: orderLookup,
2729
+ order_id: orderId,
2730
+ external_sale_number: externalSaleNumber
2731
+ }, {
2732
+ osServer: true
2733
+ }));
2734
+ case 19:
2735
+ case "end":
2736
+ return _context33.stop();
2737
+ }
2738
+ }, _callee33, this);
2739
+ }));
2740
+ function handleCheckIn(_x24) {
2741
+ return _handleCheckIn.apply(this, arguments);
2742
+ }
2743
+ return handleCheckIn;
2744
+ }()
2589
2745
  /**
2590
2746
  * 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
2591
2747
  * 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
@@ -2593,12 +2749,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2593
2749
  }, {
2594
2750
  key: "destroy",
2595
2751
  value: (function () {
2596
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
2752
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
2597
2753
  var _this$scan;
2598
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2599
- while (1) switch (_context32.prev = _context32.next) {
2754
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2755
+ while (1) switch (_context34.prev = _context34.next) {
2600
2756
  case 0:
2601
- _context32.next = 2;
2757
+ _context34.next = 2;
2602
2758
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
2603
2759
  case 2:
2604
2760
  try {
@@ -2609,9 +2765,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2609
2765
  scanCache.clear();
2610
2766
  case 4:
2611
2767
  case "end":
2612
- return _context32.stop();
2768
+ return _context34.stop();
2613
2769
  }
2614
- }, _callee32, this);
2770
+ }, _callee34, this);
2615
2771
  }));
2616
2772
  function destroy() {
2617
2773
  return _destroy.apply(this, arguments);
@@ -142,6 +142,14 @@ function resolveMainProductPrice(product, fallback) {
142
142
  const parsed = Number(value);
143
143
  return Number.isFinite(parsed) ? parsed : fallback;
144
144
  }
145
+ function mapOrderBundleToOtherBundle(bundle) {
146
+ return bundle.map((item) => {
147
+ return {
148
+ ...item,
149
+ original_price: item.original_price ?? item.bundle_selling_price ?? item.price
150
+ };
151
+ });
152
+ }
145
153
  function synthesizeProductResourceFromBooking(booking) {
146
154
  const rows = booking == null ? void 0 : booking.resources;
147
155
  if (!Array.isArray(rows) || rows.length === 0)
@@ -191,7 +199,9 @@ function buildCacheItemFromOrderLine(input) {
191
199
  const other = {
192
200
  product_variant_id: product.product_variant_id ?? 0,
193
201
  option: (0, import_utils.getProductSkuOptions)(product),
194
- bundle: Array.isArray(product.product_bundle) ? [...product.product_bundle] : []
202
+ bundle: mapOrderBundleToOtherBundle(
203
+ Array.isArray(product.product_bundle) ? product.product_bundle : []
204
+ )
195
205
  };
196
206
  const extend = {
197
207
  start_date: startDate ? (0, import_dayjs.default)(startDate) : void 0,
@@ -154,10 +154,21 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
154
154
  private calculatePaymentTotal;
155
155
  private getDepositAmount;
156
156
  private normalizeDepositAmount;
157
+ private getLastOrderDepositSnapshot;
158
+ private getLastOrderSubmitSnapshot;
157
159
  private applyDepositAmountToSummary;
160
+ private applyLastOrderDepositSnapshot;
158
161
  private isDepositOrder;
159
162
  private getOrderExpectedAmount;
160
163
  private isDepositCovered;
164
+ getPaymentCompletion(payments?: OrderPaymentSource[]): {
165
+ isFullyPaid: boolean;
166
+ isOrderFullyPaid: boolean;
167
+ isDepositFullyPaid: boolean;
168
+ paymentStage: 'deposit' | 'normal';
169
+ depositAmount: string;
170
+ orderExpectedAmount: string;
171
+ };
161
172
  private calculateDepositPaidAmount;
162
173
  private resolveNextOrderPaymentType;
163
174
  private normalizePaymentSource;
@@ -301,13 +312,27 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
301
312
  updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
302
313
  /** 从当前订单支付项中移除指定支付项。 */
303
314
  deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
315
+ private confirmPendingVoucherPaymentsInList;
316
+ private discardPendingVoucherPaymentsFromList;
317
+ private prepareVoucherPaymentsForSubmit;
318
+ private applyPaymentLifecycleChange;
319
+ confirmPendingVoucherPayments(options?: {
320
+ persist?: boolean;
321
+ recalculateSummary?: boolean;
322
+ }): OrderPaymentData[];
323
+ discardPendingVoucherPayments(options?: {
324
+ persist?: boolean;
325
+ recalculateSummary?: boolean;
326
+ }): OrderPaymentData[];
304
327
  /**
305
328
  * 覆盖当前订单中的 wallet pass 支付项。
306
329
  *
307
330
  * 判断口径与 PaymentModal 保持一致:voucher_id 存在且不为 0 的支付项
308
331
  * 视为 wallet pass;其它支付项保持不变。
309
332
  */
310
- updateVoucherOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
333
+ updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
334
+ status?: 'paid' | 'payment_pending';
335
+ }): OrderPaymentData[];
311
336
  private shouldMergeProductToOrder;
312
337
  private hasOrderProductLineNote;
313
338
  /**
@@ -407,6 +432,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
407
432
  payments?: OrderPaymentSource[];
408
433
  paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
409
434
  smallTicketDataFlag?: number;
435
+ confirmPendingVoucherPayments?: boolean;
410
436
  enhancePayload?: SubmitPayloadEnhancer;
411
437
  }): Promise<T>;
412
438
  submitTempOrderAsync<T = any>(params?: {
@@ -418,6 +444,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
418
444
  payments?: OrderPaymentSource[];
419
445
  paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
420
446
  smallTicketDataFlag?: number;
447
+ confirmPendingVoucherPayments?: boolean;
421
448
  enhancePayload?: SubmitPayloadEnhancer;
422
449
  }): Promise<T>;
423
450
  private runSubmitTempOrder;
@@ -497,5 +524,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
497
524
  private normalizeHydratedOrderProduct;
498
525
  getLastOrderInfo(): Record<string, any> | undefined;
499
526
  getOrderInfo(order_id: number): Promise<any>;
527
+ getVouchers(): any[];
500
528
  }
501
529
  export type { UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';