@pisell/pisellos 2.2.257 → 2.2.259
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.
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +17 -13
- package/dist/modules/Order/index.d.ts +32 -1
- package/dist/modules/Order/index.js +615 -288
- package/dist/modules/Order/types.d.ts +20 -2
- package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
- package/dist/modules/Order/utils.d.ts +4 -0
- package/dist/modules/Order/utils.js +114 -28
- package/dist/modules/Rules/index.d.ts +3 -3
- package/dist/modules/Rules/index.js +8 -3
- package/dist/modules/Rules/types.d.ts +2 -1
- package/dist/modules/SalesSummary/index.d.ts +7 -3
- package/dist/modules/SalesSummary/index.js +67 -39
- package/dist/modules/SalesSummary/types.d.ts +1 -0
- package/dist/modules/SalesSummary/utils.js +2 -1
- package/dist/modules/SurchargeList/index.d.ts +6 -4
- package/dist/modules/SurchargeList/index.js +62 -39
- package/dist/modules/SurchargeList/types.d.ts +6 -2
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +1136 -855
- package/dist/server/modules/order/index.d.ts +22 -3
- package/dist/server/modules/order/index.js +398 -316
- package/dist/solution/BaseSales/index.d.ts +22 -2
- package/dist/solution/BaseSales/index.js +995 -701
- package/dist/solution/BaseSales/types.d.ts +1 -0
- package/dist/solution/BaseSales/types.js +2 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +2 -1
- package/dist/solution/BookingTicket/index.d.ts +8 -0
- package/dist/solution/BookingTicket/index.js +153 -6
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +11 -1
- package/lib/modules/Order/index.d.ts +32 -1
- package/lib/modules/Order/index.js +402 -64
- package/lib/modules/Order/types.d.ts +20 -2
- package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/lib/modules/Order/utils/bundleDiscountHydration.js +139 -0
- package/lib/modules/Order/utils.d.ts +4 -0
- package/lib/modules/Order/utils.js +84 -2
- package/lib/modules/Rules/index.d.ts +3 -3
- package/lib/modules/Rules/index.js +4 -3
- package/lib/modules/Rules/types.d.ts +2 -1
- package/lib/modules/SalesSummary/index.d.ts +7 -3
- package/lib/modules/SalesSummary/index.js +28 -11
- package/lib/modules/SalesSummary/types.d.ts +1 -0
- package/lib/modules/SalesSummary/utils.js +2 -0
- package/lib/modules/SurchargeList/index.d.ts +6 -4
- package/lib/modules/SurchargeList/index.js +41 -21
- package/lib/modules/SurchargeList/types.d.ts +6 -2
- package/lib/server/index.d.ts +3 -0
- package/lib/server/index.js +215 -9
- package/lib/server/modules/order/index.d.ts +22 -3
- package/lib/server/modules/order/index.js +103 -53
- package/lib/solution/BaseSales/index.d.ts +22 -2
- package/lib/solution/BaseSales/index.js +246 -60
- package/lib/solution/BaseSales/types.d.ts +1 -0
- package/lib/solution/BaseSales/types.js +2 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +2 -1
- package/lib/solution/BookingTicket/index.d.ts +8 -0
- package/lib/solution/BookingTicket/index.js +101 -0
- 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);
|
|
@@ -66,7 +66,8 @@ function normalizeBundleItems(bundleItems) {
|
|
|
66
66
|
price: (_bundleItem$price3 = bundleItem.price) !== null && _bundleItem$price3 !== void 0 ? _bundleItem$price3 : unitStr,
|
|
67
67
|
bundle_selling_price: unitStr,
|
|
68
68
|
original_price: (_ref8 = (_ref9 = (_bundleItem$original_ = bundleItem.original_price) !== null && _bundleItem$original_ !== void 0 ? _bundleItem$original_ : bundleItem.product_price) !== null && _ref9 !== void 0 ? _ref9 : bundleItem.price) !== null && _ref8 !== void 0 ? _ref8 : unitStr,
|
|
69
|
-
option: normalizeOptionItems(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.option)
|
|
69
|
+
option: normalizeOptionItems(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.option),
|
|
70
|
+
discount_list: preferPriceField ? [] : bundleItem.discount_list
|
|
70
71
|
});
|
|
71
72
|
// bundle_selling_price 落「正净额」:markdown = |price| − Σoptions;markup/原价维持原值。
|
|
72
73
|
normalizedItem.bundle_selling_price = getBundleSellingMagnitude(magnitudeSource).toFixed(2);
|
|
@@ -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
|
+
handleRedeem(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,152 @@ 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
|
+
}() // 触发核销
|
|
2661
|
+
}, {
|
|
2662
|
+
key: "handleRedeem",
|
|
2663
|
+
value: function () {
|
|
2664
|
+
var _handleRedeem = _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, status, voucherIdSet, tempOrder, vouchers, 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
|
+
voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
|
|
2671
|
+
status = params.is_checkin ? 'used' : 'unused';
|
|
2672
|
+
this.logger.addLog({
|
|
2673
|
+
type: 'info',
|
|
2674
|
+
title: '[BookingTicket] handleRedeem',
|
|
2675
|
+
metadata: {
|
|
2676
|
+
voucher_ids: voucherIds,
|
|
2677
|
+
status: status
|
|
2678
|
+
}
|
|
2679
|
+
});
|
|
2680
|
+
voucherIdSet = new Set(voucherIds);
|
|
2681
|
+
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);
|
|
2682
|
+
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()) || [];
|
|
2683
|
+
hasUpdatedVoucher = false;
|
|
2684
|
+
nextVouchers = vouchers.map(function (voucher) {
|
|
2685
|
+
if (!voucherIdSet.has(voucher.voucher_id)) return voucher;
|
|
2686
|
+
hasUpdatedVoucher = true;
|
|
2687
|
+
return _objectSpread(_objectSpread({}, voucher), {}, {
|
|
2688
|
+
status: status
|
|
2689
|
+
});
|
|
2690
|
+
});
|
|
2691
|
+
if (!(tempOrder && hasUpdatedVoucher)) {
|
|
2692
|
+
_context33.next = 11;
|
|
2693
|
+
break;
|
|
2694
|
+
}
|
|
2695
|
+
_context33.next = 11;
|
|
2696
|
+
return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
|
|
2697
|
+
vouchers: nextVouchers
|
|
2698
|
+
}));
|
|
2699
|
+
case 11:
|
|
2700
|
+
this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
|
|
2701
|
+
if (!(voucherIds.length === 0)) {
|
|
2702
|
+
_context33.next = 14;
|
|
2703
|
+
break;
|
|
2704
|
+
}
|
|
2705
|
+
return _context33.abrupt("return", {
|
|
2706
|
+
code: 200,
|
|
2707
|
+
status: true,
|
|
2708
|
+
message: '',
|
|
2709
|
+
data: []
|
|
2710
|
+
});
|
|
2711
|
+
case 14:
|
|
2712
|
+
identity = this.getOrderIdentity();
|
|
2713
|
+
externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
|
|
2714
|
+
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;
|
|
2715
|
+
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;
|
|
2716
|
+
return _context33.abrupt("return", this.request.post('/machinecode/batch', {
|
|
2717
|
+
ids: voucherIds,
|
|
2718
|
+
status: status,
|
|
2719
|
+
order_lookup: orderLookup,
|
|
2720
|
+
order_id: orderId,
|
|
2721
|
+
external_sale_number: externalSaleNumber
|
|
2722
|
+
}, {
|
|
2723
|
+
osServer: true
|
|
2724
|
+
}));
|
|
2725
|
+
case 19:
|
|
2726
|
+
case "end":
|
|
2727
|
+
return _context33.stop();
|
|
2728
|
+
}
|
|
2729
|
+
}, _callee33, this);
|
|
2730
|
+
}));
|
|
2731
|
+
function handleRedeem(_x24) {
|
|
2732
|
+
return _handleRedeem.apply(this, arguments);
|
|
2733
|
+
}
|
|
2734
|
+
return handleRedeem;
|
|
2735
|
+
}()
|
|
2589
2736
|
/**
|
|
2590
2737
|
* 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
|
|
2591
2738
|
* 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
|
|
@@ -2593,12 +2740,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2593
2740
|
}, {
|
|
2594
2741
|
key: "destroy",
|
|
2595
2742
|
value: (function () {
|
|
2596
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2743
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2597
2744
|
var _this$scan;
|
|
2598
|
-
return _regeneratorRuntime().wrap(function
|
|
2599
|
-
while (1) switch (
|
|
2745
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2746
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2600
2747
|
case 0:
|
|
2601
|
-
|
|
2748
|
+
_context34.next = 2;
|
|
2602
2749
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
2603
2750
|
case 2:
|
|
2604
2751
|
try {
|
|
@@ -2609,9 +2756,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2609
2756
|
scanCache.clear();
|
|
2610
2757
|
case 4:
|
|
2611
2758
|
case "end":
|
|
2612
|
-
return
|
|
2759
|
+
return _context34.stop();
|
|
2613
2760
|
}
|
|
2614
|
-
},
|
|
2761
|
+
}, _callee34, this);
|
|
2615
2762
|
}));
|
|
2616
2763
|
function destroy() {
|
|
2617
2764
|
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:
|
|
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;
|
|
@@ -186,6 +197,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
186
197
|
private clearManualDepositOverride;
|
|
187
198
|
private getOriginalSalesSnapshot;
|
|
188
199
|
private isSnapshotPayableAmountUnchanged;
|
|
200
|
+
private hasShopDiscountChangedFromSnapshot;
|
|
189
201
|
private restoreOriginalSnapshotIfProductsUnchanged;
|
|
190
202
|
private clearPersistedAmountFieldsForFullRecalc;
|
|
191
203
|
private getPaymentTargetAmount;
|
|
@@ -219,6 +231,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
219
231
|
* const ids = this.collectBookingHolderRecords(booking);
|
|
220
232
|
*/
|
|
221
233
|
private collectBookingHolderRecords;
|
|
234
|
+
private setProductHolderFromBooking;
|
|
235
|
+
private syncLinkedBookingHoldersToProducts;
|
|
222
236
|
/**
|
|
223
237
|
* 按 form_record 顺序读取 booking holder 的主字段名称。
|
|
224
238
|
*
|
|
@@ -301,13 +315,27 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
301
315
|
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
|
|
302
316
|
/** 从当前订单支付项中移除指定支付项。 */
|
|
303
317
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
318
|
+
private confirmPendingVoucherPaymentsInList;
|
|
319
|
+
private discardPendingVoucherPaymentsFromList;
|
|
320
|
+
private prepareVoucherPaymentsForSubmit;
|
|
321
|
+
private applyPaymentLifecycleChange;
|
|
322
|
+
confirmPendingVoucherPayments(options?: {
|
|
323
|
+
persist?: boolean;
|
|
324
|
+
recalculateSummary?: boolean;
|
|
325
|
+
}): OrderPaymentData[];
|
|
326
|
+
discardPendingVoucherPayments(options?: {
|
|
327
|
+
persist?: boolean;
|
|
328
|
+
recalculateSummary?: boolean;
|
|
329
|
+
}): OrderPaymentData[];
|
|
304
330
|
/**
|
|
305
331
|
* 覆盖当前订单中的 wallet pass 支付项。
|
|
306
332
|
*
|
|
307
333
|
* 判断口径与 PaymentModal 保持一致:voucher_id 存在且不为 0 的支付项
|
|
308
334
|
* 视为 wallet pass;其它支付项保持不变。
|
|
309
335
|
*/
|
|
310
|
-
updateVoucherOrderPayments(payments: OrderPaymentSource[]
|
|
336
|
+
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
337
|
+
status?: 'paid' | 'payment_pending';
|
|
338
|
+
}): OrderPaymentData[];
|
|
311
339
|
private shouldMergeProductToOrder;
|
|
312
340
|
private hasOrderProductLineNote;
|
|
313
341
|
/**
|
|
@@ -407,6 +435,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
407
435
|
payments?: OrderPaymentSource[];
|
|
408
436
|
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
409
437
|
smallTicketDataFlag?: number;
|
|
438
|
+
confirmPendingVoucherPayments?: boolean;
|
|
410
439
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
411
440
|
}): Promise<T>;
|
|
412
441
|
submitTempOrderAsync<T = any>(params?: {
|
|
@@ -418,6 +447,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
418
447
|
payments?: OrderPaymentSource[];
|
|
419
448
|
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
420
449
|
smallTicketDataFlag?: number;
|
|
450
|
+
confirmPendingVoucherPayments?: boolean;
|
|
421
451
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
422
452
|
}): Promise<T>;
|
|
423
453
|
private runSubmitTempOrder;
|
|
@@ -497,5 +527,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
497
527
|
private normalizeHydratedOrderProduct;
|
|
498
528
|
getLastOrderInfo(): Record<string, any> | undefined;
|
|
499
529
|
getOrderInfo(order_id: number): Promise<any>;
|
|
530
|
+
getVouchers(): any[];
|
|
500
531
|
}
|
|
501
532
|
export type { UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';
|