@infrab4a/connect 3.14.0-beta.0 → 3.14.0-beta.2
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/bundles/infrab4a-connect.umd.js +45 -2
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/helpers/index.d.ts +1 -1
- package/domain/catalog/repositories/category.repository.d.ts +2 -0
- package/esm2015/domain/catalog/helpers/index.js +2 -2
- package/esm2015/domain/catalog/helpers/round-product-price.helper.js +15 -0
- package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
- package/esm2015/domain/users/models/user.js +2 -2
- package/esm2015/infra/elasticsearch/indexes/products-index.js +8 -3
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +7 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +19 -1
- package/fesm2015/infrab4a-connect.js +31 -2
- package/fesm2015/infrab4a-connect.js.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/esm2015/domain/catalog/helpers/RoundProdutcPriceHelper.js +0 -15
- /package/domain/catalog/helpers/{RoundProdutcPriceHelper.d.ts → round-product-price.helper.d.ts} +0 -0
|
@@ -1522,7 +1522,7 @@
|
|
|
1522
1522
|
var instance = _super.toInstance.call(this, data);
|
|
1523
1523
|
if (!lodash.isNil(data.firstName))
|
|
1524
1524
|
instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
|
|
1525
|
-
return;
|
|
1525
|
+
return instance;
|
|
1526
1526
|
};
|
|
1527
1527
|
User.prototype.toPlain = function () {
|
|
1528
1528
|
var plain = _super.prototype.toPlain.call(this);
|
|
@@ -2547,7 +2547,12 @@
|
|
|
2547
2547
|
})];
|
|
2548
2548
|
case 1:
|
|
2549
2549
|
search = _a.sent();
|
|
2550
|
-
search.hits = search.hits
|
|
2550
|
+
search.hits = search.hits
|
|
2551
|
+
.filter(function (e) { return e._source.name !== ''; })
|
|
2552
|
+
.map(function (hit) {
|
|
2553
|
+
RoundProductPricesHelper.roundProductPrices(hit._source);
|
|
2554
|
+
return hit;
|
|
2555
|
+
});
|
|
2551
2556
|
return [2 /*return*/, search];
|
|
2552
2557
|
}
|
|
2553
2558
|
});
|
|
@@ -3340,6 +3345,12 @@
|
|
|
3340
3345
|
CategoryFirestoreRepository.prototype.getCategoryByShop = function (shop) {
|
|
3341
3346
|
return;
|
|
3342
3347
|
};
|
|
3348
|
+
CategoryFirestoreRepository.prototype.getChildren = function (parentId) {
|
|
3349
|
+
return;
|
|
3350
|
+
};
|
|
3351
|
+
CategoryFirestoreRepository.prototype.isChild = function (id, parentId) {
|
|
3352
|
+
return;
|
|
3353
|
+
};
|
|
3343
3354
|
return CategoryFirestoreRepository;
|
|
3344
3355
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
3345
3356
|
|
|
@@ -5148,6 +5159,38 @@
|
|
|
5148
5159
|
});
|
|
5149
5160
|
});
|
|
5150
5161
|
};
|
|
5162
|
+
CategoryHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
|
|
5163
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5164
|
+
var category_tree;
|
|
5165
|
+
return __generator(this, function (_c) {
|
|
5166
|
+
switch (_c.label) {
|
|
5167
|
+
case 0: return [4 /*yield*/, this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
5168
|
+
args: {
|
|
5169
|
+
type: 'category_tree_args',
|
|
5170
|
+
value: { parentid: parentId },
|
|
5171
|
+
required: true,
|
|
5172
|
+
},
|
|
5173
|
+
})];
|
|
5174
|
+
case 1:
|
|
5175
|
+
category_tree = (_c.sent()).category_tree;
|
|
5176
|
+
return [2 /*return*/, category_tree.map(function (c) { return Category.toInstance(c); })];
|
|
5177
|
+
}
|
|
5178
|
+
});
|
|
5179
|
+
});
|
|
5180
|
+
};
|
|
5181
|
+
CategoryHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
|
|
5182
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5183
|
+
var categoryTree;
|
|
5184
|
+
return __generator(this, function (_c) {
|
|
5185
|
+
switch (_c.label) {
|
|
5186
|
+
case 0: return [4 /*yield*/, this.getChildren(parentId)];
|
|
5187
|
+
case 1:
|
|
5188
|
+
categoryTree = _c.sent();
|
|
5189
|
+
return [2 /*return*/, categoryTree.some(function (c) { return c.id == id.toString(); })];
|
|
5190
|
+
}
|
|
5191
|
+
});
|
|
5192
|
+
});
|
|
5193
|
+
};
|
|
5151
5194
|
return CategoryHasuraGraphQLRepository;
|
|
5152
5195
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
5153
5196
|
|