@infrab4a/connect-angular 4.13.0-beta.0 → 4.13.1
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 +7 -3
- package/esm2020/services/home-shop.service.mjs +4 -4
- package/fesm2015/infrab4a-connect-angular.mjs +12 -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 +2 -2
|
@@ -1107,8 +1107,12 @@ class CouponService {
|
|
|
1107
1107
|
if (!hasProductCategories)
|
|
1108
1108
|
throw 'Seu carrinho não possui produtos elegíveis para desconto.';
|
|
1109
1109
|
const hasMinSubTotal = await this.hasMinSubTotal(coupon, checkout);
|
|
1110
|
-
if (!hasMinSubTotal)
|
|
1111
|
-
|
|
1110
|
+
if (!hasMinSubTotal) {
|
|
1111
|
+
if (coupon.productsCategories?.length) {
|
|
1112
|
+
throw `Valor mínimo de ${Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(coupon.minSubTotalValue)} não atingido na(s) categoria(s) elegíveis para o desconto.`;
|
|
1113
|
+
}
|
|
1114
|
+
throw `Valor mínimo de ${Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(coupon.minSubTotalValue)} não atingido.`;
|
|
1115
|
+
}
|
|
1112
1116
|
return coupon;
|
|
1113
1117
|
}
|
|
1114
1118
|
calcDiscountSubscription(coupon, checkout) {
|
|
@@ -1429,7 +1433,7 @@ class CartService {
|
|
|
1429
1433
|
quantity: (item.quantity || 0) + (quantity || 0),
|
|
1430
1434
|
pricePaid,
|
|
1431
1435
|
discount: 0,
|
|
1432
|
-
categories: product.categories
|
|
1436
|
+
categories: product.categories || product.category?.id ? [product.category?.id, ...product.categories] : [],
|
|
1433
1437
|
isGift: isGift ?? null,
|
|
1434
1438
|
costPrice: product.costPrice ?? 0,
|
|
1435
1439
|
type,
|
|
@@ -2354,10 +2358,10 @@ class HomeShopService {
|
|
|
2354
2358
|
return this.getHomeConfiguration().pipe(map((home) => home.minValueForFreeShipping));
|
|
2355
2359
|
}
|
|
2356
2360
|
getDiscoverProducts(gender) {
|
|
2357
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories,
|
|
2361
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories, this.defaultShop)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2358
2362
|
}
|
|
2359
2363
|
getFeaturedProducts(gender) {
|
|
2360
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories,
|
|
2364
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories, this.defaultShop)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2361
2365
|
}
|
|
2362
2366
|
getVerticalProducts(gender) {
|
|
2363
2367
|
return this.getHomeConfiguration().pipe(concatMap((home) => forkJoin(home.verticalCarousels.filter(Boolean).map((id) => from(this.categoryRepository.get({ id })).pipe(concatMap((category) => from(this.productRepository.find({
|