@infrab4a/connect-angular 5.0.0-beta.63 → 5.0.0-beta.64
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/esm2022/angular-connect.module.mjs +1 -1
- package/esm2022/angular-elastic-search.module.mjs +1 -1
- package/esm2022/angular-firebase-auth.module.mjs +1 -1
- package/esm2022/angular-firestore.module.mjs +1 -1
- package/esm2022/angular-hasura-graphql.module.mjs +1 -1
- package/esm2022/angular-vertex-search.module.mjs +1 -1
- package/esm2022/consts/category-structure.mjs +1 -1
- package/esm2022/consts/default-shop.const.mjs +1 -1
- package/esm2022/consts/es-config.const.mjs +1 -1
- package/esm2022/consts/firebase-const.mjs +1 -1
- package/esm2022/consts/hasura-options.const.mjs +1 -1
- package/esm2022/consts/index.mjs +1 -1
- package/esm2022/consts/persistence.const.mjs +1 -1
- package/esm2022/consts/storage-base-url.const.mjs +1 -1
- package/esm2022/consts/vertex-config.const.mjs +1 -1
- package/esm2022/helpers/index.mjs +1 -1
- package/esm2022/helpers/mobile-operation-system-checker.helper.mjs +1 -1
- package/esm2022/index.mjs +1 -1
- package/esm2022/persistence/cookie-data-persistence.mjs +1 -1
- package/esm2022/persistence/data-persistence.mjs +1 -1
- package/esm2022/persistence/index.mjs +1 -1
- package/esm2022/services/auth.service.mjs +1 -1
- package/esm2022/services/cart.service.mjs +5 -5
- package/esm2022/services/catalog/adapters/category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/adapters/index.mjs +1 -1
- package/esm2022/services/catalog/adapters/new-category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/adapters/old-category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/catalog.service.mjs +1 -1
- package/esm2022/services/catalog/category.service.mjs +1 -1
- package/esm2022/services/catalog/enums/index.mjs +1 -1
- package/esm2022/services/catalog/enums/product-sorts.enum.mjs +1 -1
- package/esm2022/services/catalog/index.mjs +1 -1
- package/esm2022/services/catalog/models/category-with-tree.model.mjs +1 -1
- package/esm2022/services/catalog/models/index.mjs +1 -1
- package/esm2022/services/catalog/types/index.mjs +1 -1
- package/esm2022/services/catalog/types/product-sort.type.mjs +1 -1
- package/esm2022/services/catalog/wishlist.service.mjs +1 -1
- package/esm2022/services/checkout-subscription.service.mjs +1 -1
- package/esm2022/services/checkout.service.mjs +1 -1
- package/esm2022/services/coupon.service.mjs +1 -1
- package/esm2022/services/helpers/index.mjs +1 -1
- package/esm2022/services/helpers/util.helper.mjs +1 -1
- package/esm2022/services/home-shop.service.mjs +1 -1
- package/esm2022/services/index.mjs +1 -1
- package/esm2022/services/order.service.mjs +1 -1
- package/esm2022/services/shipping.service.mjs +1 -1
- package/esm2022/services/types/index.mjs +1 -1
- package/esm2022/services/types/required-checkout-data.type.mjs +1 -1
- package/esm2022/services/types/required-checkout-subscription-data.type.mjs +1 -1
- package/esm2022/services/types/shipping-methods.type.mjs +1 -1
- package/esm2022/types/firebase-app-config.type.mjs +1 -1
- package/esm2022/types/index.mjs +1 -1
- package/fesm2022/infrab4a-connect-angular.mjs +4 -4
- package/fesm2022/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1441,6 +1441,7 @@ class CartService {
|
|
|
1441
1441
|
isGift: isGift ?? null,
|
|
1442
1442
|
costPrice: isGift ? 0 : product.costPrice ?? 0,
|
|
1443
1443
|
type,
|
|
1444
|
+
label: product.label,
|
|
1444
1445
|
}),
|
|
1445
1446
|
};
|
|
1446
1447
|
};
|
|
@@ -1548,10 +1549,9 @@ class CartService {
|
|
|
1548
1549
|
.find({
|
|
1549
1550
|
filters: {
|
|
1550
1551
|
active: { operator: Where.EQUALS, value: true },
|
|
1551
|
-
shop: { operator: Where.EQUALS, value: this.defaultShop },
|
|
1552
1552
|
},
|
|
1553
1553
|
})
|
|
1554
|
-
.then((data) => data.data);
|
|
1554
|
+
.then((data) => data.data.filter((campaign) => campaign.shop === Shops.ALL || campaign.shop === this.defaultShop));
|
|
1555
1555
|
if (!campaigns.length)
|
|
1556
1556
|
return { ...checkout, lineItems: notGiftItems };
|
|
1557
1557
|
const elegibleCampaigns = [];
|
|
@@ -1567,7 +1567,7 @@ class CartService {
|
|
|
1567
1567
|
categoriesCampaingFullTree.push(id, ...children.map((c) => c.id.toString()));
|
|
1568
1568
|
}
|
|
1569
1569
|
const categoriesCampaingTree = [...new Set(categoriesCampaingFullTree)];
|
|
1570
|
-
const filterProductsCategories =
|
|
1570
|
+
const filterProductsCategories = notGiftItems.filter((l) => {
|
|
1571
1571
|
if (!l.categories || !l.categories?.length)
|
|
1572
1572
|
return true;
|
|
1573
1573
|
return l.categories.some((c) => categoriesCampaingTree.some((cat) => cat == c));
|
|
@@ -1575,7 +1575,7 @@ class CartService {
|
|
|
1575
1575
|
if (filterProductsCategories.length) {
|
|
1576
1576
|
const cartValuelWithCategories = filterProductsCategories.reduce((a, b) => a + b.pricePaid * b.quantity, 0);
|
|
1577
1577
|
const cartItensQuantityWithCategories = filterProductsCategories.reduce((a, b) => a + b.quantity, 0);
|
|
1578
|
-
const hasMinValue = cartValuelWithCategories >= campaign.cartValueMin;
|
|
1578
|
+
const hasMinValue = campaign.cartValueMin && cartValuelWithCategories >= campaign.cartValueMin;
|
|
1579
1579
|
const hasMinQuantity = campaign.cartItensQuantityMin && cartItensQuantityWithCategories >= campaign.cartItensQuantityMin;
|
|
1580
1580
|
if (hasMinQuantity || hasMinValue)
|
|
1581
1581
|
elegibleCampaigns.push(campaign);
|