@pisell/pisellos 2.3.39 → 2.3.41
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/core/index.d.ts +2 -0
- package/dist/core/index.js +7 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
- package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/dist/model/strategy/adapter/promotion/examples.js +99 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/dist/model/strategy/adapter/promotion/type.js +45 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -3
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -3
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +11 -40
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.d.ts +2 -0
- package/dist/modules/OpenData/index.js +10 -2
- package/dist/modules/Order/index.d.ts +29 -12
- package/dist/modules/Order/index.js +750 -509
- package/dist/modules/Order/payment-utils.d.ts +26 -0
- package/dist/modules/Order/payment-utils.js +225 -0
- package/dist/modules/Order/types.d.ts +33 -10
- package/dist/modules/Order/utils/orderCollectionIdentity.js +7 -2
- package/dist/modules/Order/utils.d.ts +0 -10
- package/dist/modules/Order/utils.js +13 -41
- package/dist/modules/Payment/index.d.ts +2 -0
- package/dist/modules/Payment/index.js +79 -50
- package/dist/modules/Payment/types.d.ts +99 -28
- package/dist/modules/Payment/types.js +20 -3
- package/dist/modules/Payment/walletpass.d.ts +25 -1
- package/dist/modules/Payment/walletpass.js +707 -157
- package/dist/modules/Product/types.d.ts +0 -1
- package/dist/modules/ProductList/index.js +14 -33
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/Rules/index.d.ts +1 -0
- package/dist/modules/Rules/index.js +89 -96
- package/dist/modules/SalesSummary/index.js +13 -12
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/index.js +2 -15
- package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
- package/dist/modules/Schedule/index.d.ts +1 -3
- package/dist/modules/Schedule/index.js +16 -21
- package/dist/modules/Summary/utils.js +13 -38
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/window.d.ts +0 -1
- package/dist/server/index.d.ts +16 -14
- package/dist/server/index.js +1925 -1143
- package/dist/server/modules/order/index.d.ts +54 -4
- package/dist/server/modules/order/index.js +1600 -700
- package/dist/server/modules/order/types.d.ts +11 -3
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +109 -20
- package/dist/solution/BaseSales/index.js +1800 -480
- package/dist/solution/BaseSales/types.d.ts +52 -0
- package/dist/solution/BaseSales/types.js +2 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/dist/solution/BaseSales/utils/cartPromotion.js +90 -31
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
- package/dist/solution/BookingByStep/index.d.ts +2 -17
- package/dist/solution/BookingByStep/index.js +215 -294
- package/dist/solution/BookingByStep/types.d.ts +1 -2
- package/dist/solution/BookingByStep/types.js +1 -3
- package/dist/solution/BookingByStep/utils/capacity.js +1 -17
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/BookingTicket/index.d.ts +7 -3
- package/dist/solution/BookingTicket/index.js +132 -49
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +172 -82
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.js +45 -0
- package/dist/solution/Sales/index.d.ts +1 -0
- package/dist/solution/Sales/index.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +14 -26
- package/dist/solution/ScanOrder/index.js +756 -1148
- package/dist/solution/ScanOrder/types.d.ts +1 -21
- package/dist/solution/ScanOrder/utils.d.ts +0 -8
- package/dist/solution/ScanOrder/utils.js +25 -66
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +87 -125
- package/dist/solution/VenueBooking/index.d.ts +11 -39
- package/dist/solution/VenueBooking/index.js +860 -1176
- package/dist/solution/VenueBooking/types.d.ts +0 -3
- package/dist/solution/VenueBooking/utils/resource.js +0 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
- package/dist/solution/index.d.ts +0 -1
- package/dist/solution/index.js +1 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/payment-number.d.ts +9 -0
- package/dist/utils/payment-number.js +69 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/lib/model/strategy/adapter/promotion/examples.js +91 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/lib/model/strategy/adapter/promotion/type.js +2 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +0 -9
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.d.ts +2 -0
- package/lib/modules/OpenData/index.js +6 -1
- package/lib/modules/Order/index.d.ts +29 -12
- package/lib/modules/Order/index.js +196 -86
- package/lib/modules/Order/payment-utils.d.ts +26 -0
- package/lib/modules/Order/payment-utils.js +224 -0
- package/lib/modules/Order/types.d.ts +33 -10
- package/lib/modules/Order/utils/orderCollectionIdentity.js +3 -0
- package/lib/modules/Order/utils.d.ts +0 -10
- package/lib/modules/Order/utils.js +16 -40
- package/lib/modules/Payment/index.d.ts +2 -0
- package/lib/modules/Payment/index.js +34 -13
- package/lib/modules/Payment/types.d.ts +99 -28
- package/lib/modules/Payment/types.js +4 -3
- package/lib/modules/Payment/walletpass.d.ts +25 -1
- package/lib/modules/Payment/walletpass.js +470 -21
- package/lib/modules/Product/types.d.ts +0 -1
- package/lib/modules/ProductList/index.js +31 -40
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/Rules/index.d.ts +1 -0
- package/lib/modules/Rules/index.js +47 -40
- package/lib/modules/SalesSummary/index.js +7 -6
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/index.js +1 -13
- package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
- package/lib/modules/Schedule/index.d.ts +1 -3
- package/lib/modules/Schedule/index.js +8 -10
- package/lib/modules/Summary/utils.js +1 -21
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/window.d.ts +0 -1
- package/lib/server/index.d.ts +16 -14
- package/lib/server/index.js +675 -83
- package/lib/server/modules/order/index.d.ts +54 -4
- package/lib/server/modules/order/index.js +679 -66
- package/lib/server/modules/order/types.d.ts +11 -3
- package/lib/solution/BaseSales/index.d.ts +109 -20
- package/lib/solution/BaseSales/index.js +883 -70
- package/lib/solution/BaseSales/types.d.ts +52 -0
- package/lib/solution/BaseSales/types.js +2 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.js +63 -12
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -17
- package/lib/solution/BookingByStep/index.js +18 -60
- package/lib/solution/BookingByStep/types.d.ts +1 -2
- package/lib/solution/BookingByStep/types.js +0 -5
- package/lib/solution/BookingByStep/utils/capacity.js +1 -20
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/BookingTicket/index.d.ts +7 -3
- package/lib/solution/BookingTicket/index.js +62 -9
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +36 -4
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +63 -0
- package/lib/solution/Sales/index.d.ts +1 -0
- package/lib/solution/Sales/index.js +5 -3
- package/lib/solution/ScanOrder/index.d.ts +14 -26
- package/lib/solution/ScanOrder/index.js +190 -449
- package/lib/solution/ScanOrder/types.d.ts +1 -21
- package/lib/solution/ScanOrder/utils.d.ts +0 -8
- package/lib/solution/ScanOrder/utils.js +0 -31
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +0 -14
- package/lib/solution/VenueBooking/index.d.ts +11 -39
- package/lib/solution/VenueBooking/index.js +123 -328
- package/lib/solution/VenueBooking/types.d.ts +0 -3
- package/lib/solution/VenueBooking/utils/resource.js +0 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
- package/lib/solution/index.d.ts +0 -1
- package/lib/solution/index.js +1 -3
- package/lib/types/index.d.ts +1 -1
- package/lib/utils/payment-number.d.ts +9 -0
- package/lib/utils/payment-number.js +64 -0
- package/package.json +1 -1
- package/dist/modules/Holder/index.d.ts +0 -48
- package/dist/modules/Holder/index.js +0 -640
- package/dist/modules/Holder/types.d.ts +0 -123
- package/dist/modules/Holder/types.js +0 -1
- package/dist/modules/Holder/utils.d.ts +0 -13
- package/dist/modules/Holder/utils.js +0 -34
- package/dist/modules/ResourcePlanner/index.d.ts +0 -24
- package/dist/modules/ResourcePlanner/index.js +0 -181
- package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
- package/dist/modules/ResourcePlanner/planner.js +0 -1069
- package/dist/modules/ResourcePlanner/types.d.ts +0 -227
- package/dist/modules/ResourcePlanner/types.js +0 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/dist/solution/UnifiedBookingSales/index.js +0 -1871
- package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/dist/solution/UnifiedBookingSales/types.js +0 -11
- package/lib/modules/Holder/index.d.ts +0 -48
- package/lib/modules/Holder/index.js +0 -402
- package/lib/modules/Holder/types.d.ts +0 -123
- package/lib/modules/Holder/types.js +0 -17
- package/lib/modules/Holder/utils.d.ts +0 -13
- package/lib/modules/Holder/utils.js +0 -71
- package/lib/modules/ResourcePlanner/index.d.ts +0 -24
- package/lib/modules/ResourcePlanner/index.js +0 -148
- package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
- package/lib/modules/ResourcePlanner/planner.js +0 -933
- package/lib/modules/ResourcePlanner/types.d.ts +0 -227
- package/lib/modules/ResourcePlanner/types.js +0 -17
- package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/lib/solution/UnifiedBookingSales/index.js +0 -1076
- package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/lib/solution/UnifiedBookingSales/types.js +0 -33
|
@@ -32,9 +32,11 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
32
32
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
33
|
import { BaseModule } from "../BaseModule";
|
|
34
34
|
import { OrderHooks } from "./types";
|
|
35
|
-
import { composeLinePrice, generateDuration, getAllDiscountList, mergeRelationForms,
|
|
35
|
+
import { composeLinePrice, generateDuration, getAllDiscountList, mergeRelationForms, buildSubmitPayload, createDefaultTempOrder, createDefaultOrderRulesHooks, createEmptySummary, createUuidV4, formatDateTime, isTempOrder, normalizeBookingIsAll, normalizeBookingSubType, mapPaymentItemsToOrderPayments, normalizeOrderProductDiscountList, resolveEffectivePerUnitDiscount, ensureProductSku, getProductSkuOptions, normalizeProductSkuOptions, sumOptionUnitPrice, clearTempOrderHolderAssignments, getOrderProductLineUid, indexOrderProductsByUid, calculateOrderProductsDeposit, mergeOrderProductDisplayFields, resolveIsFormSubject } from "./utils";
|
|
36
36
|
import { isNormalProduct } from "../Product/utils";
|
|
37
37
|
import dayjs from 'dayjs';
|
|
38
|
+
import { ensureOrderPaymentNumber, mergeOrderPaymentRecord, resolveOrderPaymentIdentity } from "./payment-utils";
|
|
39
|
+
import { resolvePaymentNumberDevicePrefix, resolvePaymentNumberDevicePrefixFromDeviceId } from "../../utils/payment-number";
|
|
38
40
|
import { processCartPromotion, appendPromotionTags as _appendPromotionTags, getOrderProductUid as getPromotionUid } from "../../solution/BaseSales/utils/cartPromotion";
|
|
39
41
|
import { buildProductLineFingerprint, getProductIdentityIndex, getSafeProductNum, isIdentityMatch, normalizeOrderProduct } from "../../solution/ScanOrder/utils";
|
|
40
42
|
import { syncManualProductDiscountProductNum } from "./utils/manualProductDiscount";
|
|
@@ -83,6 +85,10 @@ function isPaidPaymentRecord(payment) {
|
|
|
83
85
|
function isCommittedVoucherPaymentRecord(payment) {
|
|
84
86
|
return isVoucherPaymentRecord(payment) && (payment === null || payment === void 0 ? void 0 : payment.status) !== 'voided' && (hasSyncedOrderPaymentRecord(payment) || isPaidPaymentRecord(payment));
|
|
85
87
|
}
|
|
88
|
+
function getVoucherPaymentLifecycleKey(payment) {
|
|
89
|
+
if (!isVoucherPaymentRecord(payment)) return null;
|
|
90
|
+
return "".concat(String(payment.voucher_id), "::").concat(String(payment.status || ''));
|
|
91
|
+
}
|
|
86
92
|
export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
87
93
|
_inherits(OrderModule, _BaseModule);
|
|
88
94
|
var _super = _createSuper(OrderModule);
|
|
@@ -97,6 +103,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
97
103
|
_defineProperty(_assertThisInitialized(_this), "logger", void 0);
|
|
98
104
|
// LoggerManager 实例
|
|
99
105
|
_defineProperty(_assertThisInitialized(_this), "window", void 0);
|
|
106
|
+
_defineProperty(_assertThisInitialized(_this), "appPlugin", void 0);
|
|
100
107
|
_defineProperty(_assertThisInitialized(_this), "cacheId", void 0);
|
|
101
108
|
_defineProperty(_assertThisInitialized(_this), "salesSummaryModuleName", void 0);
|
|
102
109
|
_defineProperty(_assertThisInitialized(_this), "rulesHooksOverride", void 0);
|
|
@@ -283,8 +290,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
283
290
|
key: "initialize",
|
|
284
291
|
value: function () {
|
|
285
292
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
286
|
-
var
|
|
287
|
-
var
|
|
293
|
+
var _otherParams$rules, _otherParams$order, _otherParams$hooks;
|
|
294
|
+
var app, otherParams;
|
|
288
295
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
289
296
|
while (1) switch (_context.prev = _context.next) {
|
|
290
297
|
case 0:
|
|
@@ -300,12 +307,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
300
307
|
this.store.availableWalletIds = [];
|
|
301
308
|
}
|
|
302
309
|
this.request = this.core.getPlugin('request');
|
|
303
|
-
appPlugin = this.core.getPlugin('app');
|
|
304
|
-
if (
|
|
305
|
-
|
|
310
|
+
this.appPlugin = this.core.getPlugin('app');
|
|
311
|
+
if (this.appPlugin) {
|
|
312
|
+
_context.next = 9;
|
|
313
|
+
break;
|
|
306
314
|
}
|
|
307
|
-
|
|
308
|
-
|
|
315
|
+
throw new Error('Order 模块需要 app 插件支持');
|
|
316
|
+
case 9:
|
|
317
|
+
app = this.appPlugin.getApp();
|
|
318
|
+
this.logger = app.logger;
|
|
309
319
|
this.window = this.core.getPlugin('window');
|
|
310
320
|
otherParams = options.otherParams || {};
|
|
311
321
|
this.cacheId = otherParams.cacheId;
|
|
@@ -316,7 +326,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
316
326
|
this.otherParams = otherParams;
|
|
317
327
|
this.registerDiscountModules(options);
|
|
318
328
|
this.logInfo('OrderModule initialized successfully');
|
|
319
|
-
case
|
|
329
|
+
case 21:
|
|
320
330
|
case "end":
|
|
321
331
|
return _context.stop();
|
|
322
332
|
}
|
|
@@ -1221,16 +1231,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1221
1231
|
value: function persistTempOrder() {
|
|
1222
1232
|
// no-op: OrderModule 的刷新恢复不再依赖 localStorage。
|
|
1223
1233
|
}
|
|
1224
|
-
}, {
|
|
1225
|
-
key: "notifyTempOrderChanged",
|
|
1226
|
-
value: function notifyTempOrderChanged() {
|
|
1227
|
-
if (!this.store.tempOrder) return;
|
|
1228
|
-
this.store.tempOrder = _objectSpread(_objectSpread({}, this.store.tempOrder), {}, {
|
|
1229
|
-
products: _toConsumableArray(this.store.tempOrder.products),
|
|
1230
|
-
bookings: this.store.tempOrder.bookings ? _toConsumableArray(this.store.tempOrder.bookings) : []
|
|
1231
|
-
});
|
|
1232
|
-
this.persistTempOrder();
|
|
1233
|
-
}
|
|
1234
1234
|
|
|
1235
1235
|
// ─── TempOrder: 创建 & 获取 ───
|
|
1236
1236
|
}, {
|
|
@@ -1517,19 +1517,44 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1517
1517
|
var depositPaidAmount = this.calculateDepositPaidAmount(tempOrder.payments || []);
|
|
1518
1518
|
return depositPaidAmount.lt(depositAmount) ? 'deposit' : 'normal';
|
|
1519
1519
|
}
|
|
1520
|
+
}, {
|
|
1521
|
+
key: "getPaymentNumberAppData",
|
|
1522
|
+
value: function getPaymentNumberAppData(key) {
|
|
1523
|
+
var _appPlugin$getData, _app$models, _app$models$getStore, _app$models$getStore$, _app$models$getStore$2;
|
|
1524
|
+
var appPlugin = this.appPlugin;
|
|
1525
|
+
if (!appPlugin) return undefined;
|
|
1526
|
+
var getData = (_appPlugin$getData = appPlugin.getData) === null || _appPlugin$getData === void 0 ? void 0 : _appPlugin$getData.call(appPlugin);
|
|
1527
|
+
if (typeof getData === 'function') return getData(key);
|
|
1528
|
+
var app = appPlugin.getApp();
|
|
1529
|
+
var coreData = app === null || app === void 0 || (_app$models = app.models) === null || _app$models === void 0 || (_app$models$getStore = _app$models.getStore) === null || _app$models$getStore === void 0 || (_app$models$getStore$ = (_app$models$getStore$2 = _app$models$getStore.call(_app$models)).getDataByModel) === null || _app$models$getStore$ === void 0 ? void 0 : _app$models$getStore$.call(_app$models$getStore$2, 'core', 'core');
|
|
1530
|
+
return coreData === null || coreData === void 0 ? void 0 : coreData[key];
|
|
1531
|
+
}
|
|
1532
|
+
}, {
|
|
1533
|
+
key: "getPaymentNumberDevicePrefixSync",
|
|
1534
|
+
value: function getPaymentNumberDevicePrefixSync() {
|
|
1535
|
+
var _this7 = this;
|
|
1536
|
+
return resolvePaymentNumberDevicePrefixFromDeviceId(function (key) {
|
|
1537
|
+
return _this7.getPaymentNumberAppData(key);
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
}, {
|
|
1541
|
+
key: "getPaymentNumberDevicePrefixAsync",
|
|
1542
|
+
value: function getPaymentNumberDevicePrefixAsync() {
|
|
1543
|
+
var _this8 = this;
|
|
1544
|
+
return resolvePaymentNumberDevicePrefix(function (key) {
|
|
1545
|
+
return _this8.getPaymentNumberAppData(key);
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1520
1548
|
}, {
|
|
1521
1549
|
key: "normalizePaymentSource",
|
|
1522
1550
|
value: function normalizePaymentSource(payment, options) {
|
|
1523
1551
|
var _ref19, _paymentRecord$origin;
|
|
1524
1552
|
var paymentRecord = payment;
|
|
1525
1553
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
1526
|
-
|
|
1527
|
-
metadata.unique_payment_number = createUuidV4();
|
|
1528
|
-
}
|
|
1529
|
-
var normalized = _objectSpread(_objectSpread({}, paymentRecord), {}, {
|
|
1554
|
+
var normalized = ensureOrderPaymentNumber(_objectSpread(_objectSpread({}, paymentRecord), {}, {
|
|
1530
1555
|
metadata: metadata,
|
|
1531
1556
|
origin_amount: (_ref19 = (_paymentRecord$origin = paymentRecord.origin_amount) !== null && _paymentRecord$origin !== void 0 ? _paymentRecord$origin : paymentRecord.amount) !== null && _ref19 !== void 0 ? _ref19 : '0.00'
|
|
1532
|
-
});
|
|
1557
|
+
}), (options === null || options === void 0 ? void 0 : options.devicePrefix) || this.getPaymentNumberDevicePrefixSync(), createUuidV4);
|
|
1533
1558
|
if (paymentRecord.status !== undefined) {
|
|
1534
1559
|
normalized.status = paymentRecord.status;
|
|
1535
1560
|
} else if ((options === null || options === void 0 ? void 0 : options.defaultPaid) !== false) {
|
|
@@ -1647,16 +1672,16 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1647
1672
|
}, {
|
|
1648
1673
|
key: "calculatePaidPaymentSummary",
|
|
1649
1674
|
value: function calculatePaidPaymentSummary(payments) {
|
|
1650
|
-
var
|
|
1675
|
+
var _this9 = this;
|
|
1651
1676
|
return (payments || []).reduce(function (summary, payment) {
|
|
1652
1677
|
var paymentRecord = payment;
|
|
1653
1678
|
if (!isPaidPaymentRecord(paymentRecord)) return summary;
|
|
1654
1679
|
return {
|
|
1655
1680
|
customerPaidAmount: summary.customerPaidAmount.plus(paymentRecord.amount || 0),
|
|
1656
|
-
orderPaidAmount: summary.orderPaidAmount.plus(
|
|
1657
|
-
gapPaidAmount: summary.gapPaidAmount.plus(
|
|
1658
|
-
payServiceChargeAmount: summary.payServiceChargeAmount.plus(
|
|
1659
|
-
roundingAmount: summary.roundingAmount.plus(
|
|
1681
|
+
orderPaidAmount: summary.orderPaidAmount.plus(_this9.calculatePaymentOrderAmount(paymentRecord)),
|
|
1682
|
+
gapPaidAmount: summary.gapPaidAmount.plus(_this9.calculatePaymentGapAmount(paymentRecord)),
|
|
1683
|
+
payServiceChargeAmount: summary.payServiceChargeAmount.plus(_this9.calculatePaymentServiceFee(paymentRecord)),
|
|
1684
|
+
roundingAmount: summary.roundingAmount.plus(_this9.calculatePaymentRoundingAmount(paymentRecord))
|
|
1660
1685
|
};
|
|
1661
1686
|
}, {
|
|
1662
1687
|
customerPaidAmount: new Decimal(0),
|
|
@@ -1858,15 +1883,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1858
1883
|
}, {
|
|
1859
1884
|
key: "normalizeFingerprintValue",
|
|
1860
1885
|
value: function normalizeFingerprintValue(value) {
|
|
1861
|
-
var
|
|
1886
|
+
var _this10 = this;
|
|
1862
1887
|
if (Array.isArray(value)) {
|
|
1863
1888
|
return value.map(function (item) {
|
|
1864
|
-
return
|
|
1889
|
+
return _this10.normalizeFingerprintValue(item);
|
|
1865
1890
|
});
|
|
1866
1891
|
}
|
|
1867
1892
|
if (!value || _typeof(value) !== 'object') return value !== null && value !== void 0 ? value : '';
|
|
1868
1893
|
return Object.keys(value).sort().reduce(function (result, key) {
|
|
1869
|
-
result[key] =
|
|
1894
|
+
result[key] = _this10.normalizeFingerprintValue(value[key]);
|
|
1870
1895
|
return result;
|
|
1871
1896
|
}, {});
|
|
1872
1897
|
}
|
|
@@ -1881,7 +1906,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1881
1906
|
_sku$barcode,
|
|
1882
1907
|
_ref20,
|
|
1883
1908
|
_sku$variant_id,
|
|
1884
|
-
|
|
1909
|
+
_this11 = this;
|
|
1885
1910
|
var sku = (product === null || product === void 0 ? void 0 : product.product_sku) || {};
|
|
1886
1911
|
var metadata = (product === null || product === void 0 ? void 0 : product.metadata) || {};
|
|
1887
1912
|
var discountTypes = ((product === null || product === void 0 ? void 0 : product.discount_list) || []).map(function (discount) {
|
|
@@ -1915,7 +1940,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1915
1940
|
option_group_id: (_option$option_group_ = option === null || option === void 0 ? void 0 : option.option_group_id) !== null && _option$option_group_ !== void 0 ? _option$option_group_ : null,
|
|
1916
1941
|
option_group_item_id: (_ref22 = (_option$option_group_2 = option === null || option === void 0 ? void 0 : option.option_group_item_id) !== null && _option$option_group_2 !== void 0 ? _option$option_group_2 : option === null || option === void 0 ? void 0 : option.id) !== null && _ref22 !== void 0 ? _ref22 : null,
|
|
1917
1942
|
num: Number((_option$num = option === null || option === void 0 ? void 0 : option.num) !== null && _option$num !== void 0 ? _option$num : 1) || 1,
|
|
1918
|
-
add_price:
|
|
1943
|
+
add_price: _this11.normalizeFingerprintMoney((_option$add_price = option === null || option === void 0 ? void 0 : option.add_price) !== null && _option$add_price !== void 0 ? _option$add_price : option === null || option === void 0 ? void 0 : option.price)
|
|
1919
1944
|
};
|
|
1920
1945
|
})
|
|
1921
1946
|
}),
|
|
@@ -1925,8 +1950,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1925
1950
|
bundle_product_id: (_ref23 = (_ref24 = (_bundle$bundle_produc = bundle === null || bundle === void 0 ? void 0 : bundle.bundle_product_id) !== null && _bundle$bundle_produc !== void 0 ? _bundle$bundle_produc : bundle === null || bundle === void 0 ? void 0 : bundle._bundle_product_id) !== null && _ref24 !== void 0 ? _ref24 : bundle === null || bundle === void 0 ? void 0 : bundle.product_id) !== null && _ref23 !== void 0 ? _ref23 : null,
|
|
1926
1951
|
bundle_variant_id: (_ref25 = (_bundle$bundle_varian = bundle === null || bundle === void 0 ? void 0 : bundle.bundle_variant_id) !== null && _bundle$bundle_varian !== void 0 ? _bundle$bundle_varian : bundle === null || bundle === void 0 ? void 0 : bundle.product_variant_id) !== null && _ref25 !== void 0 ? _ref25 : 0,
|
|
1927
1952
|
num: getSafeProductNum((_bundle$num = bundle === null || bundle === void 0 ? void 0 : bundle.num) !== null && _bundle$num !== void 0 ? _bundle$num : bundle === null || bundle === void 0 ? void 0 : bundle.quantity),
|
|
1928
|
-
price:
|
|
1929
|
-
bundle_selling_price:
|
|
1953
|
+
price: _this11.normalizeFingerprintMoney(bundle === null || bundle === void 0 ? void 0 : bundle.price),
|
|
1954
|
+
bundle_selling_price: _this11.normalizeFingerprintMoney(bundle === null || bundle === void 0 ? void 0 : bundle.bundle_selling_price),
|
|
1930
1955
|
price_type: (_bundle$price_type = bundle === null || bundle === void 0 ? void 0 : bundle.price_type) !== null && _bundle$price_type !== void 0 ? _bundle$price_type : '',
|
|
1931
1956
|
price_type_ext: (_bundle$price_type_ex = bundle === null || bundle === void 0 ? void 0 : bundle.price_type_ext) !== null && _bundle$price_type_ex !== void 0 ? _bundle$price_type_ex : ''
|
|
1932
1957
|
};
|
|
@@ -1936,7 +1961,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1936
1961
|
return {
|
|
1937
1962
|
type: (_ref26 = (_discount$type2 = discount === null || discount === void 0 ? void 0 : discount.type) !== null && _discount$type2 !== void 0 ? _discount$type2 : discount === null || discount === void 0 ? void 0 : discount.tag) !== null && _ref26 !== void 0 ? _ref26 : '',
|
|
1938
1963
|
discount_id: (_ref27 = (_ref28 = (_discount$discount_id = discount === null || discount === void 0 ? void 0 : discount.discount_id) !== null && _discount$discount_id !== void 0 ? _discount$discount_id : discount === null || discount === void 0 ? void 0 : discount.order_discount_id) !== null && _ref28 !== void 0 ? _ref28 : discount === null || discount === void 0 || (_discount$discount = discount.discount) === null || _discount$discount === void 0 ? void 0 : _discount$discount.resource_id) !== null && _ref27 !== void 0 ? _ref27 : null,
|
|
1939
|
-
amount:
|
|
1964
|
+
amount: _this11.normalizeFingerprintMoney(discount === null || discount === void 0 ? void 0 : discount.amount)
|
|
1940
1965
|
};
|
|
1941
1966
|
}))
|
|
1942
1967
|
};
|
|
@@ -1944,9 +1969,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1944
1969
|
}, {
|
|
1945
1970
|
key: "buildOrderProductsFingerprint",
|
|
1946
1971
|
value: function buildOrderProductsFingerprint(products) {
|
|
1947
|
-
var
|
|
1972
|
+
var _this12 = this;
|
|
1948
1973
|
var items = (products || []).map(function (product) {
|
|
1949
|
-
return
|
|
1974
|
+
return _this12.buildProductFingerprintItem(product);
|
|
1950
1975
|
});
|
|
1951
1976
|
items.sort(function (left, right) {
|
|
1952
1977
|
return JSON.stringify(left).localeCompare(JSON.stringify(right));
|
|
@@ -1968,7 +1993,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1968
1993
|
_sku$barcode2,
|
|
1969
1994
|
_ref30,
|
|
1970
1995
|
_sku$variant_id2,
|
|
1971
|
-
|
|
1996
|
+
_this13 = this;
|
|
1972
1997
|
var sku = (product === null || product === void 0 ? void 0 : product.product_sku) || {};
|
|
1973
1998
|
var metadata = (product === null || product === void 0 ? void 0 : product.metadata) || {};
|
|
1974
1999
|
var discountTypes = ((product === null || product === void 0 ? void 0 : product.discount_list) || []).map(function (discount) {
|
|
@@ -1999,7 +2024,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1999
2024
|
option_group_id: (_option$option_group_3 = option === null || option === void 0 ? void 0 : option.option_group_id) !== null && _option$option_group_3 !== void 0 ? _option$option_group_3 : null,
|
|
2000
2025
|
option_group_item_id: (_ref32 = (_option$option_group_4 = option === null || option === void 0 ? void 0 : option.option_group_item_id) !== null && _option$option_group_4 !== void 0 ? _option$option_group_4 : option === null || option === void 0 ? void 0 : option.id) !== null && _ref32 !== void 0 ? _ref32 : null,
|
|
2001
2026
|
num: Number((_option$num2 = option === null || option === void 0 ? void 0 : option.num) !== null && _option$num2 !== void 0 ? _option$num2 : 1) || 1,
|
|
2002
|
-
add_price:
|
|
2027
|
+
add_price: _this13.normalizeFingerprintMoney((_option$add_price2 = option === null || option === void 0 ? void 0 : option.add_price) !== null && _option$add_price2 !== void 0 ? _option$add_price2 : option === null || option === void 0 ? void 0 : option.price)
|
|
2003
2028
|
};
|
|
2004
2029
|
})
|
|
2005
2030
|
}),
|
|
@@ -2013,14 +2038,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2013
2038
|
num: getSafeProductNum((_bundle$num2 = bundle === null || bundle === void 0 ? void 0 : bundle.num) !== null && _bundle$num2 !== void 0 ? _bundle$num2 : bundle === null || bundle === void 0 ? void 0 : bundle.quantity),
|
|
2014
2039
|
price_type: (_bundle$price_type2 = bundle === null || bundle === void 0 ? void 0 : bundle.price_type) !== null && _bundle$price_type2 !== void 0 ? _bundle$price_type2 : '',
|
|
2015
2040
|
price_type_ext: (_bundle$price_type_ex2 = bundle === null || bundle === void 0 ? void 0 : bundle.price_type_ext) !== null && _bundle$price_type_ex2 !== void 0 ? _bundle$price_type_ex2 : '',
|
|
2016
|
-
option:
|
|
2041
|
+
option: _this13.normalizeFingerprintValue(((bundle === null || bundle === void 0 ? void 0 : bundle.option) || []).map(function (option) {
|
|
2017
2042
|
var _ref38, _option$id3, _option$option_group_5, _ref39, _option$option_group_6, _option$num3, _option$add_price3;
|
|
2018
2043
|
return {
|
|
2019
2044
|
id: (_ref38 = (_option$id3 = option === null || option === void 0 ? void 0 : option.id) !== null && _option$id3 !== void 0 ? _option$id3 : option === null || option === void 0 ? void 0 : option.option_group_item_id) !== null && _ref38 !== void 0 ? _ref38 : null,
|
|
2020
2045
|
option_group_id: (_option$option_group_5 = option === null || option === void 0 ? void 0 : option.option_group_id) !== null && _option$option_group_5 !== void 0 ? _option$option_group_5 : null,
|
|
2021
2046
|
option_group_item_id: (_ref39 = (_option$option_group_6 = option === null || option === void 0 ? void 0 : option.option_group_item_id) !== null && _option$option_group_6 !== void 0 ? _option$option_group_6 : option === null || option === void 0 ? void 0 : option.id) !== null && _ref39 !== void 0 ? _ref39 : null,
|
|
2022
2047
|
num: Number((_option$num3 = option === null || option === void 0 ? void 0 : option.num) !== null && _option$num3 !== void 0 ? _option$num3 : 1) || 1,
|
|
2023
|
-
add_price:
|
|
2048
|
+
add_price: _this13.normalizeFingerprintMoney((_option$add_price3 = option === null || option === void 0 ? void 0 : option.add_price) !== null && _option$add_price3 !== void 0 ? _option$add_price3 : option === null || option === void 0 ? void 0 : option.price)
|
|
2024
2049
|
};
|
|
2025
2050
|
}))
|
|
2026
2051
|
};
|
|
@@ -2030,7 +2055,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2030
2055
|
return {
|
|
2031
2056
|
type: (_ref40 = (_discount$type4 = discount === null || discount === void 0 ? void 0 : discount.type) !== null && _discount$type4 !== void 0 ? _discount$type4 : discount === null || discount === void 0 ? void 0 : discount.tag) !== null && _ref40 !== void 0 ? _ref40 : '',
|
|
2032
2057
|
discount_id: (_ref41 = (_ref42 = (_discount$discount_id2 = discount === null || discount === void 0 ? void 0 : discount.discount_id) !== null && _discount$discount_id2 !== void 0 ? _discount$discount_id2 : discount === null || discount === void 0 ? void 0 : discount.order_discount_id) !== null && _ref42 !== void 0 ? _ref42 : discount === null || discount === void 0 || (_discount$discount2 = discount.discount) === null || _discount$discount2 === void 0 ? void 0 : _discount$discount2.resource_id) !== null && _ref41 !== void 0 ? _ref41 : null,
|
|
2033
|
-
amount:
|
|
2058
|
+
amount: _this13.normalizeFingerprintMoney(discount === null || discount === void 0 ? void 0 : discount.amount)
|
|
2034
2059
|
};
|
|
2035
2060
|
}))
|
|
2036
2061
|
};
|
|
@@ -2038,9 +2063,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2038
2063
|
}, {
|
|
2039
2064
|
key: "buildOrderProductsStructuralFingerprint",
|
|
2040
2065
|
value: function buildOrderProductsStructuralFingerprint(products) {
|
|
2041
|
-
var
|
|
2066
|
+
var _this14 = this;
|
|
2042
2067
|
var items = (products || []).map(function (product) {
|
|
2043
|
-
return
|
|
2068
|
+
return _this14.buildProductStructuralFingerprintItem(product);
|
|
2044
2069
|
});
|
|
2045
2070
|
items.sort(function (left, right) {
|
|
2046
2071
|
return JSON.stringify(left).localeCompare(JSON.stringify(right));
|
|
@@ -2468,9 +2493,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2468
2493
|
}, {
|
|
2469
2494
|
key: "sanitizeTempOrderProducts",
|
|
2470
2495
|
value: function sanitizeTempOrderProducts(tempOrder) {
|
|
2471
|
-
var
|
|
2496
|
+
var _this15 = this;
|
|
2472
2497
|
tempOrder.products = (tempOrder.products || []).map(function (product) {
|
|
2473
|
-
return
|
|
2498
|
+
return _this15.sanitizeOrderProductForTempOrder(product);
|
|
2474
2499
|
});
|
|
2475
2500
|
}
|
|
2476
2501
|
}, {
|
|
@@ -2573,7 +2598,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2573
2598
|
}, {
|
|
2574
2599
|
key: "syncLinkedBookingHoldersToProducts",
|
|
2575
2600
|
value: function syncLinkedBookingHoldersToProducts(tempOrder) {
|
|
2576
|
-
var
|
|
2601
|
+
var _this16 = this;
|
|
2577
2602
|
var bookings = tempOrder.bookings || [];
|
|
2578
2603
|
var products = tempOrder.products || [];
|
|
2579
2604
|
if (!bookings.length || !products.length) return;
|
|
@@ -2598,7 +2623,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2598
2623
|
var bookingUid = product.booking_uid || ((_product$metadata6 = product.metadata) === null || _product$metadata6 === void 0 ? void 0 : _product$metadata6.booking_uid);
|
|
2599
2624
|
var linkedBooking = (productUid !== undefined && productUid !== null && String(productUid) !== '' ? bookingByProductUid.get(String(productUid)) : undefined) || (bookingUid !== undefined && bookingUid !== null && String(bookingUid) !== '' ? bookingByBookingUid.get(String(bookingUid)) : undefined);
|
|
2600
2625
|
if (linkedBooking) {
|
|
2601
|
-
|
|
2626
|
+
_this16.setProductHolderFromBooking(product, linkedBooking);
|
|
2602
2627
|
}
|
|
2603
2628
|
});
|
|
2604
2629
|
}
|
|
@@ -2726,9 +2751,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2726
2751
|
}, {
|
|
2727
2752
|
key: "findBookingIndexByUniqueIdentificationNumber",
|
|
2728
2753
|
value: function findBookingIndexByUniqueIdentificationNumber(tempOrder, uniqueIdentificationNumber) {
|
|
2729
|
-
var
|
|
2754
|
+
var _this17 = this;
|
|
2730
2755
|
return (tempOrder.bookings || []).findIndex(function (booking) {
|
|
2731
|
-
return
|
|
2756
|
+
return _this17.getBookingUniqueIdentificationNumber(booking) === uniqueIdentificationNumber;
|
|
2732
2757
|
});
|
|
2733
2758
|
}
|
|
2734
2759
|
}, {
|
|
@@ -2736,12 +2761,12 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2736
2761
|
value: function removeLinkedBookingsForProduct(tempOrder, product) {
|
|
2737
2762
|
var _product$metadata7,
|
|
2738
2763
|
_product$metadata8,
|
|
2739
|
-
|
|
2764
|
+
_this18 = this;
|
|
2740
2765
|
var productUid = (product === null || product === void 0 || (_product$metadata7 = product.metadata) === null || _product$metadata7 === void 0 ? void 0 : _product$metadata7.unique_identification_number) || (product === null || product === void 0 ? void 0 : product.unique_identification_number);
|
|
2741
2766
|
var bookingUid = (product === null || product === void 0 ? void 0 : product.booking_uid) || (product === null || product === void 0 || (_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.booking_uid);
|
|
2742
2767
|
if (!productUid && !bookingUid) return;
|
|
2743
2768
|
tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
|
|
2744
|
-
var currentBookingUid =
|
|
2769
|
+
var currentBookingUid = _this18.getBookingUniqueIdentificationNumber(booking);
|
|
2745
2770
|
if (bookingUid && currentBookingUid === String(bookingUid)) return false;
|
|
2746
2771
|
if (productUid && String((booking === null || booking === void 0 ? void 0 : booking.product_uid) || '') === String(productUid)) return false;
|
|
2747
2772
|
return true;
|
|
@@ -3074,15 +3099,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3074
3099
|
}, {
|
|
3075
3100
|
key: "productHasCustomerBoundDiscount",
|
|
3076
3101
|
value: function productHasCustomerBoundDiscount(product) {
|
|
3077
|
-
var
|
|
3102
|
+
var _this19 = this;
|
|
3078
3103
|
if (((product === null || product === void 0 ? void 0 : product.discount_list) || []).some(function (discount) {
|
|
3079
|
-
return
|
|
3104
|
+
return _this19.isCustomerBoundDiscount(discount);
|
|
3080
3105
|
})) {
|
|
3081
3106
|
return true;
|
|
3082
3107
|
}
|
|
3083
3108
|
return ((product === null || product === void 0 ? void 0 : product.product_bundle) || []).some(function (bundle) {
|
|
3084
3109
|
return ((bundle === null || bundle === void 0 ? void 0 : bundle.discount_list) || []).some(function (discount) {
|
|
3085
|
-
return
|
|
3110
|
+
return _this19.isCustomerBoundDiscount(discount);
|
|
3086
3111
|
});
|
|
3087
3112
|
});
|
|
3088
3113
|
}
|
|
@@ -3091,18 +3116,18 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3091
3116
|
value: function shouldSkipDiscountCalculation(tempOrder) {
|
|
3092
3117
|
var _this$store$discount17,
|
|
3093
3118
|
_this$store$discount18,
|
|
3094
|
-
|
|
3119
|
+
_this20 = this;
|
|
3095
3120
|
if (this.hasActiveCustomerBoundDiscount) return false;
|
|
3096
3121
|
var discountList = ((_this$store$discount17 = this.store.discount) === null || _this$store$discount17 === void 0 || (_this$store$discount18 = _this$store$discount17.getDiscountList) === null || _this$store$discount18 === void 0 ? void 0 : _this$store$discount18.call(_this$store$discount17)) || [];
|
|
3097
3122
|
if (discountList.length > 0) return false;
|
|
3098
3123
|
return !(tempOrder.products || []).some(function (product) {
|
|
3099
|
-
return
|
|
3124
|
+
return _this20.productHasCustomerBoundDiscount(product);
|
|
3100
3125
|
});
|
|
3101
3126
|
}
|
|
3102
3127
|
}, {
|
|
3103
3128
|
key: "clearCustomerBoundDiscounts",
|
|
3104
3129
|
value: function clearCustomerBoundDiscounts(tempOrder) {
|
|
3105
|
-
var
|
|
3130
|
+
var _this21 = this,
|
|
3106
3131
|
_discountModule$getDi,
|
|
3107
3132
|
_discountModule$getOr,
|
|
3108
3133
|
_discountModule$setDi,
|
|
@@ -3111,7 +3136,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3111
3136
|
var filterDiscountList = function filterDiscountList(discountList) {
|
|
3112
3137
|
if (!Array.isArray(discountList)) return [];
|
|
3113
3138
|
return discountList.filter(function (discount) {
|
|
3114
|
-
var shouldRemove =
|
|
3139
|
+
var shouldRemove = _this21.isCustomerBoundDiscount(discount);
|
|
3115
3140
|
if (shouldRemove) didRemoveCustomerBoundDiscount = true;
|
|
3116
3141
|
return !shouldRemove;
|
|
3117
3142
|
});
|
|
@@ -3138,12 +3163,12 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3138
3163
|
var currentDiscounts = ((_discountModule$getDi = discountModule.getDiscountList) === null || _discountModule$getDi === void 0 ? void 0 : _discountModule$getDi.call(discountModule)) || [];
|
|
3139
3164
|
var currentOriginalDiscounts = ((_discountModule$getOr = discountModule.getOriginalDiscountList) === null || _discountModule$getOr === void 0 ? void 0 : _discountModule$getOr.call(discountModule)) || [];
|
|
3140
3165
|
var nextDiscounts = currentDiscounts.filter(function (discount) {
|
|
3141
|
-
if (
|
|
3142
|
-
return !
|
|
3166
|
+
if (_this21.shouldKeepCustomerBoundDiscountAfterCustomerChange(discount)) return true;
|
|
3167
|
+
return !_this21.isCustomerBoundDiscount(discount);
|
|
3143
3168
|
});
|
|
3144
3169
|
var nextOriginalDiscounts = currentOriginalDiscounts.filter(function (discount) {
|
|
3145
|
-
if (
|
|
3146
|
-
return !
|
|
3170
|
+
if (_this21.shouldKeepCustomerBoundDiscountAfterCustomerChange(discount)) return true;
|
|
3171
|
+
return !_this21.isCustomerBoundDiscount(discount);
|
|
3147
3172
|
});
|
|
3148
3173
|
void ((_discountModule$setDi = discountModule.setDiscountList) === null || _discountModule$setDi === void 0 ? void 0 : _discountModule$setDi.call(discountModule, nextDiscounts));
|
|
3149
3174
|
void ((_discountModule$setOr = discountModule.setOriginalDiscountList) === null || _discountModule$setOr === void 0 ? void 0 : _discountModule$setOr.call(discountModule, nextOriginalDiscounts));
|
|
@@ -3297,23 +3322,71 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3297
3322
|
* 用一组支付来源覆盖当前订单支付项。
|
|
3298
3323
|
*
|
|
3299
3324
|
* 入参允许来自 PaymentModule 的 PaymentItem,内部统一映射为 Sales 协议:
|
|
3300
|
-
* uuid
|
|
3325
|
+
* 新支付来源的 uuid 会作为 payment_number 的唯一号段,id -> custom_payment_id,
|
|
3301
3326
|
* isSynced 等运行态字段不会进入 tempOrder.payments。
|
|
3302
3327
|
*/
|
|
3303
3328
|
}, {
|
|
3304
3329
|
key: "setOrderPayments",
|
|
3305
3330
|
value: function setOrderPayments(payments) {
|
|
3331
|
+
var _this22 = this;
|
|
3306
3332
|
var tempOrder = this.ensureTempOrder();
|
|
3307
|
-
tempOrder.payments = mapPaymentItemsToOrderPayments(payments)
|
|
3333
|
+
tempOrder.payments = mapPaymentItemsToOrderPayments((payments || []).map(function (payment) {
|
|
3334
|
+
return _this22.normalizePaymentSource(payment, {
|
|
3335
|
+
defaultPaid: false
|
|
3336
|
+
});
|
|
3337
|
+
}));
|
|
3308
3338
|
this.persistTempOrder();
|
|
3309
3339
|
return tempOrder.payments;
|
|
3310
3340
|
}
|
|
3311
3341
|
|
|
3312
|
-
/**
|
|
3342
|
+
/** 同步兼容入口:按调用当下的 device_id 或 LOCAL 生成支付编号。 */
|
|
3313
3343
|
}, {
|
|
3314
3344
|
key: "addOrderPayment",
|
|
3315
3345
|
value: function addOrderPayment(payment) {
|
|
3316
|
-
var
|
|
3346
|
+
var hasPaymentNumber = String(payment.payment_number || '').trim() !== '';
|
|
3347
|
+
return this.addOrderPaymentWithDevicePrefix(payment, hasPaymentNumber ? 'LOCAL' : this.getPaymentNumberDevicePrefixSync());
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
/** 异步入口:创建支付项时读取最新 IoT 设备短号。 */
|
|
3351
|
+
}, {
|
|
3352
|
+
key: "addOrderPaymentAsync",
|
|
3353
|
+
value: (function () {
|
|
3354
|
+
var _addOrderPaymentAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(payment) {
|
|
3355
|
+
var hasPaymentNumber, devicePrefix;
|
|
3356
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context17) {
|
|
3357
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
3358
|
+
case 0:
|
|
3359
|
+
hasPaymentNumber = String(payment.payment_number || '').trim() !== '';
|
|
3360
|
+
if (!hasPaymentNumber) {
|
|
3361
|
+
_context17.next = 5;
|
|
3362
|
+
break;
|
|
3363
|
+
}
|
|
3364
|
+
_context17.t0 = 'LOCAL';
|
|
3365
|
+
_context17.next = 8;
|
|
3366
|
+
break;
|
|
3367
|
+
case 5:
|
|
3368
|
+
_context17.next = 7;
|
|
3369
|
+
return this.getPaymentNumberDevicePrefixAsync();
|
|
3370
|
+
case 7:
|
|
3371
|
+
_context17.t0 = _context17.sent;
|
|
3372
|
+
case 8:
|
|
3373
|
+
devicePrefix = _context17.t0;
|
|
3374
|
+
return _context17.abrupt("return", this.addOrderPaymentWithDevicePrefix(payment, devicePrefix));
|
|
3375
|
+
case 10:
|
|
3376
|
+
case "end":
|
|
3377
|
+
return _context17.stop();
|
|
3378
|
+
}
|
|
3379
|
+
}, _callee15, this);
|
|
3380
|
+
}));
|
|
3381
|
+
function addOrderPaymentAsync(_x14) {
|
|
3382
|
+
return _addOrderPaymentAsync.apply(this, arguments);
|
|
3383
|
+
}
|
|
3384
|
+
return addOrderPaymentAsync;
|
|
3385
|
+
}())
|
|
3386
|
+
}, {
|
|
3387
|
+
key: "addOrderPaymentWithDevicePrefix",
|
|
3388
|
+
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3389
|
+
var _this23 = this;
|
|
3317
3390
|
this.logInfo('addOrderPayment', {
|
|
3318
3391
|
payment: payment
|
|
3319
3392
|
});
|
|
@@ -3323,14 +3396,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3323
3396
|
type: orderPaymentType,
|
|
3324
3397
|
order_payment_type: orderPaymentType
|
|
3325
3398
|
}), {
|
|
3326
|
-
defaultPaid: true
|
|
3399
|
+
defaultPaid: true,
|
|
3400
|
+
devicePrefix: devicePrefix
|
|
3327
3401
|
})]);
|
|
3328
3402
|
tempOrder.payments = [].concat(_toConsumableArray(tempOrder.payments || []), _toConsumableArray(mapped));
|
|
3329
3403
|
this.persistTempOrder();
|
|
3330
3404
|
void this.recalculateSummary({
|
|
3331
3405
|
createIfMissing: true
|
|
3332
3406
|
}).catch(function (error) {
|
|
3333
|
-
|
|
3407
|
+
_this23.logError('recalculate summary after addOrderPayment failed', {
|
|
3334
3408
|
error: error instanceof Error ? error.message : String(error)
|
|
3335
3409
|
});
|
|
3336
3410
|
});
|
|
@@ -3338,49 +3412,80 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3338
3412
|
}
|
|
3339
3413
|
|
|
3340
3414
|
/**
|
|
3341
|
-
*
|
|
3342
|
-
*
|
|
3343
|
-
* 该方法服务 PaymentModal 的 void / 编辑场景;更新 metadata 时会做浅合并,
|
|
3344
|
-
* 避免覆盖 unique_payment_number、现金实付/找零等已有元数据。
|
|
3415
|
+
* 默认按支付唯一号精确更新;仅显式指定 legacy 时兼容历史支付标识。
|
|
3416
|
+
* metadata 与 transactions 会分别合并,避免覆盖支付会话号和已有交易记录。
|
|
3345
3417
|
*/
|
|
3346
3418
|
}, {
|
|
3347
3419
|
key: "updateOrderPayment",
|
|
3348
|
-
value: function
|
|
3349
|
-
var
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3420
|
+
value: (function () {
|
|
3421
|
+
var _updateOrderPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(paymentIdentity, updates) {
|
|
3422
|
+
var options,
|
|
3423
|
+
tempOrder,
|
|
3424
|
+
identity,
|
|
3425
|
+
matchMode,
|
|
3426
|
+
matchedPayment,
|
|
3427
|
+
updatedPayment,
|
|
3428
|
+
summary,
|
|
3429
|
+
payments,
|
|
3430
|
+
_args18 = arguments;
|
|
3431
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context18) {
|
|
3432
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
3433
|
+
case 0:
|
|
3434
|
+
options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
|
|
3435
|
+
tempOrder = this.ensureTempOrder();
|
|
3436
|
+
identity = String(paymentIdentity);
|
|
3437
|
+
matchMode = options.matchBy === 'compat' || options.matchBy === 'legacy' ? 'compat' : 'payment_number';
|
|
3438
|
+
matchedPayment = resolveOrderPaymentIdentity(tempOrder.payments || [], identity, matchMode);
|
|
3439
|
+
if (matchedPayment) {
|
|
3440
|
+
_context18.next = 7;
|
|
3441
|
+
break;
|
|
3442
|
+
}
|
|
3443
|
+
throw new Error("\u672A\u627E\u5230\u652F\u4ED8\u9879: ".concat(identity));
|
|
3444
|
+
case 7:
|
|
3445
|
+
updatedPayment = null;
|
|
3446
|
+
tempOrder.payments = (tempOrder.payments || []).map(function (payment, index) {
|
|
3447
|
+
if (index !== matchedPayment.index) return payment;
|
|
3448
|
+
var nextPayment = mergeOrderPaymentRecord(payment, _objectSpread(_objectSpread({}, updates), {}, {
|
|
3449
|
+
updated_at: updates.updated_at || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
3450
|
+
}));
|
|
3451
|
+
updatedPayment = nextPayment;
|
|
3452
|
+
return nextPayment;
|
|
3453
|
+
});
|
|
3454
|
+
this.persistTempOrder();
|
|
3455
|
+
_context18.next = 12;
|
|
3456
|
+
return this.recalculateSummary({
|
|
3457
|
+
createIfMissing: true
|
|
3458
|
+
});
|
|
3459
|
+
case 12:
|
|
3460
|
+
summary = _context18.sent;
|
|
3461
|
+
this.persistTempOrder();
|
|
3462
|
+
payments = tempOrder.payments;
|
|
3463
|
+
return _context18.abrupt("return", {
|
|
3464
|
+
updated: true,
|
|
3465
|
+
payment: payments[matchedPayment.index] || updatedPayment,
|
|
3466
|
+
payments: payments,
|
|
3467
|
+
summary: summary
|
|
3468
|
+
});
|
|
3469
|
+
case 16:
|
|
3470
|
+
case "end":
|
|
3471
|
+
return _context18.stop();
|
|
3472
|
+
}
|
|
3473
|
+
}, _callee16, this);
|
|
3474
|
+
}));
|
|
3475
|
+
function updateOrderPayment(_x15, _x16) {
|
|
3476
|
+
return _updateOrderPayment.apply(this, arguments);
|
|
3477
|
+
}
|
|
3478
|
+
return updateOrderPayment;
|
|
3479
|
+
}() /** 从当前订单支付项中移除指定支付项。 */)
|
|
3370
3480
|
}, {
|
|
3371
3481
|
key: "deleteOrderPayment",
|
|
3372
3482
|
value: function deleteOrderPayment(paymentIdentity) {
|
|
3373
3483
|
var tempOrder = this.ensureTempOrder();
|
|
3374
3484
|
var identity = String(paymentIdentity);
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
var customPaymentId = payment === null || payment === void 0 ? void 0 : payment.custom_payment_id;
|
|
3380
|
-
var uuid = payment === null || payment === void 0 ? void 0 : payment.uuid;
|
|
3381
|
-
return ![uniquePaymentNumber, orderPaymentId, customPaymentId, uuid].some(function (value) {
|
|
3382
|
-
return value !== undefined && String(value) === identity;
|
|
3383
|
-
});
|
|
3485
|
+
var matchedPayment = resolveOrderPaymentIdentity(tempOrder.payments || [], identity, 'compat');
|
|
3486
|
+
if (!matchedPayment) return tempOrder.payments;
|
|
3487
|
+
tempOrder.payments = (tempOrder.payments || []).filter(function (_, index) {
|
|
3488
|
+
return index !== matchedPayment.index;
|
|
3384
3489
|
});
|
|
3385
3490
|
this.persistTempOrder();
|
|
3386
3491
|
return tempOrder.payments;
|
|
@@ -3412,7 +3517,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3412
3517
|
}, {
|
|
3413
3518
|
key: "applyPaymentLifecycleChange",
|
|
3414
3519
|
value: function applyPaymentLifecycleChange(tempOrder, options) {
|
|
3415
|
-
var
|
|
3520
|
+
var _this24 = this;
|
|
3416
3521
|
this.updateTempOrderPaymentStatus(tempOrder);
|
|
3417
3522
|
if ((options === null || options === void 0 ? void 0 : options.persist) !== false) {
|
|
3418
3523
|
this.persistTempOrder();
|
|
@@ -3422,7 +3527,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3422
3527
|
void this.recalculateSummary({
|
|
3423
3528
|
createIfMissing: true
|
|
3424
3529
|
}).catch(function (error) {
|
|
3425
|
-
|
|
3530
|
+
_this24.logError("recalculate summary after ".concat(logContext, " failed"), {
|
|
3426
3531
|
error: error instanceof Error ? error.message : String(error)
|
|
3427
3532
|
});
|
|
3428
3533
|
});
|
|
@@ -3466,7 +3571,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3466
3571
|
}, {
|
|
3467
3572
|
key: "updateVoucherOrderPayments",
|
|
3468
3573
|
value: function updateVoucherOrderPayments(payments, options) {
|
|
3469
|
-
var
|
|
3574
|
+
var _this25 = this;
|
|
3470
3575
|
var tempOrder = this.ensureTempOrder();
|
|
3471
3576
|
var isOrderPaymentType = function isOrderPaymentType(value) {
|
|
3472
3577
|
return value === 'normal' || value === 'deposit';
|
|
@@ -3501,8 +3606,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3501
3606
|
});
|
|
3502
3607
|
};
|
|
3503
3608
|
var mappedVouchers = mapPaymentItemsToOrderPayments(payments.map(function (payment) {
|
|
3504
|
-
return
|
|
3505
|
-
defaultPaid: false
|
|
3609
|
+
return _this25.normalizePaymentSource(normalizeVoucherPaymentStatus(withVoucherPaymentType(payment)), {
|
|
3610
|
+
defaultPaid: false,
|
|
3611
|
+
devicePrefix: options === null || options === void 0 ? void 0 : options.devicePrefix
|
|
3506
3612
|
});
|
|
3507
3613
|
})).filter(function (payment) {
|
|
3508
3614
|
return isVoucherPaymentRecord(payment);
|
|
@@ -3528,14 +3634,17 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3528
3634
|
}).map(function (payment) {
|
|
3529
3635
|
return String(payment.order_payment_id);
|
|
3530
3636
|
}));
|
|
3531
|
-
var
|
|
3532
|
-
return
|
|
3637
|
+
var committedVoucherLifecycleKeys = new Set(committedVoucherPayments.map(function (payment) {
|
|
3638
|
+
return getVoucherPaymentLifecycleKey(payment);
|
|
3639
|
+
}).filter(function (key) {
|
|
3640
|
+
return key !== null;
|
|
3533
3641
|
}));
|
|
3534
3642
|
var replaceableVouchers = mappedVouchers.filter(function (payment) {
|
|
3535
3643
|
if (hasSyncedOrderPaymentRecord(payment) && committedVoucherPaymentIds.has(String(payment.order_payment_id))) {
|
|
3536
3644
|
return false;
|
|
3537
3645
|
}
|
|
3538
|
-
|
|
3646
|
+
var lifecycleKey = getVoucherPaymentLifecycleKey(payment);
|
|
3647
|
+
if (lifecycleKey && committedVoucherLifecycleKeys.has(lifecycleKey)) {
|
|
3539
3648
|
return false;
|
|
3540
3649
|
}
|
|
3541
3650
|
return true;
|
|
@@ -3550,54 +3659,93 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3550
3659
|
void this.recalculateSummary({
|
|
3551
3660
|
createIfMissing: true
|
|
3552
3661
|
}).catch(function (error) {
|
|
3553
|
-
|
|
3662
|
+
_this25.logError('recalculate summary after updateVoucherOrderPayments failed', {
|
|
3554
3663
|
error: error instanceof Error ? error.message : String(error)
|
|
3555
3664
|
});
|
|
3556
3665
|
});
|
|
3557
3666
|
return tempOrder.payments;
|
|
3558
3667
|
}
|
|
3668
|
+
}, {
|
|
3669
|
+
key: "updateVoucherOrderPaymentsAsync",
|
|
3670
|
+
value: function () {
|
|
3671
|
+
var _updateVoucherOrderPaymentsAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(payments, options) {
|
|
3672
|
+
var needsPaymentNumber, devicePrefix;
|
|
3673
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context19) {
|
|
3674
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
3675
|
+
case 0:
|
|
3676
|
+
needsPaymentNumber = (payments || []).some(function (payment) {
|
|
3677
|
+
return String(payment.payment_number || '').trim() === '';
|
|
3678
|
+
});
|
|
3679
|
+
if (!needsPaymentNumber) {
|
|
3680
|
+
_context19.next = 7;
|
|
3681
|
+
break;
|
|
3682
|
+
}
|
|
3683
|
+
_context19.next = 4;
|
|
3684
|
+
return this.getPaymentNumberDevicePrefixAsync();
|
|
3685
|
+
case 4:
|
|
3686
|
+
_context19.t0 = _context19.sent;
|
|
3687
|
+
_context19.next = 8;
|
|
3688
|
+
break;
|
|
3689
|
+
case 7:
|
|
3690
|
+
_context19.t0 = 'LOCAL';
|
|
3691
|
+
case 8:
|
|
3692
|
+
devicePrefix = _context19.t0;
|
|
3693
|
+
return _context19.abrupt("return", this.updateVoucherOrderPayments(payments, _objectSpread(_objectSpread({}, options), {}, {
|
|
3694
|
+
devicePrefix: devicePrefix
|
|
3695
|
+
})));
|
|
3696
|
+
case 10:
|
|
3697
|
+
case "end":
|
|
3698
|
+
return _context19.stop();
|
|
3699
|
+
}
|
|
3700
|
+
}, _callee17, this);
|
|
3701
|
+
}));
|
|
3702
|
+
function updateVoucherOrderPaymentsAsync(_x17, _x18) {
|
|
3703
|
+
return _updateVoucherOrderPaymentsAsync.apply(this, arguments);
|
|
3704
|
+
}
|
|
3705
|
+
return updateVoucherOrderPaymentsAsync;
|
|
3706
|
+
}()
|
|
3559
3707
|
}, {
|
|
3560
3708
|
key: "shouldMergeProductToOrder",
|
|
3561
3709
|
value: function () {
|
|
3562
|
-
var _shouldMergeProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3710
|
+
var _shouldMergeProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params) {
|
|
3563
3711
|
var _this$orderHooks;
|
|
3564
3712
|
var onBeforeMergeProductToOrder, result;
|
|
3565
|
-
return _regeneratorRuntime().wrap(function
|
|
3566
|
-
while (1) switch (
|
|
3713
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context20) {
|
|
3714
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
3567
3715
|
case 0:
|
|
3568
3716
|
onBeforeMergeProductToOrder = (_this$orderHooks = this.orderHooks) === null || _this$orderHooks === void 0 ? void 0 : _this$orderHooks.onBeforeMergeProductToOrder;
|
|
3569
3717
|
if (onBeforeMergeProductToOrder) {
|
|
3570
|
-
|
|
3718
|
+
_context20.next = 3;
|
|
3571
3719
|
break;
|
|
3572
3720
|
}
|
|
3573
|
-
return
|
|
3721
|
+
return _context20.abrupt("return", true);
|
|
3574
3722
|
case 3:
|
|
3575
|
-
|
|
3723
|
+
_context20.next = 5;
|
|
3576
3724
|
return onBeforeMergeProductToOrder(_objectSpread(_objectSpread({}, params), {}, {
|
|
3577
3725
|
defaultShouldMerge: true
|
|
3578
3726
|
}));
|
|
3579
3727
|
case 5:
|
|
3580
|
-
result =
|
|
3728
|
+
result = _context20.sent;
|
|
3581
3729
|
if (!(typeof result === 'boolean')) {
|
|
3582
|
-
|
|
3730
|
+
_context20.next = 8;
|
|
3583
3731
|
break;
|
|
3584
3732
|
}
|
|
3585
|
-
return
|
|
3733
|
+
return _context20.abrupt("return", result);
|
|
3586
3734
|
case 8:
|
|
3587
3735
|
if (!(result && _typeof(result) === 'object' && typeof result.shouldMerge === 'boolean')) {
|
|
3588
|
-
|
|
3736
|
+
_context20.next = 10;
|
|
3589
3737
|
break;
|
|
3590
3738
|
}
|
|
3591
|
-
return
|
|
3739
|
+
return _context20.abrupt("return", result.shouldMerge);
|
|
3592
3740
|
case 10:
|
|
3593
|
-
return
|
|
3741
|
+
return _context20.abrupt("return", true);
|
|
3594
3742
|
case 11:
|
|
3595
3743
|
case "end":
|
|
3596
|
-
return
|
|
3744
|
+
return _context20.stop();
|
|
3597
3745
|
}
|
|
3598
|
-
},
|
|
3746
|
+
}, _callee18, this);
|
|
3599
3747
|
}));
|
|
3600
|
-
function shouldMergeProductToOrder(
|
|
3748
|
+
function shouldMergeProductToOrder(_x19) {
|
|
3601
3749
|
return _shouldMergeProductToOrder.apply(this, arguments);
|
|
3602
3750
|
}
|
|
3603
3751
|
return shouldMergeProductToOrder;
|
|
@@ -3633,30 +3781,30 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3633
3781
|
}, {
|
|
3634
3782
|
key: "finalizeProductOrderMutation",
|
|
3635
3783
|
value: function () {
|
|
3636
|
-
var _finalizeProductOrderMutation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3637
|
-
return _regeneratorRuntime().wrap(function
|
|
3638
|
-
while (1) switch (
|
|
3784
|
+
var _finalizeProductOrderMutation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(tempOrder, options) {
|
|
3785
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context21) {
|
|
3786
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
3639
3787
|
case 0:
|
|
3640
3788
|
this.syncTempOrderHolderFromBookings(tempOrder);
|
|
3641
3789
|
if (options !== null && options !== void 0 && options.skipEditDiscountConfigRefresh) {
|
|
3642
|
-
|
|
3790
|
+
_context21.next = 4;
|
|
3643
3791
|
break;
|
|
3644
3792
|
}
|
|
3645
|
-
|
|
3793
|
+
_context21.next = 4;
|
|
3646
3794
|
return this.ensureEditDiscountConfigForProductChange(tempOrder);
|
|
3647
3795
|
case 4:
|
|
3648
3796
|
if (options !== null && options !== void 0 && options.skipDiscountRecalculation) {
|
|
3649
|
-
|
|
3797
|
+
_context21.next = 7;
|
|
3650
3798
|
break;
|
|
3651
3799
|
}
|
|
3652
|
-
|
|
3800
|
+
_context21.next = 7;
|
|
3653
3801
|
return this.applyPromotion();
|
|
3654
3802
|
case 7:
|
|
3655
3803
|
if (!(options !== null && options !== void 0 && options.skipDiscountRecalculation)) {
|
|
3656
3804
|
this.applyDiscount();
|
|
3657
3805
|
}
|
|
3658
3806
|
this.sanitizeTempOrderProducts(tempOrder);
|
|
3659
|
-
|
|
3807
|
+
_context21.next = 11;
|
|
3660
3808
|
return this.recalculateSummary({
|
|
3661
3809
|
createIfMissing: true
|
|
3662
3810
|
});
|
|
@@ -3664,11 +3812,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3664
3812
|
this.persistTempOrder();
|
|
3665
3813
|
case 12:
|
|
3666
3814
|
case "end":
|
|
3667
|
-
return
|
|
3815
|
+
return _context21.stop();
|
|
3668
3816
|
}
|
|
3669
|
-
},
|
|
3817
|
+
}, _callee19, this);
|
|
3670
3818
|
}));
|
|
3671
|
-
function finalizeProductOrderMutation(
|
|
3819
|
+
function finalizeProductOrderMutation(_x20, _x21) {
|
|
3672
3820
|
return _finalizeProductOrderMutation.apply(this, arguments);
|
|
3673
3821
|
}
|
|
3674
3822
|
return finalizeProductOrderMutation;
|
|
@@ -3683,13 +3831,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3683
3831
|
}, {
|
|
3684
3832
|
key: "appendProductLineToTempOrder",
|
|
3685
3833
|
value: (function () {
|
|
3686
|
-
var _appendProductLineToTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3834
|
+
var _appendProductLineToTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(tempOrder, product, booking) {
|
|
3687
3835
|
var _booking_uid,
|
|
3688
3836
|
_metadata,
|
|
3689
|
-
|
|
3837
|
+
_this26 = this;
|
|
3690
3838
|
var linked, productToAdd, incomingFingerprint, normalizedIncoming, incomingBookingUid, hasIncomingGoodPass, hasIncomingProductNote, hasIncomingBookingUid, shouldForceNewLine, matchedIndex, matchedProduct, existedFingerprint, shouldMerge, _targetProduct$metada, targetProduct, targetUid, normalizedProduct, nextNum, targetIsManualProductDiscount, nextDiscountList;
|
|
3691
|
-
return _regeneratorRuntime().wrap(function
|
|
3692
|
-
while (1) switch (
|
|
3839
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context22) {
|
|
3840
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
3693
3841
|
case 0:
|
|
3694
3842
|
linked = booking ? this.createLinkedProductAndBooking({
|
|
3695
3843
|
product: product,
|
|
@@ -3712,8 +3860,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3712
3860
|
shouldForceNewLine = !!booking || hasIncomingProductNote || hasIncomingBookingUid;
|
|
3713
3861
|
matchedIndex = hasIncomingGoodPass || shouldForceNewLine ? -1 : tempOrder.products.findIndex(function (item) {
|
|
3714
3862
|
var _item$metadata3;
|
|
3715
|
-
if (
|
|
3716
|
-
if (
|
|
3863
|
+
if (_this26.hasGoodPassDiscount(item)) return false;
|
|
3864
|
+
if (_this26.hasOrderProductLineNote(item)) return false;
|
|
3717
3865
|
if (item.order_detail_id !== undefined && item.order_detail_id !== null) return false;
|
|
3718
3866
|
if ((_item$metadata3 = item.metadata) !== null && _item$metadata3 !== void 0 && _item$metadata3.is_edit_for_runtime) return false;
|
|
3719
3867
|
if (item.product_id !== productToAdd.product_id) return false;
|
|
@@ -3724,10 +3872,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3724
3872
|
matchedProduct = matchedIndex === -1 ? null : tempOrder.products[matchedIndex];
|
|
3725
3873
|
existedFingerprint = matchedProduct ? buildProductLineFingerprint(getProductSkuOptions(matchedProduct), matchedProduct.product_bundle) : '';
|
|
3726
3874
|
if (!matchedProduct) {
|
|
3727
|
-
|
|
3875
|
+
_context22.next = 20;
|
|
3728
3876
|
break;
|
|
3729
3877
|
}
|
|
3730
|
-
|
|
3878
|
+
_context22.next = 17;
|
|
3731
3879
|
return this.shouldMergeProductToOrder({
|
|
3732
3880
|
incomingProduct: productToAdd,
|
|
3733
3881
|
normalizedIncoming: normalizedIncoming,
|
|
@@ -3739,13 +3887,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3739
3887
|
booking: booking
|
|
3740
3888
|
});
|
|
3741
3889
|
case 17:
|
|
3742
|
-
|
|
3743
|
-
|
|
3890
|
+
_context22.t0 = _context22.sent;
|
|
3891
|
+
_context22.next = 21;
|
|
3744
3892
|
break;
|
|
3745
3893
|
case 20:
|
|
3746
|
-
|
|
3894
|
+
_context22.t0 = false;
|
|
3747
3895
|
case 21:
|
|
3748
|
-
shouldMerge =
|
|
3896
|
+
shouldMerge = _context22.t0;
|
|
3749
3897
|
if (matchedIndex === -1 || !matchedProduct || !shouldMerge) {
|
|
3750
3898
|
this.captureProductRuntime(tempOrder, productToAdd, normalizedIncoming);
|
|
3751
3899
|
if (linked) {
|
|
@@ -3799,11 +3947,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3799
3947
|
}
|
|
3800
3948
|
case 24:
|
|
3801
3949
|
case "end":
|
|
3802
|
-
return
|
|
3950
|
+
return _context22.stop();
|
|
3803
3951
|
}
|
|
3804
|
-
},
|
|
3952
|
+
}, _callee20, this);
|
|
3805
3953
|
}));
|
|
3806
|
-
function appendProductLineToTempOrder(
|
|
3954
|
+
function appendProductLineToTempOrder(_x22, _x23, _x24) {
|
|
3807
3955
|
return _appendProductLineToTempOrder.apply(this, arguments);
|
|
3808
3956
|
}
|
|
3809
3957
|
return appendProductLineToTempOrder;
|
|
@@ -3819,61 +3967,61 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3819
3967
|
}, {
|
|
3820
3968
|
key: "addProductToOrder",
|
|
3821
3969
|
value: (function () {
|
|
3822
|
-
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3970
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(product, booking) {
|
|
3823
3971
|
var tempOrder, _ref61, _productRecord$num, productRecord, splitCount, i, singleLine;
|
|
3824
|
-
return _regeneratorRuntime().wrap(function
|
|
3825
|
-
while (1) switch (
|
|
3972
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context23) {
|
|
3973
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
3826
3974
|
case 0:
|
|
3827
3975
|
tempOrder = this.ensureTempOrder();
|
|
3828
3976
|
if (!booking) {
|
|
3829
|
-
|
|
3977
|
+
_context23.next = 18;
|
|
3830
3978
|
break;
|
|
3831
3979
|
}
|
|
3832
3980
|
productRecord = product;
|
|
3833
3981
|
splitCount = getSafeProductNum((_ref61 = (_productRecord$num = productRecord.num) !== null && _productRecord$num !== void 0 ? _productRecord$num : productRecord.product_quantity) !== null && _ref61 !== void 0 ? _ref61 : 1);
|
|
3834
3982
|
if (!(splitCount > 1)) {
|
|
3835
|
-
|
|
3983
|
+
_context23.next = 18;
|
|
3836
3984
|
break;
|
|
3837
3985
|
}
|
|
3838
3986
|
i = 0;
|
|
3839
3987
|
case 6:
|
|
3840
3988
|
if (!(i < splitCount)) {
|
|
3841
|
-
|
|
3989
|
+
_context23.next = 15;
|
|
3842
3990
|
break;
|
|
3843
3991
|
}
|
|
3844
3992
|
singleLine = cloneDeep(productRecord);
|
|
3845
3993
|
singleLine.num = 1;
|
|
3846
3994
|
delete singleLine.product_quantity;
|
|
3847
|
-
|
|
3995
|
+
_context23.next = 12;
|
|
3848
3996
|
return this.appendProductLineToTempOrder(tempOrder, singleLine, cloneDeep(booking));
|
|
3849
3997
|
case 12:
|
|
3850
3998
|
i += 1;
|
|
3851
|
-
|
|
3999
|
+
_context23.next = 6;
|
|
3852
4000
|
break;
|
|
3853
4001
|
case 15:
|
|
3854
|
-
|
|
4002
|
+
_context23.next = 17;
|
|
3855
4003
|
return this.finalizeProductOrderMutation(tempOrder);
|
|
3856
4004
|
case 17:
|
|
3857
|
-
return
|
|
4005
|
+
return _context23.abrupt("return", tempOrder.products);
|
|
3858
4006
|
case 18:
|
|
3859
|
-
|
|
4007
|
+
_context23.next = 20;
|
|
3860
4008
|
return this.appendProductLineToTempOrder(tempOrder, product, booking);
|
|
3861
4009
|
case 20:
|
|
3862
|
-
|
|
4010
|
+
_context23.next = 22;
|
|
3863
4011
|
return this.finalizeProductOrderMutation(tempOrder);
|
|
3864
4012
|
case 22:
|
|
3865
4013
|
this.logInfo('addProductToOrder success', {
|
|
3866
4014
|
product_id: product.product_id,
|
|
3867
4015
|
with_booking: !!booking
|
|
3868
4016
|
});
|
|
3869
|
-
return
|
|
4017
|
+
return _context23.abrupt("return", tempOrder.products);
|
|
3870
4018
|
case 24:
|
|
3871
4019
|
case "end":
|
|
3872
|
-
return
|
|
4020
|
+
return _context23.stop();
|
|
3873
4021
|
}
|
|
3874
|
-
},
|
|
4022
|
+
}, _callee21, this);
|
|
3875
4023
|
}));
|
|
3876
|
-
function addProductToOrder(
|
|
4024
|
+
function addProductToOrder(_x25, _x26) {
|
|
3877
4025
|
return _addProductToOrder.apply(this, arguments);
|
|
3878
4026
|
}
|
|
3879
4027
|
return addProductToOrder;
|
|
@@ -3891,93 +4039,93 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
3891
4039
|
}, {
|
|
3892
4040
|
key: "addProductsToOrder",
|
|
3893
4041
|
value: (function () {
|
|
3894
|
-
var _addProductsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4042
|
+
var _addProductsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(items, options) {
|
|
3895
4043
|
var tempOrder, _iterator20, _step20, item, product, booking, _ref62, _productRecord$num2, productRecord, splitCount, i, singleLine;
|
|
3896
|
-
return _regeneratorRuntime().wrap(function
|
|
3897
|
-
while (1) switch (
|
|
4044
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context24) {
|
|
4045
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
3898
4046
|
case 0:
|
|
3899
4047
|
tempOrder = this.ensureTempOrder();
|
|
3900
4048
|
if (!(!Array.isArray(items) || items.length === 0)) {
|
|
3901
|
-
|
|
4049
|
+
_context24.next = 3;
|
|
3902
4050
|
break;
|
|
3903
4051
|
}
|
|
3904
|
-
return
|
|
4052
|
+
return _context24.abrupt("return", tempOrder.products);
|
|
3905
4053
|
case 3:
|
|
3906
4054
|
_iterator20 = _createForOfIteratorHelper(items || []);
|
|
3907
|
-
|
|
4055
|
+
_context24.prev = 4;
|
|
3908
4056
|
_iterator20.s();
|
|
3909
4057
|
case 6:
|
|
3910
4058
|
if ((_step20 = _iterator20.n()).done) {
|
|
3911
|
-
|
|
4059
|
+
_context24.next = 30;
|
|
3912
4060
|
break;
|
|
3913
4061
|
}
|
|
3914
4062
|
item = _step20.value;
|
|
3915
4063
|
product = item.product, booking = item.booking;
|
|
3916
4064
|
if (product) {
|
|
3917
|
-
|
|
4065
|
+
_context24.next = 11;
|
|
3918
4066
|
break;
|
|
3919
4067
|
}
|
|
3920
|
-
return
|
|
4068
|
+
return _context24.abrupt("continue", 28);
|
|
3921
4069
|
case 11:
|
|
3922
4070
|
if (!booking) {
|
|
3923
|
-
|
|
4071
|
+
_context24.next = 26;
|
|
3924
4072
|
break;
|
|
3925
4073
|
}
|
|
3926
4074
|
productRecord = product;
|
|
3927
4075
|
splitCount = getSafeProductNum((_ref62 = (_productRecord$num2 = productRecord.num) !== null && _productRecord$num2 !== void 0 ? _productRecord$num2 : productRecord.product_quantity) !== null && _ref62 !== void 0 ? _ref62 : 1);
|
|
3928
4076
|
if (!(splitCount > 1)) {
|
|
3929
|
-
|
|
4077
|
+
_context24.next = 26;
|
|
3930
4078
|
break;
|
|
3931
4079
|
}
|
|
3932
4080
|
i = 0;
|
|
3933
4081
|
case 16:
|
|
3934
4082
|
if (!(i < splitCount)) {
|
|
3935
|
-
|
|
4083
|
+
_context24.next = 25;
|
|
3936
4084
|
break;
|
|
3937
4085
|
}
|
|
3938
4086
|
singleLine = cloneDeep(productRecord);
|
|
3939
4087
|
singleLine.num = 1;
|
|
3940
4088
|
delete singleLine.product_quantity;
|
|
3941
|
-
|
|
4089
|
+
_context24.next = 22;
|
|
3942
4090
|
return this.appendProductLineToTempOrder(tempOrder, singleLine, cloneDeep(booking));
|
|
3943
4091
|
case 22:
|
|
3944
4092
|
i += 1;
|
|
3945
|
-
|
|
4093
|
+
_context24.next = 16;
|
|
3946
4094
|
break;
|
|
3947
4095
|
case 25:
|
|
3948
|
-
return
|
|
4096
|
+
return _context24.abrupt("continue", 28);
|
|
3949
4097
|
case 26:
|
|
3950
|
-
|
|
4098
|
+
_context24.next = 28;
|
|
3951
4099
|
return this.appendProductLineToTempOrder(tempOrder, product, booking);
|
|
3952
4100
|
case 28:
|
|
3953
|
-
|
|
4101
|
+
_context24.next = 6;
|
|
3954
4102
|
break;
|
|
3955
4103
|
case 30:
|
|
3956
|
-
|
|
4104
|
+
_context24.next = 35;
|
|
3957
4105
|
break;
|
|
3958
4106
|
case 32:
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
_iterator20.e(
|
|
4107
|
+
_context24.prev = 32;
|
|
4108
|
+
_context24.t0 = _context24["catch"](4);
|
|
4109
|
+
_iterator20.e(_context24.t0);
|
|
3962
4110
|
case 35:
|
|
3963
|
-
|
|
4111
|
+
_context24.prev = 35;
|
|
3964
4112
|
_iterator20.f();
|
|
3965
|
-
return
|
|
4113
|
+
return _context24.finish(35);
|
|
3966
4114
|
case 38:
|
|
3967
|
-
|
|
4115
|
+
_context24.next = 40;
|
|
3968
4116
|
return this.finalizeProductOrderMutation(tempOrder, options);
|
|
3969
4117
|
case 40:
|
|
3970
4118
|
this.logInfo('addProductsToOrder success', {
|
|
3971
4119
|
itemsCount: items.length
|
|
3972
4120
|
});
|
|
3973
|
-
return
|
|
4121
|
+
return _context24.abrupt("return", tempOrder.products);
|
|
3974
4122
|
case 42:
|
|
3975
4123
|
case "end":
|
|
3976
|
-
return
|
|
4124
|
+
return _context24.stop();
|
|
3977
4125
|
}
|
|
3978
|
-
},
|
|
4126
|
+
}, _callee22, this, [[4, 32, 35, 38]]);
|
|
3979
4127
|
}));
|
|
3980
|
-
function addProductsToOrder(
|
|
4128
|
+
function addProductsToOrder(_x27, _x28) {
|
|
3981
4129
|
return _addProductsToOrder.apply(this, arguments);
|
|
3982
4130
|
}
|
|
3983
4131
|
return addProductsToOrder;
|
|
@@ -4011,17 +4159,17 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4011
4159
|
}, {
|
|
4012
4160
|
key: "preservePersistedBundlePriceFields",
|
|
4013
4161
|
value: function preservePersistedBundlePriceFields(previousBundles, nextBundles) {
|
|
4014
|
-
var
|
|
4162
|
+
var _this27 = this;
|
|
4015
4163
|
if (!Array.isArray(nextBundles)) return nextBundles;
|
|
4016
4164
|
if (!Array.isArray(previousBundles) || previousBundles.length === 0) return nextBundles;
|
|
4017
4165
|
var previousByIdentity = new Map();
|
|
4018
4166
|
previousBundles.forEach(function (bundle) {
|
|
4019
|
-
var identity =
|
|
4167
|
+
var identity = _this27.getBundleRuntimeIdentity(bundle);
|
|
4020
4168
|
if (identity) previousByIdentity.set(identity, bundle);
|
|
4021
4169
|
});
|
|
4022
4170
|
return nextBundles.map(function (bundle, index) {
|
|
4023
4171
|
if (!bundle || _typeof(bundle) !== 'object') return bundle;
|
|
4024
|
-
var previous = previousByIdentity.get(
|
|
4172
|
+
var previous = previousByIdentity.get(_this27.getBundleRuntimeIdentity(bundle)) || previousBundles[index];
|
|
4025
4173
|
if (!previous || _typeof(previous) !== 'object') return bundle;
|
|
4026
4174
|
return _objectSpread(_objectSpread(_objectSpread({}, bundle), (bundle.cover === undefined || bundle.cover === null || bundle.cover === '') && previous.cover !== undefined && previous.cover !== null && previous.cover !== '' ? {
|
|
4027
4175
|
cover: previous.cover
|
|
@@ -4222,21 +4370,21 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4222
4370
|
}, {
|
|
4223
4371
|
key: "updateOrderProduct",
|
|
4224
4372
|
value: function () {
|
|
4225
|
-
var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4373
|
+
var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
|
|
4226
4374
|
var tempOrder, updatedProductUid;
|
|
4227
|
-
return _regeneratorRuntime().wrap(function
|
|
4228
|
-
while (1) switch (
|
|
4375
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context25) {
|
|
4376
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
4229
4377
|
case 0:
|
|
4230
4378
|
tempOrder = this.ensureTempOrder();
|
|
4231
4379
|
updatedProductUid = this.applyOrderProductUpdateToTempOrder(tempOrder, params);
|
|
4232
|
-
|
|
4380
|
+
_context25.next = 4;
|
|
4233
4381
|
return this.applyPromotion();
|
|
4234
4382
|
case 4:
|
|
4235
4383
|
this.applyDiscount({
|
|
4236
4384
|
reapplyBookingDiscountProductUids: params.allow_booking_discount_reapply && updatedProductUid ? [String(updatedProductUid)] : undefined
|
|
4237
4385
|
});
|
|
4238
4386
|
this.sanitizeTempOrderProducts(tempOrder);
|
|
4239
|
-
|
|
4387
|
+
_context25.next = 8;
|
|
4240
4388
|
return this.recalculateSummary({
|
|
4241
4389
|
createIfMissing: true
|
|
4242
4390
|
});
|
|
@@ -4245,14 +4393,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4245
4393
|
this.logInfo('updateOrderProduct success', {
|
|
4246
4394
|
params: params
|
|
4247
4395
|
});
|
|
4248
|
-
return
|
|
4396
|
+
return _context25.abrupt("return", tempOrder.products);
|
|
4249
4397
|
case 11:
|
|
4250
4398
|
case "end":
|
|
4251
|
-
return
|
|
4399
|
+
return _context25.stop();
|
|
4252
4400
|
}
|
|
4253
|
-
},
|
|
4401
|
+
}, _callee23, this);
|
|
4254
4402
|
}));
|
|
4255
|
-
function updateOrderProduct(
|
|
4403
|
+
function updateOrderProduct(_x29) {
|
|
4256
4404
|
return _updateOrderProduct.apply(this, arguments);
|
|
4257
4405
|
}
|
|
4258
4406
|
return updateOrderProduct;
|
|
@@ -4260,28 +4408,28 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4260
4408
|
}, {
|
|
4261
4409
|
key: "updateOrderProducts",
|
|
4262
4410
|
value: function () {
|
|
4263
|
-
var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4264
|
-
var
|
|
4411
|
+
var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(paramsList) {
|
|
4412
|
+
var _this28 = this;
|
|
4265
4413
|
var tempOrder, reapplyBookingDiscountProductUids;
|
|
4266
|
-
return _regeneratorRuntime().wrap(function
|
|
4267
|
-
while (1) switch (
|
|
4414
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context26) {
|
|
4415
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
4268
4416
|
case 0:
|
|
4269
4417
|
tempOrder = this.ensureTempOrder();
|
|
4270
4418
|
if (paramsList.length) {
|
|
4271
|
-
|
|
4419
|
+
_context26.next = 3;
|
|
4272
4420
|
break;
|
|
4273
4421
|
}
|
|
4274
|
-
return
|
|
4422
|
+
return _context26.abrupt("return", tempOrder.products);
|
|
4275
4423
|
case 3:
|
|
4276
4424
|
reapplyBookingDiscountProductUids = paramsList.reduce(function (acc, params) {
|
|
4277
|
-
var updatedProductUid =
|
|
4425
|
+
var updatedProductUid = _this28.applyOrderProductUpdateToTempOrder(tempOrder, params);
|
|
4278
4426
|
// 批量改预约时间时,延迟到最后一次折扣计算里统一恢复已选预约折扣卡。
|
|
4279
4427
|
if (params.allow_booking_discount_reapply && updatedProductUid) {
|
|
4280
4428
|
acc.push(String(updatedProductUid));
|
|
4281
4429
|
}
|
|
4282
4430
|
return acc;
|
|
4283
4431
|
}, []);
|
|
4284
|
-
|
|
4432
|
+
_context26.next = 6;
|
|
4285
4433
|
return this.finalizeAfterProductsMutation(tempOrder, {
|
|
4286
4434
|
reapplyBookingDiscountProductUids: reapplyBookingDiscountProductUids.length ? reapplyBookingDiscountProductUids : undefined
|
|
4287
4435
|
});
|
|
@@ -4289,14 +4437,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4289
4437
|
this.logInfo('updateOrderProduct success', {
|
|
4290
4438
|
paramsList: paramsList
|
|
4291
4439
|
});
|
|
4292
|
-
return
|
|
4440
|
+
return _context26.abrupt("return", tempOrder.products);
|
|
4293
4441
|
case 8:
|
|
4294
4442
|
case "end":
|
|
4295
|
-
return
|
|
4443
|
+
return _context26.stop();
|
|
4296
4444
|
}
|
|
4297
|
-
},
|
|
4445
|
+
}, _callee24, this);
|
|
4298
4446
|
}));
|
|
4299
|
-
function updateOrderProducts(
|
|
4447
|
+
function updateOrderProducts(_x30) {
|
|
4300
4448
|
return _updateOrderProducts.apply(this, arguments);
|
|
4301
4449
|
}
|
|
4302
4450
|
return updateOrderProducts;
|
|
@@ -4304,11 +4452,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4304
4452
|
}, {
|
|
4305
4453
|
key: "updateOrderProductQuantity",
|
|
4306
4454
|
value: function () {
|
|
4307
|
-
var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4455
|
+
var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(params) {
|
|
4308
4456
|
var _targetProduct$metada17;
|
|
4309
4457
|
var product_id, product_variant_id, num, unique_identification_number, identity_key, product_sku, product_bundle, tempOrder, identityLookup, productIndex, targetUid, targetProduct, normalizedProduct;
|
|
4310
|
-
return _regeneratorRuntime().wrap(function
|
|
4311
|
-
while (1) switch (
|
|
4458
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context27) {
|
|
4459
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
4312
4460
|
case 0:
|
|
4313
4461
|
product_id = params.product_id, product_variant_id = params.product_variant_id, num = params.num, unique_identification_number = params.unique_identification_number, identity_key = params.identity_key, product_sku = params.product_sku, product_bundle = params.product_bundle;
|
|
4314
4462
|
tempOrder = this.ensureTempOrder();
|
|
@@ -4337,7 +4485,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4337
4485
|
productIndex = getProductIdentityIndex(tempOrder.products, identityLookup);
|
|
4338
4486
|
}
|
|
4339
4487
|
if (!(productIndex === -1)) {
|
|
4340
|
-
|
|
4488
|
+
_context27.next = 12;
|
|
4341
4489
|
break;
|
|
4342
4490
|
}
|
|
4343
4491
|
throw new Error('[Order] 目标商品不存在,无法更新数量');
|
|
@@ -4351,12 +4499,12 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4351
4499
|
}));
|
|
4352
4500
|
normalizedProduct.discount_list = normalizeOrderProductDiscountList(normalizedProduct.discount_list);
|
|
4353
4501
|
tempOrder.products[productIndex] = normalizedProduct;
|
|
4354
|
-
|
|
4502
|
+
_context27.next = 18;
|
|
4355
4503
|
return this.applyPromotion();
|
|
4356
4504
|
case 18:
|
|
4357
4505
|
this.applyDiscount();
|
|
4358
4506
|
this.sanitizeTempOrderProducts(tempOrder);
|
|
4359
|
-
|
|
4507
|
+
_context27.next = 22;
|
|
4360
4508
|
return this.recalculateSummary({
|
|
4361
4509
|
createIfMissing: true
|
|
4362
4510
|
});
|
|
@@ -4365,14 +4513,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4365
4513
|
this.logInfo('updateOrderProductQuantity success', {
|
|
4366
4514
|
params: params
|
|
4367
4515
|
});
|
|
4368
|
-
return
|
|
4516
|
+
return _context27.abrupt("return", tempOrder.products);
|
|
4369
4517
|
case 25:
|
|
4370
4518
|
case "end":
|
|
4371
|
-
return
|
|
4519
|
+
return _context27.stop();
|
|
4372
4520
|
}
|
|
4373
|
-
},
|
|
4521
|
+
}, _callee25, this);
|
|
4374
4522
|
}));
|
|
4375
|
-
function updateOrderProductQuantity(
|
|
4523
|
+
function updateOrderProductQuantity(_x31) {
|
|
4376
4524
|
return _updateOrderProductQuantity.apply(this, arguments);
|
|
4377
4525
|
}
|
|
4378
4526
|
return updateOrderProductQuantity;
|
|
@@ -4413,19 +4561,19 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4413
4561
|
}, {
|
|
4414
4562
|
key: "finalizeAfterProductsMutation",
|
|
4415
4563
|
value: (function () {
|
|
4416
|
-
var _finalizeAfterProductsMutation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4417
|
-
return _regeneratorRuntime().wrap(function
|
|
4418
|
-
while (1) switch (
|
|
4564
|
+
var _finalizeAfterProductsMutation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(tempOrder, options) {
|
|
4565
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context28) {
|
|
4566
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
4419
4567
|
case 0:
|
|
4420
4568
|
this.syncTempOrderHolderFromBookings(tempOrder);
|
|
4421
|
-
|
|
4569
|
+
_context28.next = 3;
|
|
4422
4570
|
return this.applyPromotion();
|
|
4423
4571
|
case 3:
|
|
4424
4572
|
this.applyDiscount({
|
|
4425
4573
|
reapplyBookingDiscountProductUids: options === null || options === void 0 ? void 0 : options.reapplyBookingDiscountProductUids
|
|
4426
4574
|
});
|
|
4427
4575
|
this.sanitizeTempOrderProducts(tempOrder);
|
|
4428
|
-
|
|
4576
|
+
_context28.next = 7;
|
|
4429
4577
|
return this.recalculateSummary({
|
|
4430
4578
|
createIfMissing: true
|
|
4431
4579
|
});
|
|
@@ -4433,11 +4581,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4433
4581
|
this.persistTempOrder();
|
|
4434
4582
|
case 8:
|
|
4435
4583
|
case "end":
|
|
4436
|
-
return
|
|
4584
|
+
return _context28.stop();
|
|
4437
4585
|
}
|
|
4438
|
-
},
|
|
4586
|
+
}, _callee26, this);
|
|
4439
4587
|
}));
|
|
4440
|
-
function finalizeAfterProductsMutation(
|
|
4588
|
+
function finalizeAfterProductsMutation(_x32, _x33) {
|
|
4441
4589
|
return _finalizeAfterProductsMutation.apply(this, arguments);
|
|
4442
4590
|
}
|
|
4443
4591
|
return finalizeAfterProductsMutation;
|
|
@@ -4452,18 +4600,18 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4452
4600
|
}, {
|
|
4453
4601
|
key: "removeProductsFromOrder",
|
|
4454
4602
|
value: (function () {
|
|
4455
|
-
var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4456
|
-
var
|
|
4603
|
+
var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(identities) {
|
|
4604
|
+
var _this29 = this;
|
|
4457
4605
|
var tempOrder, productsBeforeRemove, bookingsBeforeRemove, matchedProducts, removedProducts, _i2, _removedProducts, product, linkedBookingUidsToRemove, _iterator21, _step21, _loop3;
|
|
4458
|
-
return _regeneratorRuntime().wrap(function
|
|
4459
|
-
while (1) switch (
|
|
4606
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context30) {
|
|
4607
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
4460
4608
|
case 0:
|
|
4461
4609
|
tempOrder = this.ensureTempOrder();
|
|
4462
4610
|
if (identities.length) {
|
|
4463
|
-
|
|
4611
|
+
_context30.next = 3;
|
|
4464
4612
|
break;
|
|
4465
4613
|
}
|
|
4466
|
-
return
|
|
4614
|
+
return _context30.abrupt("return", tempOrder.products);
|
|
4467
4615
|
case 3:
|
|
4468
4616
|
productsBeforeRemove = tempOrder.products || [];
|
|
4469
4617
|
bookingsBeforeRemove = tempOrder.bookings || [];
|
|
@@ -4486,29 +4634,29 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4486
4634
|
}
|
|
4487
4635
|
linkedBookingUidsToRemove = new Set();
|
|
4488
4636
|
_iterator21 = _createForOfIteratorHelper(matchedProducts);
|
|
4489
|
-
|
|
4637
|
+
_context30.prev = 11;
|
|
4490
4638
|
_loop3 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop3() {
|
|
4491
4639
|
var _metadata11, _metadata12, _metadata13, _metadata14;
|
|
4492
4640
|
var product, productUid, productBookingUid, isAddTimeProduct;
|
|
4493
|
-
return _regeneratorRuntime().wrap(function _loop3$(
|
|
4494
|
-
while (1) switch (
|
|
4641
|
+
return _regeneratorRuntime().wrap(function _loop3$(_context29) {
|
|
4642
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
4495
4643
|
case 0:
|
|
4496
4644
|
product = _step21.value;
|
|
4497
4645
|
productUid = (product === null || product === void 0 || (_metadata11 = product.metadata) === null || _metadata11 === void 0 ? void 0 : _metadata11.unique_identification_number) || (product === null || product === void 0 ? void 0 : product.unique_identification_number);
|
|
4498
4646
|
productBookingUid = (product === null || product === void 0 ? void 0 : product.booking_uid) || (product === null || product === void 0 || (_metadata12 = product.metadata) === null || _metadata12 === void 0 ? void 0 : _metadata12.booking_uid);
|
|
4499
4647
|
isAddTimeProduct = (product === null || product === void 0 || (_metadata13 = product.metadata) === null || _metadata13 === void 0 ? void 0 : _metadata13.product_add_schedule_time) !== undefined && (product === null || product === void 0 || (_metadata14 = product.metadata) === null || _metadata14 === void 0 ? void 0 : _metadata14.product_add_schedule_time) !== null;
|
|
4500
4648
|
if (!isAddTimeProduct) {
|
|
4501
|
-
|
|
4649
|
+
_context29.next = 6;
|
|
4502
4650
|
break;
|
|
4503
4651
|
}
|
|
4504
|
-
return
|
|
4652
|
+
return _context29.abrupt("return", 1);
|
|
4505
4653
|
case 6:
|
|
4506
4654
|
if (productBookingUid !== undefined && productBookingUid !== null && productBookingUid !== '') {
|
|
4507
4655
|
linkedBookingUidsToRemove.add(String(productBookingUid));
|
|
4508
4656
|
}
|
|
4509
4657
|
if (productUid !== undefined && productUid !== null && productUid !== '') {
|
|
4510
4658
|
bookingsBeforeRemove.forEach(function (booking) {
|
|
4511
|
-
var bookingUid =
|
|
4659
|
+
var bookingUid = _this29.getBookingUniqueIdentificationNumber(booking);
|
|
4512
4660
|
if (bookingUid && String((booking === null || booking === void 0 ? void 0 : booking.product_uid) || '') === String(productUid)) {
|
|
4513
4661
|
linkedBookingUidsToRemove.add(bookingUid);
|
|
4514
4662
|
}
|
|
@@ -4516,37 +4664,37 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4516
4664
|
}
|
|
4517
4665
|
case 8:
|
|
4518
4666
|
case "end":
|
|
4519
|
-
return
|
|
4667
|
+
return _context29.stop();
|
|
4520
4668
|
}
|
|
4521
4669
|
}, _loop3);
|
|
4522
4670
|
});
|
|
4523
4671
|
_iterator21.s();
|
|
4524
4672
|
case 14:
|
|
4525
4673
|
if ((_step21 = _iterator21.n()).done) {
|
|
4526
|
-
|
|
4674
|
+
_context30.next = 20;
|
|
4527
4675
|
break;
|
|
4528
4676
|
}
|
|
4529
|
-
return
|
|
4677
|
+
return _context30.delegateYield(_loop3(), "t0", 16);
|
|
4530
4678
|
case 16:
|
|
4531
|
-
if (!
|
|
4532
|
-
|
|
4679
|
+
if (!_context30.t0) {
|
|
4680
|
+
_context30.next = 18;
|
|
4533
4681
|
break;
|
|
4534
4682
|
}
|
|
4535
|
-
return
|
|
4683
|
+
return _context30.abrupt("continue", 18);
|
|
4536
4684
|
case 18:
|
|
4537
|
-
|
|
4685
|
+
_context30.next = 14;
|
|
4538
4686
|
break;
|
|
4539
4687
|
case 20:
|
|
4540
|
-
|
|
4688
|
+
_context30.next = 25;
|
|
4541
4689
|
break;
|
|
4542
4690
|
case 22:
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
_iterator21.e(
|
|
4691
|
+
_context30.prev = 22;
|
|
4692
|
+
_context30.t1 = _context30["catch"](11);
|
|
4693
|
+
_iterator21.e(_context30.t1);
|
|
4546
4694
|
case 25:
|
|
4547
|
-
|
|
4695
|
+
_context30.prev = 25;
|
|
4548
4696
|
_iterator21.f();
|
|
4549
|
-
return
|
|
4697
|
+
return _context30.finish(25);
|
|
4550
4698
|
case 28:
|
|
4551
4699
|
if (linkedBookingUidsToRemove.size > 0) {
|
|
4552
4700
|
// 删除主预约商品时,同步移除挂在同一 booking_uid 下的加时商品,避免残留孤儿行。
|
|
@@ -4557,20 +4705,20 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4557
4705
|
return !(isAddTimeProduct && lineBookingUid !== undefined && lineBookingUid !== null && linkedBookingUidsToRemove.has(String(lineBookingUid)));
|
|
4558
4706
|
});
|
|
4559
4707
|
}
|
|
4560
|
-
|
|
4708
|
+
_context30.next = 31;
|
|
4561
4709
|
return this.finalizeAfterProductsMutation(tempOrder);
|
|
4562
4710
|
case 31:
|
|
4563
4711
|
this.logInfo('removeProductsFromOrder success', {
|
|
4564
4712
|
identities: identities
|
|
4565
4713
|
});
|
|
4566
|
-
return
|
|
4714
|
+
return _context30.abrupt("return", tempOrder.products);
|
|
4567
4715
|
case 33:
|
|
4568
4716
|
case "end":
|
|
4569
|
-
return
|
|
4717
|
+
return _context30.stop();
|
|
4570
4718
|
}
|
|
4571
|
-
},
|
|
4719
|
+
}, _callee27, this, [[11, 22, 25, 28]]);
|
|
4572
4720
|
}));
|
|
4573
|
-
function removeProductsFromOrder(
|
|
4721
|
+
function removeProductsFromOrder(_x34) {
|
|
4574
4722
|
return _removeProductsFromOrder.apply(this, arguments);
|
|
4575
4723
|
}
|
|
4576
4724
|
return removeProductsFromOrder;
|
|
@@ -4578,18 +4726,18 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4578
4726
|
}, {
|
|
4579
4727
|
key: "removeProductFromOrder",
|
|
4580
4728
|
value: function () {
|
|
4581
|
-
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4582
|
-
return _regeneratorRuntime().wrap(function
|
|
4583
|
-
while (1) switch (
|
|
4729
|
+
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(identity) {
|
|
4730
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context31) {
|
|
4731
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
4584
4732
|
case 0:
|
|
4585
|
-
return
|
|
4733
|
+
return _context31.abrupt("return", this.removeProductsFromOrder([identity]));
|
|
4586
4734
|
case 1:
|
|
4587
4735
|
case "end":
|
|
4588
|
-
return
|
|
4736
|
+
return _context31.stop();
|
|
4589
4737
|
}
|
|
4590
|
-
},
|
|
4738
|
+
}, _callee28, this);
|
|
4591
4739
|
}));
|
|
4592
|
-
function removeProductFromOrder(
|
|
4740
|
+
function removeProductFromOrder(_x35) {
|
|
4593
4741
|
return _removeProductFromOrder.apply(this, arguments);
|
|
4594
4742
|
}
|
|
4595
4743
|
return removeProductFromOrder;
|
|
@@ -4601,10 +4749,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4601
4749
|
}, {
|
|
4602
4750
|
key: "clearOrderCartLines",
|
|
4603
4751
|
value: (function () {
|
|
4604
|
-
var _clearOrderCartLines = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4752
|
+
var _clearOrderCartLines = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
4605
4753
|
var tempOrder;
|
|
4606
|
-
return _regeneratorRuntime().wrap(function
|
|
4607
|
-
while (1) switch (
|
|
4754
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context32) {
|
|
4755
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
4608
4756
|
case 0:
|
|
4609
4757
|
tempOrder = this.ensureTempOrder();
|
|
4610
4758
|
tempOrder.products = [];
|
|
@@ -4615,24 +4763,24 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4615
4763
|
productsByUid: {}
|
|
4616
4764
|
});
|
|
4617
4765
|
}
|
|
4618
|
-
|
|
4766
|
+
_context32.next = 7;
|
|
4619
4767
|
return this.applyPromotion();
|
|
4620
4768
|
case 7:
|
|
4621
4769
|
this.applyDiscount();
|
|
4622
4770
|
this.sanitizeTempOrderProducts(tempOrder);
|
|
4623
|
-
|
|
4771
|
+
_context32.next = 11;
|
|
4624
4772
|
return this.recalculateSummary({
|
|
4625
4773
|
createIfMissing: true
|
|
4626
4774
|
});
|
|
4627
4775
|
case 11:
|
|
4628
4776
|
this.persistTempOrder();
|
|
4629
4777
|
this.logInfo('clearOrderCartLines success', {});
|
|
4630
|
-
return
|
|
4778
|
+
return _context32.abrupt("return", tempOrder);
|
|
4631
4779
|
case 14:
|
|
4632
4780
|
case "end":
|
|
4633
|
-
return
|
|
4781
|
+
return _context32.stop();
|
|
4634
4782
|
}
|
|
4635
|
-
},
|
|
4783
|
+
}, _callee29, this);
|
|
4636
4784
|
}));
|
|
4637
4785
|
function clearOrderCartLines() {
|
|
4638
4786
|
return _clearOrderCartLines.apply(this, arguments);
|
|
@@ -4670,17 +4818,17 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4670
4818
|
}, {
|
|
4671
4819
|
key: "applyLocalPrintOrderNumbers",
|
|
4672
4820
|
value: function () {
|
|
4673
|
-
var _applyLocalPrintOrderNumbers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4821
|
+
var _applyLocalPrintOrderNumbers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(order) {
|
|
4674
4822
|
var tempOrder, shopOrderNumber, shopFullOrderNumber;
|
|
4675
|
-
return _regeneratorRuntime().wrap(function
|
|
4676
|
-
while (1) switch (
|
|
4823
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context33) {
|
|
4824
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
4677
4825
|
case 0:
|
|
4678
4826
|
tempOrder = this.ensureTempOrder();
|
|
4679
4827
|
if (!(!order || _typeof(order) !== 'object')) {
|
|
4680
|
-
|
|
4828
|
+
_context33.next = 3;
|
|
4681
4829
|
break;
|
|
4682
4830
|
}
|
|
4683
|
-
return
|
|
4831
|
+
return _context33.abrupt("return", tempOrder);
|
|
4684
4832
|
case 3:
|
|
4685
4833
|
shopOrderNumber = order.shop_order_number;
|
|
4686
4834
|
shopFullOrderNumber = order.shop_full_order_number;
|
|
@@ -4691,21 +4839,88 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4691
4839
|
tempOrder.shop_full_order_number = String(shopFullOrderNumber);
|
|
4692
4840
|
}
|
|
4693
4841
|
this.persistTempOrder();
|
|
4694
|
-
|
|
4842
|
+
_context33.next = 10;
|
|
4695
4843
|
return this.saveDraft();
|
|
4696
4844
|
case 10:
|
|
4697
|
-
return
|
|
4845
|
+
return _context33.abrupt("return", tempOrder);
|
|
4698
4846
|
case 11:
|
|
4699
4847
|
case "end":
|
|
4700
|
-
return
|
|
4848
|
+
return _context33.stop();
|
|
4701
4849
|
}
|
|
4702
|
-
},
|
|
4850
|
+
}, _callee30, this);
|
|
4703
4851
|
}));
|
|
4704
|
-
function applyLocalPrintOrderNumbers(
|
|
4852
|
+
function applyLocalPrintOrderNumbers(_x36) {
|
|
4705
4853
|
return _applyLocalPrintOrderNumbers.apply(this, arguments);
|
|
4706
4854
|
}
|
|
4707
4855
|
return applyLocalPrintOrderNumbers;
|
|
4708
4856
|
}()
|
|
4857
|
+
}, {
|
|
4858
|
+
key: "saveTempOrderAsDraft",
|
|
4859
|
+
value: function () {
|
|
4860
|
+
var _saveTempOrderAsDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
4861
|
+
var _params$cacheId2, _this$otherParams6, _this$otherParams7, _this$otherParams8, _params$type, _this$otherParams9, _payload$products;
|
|
4862
|
+
var tempOrder, latestSummary, payload;
|
|
4863
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context34) {
|
|
4864
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
4865
|
+
case 0:
|
|
4866
|
+
tempOrder = this.ensureTempOrder();
|
|
4867
|
+
this.ensureExternalSaleNumber(tempOrder);
|
|
4868
|
+
this.persistTempOrder();
|
|
4869
|
+
_context34.next = 5;
|
|
4870
|
+
return this.recalculateSummary({
|
|
4871
|
+
createIfMissing: true
|
|
4872
|
+
});
|
|
4873
|
+
case 5:
|
|
4874
|
+
_context34.t1 = _context34.sent;
|
|
4875
|
+
if (_context34.t1) {
|
|
4876
|
+
_context34.next = 8;
|
|
4877
|
+
break;
|
|
4878
|
+
}
|
|
4879
|
+
_context34.t1 = this.store.summary;
|
|
4880
|
+
case 8:
|
|
4881
|
+
_context34.t0 = _context34.t1;
|
|
4882
|
+
if (_context34.t0) {
|
|
4883
|
+
_context34.next = 11;
|
|
4884
|
+
break;
|
|
4885
|
+
}
|
|
4886
|
+
_context34.t0 = createEmptySummary();
|
|
4887
|
+
case 11:
|
|
4888
|
+
latestSummary = _context34.t0;
|
|
4889
|
+
payload = buildSubmitPayload({
|
|
4890
|
+
tempOrder: tempOrder,
|
|
4891
|
+
cacheId: (_params$cacheId2 = params === null || params === void 0 ? void 0 : params.cacheId) !== null && _params$cacheId2 !== void 0 ? _params$cacheId2 : this.cacheId,
|
|
4892
|
+
platform: (params === null || params === void 0 ? void 0 : params.platform) || ((_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.platform),
|
|
4893
|
+
businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.businessCode) || ((_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.business_code) || tempOrder.business_code,
|
|
4894
|
+
channel: params === null || params === void 0 ? void 0 : params.channel,
|
|
4895
|
+
type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.type,
|
|
4896
|
+
summary: latestSummary,
|
|
4897
|
+
enhance: params === null || params === void 0 ? void 0 : params.enhancePayload
|
|
4898
|
+
});
|
|
4899
|
+
if (!payload.created_at) {
|
|
4900
|
+
payload.created_at = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4901
|
+
}
|
|
4902
|
+
payload.need_sync = 0;
|
|
4903
|
+
payload.is_draft_order = 1;
|
|
4904
|
+
this.logInfo('saveTempOrderAsDraft calling sales draft', {
|
|
4905
|
+
orderId: payload.order_id,
|
|
4906
|
+
externalSaleNumber: payload.external_sale_number,
|
|
4907
|
+
productsCount: ((_payload$products = payload.products) === null || _payload$products === void 0 ? void 0 : _payload$products.length) || 0
|
|
4908
|
+
});
|
|
4909
|
+
return _context34.abrupt("return", this.request.post('/order/sales/draft', payload, {
|
|
4910
|
+
osServer: true,
|
|
4911
|
+
customToast: function customToast() {}
|
|
4912
|
+
}));
|
|
4913
|
+
case 18:
|
|
4914
|
+
case "end":
|
|
4915
|
+
return _context34.stop();
|
|
4916
|
+
}
|
|
4917
|
+
}, _callee31, this);
|
|
4918
|
+
}));
|
|
4919
|
+
function saveTempOrderAsDraft(_x37) {
|
|
4920
|
+
return _saveTempOrderAsDraft.apply(this, arguments);
|
|
4921
|
+
}
|
|
4922
|
+
return saveTempOrderAsDraft;
|
|
4923
|
+
}()
|
|
4709
4924
|
/**
|
|
4710
4925
|
* 提交当前 Sales tempOrder。
|
|
4711
4926
|
*
|
|
@@ -4715,18 +4930,18 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4715
4930
|
}, {
|
|
4716
4931
|
key: "submitTempOrder",
|
|
4717
4932
|
value: (function () {
|
|
4718
|
-
var _submitTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4719
|
-
return _regeneratorRuntime().wrap(function
|
|
4720
|
-
while (1) switch (
|
|
4933
|
+
var _submitTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
|
|
4934
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context35) {
|
|
4935
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
4721
4936
|
case 0:
|
|
4722
|
-
return
|
|
4937
|
+
return _context35.abrupt("return", this.runSubmitTempOrder(params));
|
|
4723
4938
|
case 1:
|
|
4724
4939
|
case "end":
|
|
4725
|
-
return
|
|
4940
|
+
return _context35.stop();
|
|
4726
4941
|
}
|
|
4727
|
-
},
|
|
4942
|
+
}, _callee32, this);
|
|
4728
4943
|
}));
|
|
4729
|
-
function submitTempOrder(
|
|
4944
|
+
function submitTempOrder(_x38) {
|
|
4730
4945
|
return _submitTempOrder.apply(this, arguments);
|
|
4731
4946
|
}
|
|
4732
4947
|
return submitTempOrder;
|
|
@@ -4734,20 +4949,20 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4734
4949
|
}, {
|
|
4735
4950
|
key: "submitTempOrderAsync",
|
|
4736
4951
|
value: function () {
|
|
4737
|
-
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4738
|
-
return _regeneratorRuntime().wrap(function
|
|
4739
|
-
while (1) switch (
|
|
4952
|
+
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
|
|
4953
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context36) {
|
|
4954
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
4740
4955
|
case 0:
|
|
4741
|
-
return
|
|
4956
|
+
return _context36.abrupt("return", this.runSubmitTempOrder(_objectSpread(_objectSpread({}, params), {}, {
|
|
4742
4957
|
syncMode: true
|
|
4743
4958
|
})));
|
|
4744
4959
|
case 1:
|
|
4745
4960
|
case "end":
|
|
4746
|
-
return
|
|
4961
|
+
return _context36.stop();
|
|
4747
4962
|
}
|
|
4748
|
-
},
|
|
4963
|
+
}, _callee33, this);
|
|
4749
4964
|
}));
|
|
4750
|
-
function submitTempOrderAsync(
|
|
4965
|
+
function submitTempOrderAsync(_x39) {
|
|
4751
4966
|
return _submitTempOrderAsync.apply(this, arguments);
|
|
4752
4967
|
}
|
|
4753
4968
|
return submitTempOrderAsync;
|
|
@@ -4755,11 +4970,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4755
4970
|
}, {
|
|
4756
4971
|
key: "runSubmitTempOrder",
|
|
4757
4972
|
value: function () {
|
|
4758
|
-
var _runSubmitTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4759
|
-
var _params$
|
|
4973
|
+
var _runSubmitTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(params) {
|
|
4974
|
+
var _params$cacheId3, _this$otherParams10, _ref74, _ref75, _submitSnapshot$busin, _this$otherParams11, _this$otherParams12, _submitSnapshot$type;
|
|
4760
4975
|
var tempOrder, shouldConfirmPendingVoucherPayments, hasPaymentOverride, preparedPaymentOverride, latestSummary, effectiveCacheId, hasPaymentStatusOverride, hasSmallTicketDataFlagOverride, enhancePayload, submitSnapshot, payload, result, _payload$payments, _payload$payments2, backendErrorResponse, submittedOrderId, resultRecord;
|
|
4761
|
-
return _regeneratorRuntime().wrap(function
|
|
4762
|
-
while (1) switch (
|
|
4976
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context37) {
|
|
4977
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
4763
4978
|
case 0:
|
|
4764
4979
|
tempOrder = this.ensureTempOrder();
|
|
4765
4980
|
shouldConfirmPendingVoucherPayments = (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== false;
|
|
@@ -4779,27 +4994,27 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4779
4994
|
}
|
|
4780
4995
|
}
|
|
4781
4996
|
this.persistTempOrder();
|
|
4782
|
-
|
|
4997
|
+
_context37.next = 8;
|
|
4783
4998
|
return this.recalculateSummary({
|
|
4784
4999
|
createIfMissing: true
|
|
4785
5000
|
});
|
|
4786
5001
|
case 8:
|
|
4787
|
-
|
|
4788
|
-
if (
|
|
4789
|
-
|
|
5002
|
+
_context37.t1 = _context37.sent;
|
|
5003
|
+
if (_context37.t1) {
|
|
5004
|
+
_context37.next = 11;
|
|
4790
5005
|
break;
|
|
4791
5006
|
}
|
|
4792
|
-
|
|
5007
|
+
_context37.t1 = this.store.summary;
|
|
4793
5008
|
case 11:
|
|
4794
|
-
|
|
4795
|
-
if (
|
|
4796
|
-
|
|
5009
|
+
_context37.t0 = _context37.t1;
|
|
5010
|
+
if (_context37.t0) {
|
|
5011
|
+
_context37.next = 14;
|
|
4797
5012
|
break;
|
|
4798
5013
|
}
|
|
4799
|
-
|
|
5014
|
+
_context37.t0 = createEmptySummary();
|
|
4800
5015
|
case 14:
|
|
4801
|
-
latestSummary =
|
|
4802
|
-
effectiveCacheId = (_params$
|
|
5016
|
+
latestSummary = _context37.t0;
|
|
5017
|
+
effectiveCacheId = (_params$cacheId3 = params === null || params === void 0 ? void 0 : params.cacheId) !== null && _params$cacheId3 !== void 0 ? _params$cacheId3 : this.cacheId;
|
|
4803
5018
|
hasPaymentStatusOverride = (params === null || params === void 0 ? void 0 : params.paymentStatus) !== undefined;
|
|
4804
5019
|
hasSmallTicketDataFlagOverride = (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined;
|
|
4805
5020
|
enhancePayload = hasPaymentOverride || hasPaymentStatusOverride || hasSmallTicketDataFlagOverride || params !== null && params !== void 0 && params.enhancePayload ? function (payload, ctx) {
|
|
@@ -4817,8 +5032,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4817
5032
|
payload = buildSubmitPayload({
|
|
4818
5033
|
tempOrder: tempOrder,
|
|
4819
5034
|
cacheId: effectiveCacheId,
|
|
4820
|
-
platform: (params === null || params === void 0 ? void 0 : params.platform) || ((_this$
|
|
4821
|
-
businessCode: (_ref74 = (_ref75 = (_submitSnapshot$busin = submitSnapshot.businessCode) !== null && _submitSnapshot$busin !== void 0 ? _submitSnapshot$busin : params === null || params === void 0 ? void 0 : params.businessCode) !== null && _ref75 !== void 0 ? _ref75 : (_this$
|
|
5035
|
+
platform: (params === null || params === void 0 ? void 0 : params.platform) || ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.platform),
|
|
5036
|
+
businessCode: (_ref74 = (_ref75 = (_submitSnapshot$busin = submitSnapshot.businessCode) !== null && _submitSnapshot$busin !== void 0 ? _submitSnapshot$busin : params === null || params === void 0 ? void 0 : params.businessCode) !== null && _ref75 !== void 0 ? _ref75 : (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.businessCode) !== null && _ref74 !== void 0 ? _ref74 : (_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.business_code,
|
|
4822
5037
|
channel: params === null || params === void 0 ? void 0 : params.channel,
|
|
4823
5038
|
type: (_submitSnapshot$type = submitSnapshot.type) !== null && _submitSnapshot$type !== void 0 ? _submitSnapshot$type : params === null || params === void 0 ? void 0 : params.type,
|
|
4824
5039
|
summary: latestSummary,
|
|
@@ -4833,10 +5048,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4833
5048
|
if (!payload.created_at) {
|
|
4834
5049
|
payload.created_at = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4835
5050
|
}
|
|
4836
|
-
|
|
5051
|
+
_context37.next = 26;
|
|
4837
5052
|
return this.saveDraft();
|
|
4838
5053
|
case 26:
|
|
4839
|
-
|
|
5054
|
+
_context37.prev = 26;
|
|
4840
5055
|
this.logInfo('submitTempOrder calling sales checkout', {
|
|
4841
5056
|
orderId: payload.order_id,
|
|
4842
5057
|
externalSaleNumber: payload.external_sale_number,
|
|
@@ -4846,43 +5061,43 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4846
5061
|
smallTicketDataFlag: payload.small_ticket_data_flag,
|
|
4847
5062
|
syncMode: payload.sync_mode
|
|
4848
5063
|
});
|
|
4849
|
-
|
|
5064
|
+
_context37.next = 30;
|
|
4850
5065
|
return this.submitSalesOrder({
|
|
4851
5066
|
query: payload
|
|
4852
5067
|
});
|
|
4853
5068
|
case 30:
|
|
4854
|
-
result =
|
|
4855
|
-
|
|
5069
|
+
result = _context37.sent;
|
|
5070
|
+
_context37.next = 43;
|
|
4856
5071
|
break;
|
|
4857
5072
|
case 33:
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
backendErrorResponse = this.extractSubmitErrorResponse(
|
|
5073
|
+
_context37.prev = 33;
|
|
5074
|
+
_context37.t2 = _context37["catch"](26);
|
|
5075
|
+
backendErrorResponse = this.extractSubmitErrorResponse(_context37.t2);
|
|
4861
5076
|
if (!backendErrorResponse) {
|
|
4862
|
-
|
|
5077
|
+
_context37.next = 40;
|
|
4863
5078
|
break;
|
|
4864
5079
|
}
|
|
4865
5080
|
this.store.syncState = 'failed';
|
|
4866
5081
|
this.logSubmitBackendRejected(backendErrorResponse, payload);
|
|
4867
|
-
return
|
|
5082
|
+
return _context37.abrupt("return", backendErrorResponse);
|
|
4868
5083
|
case 40:
|
|
4869
5084
|
this.store.syncState = 'failed';
|
|
4870
5085
|
this.logError('submitTempOrder failed', {
|
|
4871
|
-
error:
|
|
5086
|
+
error: _context37.t2 instanceof Error ? _context37.t2.message : String(_context37.t2),
|
|
4872
5087
|
orderId: payload.order_id,
|
|
4873
5088
|
externalSaleNumber: payload.external_sale_number,
|
|
4874
5089
|
paymentStatus: payload.payment_status,
|
|
4875
5090
|
paymentsCount: ((_payload$payments2 = payload.payments) === null || _payload$payments2 === void 0 ? void 0 : _payload$payments2.length) || 0
|
|
4876
5091
|
});
|
|
4877
|
-
throw
|
|
5092
|
+
throw _context37.t2;
|
|
4878
5093
|
case 43:
|
|
4879
5094
|
if (!this.isSubmitResponseRejected(result)) {
|
|
4880
|
-
|
|
5095
|
+
_context37.next = 47;
|
|
4881
5096
|
break;
|
|
4882
5097
|
}
|
|
4883
5098
|
this.store.syncState = 'failed';
|
|
4884
5099
|
this.logSubmitBackendRejected(result, payload);
|
|
4885
|
-
return
|
|
5100
|
+
return _context37.abrupt("return", result);
|
|
4886
5101
|
case 47:
|
|
4887
5102
|
submittedOrderId = this.extractOrderIdFromSubmitResult(result);
|
|
4888
5103
|
this.logInfo('runSubmitTempOrder: 提交成功', {
|
|
@@ -4893,15 +5108,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4893
5108
|
})
|
|
4894
5109
|
});
|
|
4895
5110
|
if (!(submittedOrderId !== null && submittedOrderId !== undefined)) {
|
|
4896
|
-
|
|
5111
|
+
_context37.next = 56;
|
|
4897
5112
|
break;
|
|
4898
5113
|
}
|
|
4899
5114
|
tempOrder.order_id = submittedOrderId;
|
|
4900
5115
|
resultRecord = result;
|
|
4901
|
-
|
|
5116
|
+
_context37.next = 54;
|
|
4902
5117
|
return this.markLocalOrderSynced(submittedOrderId, (resultRecord === null || resultRecord === void 0 ? void 0 : resultRecord.data) || resultRecord || {});
|
|
4903
5118
|
case 54:
|
|
4904
|
-
|
|
5119
|
+
_context37.next = 57;
|
|
4905
5120
|
break;
|
|
4906
5121
|
case 56:
|
|
4907
5122
|
if (this.isLocalPendingSubmitResult(result)) {
|
|
@@ -4910,14 +5125,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4910
5125
|
this.store.syncState = 'submitted';
|
|
4911
5126
|
}
|
|
4912
5127
|
case 57:
|
|
4913
|
-
return
|
|
5128
|
+
return _context37.abrupt("return", result);
|
|
4914
5129
|
case 58:
|
|
4915
5130
|
case "end":
|
|
4916
|
-
return
|
|
5131
|
+
return _context37.stop();
|
|
4917
5132
|
}
|
|
4918
|
-
},
|
|
5133
|
+
}, _callee34, this, [[26, 33]]);
|
|
4919
5134
|
}));
|
|
4920
|
-
function runSubmitTempOrder(
|
|
5135
|
+
function runSubmitTempOrder(_x40) {
|
|
4921
5136
|
return _runSubmitTempOrder.apply(this, arguments);
|
|
4922
5137
|
}
|
|
4923
5138
|
return runSubmitTempOrder;
|
|
@@ -4925,10 +5140,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4925
5140
|
}, {
|
|
4926
5141
|
key: "markLocalOrderSynced",
|
|
4927
5142
|
value: function () {
|
|
4928
|
-
var _markLocalOrderSynced = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5143
|
+
var _markLocalOrderSynced = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(orderId, remoteOrder) {
|
|
4929
5144
|
var tempOrder;
|
|
4930
|
-
return _regeneratorRuntime().wrap(function
|
|
4931
|
-
while (1) switch (
|
|
5145
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context38) {
|
|
5146
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
4932
5147
|
case 0:
|
|
4933
5148
|
tempOrder = this.ensureTempOrder();
|
|
4934
5149
|
tempOrder.order_id = orderId;
|
|
@@ -4936,15 +5151,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4936
5151
|
this.store.lastOrderInfo = remoteOrder;
|
|
4937
5152
|
this.store.syncState = 'submitted';
|
|
4938
5153
|
this.persistTempOrder();
|
|
4939
|
-
|
|
5154
|
+
_context38.next = 8;
|
|
4940
5155
|
return this.saveDraft();
|
|
4941
5156
|
case 8:
|
|
4942
5157
|
case "end":
|
|
4943
|
-
return
|
|
5158
|
+
return _context38.stop();
|
|
4944
5159
|
}
|
|
4945
|
-
},
|
|
5160
|
+
}, _callee35, this);
|
|
4946
5161
|
}));
|
|
4947
|
-
function markLocalOrderSynced(
|
|
5162
|
+
function markLocalOrderSynced(_x41, _x42) {
|
|
4948
5163
|
return _markLocalOrderSynced.apply(this, arguments);
|
|
4949
5164
|
}
|
|
4950
5165
|
return markLocalOrderSynced;
|
|
@@ -4987,10 +5202,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4987
5202
|
value: function extractSubmitErrorResponse(error) {
|
|
4988
5203
|
var _error$response,
|
|
4989
5204
|
_error$response2,
|
|
4990
|
-
|
|
5205
|
+
_this30 = this;
|
|
4991
5206
|
var candidates = [error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data, error === null || error === void 0 ? void 0 : error.data, error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.body, error === null || error === void 0 ? void 0 : error.body];
|
|
4992
5207
|
return candidates.find(function (candidate) {
|
|
4993
|
-
return
|
|
5208
|
+
return _this30.isSubmitErrorResponse(candidate);
|
|
4994
5209
|
}) || null;
|
|
4995
5210
|
}
|
|
4996
5211
|
}, {
|
|
@@ -5017,14 +5232,37 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5017
5232
|
}, {
|
|
5018
5233
|
key: "syncPaymentsToOrder",
|
|
5019
5234
|
value: function () {
|
|
5020
|
-
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5021
|
-
var
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5235
|
+
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(params) {
|
|
5236
|
+
var _this31 = this,
|
|
5237
|
+
_params$confirmPendin;
|
|
5238
|
+
var tempOrder, needsPaymentNumber, devicePrefix, mappedPayments, shouldConfirmPendingVoucherPayments, effectivePayments, completion, orderPaidPaymentTotal, paymentStatus, paymentSyncIdempotencyToken, submitResult;
|
|
5239
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context39) {
|
|
5240
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
5025
5241
|
case 0:
|
|
5026
5242
|
tempOrder = this.ensureTempOrder();
|
|
5027
|
-
|
|
5243
|
+
needsPaymentNumber = (params.payments || []).some(function (payment) {
|
|
5244
|
+
return String(payment.payment_number || '').trim() === '';
|
|
5245
|
+
});
|
|
5246
|
+
if (!needsPaymentNumber) {
|
|
5247
|
+
_context39.next = 8;
|
|
5248
|
+
break;
|
|
5249
|
+
}
|
|
5250
|
+
_context39.next = 5;
|
|
5251
|
+
return this.getPaymentNumberDevicePrefixAsync();
|
|
5252
|
+
case 5:
|
|
5253
|
+
_context39.t0 = _context39.sent;
|
|
5254
|
+
_context39.next = 9;
|
|
5255
|
+
break;
|
|
5256
|
+
case 8:
|
|
5257
|
+
_context39.t0 = 'LOCAL';
|
|
5258
|
+
case 9:
|
|
5259
|
+
devicePrefix = _context39.t0;
|
|
5260
|
+
mappedPayments = mapPaymentItemsToOrderPayments((params.payments || []).map(function (payment) {
|
|
5261
|
+
return _this31.normalizePaymentSource(payment, {
|
|
5262
|
+
defaultPaid: false,
|
|
5263
|
+
devicePrefix: devicePrefix
|
|
5264
|
+
});
|
|
5265
|
+
}));
|
|
5028
5266
|
shouldConfirmPendingVoucherPayments = (_params$confirmPendin = params.confirmPendingVoucherPayments) !== null && _params$confirmPendin !== void 0 ? _params$confirmPendin : params.submitWhenPaid === true;
|
|
5029
5267
|
effectivePayments = shouldConfirmPendingVoucherPayments ? this.confirmPendingVoucherPaymentsInList(mappedPayments) : params.confirmPendingVoucherPayments === false ? this.discardPendingVoucherPaymentsFromList(mappedPayments) : mappedPayments;
|
|
5030
5268
|
completion = this.getPaymentCompletion(effectivePayments);
|
|
@@ -5033,24 +5271,25 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5033
5271
|
tempOrder.payments = effectivePayments;
|
|
5034
5272
|
tempOrder.payment_status = paymentStatus;
|
|
5035
5273
|
this.persistTempOrder();
|
|
5036
|
-
|
|
5274
|
+
_context39.next = 21;
|
|
5037
5275
|
return this.saveDraft();
|
|
5038
|
-
case
|
|
5276
|
+
case 21:
|
|
5039
5277
|
if (params.submitWhenPaid) {
|
|
5040
|
-
|
|
5278
|
+
_context39.next = 23;
|
|
5041
5279
|
break;
|
|
5042
5280
|
}
|
|
5043
|
-
return
|
|
5044
|
-
case
|
|
5281
|
+
return _context39.abrupt("return", completion);
|
|
5282
|
+
case 23:
|
|
5045
5283
|
if (!(this.store.syncState === 'submitting')) {
|
|
5046
|
-
|
|
5284
|
+
_context39.next = 25;
|
|
5047
5285
|
break;
|
|
5048
5286
|
}
|
|
5049
|
-
return
|
|
5050
|
-
case
|
|
5287
|
+
return _context39.abrupt("return", completion);
|
|
5288
|
+
case 25:
|
|
5051
5289
|
this.store.syncState = 'submitting';
|
|
5052
5290
|
paymentSyncIdempotencyToken = this.buildPaymentSyncIdempotencyToken(tempOrder, effectivePayments);
|
|
5053
|
-
|
|
5291
|
+
_context39.next = 29;
|
|
5292
|
+
return this.submitTempOrder({
|
|
5054
5293
|
payments: effectivePayments,
|
|
5055
5294
|
paymentStatus: paymentStatus,
|
|
5056
5295
|
smallTicketDataFlag: params.smallTicketDataFlag,
|
|
@@ -5063,34 +5302,19 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5063
5302
|
});
|
|
5064
5303
|
return nextPayload;
|
|
5065
5304
|
}
|
|
5066
|
-
};
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
}
|
|
5071
|
-
_context35.next = 22;
|
|
5072
|
-
return this.submitTempOrderAsync(submitParams);
|
|
5073
|
-
case 22:
|
|
5074
|
-
_context35.t0 = _context35.sent;
|
|
5075
|
-
_context35.next = 28;
|
|
5076
|
-
break;
|
|
5077
|
-
case 25:
|
|
5078
|
-
_context35.next = 27;
|
|
5079
|
-
return this.submitTempOrder(submitParams);
|
|
5080
|
-
case 27:
|
|
5081
|
-
_context35.t0 = _context35.sent;
|
|
5082
|
-
case 28:
|
|
5083
|
-
submitResult = _context35.t0;
|
|
5084
|
-
return _context35.abrupt("return", _objectSpread(_objectSpread({}, completion), {}, {
|
|
5305
|
+
});
|
|
5306
|
+
case 29:
|
|
5307
|
+
submitResult = _context39.sent;
|
|
5308
|
+
return _context39.abrupt("return", _objectSpread(_objectSpread({}, completion), {}, {
|
|
5085
5309
|
submitResult: submitResult
|
|
5086
5310
|
}));
|
|
5087
|
-
case
|
|
5311
|
+
case 31:
|
|
5088
5312
|
case "end":
|
|
5089
|
-
return
|
|
5313
|
+
return _context39.stop();
|
|
5090
5314
|
}
|
|
5091
|
-
},
|
|
5315
|
+
}, _callee36, this);
|
|
5092
5316
|
}));
|
|
5093
|
-
function syncPaymentsToOrder(
|
|
5317
|
+
function syncPaymentsToOrder(_x43) {
|
|
5094
5318
|
return _syncPaymentsToOrder.apply(this, arguments);
|
|
5095
5319
|
}
|
|
5096
5320
|
return syncPaymentsToOrder;
|
|
@@ -5098,7 +5322,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5098
5322
|
}, {
|
|
5099
5323
|
key: "createOrder",
|
|
5100
5324
|
value: function createOrder(params) {
|
|
5101
|
-
var _this28 = this;
|
|
5102
5325
|
var order = _objectSpread({
|
|
5103
5326
|
type: (params === null || params === void 0 ? void 0 : params.type) || 'appointment_booking',
|
|
5104
5327
|
// 要从外面拿,virtual
|
|
@@ -5110,13 +5333,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5110
5333
|
schedule_date: '',
|
|
5111
5334
|
is_deposit: 0,
|
|
5112
5335
|
relation_products: [],
|
|
5113
|
-
relation_forms: []
|
|
5114
|
-
business_code: params === null || params === void 0 ? void 0 : params.business_code
|
|
5336
|
+
relation_forms: []
|
|
5115
5337
|
}, (params === null || params === void 0 ? void 0 : params.extraData) || {});
|
|
5116
5338
|
var is_deposit = 0; // 是否存在定金,0 不存在,1 存在
|
|
5117
5339
|
if (params.cartItems.length > 0) {
|
|
5118
5340
|
params.cartItems.forEach(function (item) {
|
|
5119
|
-
var _params$extraData;
|
|
5120
5341
|
if (!item._origin.duration) {
|
|
5121
5342
|
var _generateDuration = generateDuration(item),
|
|
5122
5343
|
duration = _generateDuration.duration,
|
|
@@ -5128,11 +5349,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5128
5349
|
var discountList = getAllDiscountList(item);
|
|
5129
5350
|
item._origin.product.discount_list = discountList;
|
|
5130
5351
|
|
|
5131
|
-
// 为预约补齐 holder 信息
|
|
5132
|
-
if (params !== null && params !== void 0 && (_params$extraData = params.extraData) !== null && _params$extraData !== void 0 && _params$extraData.is_add_holder_info) {
|
|
5133
|
-
ensureCartItemOriginHolder(item, _this28.window);
|
|
5134
|
-
}
|
|
5135
|
-
|
|
5136
5352
|
// 购物车是否为普通商品
|
|
5137
5353
|
if (isNormalProduct(item._origin)) {
|
|
5138
5354
|
var _order$relation_forms;
|
|
@@ -5187,11 +5403,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5187
5403
|
}, {
|
|
5188
5404
|
key: "submitOrder",
|
|
5189
5405
|
value: function () {
|
|
5190
|
-
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5406
|
+
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(order) {
|
|
5191
5407
|
var _order$query$cartItem, _params$bookings, _params$relation_prod;
|
|
5192
5408
|
var url, query, fetchUrl, params;
|
|
5193
|
-
return _regeneratorRuntime().wrap(function
|
|
5194
|
-
while (1) switch (
|
|
5409
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context40) {
|
|
5410
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
5195
5411
|
case 0:
|
|
5196
5412
|
this.logInfo('submitOrder called', {
|
|
5197
5413
|
url: order.url,
|
|
@@ -5211,14 +5427,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5211
5427
|
relationProductsCount: ((_params$relation_prod = params.relation_products) === null || _params$relation_prod === void 0 ? void 0 : _params$relation_prod.length) || 0,
|
|
5212
5428
|
scheduleDate: params.schedule_date
|
|
5213
5429
|
});
|
|
5214
|
-
return
|
|
5430
|
+
return _context40.abrupt("return", this.request.post(fetchUrl, params));
|
|
5215
5431
|
case 6:
|
|
5216
5432
|
case "end":
|
|
5217
|
-
return
|
|
5433
|
+
return _context40.stop();
|
|
5218
5434
|
}
|
|
5219
|
-
},
|
|
5435
|
+
}, _callee37, this);
|
|
5220
5436
|
}));
|
|
5221
|
-
function submitOrder(
|
|
5437
|
+
function submitOrder(_x44) {
|
|
5222
5438
|
return _submitOrder.apply(this, arguments);
|
|
5223
5439
|
}
|
|
5224
5440
|
return submitOrder;
|
|
@@ -5226,13 +5442,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5226
5442
|
}, {
|
|
5227
5443
|
key: "cancelOrder",
|
|
5228
5444
|
value: function () {
|
|
5229
|
-
var _cancelOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5445
|
+
var _cancelOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(params) {
|
|
5230
5446
|
var payload;
|
|
5231
|
-
return _regeneratorRuntime().wrap(function
|
|
5232
|
-
while (1) switch (
|
|
5447
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context41) {
|
|
5448
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
5233
5449
|
case 0:
|
|
5234
5450
|
if (!(!Array.isArray(params.order_ids) || params.order_ids.length === 0)) {
|
|
5235
|
-
|
|
5451
|
+
_context41.next = 2;
|
|
5236
5452
|
break;
|
|
5237
5453
|
}
|
|
5238
5454
|
throw new Error('取消订单失败:order_ids 不能为空');
|
|
@@ -5248,16 +5464,16 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5248
5464
|
method: 'PUT',
|
|
5249
5465
|
orderIdsCount: params.order_ids.length
|
|
5250
5466
|
});
|
|
5251
|
-
return
|
|
5467
|
+
return _context41.abrupt("return", this.request.put('/order/update-status', payload, {
|
|
5252
5468
|
isShopApi: true
|
|
5253
5469
|
}));
|
|
5254
5470
|
case 5:
|
|
5255
5471
|
case "end":
|
|
5256
|
-
return
|
|
5472
|
+
return _context41.stop();
|
|
5257
5473
|
}
|
|
5258
|
-
},
|
|
5474
|
+
}, _callee38, this);
|
|
5259
5475
|
}));
|
|
5260
|
-
function cancelOrder(
|
|
5476
|
+
function cancelOrder(_x45) {
|
|
5261
5477
|
return _cancelOrder.apply(this, arguments);
|
|
5262
5478
|
}
|
|
5263
5479
|
return cancelOrder;
|
|
@@ -5265,19 +5481,19 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5265
5481
|
}, {
|
|
5266
5482
|
key: "changeBookingStatus",
|
|
5267
5483
|
value: function () {
|
|
5268
|
-
var _changeBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5484
|
+
var _changeBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(params) {
|
|
5269
5485
|
var url, payload;
|
|
5270
|
-
return _regeneratorRuntime().wrap(function
|
|
5271
|
-
while (1) switch (
|
|
5486
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context42) {
|
|
5487
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
5272
5488
|
case 0:
|
|
5273
5489
|
if (params.booking_id) {
|
|
5274
|
-
|
|
5490
|
+
_context42.next = 2;
|
|
5275
5491
|
break;
|
|
5276
5492
|
}
|
|
5277
5493
|
throw new Error('变更预约状态失败:booking_id 不能为空');
|
|
5278
5494
|
case 2:
|
|
5279
5495
|
if (params.appointment_status) {
|
|
5280
|
-
|
|
5496
|
+
_context42.next = 4;
|
|
5281
5497
|
break;
|
|
5282
5498
|
}
|
|
5283
5499
|
throw new Error('变更预约状态失败:appointment_status 不能为空');
|
|
@@ -5292,16 +5508,16 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5292
5508
|
bookingId: params.booking_id,
|
|
5293
5509
|
appointmentStatus: params.appointment_status
|
|
5294
5510
|
});
|
|
5295
|
-
return
|
|
5511
|
+
return _context42.abrupt("return", this.request.put(url, payload, {
|
|
5296
5512
|
isShopApi: true
|
|
5297
5513
|
}));
|
|
5298
5514
|
case 8:
|
|
5299
5515
|
case "end":
|
|
5300
|
-
return
|
|
5516
|
+
return _context42.stop();
|
|
5301
5517
|
}
|
|
5302
|
-
},
|
|
5518
|
+
}, _callee39, this);
|
|
5303
5519
|
}));
|
|
5304
|
-
function changeBookingStatus(
|
|
5520
|
+
function changeBookingStatus(_x46) {
|
|
5305
5521
|
return _changeBookingStatus.apply(this, arguments);
|
|
5306
5522
|
}
|
|
5307
5523
|
return changeBookingStatus;
|
|
@@ -5319,11 +5535,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5319
5535
|
}, {
|
|
5320
5536
|
key: "createOrderByCheckout",
|
|
5321
5537
|
value: (function () {
|
|
5322
|
-
var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5538
|
+
var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(params) {
|
|
5323
5539
|
var _params$payments, _params$bookings2, _params$relation_prod2, _params$payments2, _params$payments3, _params$bookings3, _params$relation_prod3, _params$payments4;
|
|
5324
5540
|
var onlineStorePaymentCodeList, _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, _orderData$bookings2, _orderData$relation_p2, _orderData$payments4, _orderData$payments5, _response$data, orderData, response;
|
|
5325
|
-
return _regeneratorRuntime().wrap(function
|
|
5326
|
-
while (1) switch (
|
|
5541
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context43) {
|
|
5542
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
5327
5543
|
case 0:
|
|
5328
5544
|
// 过滤掉由在线店铺下单的 payment 支付数据
|
|
5329
5545
|
onlineStorePaymentCodeList = ['WXPAY', 'WECHAT', 'ALIPAY', 'APPLE_PAY', 'CREDIT_CARD_3DS', 'CREDIT_CARD_TOKEN', 'GOOGLE_PAY', 'GOOGLE_PAY_3DS', 'CREDIT_CARD'];
|
|
@@ -5357,7 +5573,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5357
5573
|
relationProductsCount: ((_params$relation_prod3 = params.relation_products) === null || _params$relation_prod3 === void 0 ? void 0 : _params$relation_prod3.length) || 0,
|
|
5358
5574
|
paymentsCount: ((_params$payments4 = params.payments) === null || _params$payments4 === void 0 ? void 0 : _params$payments4.length) || 0
|
|
5359
5575
|
});
|
|
5360
|
-
|
|
5576
|
+
_context43.prev = 4;
|
|
5361
5577
|
// 构建订单数据,设置默认值并允许 params 覆盖
|
|
5362
5578
|
orderData = _objectSpread({
|
|
5363
5579
|
sales_channel: 'my_pisel',
|
|
@@ -5419,13 +5635,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5419
5635
|
hasOrderId: !!orderData.order_id,
|
|
5420
5636
|
smallTicketDataFlag: orderData.small_ticket_data_flag
|
|
5421
5637
|
});
|
|
5422
|
-
|
|
5638
|
+
_context43.next = 12;
|
|
5423
5639
|
return this.request.post('/order/checkout', orderData, {
|
|
5424
5640
|
osServer: true,
|
|
5425
5641
|
customToast: function customToast() {}
|
|
5426
5642
|
});
|
|
5427
5643
|
case 12:
|
|
5428
|
-
response =
|
|
5644
|
+
response = _context43.sent;
|
|
5429
5645
|
this.logInfo('Order API called successfully', {
|
|
5430
5646
|
response: response
|
|
5431
5647
|
});
|
|
@@ -5433,22 +5649,22 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5433
5649
|
success: !!response,
|
|
5434
5650
|
hasOrderId: !!(response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.order_id || response !== null && response !== void 0 && response.order_id)
|
|
5435
5651
|
});
|
|
5436
|
-
return
|
|
5652
|
+
return _context43.abrupt("return", response);
|
|
5437
5653
|
case 18:
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
console.error('[Order] createOrderByCheckout 创建订单失败:',
|
|
5654
|
+
_context43.prev = 18;
|
|
5655
|
+
_context43.t0 = _context43["catch"](4);
|
|
5656
|
+
console.error('[Order] createOrderByCheckout 创建订单失败:', _context43.t0);
|
|
5441
5657
|
this.logInfo('Order API called failed', {
|
|
5442
|
-
error:
|
|
5658
|
+
error: _context43.t0 instanceof Error ? _context43.t0.message : String(_context43.t0)
|
|
5443
5659
|
});
|
|
5444
|
-
throw
|
|
5660
|
+
throw _context43.t0;
|
|
5445
5661
|
case 23:
|
|
5446
5662
|
case "end":
|
|
5447
|
-
return
|
|
5663
|
+
return _context43.stop();
|
|
5448
5664
|
}
|
|
5449
|
-
},
|
|
5665
|
+
}, _callee40, this, [[4, 18]]);
|
|
5450
5666
|
}));
|
|
5451
|
-
function createOrderByCheckout(
|
|
5667
|
+
function createOrderByCheckout(_x47) {
|
|
5452
5668
|
return _createOrderByCheckout.apply(this, arguments);
|
|
5453
5669
|
}
|
|
5454
5670
|
return createOrderByCheckout;
|
|
@@ -5456,24 +5672,24 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5456
5672
|
}, {
|
|
5457
5673
|
key: "submitSalesOrder",
|
|
5458
5674
|
value: function () {
|
|
5459
|
-
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5675
|
+
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(params) {
|
|
5460
5676
|
var url, query, fetchUrl;
|
|
5461
|
-
return _regeneratorRuntime().wrap(function
|
|
5462
|
-
while (1) switch (
|
|
5677
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context44) {
|
|
5678
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
5463
5679
|
case 0:
|
|
5464
5680
|
url = params.url, query = params.query;
|
|
5465
5681
|
fetchUrl = url || '/order/sales/checkout';
|
|
5466
|
-
return
|
|
5682
|
+
return _context44.abrupt("return", this.request.post(fetchUrl, query, {
|
|
5467
5683
|
osServer: true,
|
|
5468
5684
|
customToast: function customToast() {}
|
|
5469
5685
|
}));
|
|
5470
5686
|
case 3:
|
|
5471
5687
|
case "end":
|
|
5472
|
-
return
|
|
5688
|
+
return _context44.stop();
|
|
5473
5689
|
}
|
|
5474
|
-
},
|
|
5690
|
+
}, _callee41, this);
|
|
5475
5691
|
}));
|
|
5476
|
-
function submitSalesOrder(
|
|
5692
|
+
function submitSalesOrder(_x48) {
|
|
5477
5693
|
return _submitSalesOrder.apply(this, arguments);
|
|
5478
5694
|
}
|
|
5479
5695
|
return submitSalesOrder;
|
|
@@ -5487,37 +5703,37 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5487
5703
|
}, {
|
|
5488
5704
|
key: "sendCustomerPayLink",
|
|
5489
5705
|
value: (function () {
|
|
5490
|
-
var _sendCustomerPayLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5706
|
+
var _sendCustomerPayLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(params) {
|
|
5491
5707
|
var _params$emails;
|
|
5492
5708
|
var orderIds;
|
|
5493
|
-
return _regeneratorRuntime().wrap(function
|
|
5494
|
-
while (1) switch (
|
|
5709
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context45) {
|
|
5710
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
5495
5711
|
case 0:
|
|
5496
5712
|
orderIds = params.order_ids || params.orderIds || [];
|
|
5497
5713
|
if (orderIds.length) {
|
|
5498
|
-
|
|
5714
|
+
_context45.next = 3;
|
|
5499
5715
|
break;
|
|
5500
5716
|
}
|
|
5501
5717
|
throw new Error('发送支付链接前必须先提交本地订单并取得订单 ID');
|
|
5502
5718
|
case 3:
|
|
5503
5719
|
if ((_params$emails = params.emails) !== null && _params$emails !== void 0 && _params$emails.length) {
|
|
5504
|
-
|
|
5720
|
+
_context45.next = 5;
|
|
5505
5721
|
break;
|
|
5506
5722
|
}
|
|
5507
5723
|
throw new Error('发送支付链接需要至少一个邮箱');
|
|
5508
5724
|
case 5:
|
|
5509
|
-
return
|
|
5725
|
+
return _context45.abrupt("return", this.request.post('/order/batch-email', {
|
|
5510
5726
|
order_ids: orderIds,
|
|
5511
5727
|
notify_action: params.notify_action || 'order_payment_reminder',
|
|
5512
5728
|
emails: params.emails
|
|
5513
5729
|
}));
|
|
5514
5730
|
case 6:
|
|
5515
5731
|
case "end":
|
|
5516
|
-
return
|
|
5732
|
+
return _context45.stop();
|
|
5517
5733
|
}
|
|
5518
|
-
},
|
|
5734
|
+
}, _callee42, this);
|
|
5519
5735
|
}));
|
|
5520
|
-
function sendCustomerPayLink(
|
|
5736
|
+
function sendCustomerPayLink(_x49) {
|
|
5521
5737
|
return _sendCustomerPayLink.apply(this, arguments);
|
|
5522
5738
|
}
|
|
5523
5739
|
return sendCustomerPayLink;
|
|
@@ -5525,14 +5741,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5525
5741
|
}, {
|
|
5526
5742
|
key: "getSalesOrderByLookup",
|
|
5527
5743
|
value: function () {
|
|
5528
|
-
var _getSalesOrderByLookup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5744
|
+
var _getSalesOrderByLookup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
|
|
5529
5745
|
var lookup, res;
|
|
5530
|
-
return _regeneratorRuntime().wrap(function
|
|
5531
|
-
while (1) switch (
|
|
5746
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context46) {
|
|
5747
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
5532
5748
|
case 0:
|
|
5533
5749
|
lookup = params.lookup === undefined || params.lookup === null ? '' : String(params.lookup).trim();
|
|
5534
5750
|
if (lookup) {
|
|
5535
|
-
|
|
5751
|
+
_context46.next = 3;
|
|
5536
5752
|
break;
|
|
5537
5753
|
}
|
|
5538
5754
|
throw new Error('加载销售详情需要 lookup');
|
|
@@ -5541,7 +5757,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5541
5757
|
if (lookup.startsWith('LOCAL_')) {
|
|
5542
5758
|
params.forceRemote = false;
|
|
5543
5759
|
}
|
|
5544
|
-
|
|
5760
|
+
_context46.next = 6;
|
|
5545
5761
|
return this.request.get("/order/sales/".concat(encodeURIComponent(lookup)), _objectSpread({
|
|
5546
5762
|
with: ['products', 'bookings', 'payments', 'customer', 'summary', 'contacts_info']
|
|
5547
5763
|
}, params.forceRemote ? {
|
|
@@ -5550,18 +5766,18 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5550
5766
|
osServer: true
|
|
5551
5767
|
});
|
|
5552
5768
|
case 6:
|
|
5553
|
-
res =
|
|
5769
|
+
res = _context46.sent;
|
|
5554
5770
|
if (res.code === 200) {
|
|
5555
5771
|
this.store.lastOrderInfo = res.data;
|
|
5556
5772
|
}
|
|
5557
|
-
return
|
|
5773
|
+
return _context46.abrupt("return", res);
|
|
5558
5774
|
case 9:
|
|
5559
5775
|
case "end":
|
|
5560
|
-
return
|
|
5776
|
+
return _context46.stop();
|
|
5561
5777
|
}
|
|
5562
|
-
},
|
|
5778
|
+
}, _callee43, this);
|
|
5563
5779
|
}));
|
|
5564
|
-
function getSalesOrderByLookup(
|
|
5780
|
+
function getSalesOrderByLookup(_x50) {
|
|
5565
5781
|
return _getSalesOrderByLookup.apply(this, arguments);
|
|
5566
5782
|
}
|
|
5567
5783
|
return getSalesOrderByLookup;
|
|
@@ -5575,11 +5791,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5575
5791
|
}, {
|
|
5576
5792
|
key: "hydrateTempOrderFromRecord",
|
|
5577
5793
|
value: (function () {
|
|
5578
|
-
var _hydrateTempOrderFromRecord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5794
|
+
var _hydrateTempOrderFromRecord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(record, options) {
|
|
5579
5795
|
var _this$store$discount19;
|
|
5580
|
-
var sourceRaw, identityReadySource, normalizedCollections, raw, hasIdentityChanges, identityLogMetadata, hasIdentityWarnings, nextTempOrder, rawSummary, summarySurcharges, hydratedEditDiscounts, currentDiscounts, currentScanDiscounts, hydratedDiscountIds, retainedScanDiscounts, nextDiscounts, shouldSkipEmptyDiscountSync, _this$store$discount20, _this$store$discount21;
|
|
5581
|
-
return _regeneratorRuntime().wrap(function
|
|
5582
|
-
while (1) switch (
|
|
5796
|
+
var sourceRaw, identityReadySource, normalizedCollections, raw, hasIdentityChanges, identityLogMetadata, hasIdentityWarnings, nextTempOrder, sourceLastOrderInfo, isDraftOrder, syntheticIdentityOptions, rawSummary, summarySurcharges, hadSyntheticDraftOrderId, hydratedEditDiscounts, currentDiscounts, currentScanDiscounts, hydratedDiscountIds, retainedScanDiscounts, nextDiscounts, shouldSkipEmptyDiscountSync, _this$store$discount20, _this$store$discount21;
|
|
5797
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context47) {
|
|
5798
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
5583
5799
|
case 0:
|
|
5584
5800
|
sourceRaw = record && _typeof(record) === 'object' && record.data && record.order_id == null ? record.data : record || {};
|
|
5585
5801
|
identityReadySource = this.seedAnonymousBookingUidsFromProducts(sourceRaw);
|
|
@@ -5604,7 +5820,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5604
5820
|
}
|
|
5605
5821
|
nextTempOrder = this.normalizeTempOrderForRuntime(raw, {
|
|
5606
5822
|
makeEditMark: true
|
|
5607
|
-
});
|
|
5823
|
+
}); // Server list compatibility may synthesize order_id from external_sale_number; tempOrder must not.
|
|
5824
|
+
sourceLastOrderInfo = raw.lastOrderInfo || raw;
|
|
5825
|
+
isDraftOrder = Number(nextTempOrder.is_draft_order || 0) === 1;
|
|
5826
|
+
syntheticIdentityOptions = {
|
|
5827
|
+
isDraftOrder: isDraftOrder,
|
|
5828
|
+
externalSaleNumber: nextTempOrder.external_sale_number
|
|
5829
|
+
};
|
|
5608
5830
|
rawSummary = raw.summary && _typeof(raw.summary) === 'object' ? raw.summary : {};
|
|
5609
5831
|
summarySurcharges = Array.isArray(rawSummary.surcharges) ? rawSummary.surcharges.map(function (s) {
|
|
5610
5832
|
return _objectSpread({}, s || {});
|
|
@@ -5624,10 +5846,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5624
5846
|
productFingerprint: this.buildOrderProductsFingerprint(nextTempOrder.products || [])
|
|
5625
5847
|
}
|
|
5626
5848
|
});
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5849
|
+
this.store.lastOrderInfo = this.withoutSyntheticDraftOrderIdForRuntime(sourceLastOrderInfo, syntheticIdentityOptions);
|
|
5850
|
+
hadSyntheticDraftOrderId = this.isSyntheticDraftOrderIdForRuntime(raw, syntheticIdentityOptions) || this.isSyntheticDraftOrderIdForRuntime(sourceLastOrderInfo, syntheticIdentityOptions);
|
|
5851
|
+
if (hadSyntheticDraftOrderId && this.store.syncState !== 'submitting') {
|
|
5852
|
+
this.store.syncState = 'local';
|
|
5853
|
+
}
|
|
5631
5854
|
hydratedEditDiscounts = this.collectHydratedEditDiscounts(nextTempOrder.products);
|
|
5632
5855
|
currentDiscounts = typeof ((_this$store$discount19 = this.store.discount) === null || _this$store$discount19 === void 0 ? void 0 : _this$store$discount19.getDiscountList) === 'function' ? this.store.discount.getDiscountList() || [] : [];
|
|
5633
5856
|
currentScanDiscounts = currentDiscounts.filter(function (discount) {
|
|
@@ -5642,34 +5865,34 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5642
5865
|
nextDiscounts = [].concat(_toConsumableArray(hydratedEditDiscounts), _toConsumableArray(retainedScanDiscounts));
|
|
5643
5866
|
shouldSkipEmptyDiscountSync = nextDiscounts.length === 0 && currentDiscounts.length === 0;
|
|
5644
5867
|
if (shouldSkipEmptyDiscountSync) {
|
|
5645
|
-
|
|
5868
|
+
_context47.next = 31;
|
|
5646
5869
|
break;
|
|
5647
5870
|
}
|
|
5648
5871
|
OrderModule.populateSavedAmounts(nextTempOrder.products, nextDiscounts);
|
|
5649
|
-
|
|
5872
|
+
_context47.next = 29;
|
|
5650
5873
|
return (_this$store$discount20 = this.store.discount) === null || _this$store$discount20 === void 0 ? void 0 : _this$store$discount20.setOriginalDiscountList(nextDiscounts);
|
|
5651
|
-
case
|
|
5652
|
-
|
|
5874
|
+
case 29:
|
|
5875
|
+
_context47.next = 31;
|
|
5653
5876
|
return (_this$store$discount21 = this.store.discount) === null || _this$store$discount21 === void 0 ? void 0 : _this$store$discount21.setDiscountList(nextDiscounts);
|
|
5654
|
-
case
|
|
5877
|
+
case 31:
|
|
5655
5878
|
if (!(options !== null && options !== void 0 && options.recalcOnHydrate)) {
|
|
5656
|
-
|
|
5879
|
+
_context47.next = 34;
|
|
5657
5880
|
break;
|
|
5658
5881
|
}
|
|
5659
|
-
|
|
5882
|
+
_context47.next = 34;
|
|
5660
5883
|
return this.recalculateSummary({
|
|
5661
5884
|
createIfMissing: false
|
|
5662
5885
|
});
|
|
5663
|
-
case
|
|
5886
|
+
case 34:
|
|
5664
5887
|
this.persistTempOrder();
|
|
5665
|
-
return
|
|
5666
|
-
case
|
|
5888
|
+
return _context47.abrupt("return", nextTempOrder);
|
|
5889
|
+
case 36:
|
|
5667
5890
|
case "end":
|
|
5668
|
-
return
|
|
5891
|
+
return _context47.stop();
|
|
5669
5892
|
}
|
|
5670
|
-
},
|
|
5893
|
+
}, _callee44, this);
|
|
5671
5894
|
}));
|
|
5672
|
-
function hydrateTempOrderFromRecord(
|
|
5895
|
+
function hydrateTempOrderFromRecord(_x51, _x52) {
|
|
5673
5896
|
return _hydrateTempOrderFromRecord.apply(this, arguments);
|
|
5674
5897
|
}
|
|
5675
5898
|
return hydrateTempOrderFromRecord;
|
|
@@ -5783,11 +6006,12 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5783
6006
|
}, {
|
|
5784
6007
|
key: "normalizeTempOrderForRuntime",
|
|
5785
6008
|
value: function normalizeTempOrderForRuntime(raw, options) {
|
|
5786
|
-
var
|
|
5787
|
-
var
|
|
6009
|
+
var _this32 = this;
|
|
6010
|
+
var runtimeRaw = this.withoutSyntheticDraftOrderIdForRuntime(raw);
|
|
6011
|
+
var nextTempOrder = _objectSpread(_objectSpread({}, this.createDefaultTempOrderInstance()), runtimeRaw || {});
|
|
5788
6012
|
// ES 列表详情使用 id 表示订单主键;OS 详情态统一依赖 order_id 驱动操作按钮。
|
|
5789
|
-
if ((nextTempOrder.order_id === undefined || nextTempOrder.order_id === null) && (
|
|
5790
|
-
nextTempOrder.order_id =
|
|
6013
|
+
if ((nextTempOrder.order_id === undefined || nextTempOrder.order_id === null) && (runtimeRaw === null || runtimeRaw === void 0 ? void 0 : runtimeRaw.id) !== undefined && (runtimeRaw === null || runtimeRaw === void 0 ? void 0 : runtimeRaw.id) !== null) {
|
|
6014
|
+
nextTempOrder.order_id = runtimeRaw.id;
|
|
5791
6015
|
}
|
|
5792
6016
|
delete nextTempOrder.summary;
|
|
5793
6017
|
delete nextTempOrder.lastOrderInfo;
|
|
@@ -5806,12 +6030,12 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5806
6030
|
nextTempOrder.holder = raw.holder && _typeof(raw.holder) === 'object' ? _objectSpread({}, raw.holder) : null;
|
|
5807
6031
|
var rawProducts = Array.isArray(raw.products) ? raw.products : [];
|
|
5808
6032
|
nextTempOrder.products = rawProducts.length > 0 ? rawProducts.map(function (p) {
|
|
5809
|
-
return
|
|
6033
|
+
return _this32.normalizeHydratedOrderProduct(p, {
|
|
5810
6034
|
makeEditMark: options === null || options === void 0 ? void 0 : options.makeEditMark
|
|
5811
6035
|
});
|
|
5812
6036
|
}) : [];
|
|
5813
6037
|
nextTempOrder.bookings = Array.isArray(raw.bookings) ? raw.bookings.map(function (b) {
|
|
5814
|
-
var booking =
|
|
6038
|
+
var booking = _this32.normalizeHydratedBookingHolder(b || {});
|
|
5815
6039
|
return _objectSpread(_objectSpread({}, booking), {}, {
|
|
5816
6040
|
is_all: normalizeBookingIsAll(booking),
|
|
5817
6041
|
sub_type: normalizeBookingSubType(booking)
|
|
@@ -5877,6 +6101,23 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5877
6101
|
nextTempOrder.vouchers = raw.vouchers || [];
|
|
5878
6102
|
return nextTempOrder;
|
|
5879
6103
|
}
|
|
6104
|
+
}, {
|
|
6105
|
+
key: "isSyntheticDraftOrderIdForRuntime",
|
|
6106
|
+
value: function isSyntheticDraftOrderIdForRuntime(record, options) {
|
|
6107
|
+
var _options$isDraftOrder, _record$external_sale;
|
|
6108
|
+
var isDraftOrder = (_options$isDraftOrder = options === null || options === void 0 ? void 0 : options.isDraftOrder) !== null && _options$isDraftOrder !== void 0 ? _options$isDraftOrder : Number((record === null || record === void 0 ? void 0 : record.is_draft_order) || 0) === 1;
|
|
6109
|
+
var externalSaleNumber = (_record$external_sale = record === null || record === void 0 ? void 0 : record.external_sale_number) !== null && _record$external_sale !== void 0 ? _record$external_sale : options === null || options === void 0 ? void 0 : options.externalSaleNumber;
|
|
6110
|
+
var orderId = record === null || record === void 0 ? void 0 : record.order_id;
|
|
6111
|
+
return Boolean(isDraftOrder && orderId !== undefined && orderId !== null && orderId !== '' && externalSaleNumber !== undefined && externalSaleNumber !== null && externalSaleNumber !== '' && String(orderId) === String(externalSaleNumber));
|
|
6112
|
+
}
|
|
6113
|
+
}, {
|
|
6114
|
+
key: "withoutSyntheticDraftOrderIdForRuntime",
|
|
6115
|
+
value: function withoutSyntheticDraftOrderIdForRuntime(record, options) {
|
|
6116
|
+
if (!this.isSyntheticDraftOrderIdForRuntime(record, options)) return record;
|
|
6117
|
+
return _objectSpread(_objectSpread({}, record), {}, {
|
|
6118
|
+
order_id: null
|
|
6119
|
+
});
|
|
6120
|
+
}
|
|
5880
6121
|
}, {
|
|
5881
6122
|
key: "hydrateLinkedBookingIdentity",
|
|
5882
6123
|
value: function hydrateLinkedBookingIdentity(tempOrder) {
|
|
@@ -5981,7 +6222,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5981
6222
|
}, {
|
|
5982
6223
|
key: "normalizeHydratedOrderProduct",
|
|
5983
6224
|
value: function normalizeHydratedOrderProduct(product, options) {
|
|
5984
|
-
var
|
|
6225
|
+
var _this33 = this;
|
|
5985
6226
|
var row = _objectSpread({}, product || {});
|
|
5986
6227
|
if (row.num === undefined && row.product_quantity !== undefined) {
|
|
5987
6228
|
row.num = row.product_quantity;
|
|
@@ -5989,7 +6230,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5989
6230
|
var productSku = ensureProductSku(row);
|
|
5990
6231
|
row.product_sku = _objectSpread(_objectSpread({}, productSku), {}, {
|
|
5991
6232
|
option: normalizeProductSkuOptions(productSku.option.map(function (optionItem) {
|
|
5992
|
-
return
|
|
6233
|
+
return _this33.normalizeHydratedProductOptionItem(optionItem || {});
|
|
5993
6234
|
}))
|
|
5994
6235
|
});
|
|
5995
6236
|
delete row["product_".concat('option', "_item")];
|
|
@@ -6026,27 +6267,27 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
6026
6267
|
}, {
|
|
6027
6268
|
key: "getOrderInfo",
|
|
6028
6269
|
value: function () {
|
|
6029
|
-
var _getOrderInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6270
|
+
var _getOrderInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(order_id) {
|
|
6030
6271
|
var res;
|
|
6031
|
-
return _regeneratorRuntime().wrap(function
|
|
6032
|
-
while (1) switch (
|
|
6272
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context48) {
|
|
6273
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
6033
6274
|
case 0:
|
|
6034
|
-
|
|
6275
|
+
_context48.next = 2;
|
|
6035
6276
|
return this.request.get("/order/sales/".concat(order_id), {
|
|
6036
6277
|
with: ['products', 'bookings']
|
|
6037
6278
|
}, {
|
|
6038
6279
|
osServer: true
|
|
6039
6280
|
});
|
|
6040
6281
|
case 2:
|
|
6041
|
-
res =
|
|
6042
|
-
return
|
|
6282
|
+
res = _context48.sent;
|
|
6283
|
+
return _context48.abrupt("return", res);
|
|
6043
6284
|
case 4:
|
|
6044
6285
|
case "end":
|
|
6045
|
-
return
|
|
6286
|
+
return _context48.stop();
|
|
6046
6287
|
}
|
|
6047
|
-
},
|
|
6288
|
+
}, _callee45, this);
|
|
6048
6289
|
}));
|
|
6049
|
-
function getOrderInfo(
|
|
6290
|
+
function getOrderInfo(_x53) {
|
|
6050
6291
|
return _getOrderInfo.apply(this, arguments);
|
|
6051
6292
|
}
|
|
6052
6293
|
return getOrderInfo;
|