@pisell/pisellos 0.0.522 → 0.0.524
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/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/walletPass/locales.js +8 -8
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/ScanOrder/index.js +2 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/model/strategy/adapter/walletPass/locales.js +8 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/ScanOrder/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY } from "./examples";
|
|
@@ -6,9 +6,9 @@ export var locales = {
|
|
|
6
6
|
'max_passes_per_item_reached': '该商品已达到卡券使用上限',
|
|
7
7
|
'not_available_for_this_channel': '当前渠道不可使用',
|
|
8
8
|
'not_valid_for_this_order_type': '当前订单类型不适用',
|
|
9
|
-
'order_total_amount_not_enough': '
|
|
10
|
-
'applicable_product_total_amount_not_enough': '
|
|
11
|
-
'applicable_product_count_not_enough': '
|
|
9
|
+
'order_total_amount_not_enough': '满 {currency}{value} 可用',
|
|
10
|
+
'applicable_product_total_amount_not_enough': '满 {currency}{value} 可用',
|
|
11
|
+
'applicable_product_count_not_enough': '至少 {value} 件'
|
|
12
12
|
},
|
|
13
13
|
'en': {
|
|
14
14
|
'not_meet_the_required_conditions': 'Not meet the required conditions.',
|
|
@@ -18,8 +18,8 @@ export var locales = {
|
|
|
18
18
|
'not_available_for_this_channel': 'Not available for this channel.',
|
|
19
19
|
'not_valid_for_this_order_type': 'Not valid for this order type.',
|
|
20
20
|
'order_total_amount_not_enough': 'Spend {currency}{value} to use',
|
|
21
|
-
'applicable_product_total_amount_not_enough': '{currency}{value}
|
|
22
|
-
'applicable_product_count_not_enough': '
|
|
21
|
+
'applicable_product_total_amount_not_enough': 'Spend {currency}{value} to use',
|
|
22
|
+
'applicable_product_count_not_enough': 'Min. Qty {value}'
|
|
23
23
|
},
|
|
24
24
|
'zh-HK': {
|
|
25
25
|
'not_meet_the_required_conditions': '未達使用條件',
|
|
@@ -28,8 +28,8 @@ export var locales = {
|
|
|
28
28
|
'max_passes_per_item_reached': '該商品已達卡券使用上限',
|
|
29
29
|
'not_available_for_this_channel': '當前渠道不可使用',
|
|
30
30
|
'not_valid_for_this_order_type': '當前訂單類型不適用',
|
|
31
|
-
'order_total_amount_not_enough': '
|
|
32
|
-
'applicable_product_total_amount_not_enough': '
|
|
33
|
-
'applicable_product_count_not_enough': '
|
|
31
|
+
'order_total_amount_not_enough': '滿 {currency}{value} 可用',
|
|
32
|
+
'applicable_product_total_amount_not_enough': '滿 {currency}{value} 可用',
|
|
33
|
+
'applicable_product_count_not_enough': '至少 {value} 件'
|
|
34
34
|
}
|
|
35
35
|
};
|
|
@@ -706,25 +706,50 @@ var getBundleItemIsDiscountPrice = function getBundleItemIsDiscountPrice(item) {
|
|
|
706
706
|
var getBundleItemIsMarkupOrDiscountPrice = function getBundleItemIsMarkupOrDiscountPrice(item) {
|
|
707
707
|
return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
|
|
708
708
|
};
|
|
709
|
+
var getDiscountAmount = function getDiscountAmount(discounts) {
|
|
710
|
+
return (discounts || []).reduce(function (total, discount) {
|
|
711
|
+
return total.add(new Decimal(discount.amount || 0));
|
|
712
|
+
}, new Decimal(0)).toNumber();
|
|
713
|
+
};
|
|
709
714
|
|
|
710
715
|
/**
|
|
711
716
|
* 获取主商品加价减价后的总价 (主商品价格 + 子商品加价减价)
|
|
712
717
|
*/
|
|
713
718
|
var getMainProductTotal = function getMainProductTotal(item) {
|
|
714
|
-
var _ref8, _ref9, _item$main_product_se, _item$metadata, _item$metadata2;
|
|
719
|
+
var _ref8, _ref9, _item$main_product_se, _item$metadata, _item$metadata2, _item$metadata3, _item$metadata4;
|
|
715
720
|
// 新语义 v2 下 `main_product_selling_price` / `metadata.main_product_selling_price`
|
|
716
721
|
// 已经是"含 option、含主商品折扣"的主价,直接作为主商品基准,无需再减折扣或加 option。
|
|
717
722
|
// 仅需叠加 markup / markdown 类 bundle(原价 bundle 的税费单独处理)。
|
|
718
723
|
var total = new Decimal((_ref8 = (_ref9 = (_item$main_product_se = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se !== void 0 ? _item$main_product_se : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.main_product_selling_price) !== null && _ref9 !== void 0 ? _ref9 : item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.main_product_original_price) !== null && _ref8 !== void 0 ? _ref8 : 0);
|
|
724
|
+
|
|
725
|
+
// 做个兜底 如果新语义价格字段都没有,则切换回老逻辑
|
|
726
|
+
var hasMainProductPrice = (item === null || item === void 0 ? void 0 : item.main_product_selling_price) != null || (item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.main_product_selling_price) != null || (item === null || item === void 0 || (_item$metadata4 = item.metadata) === null || _item$metadata4 === void 0 ? void 0 : _item$metadata4.main_product_original_price) != null;
|
|
727
|
+
if (!hasMainProductPrice) {
|
|
728
|
+
var _ref10, _ref11, _item$main_product_se2, _item$metadata5, _item$_origin3, _item$_originData;
|
|
729
|
+
total = new Decimal((_ref10 = (_ref11 = (_item$main_product_se2 = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se2 !== void 0 ? _item$main_product_se2 : item === null || item === void 0 || (_item$metadata5 = item.metadata) === null || _item$metadata5 === void 0 ? void 0 : _item$metadata5.main_product_selling_price) !== null && _ref11 !== void 0 ? _ref11 : item.price) !== null && _ref10 !== void 0 ? _ref10 : 0);
|
|
730
|
+
var discount = (item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.discount_list) || (item === null || item === void 0 || (_item$_originData = item._originData) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.product) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.discount_list) === null || _item$_originData === void 0 ? void 0 : _item$_originData.filter(function (item) {
|
|
731
|
+
var _item$metadata6;
|
|
732
|
+
return !(item !== null && item !== void 0 && (_item$metadata6 = item.metadata) !== null && _item$metadata6 !== void 0 && _item$metadata6.custom_product_bundle_map_id);
|
|
733
|
+
})) || [];
|
|
734
|
+
var mainProductDiscountAmount = getDiscountAmount(discount);
|
|
735
|
+
total = total.minus(mainProductDiscountAmount);
|
|
736
|
+
|
|
737
|
+
// 单规格
|
|
738
|
+
if (item !== null && item !== void 0 && item.option && Array.isArray(item === null || item === void 0 ? void 0 : item.option)) {
|
|
739
|
+
total = total.add(item === null || item === void 0 ? void 0 : item.option.reduce(function (t, option) {
|
|
740
|
+
return t.add(new Decimal(option.price || 0).mul(option.num || 1));
|
|
741
|
+
}, new Decimal(0)));
|
|
742
|
+
}
|
|
743
|
+
}
|
|
719
744
|
var _iterator4 = _createForOfIteratorHelper((item === null || item === void 0 ? void 0 : item.bundle) || []),
|
|
720
745
|
_step4;
|
|
721
746
|
try {
|
|
722
747
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
723
748
|
var bundleItem = _step4.value;
|
|
724
749
|
if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
|
|
725
|
-
var
|
|
750
|
+
var _ref12, _bundleItem$bundle_se2;
|
|
726
751
|
// IMPORTANT: 套餐子商品如果应用了 discount,bundle_selling_price 和 price 其实都已经是折后价格了,不需要单独再减一次
|
|
727
|
-
var bundleItemTotal = new Decimal((
|
|
752
|
+
var bundleItemTotal = new Decimal((_ref12 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref12 !== void 0 ? _ref12 : 0);
|
|
728
753
|
total = total.add(bundleItemTotal);
|
|
729
754
|
}
|
|
730
755
|
}
|
|
@@ -844,12 +869,12 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
|
|
|
844
869
|
* @param options.scheduleById schedule 映射表:`{ [scheduleId]: schedule }`(用于根据配置的 `available_schedule_ids` 做日程匹配)
|
|
845
870
|
* @returns 附加费列表(仅返回金额 > 0 的项)
|
|
846
871
|
*/
|
|
847
|
-
export var getSurcharge = function getSurcharge(
|
|
872
|
+
export var getSurcharge = function getSurcharge(_ref13, options) {
|
|
848
873
|
var _service$filter;
|
|
849
|
-
var service =
|
|
850
|
-
addons =
|
|
851
|
-
bookingDetail =
|
|
852
|
-
bookingId =
|
|
874
|
+
var service = _ref13.service,
|
|
875
|
+
addons = _ref13.addons,
|
|
876
|
+
bookingDetail = _ref13.bookingDetail,
|
|
877
|
+
bookingId = _ref13.bookingId;
|
|
853
878
|
var isEdit = options.isEdit,
|
|
854
879
|
isInScheduleByDate = options.isInScheduleByDate,
|
|
855
880
|
surcharge_list = options.surcharge_list,
|
|
@@ -971,11 +996,11 @@ export var getSurcharge = function getSurcharge(_ref11, options) {
|
|
|
971
996
|
scheduleById: scheduleById || {},
|
|
972
997
|
isInScheduleByDate: isInScheduleByDate
|
|
973
998
|
})) {
|
|
974
|
-
var
|
|
999
|
+
var _ref14, _bundleItem$bundle_se3;
|
|
975
1000
|
var _mainQuantity = item.num || 1;
|
|
976
1001
|
matchedItems.push({
|
|
977
1002
|
isMain: false,
|
|
978
|
-
total: Number((
|
|
1003
|
+
total: Number((_ref14 = (_bundleItem$bundle_se3 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se3 !== void 0 ? _bundleItem$bundle_se3 : bundleItem.price) !== null && _ref14 !== void 0 ? _ref14 : 0),
|
|
979
1004
|
quantity: bundleItem.num || bundleItem.quantity || 1,
|
|
980
1005
|
item: bundleItem,
|
|
981
1006
|
mainQuantity: _mainQuantity // 子商品的mainQuantity是所属主商品的quantity
|
|
@@ -1191,9 +1216,9 @@ export var getSurcharge = function getSurcharge(_ref11, options) {
|
|
|
1191
1216
|
}
|
|
1192
1217
|
return surchargeWithAmount;
|
|
1193
1218
|
};
|
|
1194
|
-
function resetItemsSurchargeSideEffects(
|
|
1195
|
-
var service =
|
|
1196
|
-
addons =
|
|
1219
|
+
function resetItemsSurchargeSideEffects(_ref15) {
|
|
1220
|
+
var service = _ref15.service,
|
|
1221
|
+
addons = _ref15.addons;
|
|
1197
1222
|
var resetItem = function resetItem(item) {
|
|
1198
1223
|
if (!item) return;
|
|
1199
1224
|
item.surcharge_fee = 0;
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 5 | 3 | 2 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -1390,11 +1390,12 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1390
1390
|
})
|
|
1391
1391
|
} : undefined;
|
|
1392
1392
|
var ruleProductUid = ruleProduct ? createUuidV4() : undefined;
|
|
1393
|
-
// 有 collect_pax 时 booking/resource capacity 都代表本次 pax;否则使用资源占用兜底值。
|
|
1393
|
+
// 有 collect_pax 时 booking/resource capacity 与 number 都代表本次 pax;否则使用资源占用兜底值。
|
|
1394
1394
|
var bookingCapacityValue = resourceCapacityValue;
|
|
1395
1395
|
var bookingCapacityDimensionId = (_pickFirstCustomCapac = pickFirstCustomCapacityDimensionId(_this5.enabledReservationRuleProducts)) !== null && _pickFirstCustomCapac !== void 0 ? _pickFirstCustomCapac : 0;
|
|
1396
1396
|
var nextBookings = (payload.bookings || []).map(function (booking, idx) {
|
|
1397
1397
|
return _objectSpread(_objectSpread(_objectSpread({}, booking), {}, {
|
|
1398
|
+
number: bookingCapacityValue,
|
|
1398
1399
|
appointment_status: 'started',
|
|
1399
1400
|
metadata: _objectSpread(_objectSpread(_objectSpread({}, booking.metadata || {}), resourceSelectType ? {
|
|
1400
1401
|
resource_select_type: resourceSelectType
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
+
var promotion_exports = {};
|
|
31
|
+
__export(promotion_exports, {
|
|
32
|
+
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
34
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
35
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
36
|
+
default: () => import_adapter2.default
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
39
|
+
var import_evaluator = require("./evaluator");
|
|
40
|
+
var import_adapter = require("./adapter");
|
|
41
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
42
|
+
var import_examples = require("./examples");
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
46
|
+
PromotionAdapter,
|
|
47
|
+
PromotionEvaluator,
|
|
48
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
49
|
+
});
|
|
@@ -30,9 +30,9 @@ var locales = {
|
|
|
30
30
|
"max_passes_per_item_reached": "该商品已达到卡券使用上限",
|
|
31
31
|
"not_available_for_this_channel": "当前渠道不可使用",
|
|
32
32
|
"not_valid_for_this_order_type": "当前订单类型不适用",
|
|
33
|
-
"order_total_amount_not_enough": "
|
|
34
|
-
"applicable_product_total_amount_not_enough": "
|
|
35
|
-
"applicable_product_count_not_enough": "
|
|
33
|
+
"order_total_amount_not_enough": "满 {currency}{value} 可用",
|
|
34
|
+
"applicable_product_total_amount_not_enough": "满 {currency}{value} 可用",
|
|
35
|
+
"applicable_product_count_not_enough": "至少 {value} 件"
|
|
36
36
|
},
|
|
37
37
|
"en": {
|
|
38
38
|
"not_meet_the_required_conditions": "Not meet the required conditions.",
|
|
@@ -42,8 +42,8 @@ var locales = {
|
|
|
42
42
|
"not_available_for_this_channel": "Not available for this channel.",
|
|
43
43
|
"not_valid_for_this_order_type": "Not valid for this order type.",
|
|
44
44
|
"order_total_amount_not_enough": "Spend {currency}{value} to use",
|
|
45
|
-
"applicable_product_total_amount_not_enough": "{currency}{value}
|
|
46
|
-
"applicable_product_count_not_enough": "
|
|
45
|
+
"applicable_product_total_amount_not_enough": "Spend {currency}{value} to use",
|
|
46
|
+
"applicable_product_count_not_enough": "Min. Qty {value}"
|
|
47
47
|
},
|
|
48
48
|
"zh-HK": {
|
|
49
49
|
"not_meet_the_required_conditions": "未達使用條件",
|
|
@@ -52,9 +52,9 @@ var locales = {
|
|
|
52
52
|
"max_passes_per_item_reached": "該商品已達卡券使用上限",
|
|
53
53
|
"not_available_for_this_channel": "當前渠道不可使用",
|
|
54
54
|
"not_valid_for_this_order_type": "當前訂單類型不適用",
|
|
55
|
-
"order_total_amount_not_enough": "
|
|
56
|
-
"applicable_product_total_amount_not_enough": "
|
|
57
|
-
"applicable_product_count_not_enough": "
|
|
55
|
+
"order_total_amount_not_enough": "滿 {currency}{value} 可用",
|
|
56
|
+
"applicable_product_total_amount_not_enough": "滿 {currency}{value} 可用",
|
|
57
|
+
"applicable_product_count_not_enough": "至少 {value} 件"
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -437,11 +437,31 @@ var getBundleItemIsDiscountPrice = (item) => {
|
|
|
437
437
|
var getBundleItemIsMarkupOrDiscountPrice = (item) => {
|
|
438
438
|
return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
|
|
439
439
|
};
|
|
440
|
+
var getDiscountAmount = (discounts) => {
|
|
441
|
+
return (discounts || []).reduce((total, discount) => {
|
|
442
|
+
return total.add(new import_decimal.default(discount.amount || 0));
|
|
443
|
+
}, new import_decimal.default(0)).toNumber();
|
|
444
|
+
};
|
|
440
445
|
var getMainProductTotal = (item) => {
|
|
441
|
-
var _a, _b;
|
|
446
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
442
447
|
let total = new import_decimal.default(
|
|
443
448
|
(item == null ? void 0 : item.main_product_selling_price) ?? ((_a = item == null ? void 0 : item.metadata) == null ? void 0 : _a.main_product_selling_price) ?? ((_b = item == null ? void 0 : item.metadata) == null ? void 0 : _b.main_product_original_price) ?? 0
|
|
444
449
|
);
|
|
450
|
+
const hasMainProductPrice = (item == null ? void 0 : item.main_product_selling_price) != null || ((_c = item == null ? void 0 : item.metadata) == null ? void 0 : _c.main_product_selling_price) != null || ((_d = item == null ? void 0 : item.metadata) == null ? void 0 : _d.main_product_original_price) != null;
|
|
451
|
+
if (!hasMainProductPrice) {
|
|
452
|
+
total = new import_decimal.default((item == null ? void 0 : item.main_product_selling_price) ?? ((_e = item == null ? void 0 : item.metadata) == null ? void 0 : _e.main_product_selling_price) ?? item.price ?? 0);
|
|
453
|
+
const discount = ((_g = (_f = item == null ? void 0 : item._origin) == null ? void 0 : _f.product) == null ? void 0 : _g.discount_list) || ((_j = (_i = (_h = item == null ? void 0 : item._originData) == null ? void 0 : _h.product) == null ? void 0 : _i.discount_list) == null ? void 0 : _j.filter((item2) => {
|
|
454
|
+
var _a2;
|
|
455
|
+
return !((_a2 = item2 == null ? void 0 : item2.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id);
|
|
456
|
+
})) || [];
|
|
457
|
+
const mainProductDiscountAmount = getDiscountAmount(discount);
|
|
458
|
+
total = total.minus(mainProductDiscountAmount);
|
|
459
|
+
if ((item == null ? void 0 : item.option) && Array.isArray(item == null ? void 0 : item.option)) {
|
|
460
|
+
total = total.add(item == null ? void 0 : item.option.reduce((t, option) => {
|
|
461
|
+
return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
|
|
462
|
+
}, new import_decimal.default(0)));
|
|
463
|
+
}
|
|
464
|
+
}
|
|
445
465
|
for (let bundleItem of (item == null ? void 0 : item.bundle) || []) {
|
|
446
466
|
if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
|
|
447
467
|
const bundleItemTotal = new import_decimal.default(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 5 | 3 | 2 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -867,6 +867,7 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
867
867
|
const bookingCapacityDimensionId = (0, import_utils.pickFirstCustomCapacityDimensionId)(this.enabledReservationRuleProducts) ?? 0;
|
|
868
868
|
const nextBookings = (payload.bookings || []).map((booking, idx) => ({
|
|
869
869
|
...booking,
|
|
870
|
+
number: bookingCapacityValue,
|
|
870
871
|
appointment_status: "started",
|
|
871
872
|
metadata: {
|
|
872
873
|
...booking.metadata || {},
|