@infrab4a/connect-angular 4.12.1-beta.5 → 4.12.1-beta.6
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/esm2020/services/cart.service.mjs +2 -2
- package/esm2020/services/coupon.service.mjs +9 -5
- package/fesm2015/infrab4a-connect-angular.mjs +11 -7
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +9 -5
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1095,7 +1095,7 @@ class CouponService {
|
|
|
1095
1095
|
const hasMinSubTotal = await this.hasMinSubTotal(coupon, checkout);
|
|
1096
1096
|
if (!hasMinSubTotal) {
|
|
1097
1097
|
if (coupon.productsCategories?.length) {
|
|
1098
|
-
throw `Valor mínimo de ${Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(coupon.minSubTotalValue)} não atingido na(s) categoria(s)/marca(s)
|
|
1098
|
+
throw `Valor mínimo de ${Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(coupon.minSubTotalValue)} não atingido na(s) categoria(s)/marca(s) elegiveis para o desconto.`;
|
|
1099
1099
|
}
|
|
1100
1100
|
throw `Valor mínimo de ${Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(coupon.minSubTotalValue)} não atingido`;
|
|
1101
1101
|
}
|
|
@@ -1183,9 +1183,13 @@ class CouponService {
|
|
|
1183
1183
|
async getCouponCategoriesId(productsCategories) {
|
|
1184
1184
|
const couponCategories = [];
|
|
1185
1185
|
for (let index = 0; index < productsCategories.length; index++) {
|
|
1186
|
-
const category = await this.categoryRepository
|
|
1187
|
-
|
|
1188
|
-
|
|
1186
|
+
const category = await this.categoryRepository
|
|
1187
|
+
.find({
|
|
1188
|
+
filters: {
|
|
1189
|
+
id: productsCategories[index],
|
|
1190
|
+
},
|
|
1191
|
+
})
|
|
1192
|
+
.then((res) => res.data.at(0));
|
|
1189
1193
|
if (category) {
|
|
1190
1194
|
const children = await this.categoryRepository.getChildren(parseInt(productsCategories[index]));
|
|
1191
1195
|
couponCategories.push(category.id, ...children.map((c) => c.id.toString()));
|
|
@@ -1419,7 +1423,7 @@ class CartService {
|
|
|
1419
1423
|
quantity: (item.quantity || 0) + (quantity || 0),
|
|
1420
1424
|
pricePaid,
|
|
1421
1425
|
discount: 0,
|
|
1422
|
-
categories: product.categories
|
|
1426
|
+
categories: product.categories || product.category?.id ? [product.category?.id, ...product.categories] : [],
|
|
1423
1427
|
isGift: isGift ?? null,
|
|
1424
1428
|
costPrice: product.costPrice ?? 0,
|
|
1425
1429
|
type,
|