@infrab4a/connect 4.0.0-beta.29 → 4.0.0-beta.30
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/domain/catalog/helpers/index.d.ts +1 -1
- package/domain/catalog/repositories/category.repository.d.ts +2 -0
- package/esm2020/domain/catalog/helpers/index.mjs +2 -2
- package/esm2020/domain/catalog/helpers/round-product-price.helper.mjs +15 -0
- package/esm2020/domain/catalog/repositories/category.repository.mjs +1 -1
- package/esm2020/domain/users/models/user.mjs +1 -1
- package/esm2020/infra/elasticsearch/indexes/products-index.mjs +8 -3
- package/esm2020/infra/firebase/firestore/repositories/catalog/category-firestore.repository.mjs +7 -1
- package/esm2020/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.mjs +15 -1
- package/fesm2015/infrab4a-connect.mjs +30 -1
- package/fesm2015/infrab4a-connect.mjs.map +1 -1
- package/fesm2020/infrab4a-connect.mjs +26 -1
- package/fesm2020/infrab4a-connect.mjs.map +1 -1
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +2 -0
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +2 -0
- package/package.json +1 -1
- package/esm2020/domain/catalog/helpers/RoundProdutcPriceHelper.mjs +0 -15
- /package/domain/catalog/helpers/{RoundProdutcPriceHelper.d.ts → round-product-price.helper.d.ts} +0 -0
|
@@ -1687,7 +1687,12 @@ class ProductsIndex {
|
|
|
1687
1687
|
},
|
|
1688
1688
|
},
|
|
1689
1689
|
});
|
|
1690
|
-
search.hits = search.hits
|
|
1690
|
+
search.hits = search.hits
|
|
1691
|
+
.filter((e) => e._source.name !== '')
|
|
1692
|
+
.map((hit) => {
|
|
1693
|
+
RoundProductPricesHelper.roundProductPrices(hit._source);
|
|
1694
|
+
return hit;
|
|
1695
|
+
});
|
|
1691
1696
|
return search;
|
|
1692
1697
|
}
|
|
1693
1698
|
async save(product) {
|
|
@@ -2246,6 +2251,12 @@ class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFire
|
|
|
2246
2251
|
getCategoryByShop(shop) {
|
|
2247
2252
|
return;
|
|
2248
2253
|
}
|
|
2254
|
+
getChildren(parentId) {
|
|
2255
|
+
return;
|
|
2256
|
+
}
|
|
2257
|
+
isChild(id, parentId) {
|
|
2258
|
+
return;
|
|
2259
|
+
}
|
|
2249
2260
|
}
|
|
2250
2261
|
|
|
2251
2262
|
class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
@@ -3672,6 +3683,20 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
3672
3683
|
}
|
|
3673
3684
|
return [];
|
|
3674
3685
|
}
|
|
3686
|
+
async getChildren(parentId) {
|
|
3687
|
+
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
3688
|
+
args: {
|
|
3689
|
+
type: 'category_tree_args',
|
|
3690
|
+
value: { parentid: parentId },
|
|
3691
|
+
required: true,
|
|
3692
|
+
},
|
|
3693
|
+
});
|
|
3694
|
+
return category_tree.map((category) => Category.toInstance(category));
|
|
3695
|
+
}
|
|
3696
|
+
async isChild(id, parentId) {
|
|
3697
|
+
const categoryTree = await this.getChildren(parentId);
|
|
3698
|
+
return categoryTree.some((c) => c.id == id.toString());
|
|
3699
|
+
}
|
|
3675
3700
|
}
|
|
3676
3701
|
|
|
3677
3702
|
class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|