@pisell/pisellos 2.3.131 → 2.3.132
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.
|
@@ -47,7 +47,7 @@ import { extractResourceIds, buildResourceProductMap } from "./utils/resource";
|
|
|
47
47
|
import { buildTimeSlotGrid, isBusinessHoursCrossDay, generateTimeLabels } from "./utils/timeSlot";
|
|
48
48
|
import { buildDateRangeSummary } from "./utils/dateSummary";
|
|
49
49
|
import { mergeConsecutiveSlots, expandMergedSlotToIndividual, buildVenueIdentityKey, buildVenueBookingEntry, buildVenueResourceMetadata, buildPriceBreakdown } from "./utils/slotMerge";
|
|
50
|
-
import { composeLinePrice, createUuidV4, getProductSkuOptions, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
50
|
+
import { composeLinePrice, createUuidV4, getOrderProductLineUid, getProductSkuOptions, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
51
51
|
import { OrderModule } from "../../modules/Order";
|
|
52
52
|
import { RegisterAndLoginHooks } from "../RegisterAndLogin/types";
|
|
53
53
|
import Decimal from 'decimal.js';
|
|
@@ -309,8 +309,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
309
309
|
}, {
|
|
310
310
|
key: "readProductOriginFromTempOrder",
|
|
311
311
|
value: function readProductOriginFromTempOrder(tempOrder, product) {
|
|
312
|
-
var
|
|
313
|
-
var uid = (
|
|
312
|
+
var _tempOrder$_extend3;
|
|
313
|
+
var uid = getOrderProductLineUid(product);
|
|
314
314
|
if (uid && (_tempOrder$_extend3 = tempOrder._extend) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3[uid]) !== null && _tempOrder$_extend3 !== void 0 && _tempOrder$_extend3.origin) {
|
|
315
315
|
return tempOrder._extend.productsByUid[uid].origin;
|
|
316
316
|
}
|
|
@@ -1795,9 +1795,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1795
1795
|
_step10;
|
|
1796
1796
|
try {
|
|
1797
1797
|
var _loop2 = function _loop2() {
|
|
1798
|
-
var _product$
|
|
1798
|
+
var _product$metadata;
|
|
1799
1799
|
var product = _step10.value;
|
|
1800
|
-
var resourceId = (_product$
|
|
1800
|
+
var resourceId = (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.resource_id;
|
|
1801
1801
|
if (resourceId == null) return 1; // continue
|
|
1802
1802
|
var productId = Number(product.product_id);
|
|
1803
1803
|
var existing = result.get(resourceId) || [];
|
|
@@ -1845,7 +1845,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1845
1845
|
value: (function () {
|
|
1846
1846
|
var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(resourceId, productId, slots) {
|
|
1847
1847
|
var _this$store$order6, _this$store$order6$ge;
|
|
1848
|
-
var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, _this$otherParams15, group,
|
|
1848
|
+
var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, _this$otherParams15, group, productUid, bookingUuid, startMoment, endMoment, duration, customDepositData, productTitle, resourceEntry, venueProductOrigin, normalizedVenueOrderProduct, venueOrderProduct, booking, products;
|
|
1849
1849
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1850
1850
|
while (1) switch (_context19.prev = _context19.next) {
|
|
1851
1851
|
case 0:
|
|
@@ -1904,7 +1904,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1904
1904
|
tempOrder.bookings = tempOrder.bookings || [];
|
|
1905
1905
|
for (i = 0; i < merged.length; i++) {
|
|
1906
1906
|
group = merged[i];
|
|
1907
|
-
|
|
1907
|
+
productUid = buildVenueIdentityKey(resourceId, i);
|
|
1908
1908
|
bookingUuid = createUuidV4();
|
|
1909
1909
|
startMoment = dayjs(group.startTime, 'YYYY-MM-DD HH:mm');
|
|
1910
1910
|
endMoment = dayjs(group.endTime, 'YYYY-MM-DD HH:mm');
|
|
@@ -1980,12 +1980,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1980
1980
|
normalizedVenueOrderProduct = normalizeOrderProduct({
|
|
1981
1981
|
product_id: mapping.productId,
|
|
1982
1982
|
product_variant_id: 0,
|
|
1983
|
-
identity_key: identityKey,
|
|
1984
1983
|
num: 1,
|
|
1985
1984
|
selling_price: group.totalPrice,
|
|
1986
1985
|
original_price: group.totalPrice,
|
|
1987
1986
|
is_charge_tax: (_venueProduct$is_char = venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.is_charge_tax) !== null && _venueProduct$is_char !== void 0 ? _venueProduct$is_char : 0,
|
|
1988
1987
|
metadata: _objectSpread(_objectSpread({
|
|
1988
|
+
unique_identification_number: productUid,
|
|
1989
1989
|
venue_booking: true
|
|
1990
1990
|
}, productTitle ? {
|
|
1991
1991
|
product_title: productTitle
|
|
@@ -2009,7 +2009,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2009
2009
|
venueOrderProduct = productTitle ? _objectSpread(_objectSpread({}, normalizedVenueOrderProduct), {}, {
|
|
2010
2010
|
product_title: productTitle
|
|
2011
2011
|
}) : normalizedVenueOrderProduct;
|
|
2012
|
-
this.attachProductOriginToTempOrder(tempOrder,
|
|
2012
|
+
this.attachProductOriginToTempOrder(tempOrder, productUid, venueProductOrigin);
|
|
2013
2013
|
tempOrder.products.push(venueOrderProduct);
|
|
2014
2014
|
booking = buildVenueBookingEntry({
|
|
2015
2015
|
group: group,
|
|
@@ -2017,7 +2017,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2017
2017
|
mapping: mapping,
|
|
2018
2018
|
rawResource: rawResource,
|
|
2019
2019
|
bookingUuid: bookingUuid,
|
|
2020
|
-
productUid:
|
|
2020
|
+
productUid: productUid,
|
|
2021
2021
|
childResources: childRawResources
|
|
2022
2022
|
});
|
|
2023
2023
|
tempOrder.bookings.push(booking);
|
|
@@ -2223,9 +2223,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2223
2223
|
_step13;
|
|
2224
2224
|
try {
|
|
2225
2225
|
var _loop4 = function _loop4() {
|
|
2226
|
-
var _product$
|
|
2226
|
+
var _product$metadata2;
|
|
2227
2227
|
var product = _step13.value;
|
|
2228
|
-
if ((_product$
|
|
2228
|
+
if ((_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.venue_booking) {
|
|
2229
2229
|
var mappings = _this11.resourceProductMap.get(product.metadata.resource_id);
|
|
2230
2230
|
if (!mappings || !mappings.length) return 0; // continue
|
|
2231
2231
|
var mapping = mappings.find(function (m) {
|
|
@@ -2346,7 +2346,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2346
2346
|
key: "setDiscountSelected",
|
|
2347
2347
|
value: (function () {
|
|
2348
2348
|
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
|
|
2349
|
-
var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, selectedResourceIds, _iterator15, _step15, _origin, _product$metadata$sou, _product$
|
|
2349
|
+
var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, selectedResourceIds, _iterator15, _step15, _origin, _product$metadata$sou, _product$metadata3, _product$metadata4, _product$original_pri, product, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
|
|
2350
2350
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2351
2351
|
while (1) switch (_context23.prev = _context23.next) {
|
|
2352
2352
|
case 0:
|
|
@@ -2465,7 +2465,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2465
2465
|
return sum + (pd.amount || 0);
|
|
2466
2466
|
}, 0);
|
|
2467
2467
|
optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
|
|
2468
|
-
sourcePrice = (_product$metadata$sou = (_product$
|
|
2468
|
+
sourcePrice = (_product$metadata$sou = (_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.source_product_price) !== null && _product$metadata$sou !== void 0 ? _product$metadata$sou : ((_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.main_product_original_price) != null ? new Decimal(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : '0';
|
|
2469
2469
|
newSourceSellingPrice = new Decimal(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
2470
2470
|
newMainSellingPrice = new Decimal(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
2471
2471
|
if (product.metadata) {
|
|
@@ -2671,7 +2671,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2671
2671
|
key: "addProductToOrder",
|
|
2672
2672
|
value: function () {
|
|
2673
2673
|
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(product) {
|
|
2674
|
-
var _product$
|
|
2674
|
+
var _product$metadata5, _product$product_vari2, _this$otherParams20, quotationPrice, products;
|
|
2675
2675
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2676
2676
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2677
2677
|
case 0:
|
|
@@ -2686,7 +2686,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2686
2686
|
}
|
|
2687
2687
|
throw new Error('order 模块未初始化');
|
|
2688
2688
|
case 4:
|
|
2689
|
-
if (!((_product$
|
|
2689
|
+
if (!((_product$metadata5 = product.metadata) !== null && _product$metadata5 !== void 0 && _product$metadata5.venue_booking) && this.store.quotation && product.product_id != null) {
|
|
2690
2690
|
quotationPrice = this.store.quotation.getPriceForProduct({
|
|
2691
2691
|
productId: product.product_id,
|
|
2692
2692
|
variantId: (_product$product_vari2 = product.product_variant_id) !== null && _product$product_vari2 !== void 0 ? _product$product_vari2 : undefined,
|
|
@@ -2783,7 +2783,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2783
2783
|
key: "removeProductFromOrder",
|
|
2784
2784
|
value: function () {
|
|
2785
2785
|
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(identity) {
|
|
2786
|
-
var _this$store$order$get3, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$
|
|
2786
|
+
var _this$store$order$get3, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata6, _product$metadata7, product, productUid, beforeBookingCount, _this$store$order$per, _this$store$order10;
|
|
2787
2787
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2788
2788
|
while (1) switch (_context29.prev = _context29.next) {
|
|
2789
2789
|
case 0:
|
|
@@ -2804,7 +2804,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2804
2804
|
case 7:
|
|
2805
2805
|
products = _context29.sent;
|
|
2806
2806
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
|
|
2807
|
-
_context29.next =
|
|
2807
|
+
_context29.next = 34;
|
|
2808
2808
|
break;
|
|
2809
2809
|
}
|
|
2810
2810
|
venueProductUids = new Set();
|
|
@@ -2814,35 +2814,36 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2814
2814
|
_iterator16.s();
|
|
2815
2815
|
case 14:
|
|
2816
2816
|
if ((_step16 = _iterator16.n()).done) {
|
|
2817
|
-
_context29.next =
|
|
2817
|
+
_context29.next = 23;
|
|
2818
2818
|
break;
|
|
2819
2819
|
}
|
|
2820
2820
|
product = _step16.value;
|
|
2821
|
-
if (product !== null && product !== void 0 && (_product$
|
|
2821
|
+
if (product !== null && product !== void 0 && (_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) {
|
|
2822
2822
|
_context29.next = 18;
|
|
2823
2823
|
break;
|
|
2824
2824
|
}
|
|
2825
|
-
return _context29.abrupt("continue",
|
|
2825
|
+
return _context29.abrupt("continue", 21);
|
|
2826
2826
|
case 18:
|
|
2827
|
-
|
|
2828
|
-
if (
|
|
2827
|
+
productUid = getOrderProductLineUid(product);
|
|
2828
|
+
if (productUid) venueProductUids.add(productUid);
|
|
2829
|
+
if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
|
|
2829
2830
|
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
2830
2831
|
}
|
|
2831
|
-
case
|
|
2832
|
+
case 21:
|
|
2832
2833
|
_context29.next = 14;
|
|
2833
2834
|
break;
|
|
2834
|
-
case
|
|
2835
|
-
_context29.next =
|
|
2835
|
+
case 23:
|
|
2836
|
+
_context29.next = 28;
|
|
2836
2837
|
break;
|
|
2837
|
-
case
|
|
2838
|
-
_context29.prev =
|
|
2838
|
+
case 25:
|
|
2839
|
+
_context29.prev = 25;
|
|
2839
2840
|
_context29.t0 = _context29["catch"](12);
|
|
2840
2841
|
_iterator16.e(_context29.t0);
|
|
2841
|
-
case
|
|
2842
|
-
_context29.prev =
|
|
2842
|
+
case 28:
|
|
2843
|
+
_context29.prev = 28;
|
|
2843
2844
|
_iterator16.f();
|
|
2844
|
-
return _context29.finish(
|
|
2845
|
-
case
|
|
2845
|
+
return _context29.finish(28);
|
|
2846
|
+
case 31:
|
|
2846
2847
|
beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
|
|
2847
2848
|
tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
|
|
2848
2849
|
var _booking$metadata, _booking$metadata2;
|
|
@@ -2857,27 +2858,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2857
2858
|
if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
|
|
2858
2859
|
(_this$store$order$per = (_this$store$order10 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order10);
|
|
2859
2860
|
}
|
|
2860
|
-
case
|
|
2861
|
-
_context29.next =
|
|
2861
|
+
case 34:
|
|
2862
|
+
_context29.next = 36;
|
|
2862
2863
|
return this.refreshItemRuleQuantityLimits();
|
|
2863
|
-
case
|
|
2864
|
-
_context29.next =
|
|
2864
|
+
case 36:
|
|
2865
|
+
_context29.next = 38;
|
|
2865
2866
|
return this.refreshCartValidationPassed();
|
|
2866
|
-
case
|
|
2867
|
+
case 38:
|
|
2867
2868
|
this.logMethodSuccess('removeProductFromOrder', {
|
|
2868
2869
|
productCount: products.length
|
|
2869
2870
|
});
|
|
2870
2871
|
return _context29.abrupt("return", products);
|
|
2871
|
-
case
|
|
2872
|
-
_context29.prev =
|
|
2872
|
+
case 42:
|
|
2873
|
+
_context29.prev = 42;
|
|
2873
2874
|
_context29.t1 = _context29["catch"](1);
|
|
2874
2875
|
this.logMethodError('removeProductFromOrder', _context29.t1);
|
|
2875
2876
|
throw _context29.t1;
|
|
2876
|
-
case
|
|
2877
|
+
case 46:
|
|
2877
2878
|
case "end":
|
|
2878
2879
|
return _context29.stop();
|
|
2879
2880
|
}
|
|
2880
|
-
}, _callee29, this, [[1,
|
|
2881
|
+
}, _callee29, this, [[1, 42], [12, 25, 28, 31]]);
|
|
2881
2882
|
}));
|
|
2882
2883
|
function removeProductFromOrder(_x20) {
|
|
2883
2884
|
return _removeProductFromOrder.apply(this, arguments);
|
|
@@ -3257,7 +3258,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3257
3258
|
key: "applyPrefillByItemRule",
|
|
3258
3259
|
value: function () {
|
|
3259
3260
|
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
|
|
3260
|
-
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator18, _step18, _prefillItem$product_, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price,
|
|
3261
|
+
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator18, _step18, _prefillItem$product_, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, sellingPrice, origin, product, productUid, targetProduct, previousOrigin, nextOrigin, existedQuantity, delta, nextProduct, _productUid;
|
|
3261
3262
|
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
3262
3263
|
while (1) switch (_context38.prev = _context38.next) {
|
|
3263
3264
|
case 0:
|
|
@@ -3352,7 +3353,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3352
3353
|
},
|
|
3353
3354
|
_origin: origin
|
|
3354
3355
|
});
|
|
3355
|
-
productUid =
|
|
3356
|
+
productUid = getOrderProductLineUid(product) || '';
|
|
3356
3357
|
this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
|
|
3357
3358
|
tempOrder.products.push(product);
|
|
3358
3359
|
hasChanges = true;
|
|
@@ -3372,7 +3373,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3372
3373
|
})
|
|
3373
3374
|
});
|
|
3374
3375
|
if (delta > 0 || Boolean(sourceItem && (!previousOrigin || (previousOrigin === null || previousOrigin === void 0 ? void 0 : previousOrigin.price) !== (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price)))) {
|
|
3375
|
-
_productUid =
|
|
3376
|
+
_productUid = getOrderProductLineUid(nextProduct) || '';
|
|
3376
3377
|
this.attachProductOriginToTempOrder(tempOrder, _productUid, nextOrigin);
|
|
3377
3378
|
tempOrder.products[productIndex] = nextProduct;
|
|
3378
3379
|
hasChanges = true;
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _adapter.PromotionAdapter;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _evaluator.PromotionEvaluator;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "default", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _adapter.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
var _evaluator = require("./evaluator");
|
|
43
|
-
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
-
var _examples = require("./examples");
|
|
45
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
1
|
+
"use strict";
|
|
@@ -248,7 +248,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
readProductOriginFromTempOrder(tempOrder, product) {
|
|
251
|
-
const uid =
|
|
251
|
+
const uid = (0, _utils3.getOrderProductLineUid)(product);
|
|
252
252
|
if (uid && tempOrder._extend?.productsByUid?.[uid]?.origin) {
|
|
253
253
|
return tempOrder._extend.productsByUid[uid].origin;
|
|
254
254
|
}
|
|
@@ -1107,7 +1107,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1107
1107
|
tempOrder.bookings = tempOrder.bookings || [];
|
|
1108
1108
|
for (let i = 0; i < merged.length; i++) {
|
|
1109
1109
|
const group = merged[i];
|
|
1110
|
-
const
|
|
1110
|
+
const productUid = (0, _slotMerge.buildVenueIdentityKey)(resourceId, i);
|
|
1111
1111
|
const bookingUuid = (0, _utils3.createUuidV4)();
|
|
1112
1112
|
const startMoment = (0, _dayjs.default)(group.startTime, 'YYYY-MM-DD HH:mm');
|
|
1113
1113
|
const endMoment = (0, _dayjs.default)(group.endTime, 'YYYY-MM-DD HH:mm');
|
|
@@ -1180,12 +1180,12 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1180
1180
|
const normalizedVenueOrderProduct = (0, _utils.normalizeOrderProduct)({
|
|
1181
1181
|
product_id: mapping.productId,
|
|
1182
1182
|
product_variant_id: 0,
|
|
1183
|
-
identity_key: identityKey,
|
|
1184
1183
|
num: 1,
|
|
1185
1184
|
selling_price: group.totalPrice,
|
|
1186
1185
|
original_price: group.totalPrice,
|
|
1187
1186
|
is_charge_tax: venueProduct?.is_charge_tax ?? 0,
|
|
1188
1187
|
metadata: {
|
|
1188
|
+
unique_identification_number: productUid,
|
|
1189
1189
|
venue_booking: true,
|
|
1190
1190
|
...(productTitle ? {
|
|
1191
1191
|
product_title: productTitle
|
|
@@ -1210,7 +1210,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1210
1210
|
...normalizedVenueOrderProduct,
|
|
1211
1211
|
product_title: productTitle
|
|
1212
1212
|
} : normalizedVenueOrderProduct;
|
|
1213
|
-
this.attachProductOriginToTempOrder(tempOrder,
|
|
1213
|
+
this.attachProductOriginToTempOrder(tempOrder, productUid, venueProductOrigin);
|
|
1214
1214
|
tempOrder.products.push(venueOrderProduct);
|
|
1215
1215
|
const booking = (0, _slotMerge.buildVenueBookingEntry)({
|
|
1216
1216
|
group,
|
|
@@ -1218,7 +1218,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1218
1218
|
mapping,
|
|
1219
1219
|
rawResource,
|
|
1220
1220
|
bookingUuid,
|
|
1221
|
-
productUid
|
|
1221
|
+
productUid,
|
|
1222
1222
|
childResources: childRawResources
|
|
1223
1223
|
});
|
|
1224
1224
|
tempOrder.bookings.push(booking);
|
|
@@ -1624,7 +1624,8 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1624
1624
|
const venueBookingUids = new Set();
|
|
1625
1625
|
for (const product of tempOrder.products || []) {
|
|
1626
1626
|
if (!product?.metadata?.venue_booking) continue;
|
|
1627
|
-
|
|
1627
|
+
const productUid = (0, _utils3.getOrderProductLineUid)(product);
|
|
1628
|
+
if (productUid) venueProductUids.add(productUid);
|
|
1628
1629
|
if (product.metadata?.booking_uid) {
|
|
1629
1630
|
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
1630
1631
|
}
|
|
@@ -1853,7 +1854,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1853
1854
|
},
|
|
1854
1855
|
_origin: origin
|
|
1855
1856
|
});
|
|
1856
|
-
const productUid =
|
|
1857
|
+
const productUid = (0, _utils3.getOrderProductLineUid)(product) || '';
|
|
1857
1858
|
this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
|
|
1858
1859
|
tempOrder.products.push(product);
|
|
1859
1860
|
hasChanges = true;
|
|
@@ -1879,7 +1880,7 @@ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
|
1879
1880
|
}
|
|
1880
1881
|
};
|
|
1881
1882
|
if (delta > 0 || Boolean(sourceItem && (!previousOrigin || previousOrigin?.price !== sourceItem?.price))) {
|
|
1882
|
-
const productUid =
|
|
1883
|
+
const productUid = (0, _utils3.getOrderProductLineUid)(nextProduct) || '';
|
|
1883
1884
|
this.attachProductOriginToTempOrder(tempOrder, productUid, nextOrigin);
|
|
1884
1885
|
tempOrder.products[productIndex] = nextProduct;
|
|
1885
1886
|
hasChanges = true;
|