@infrab4a/connect 3.12.0-beta.0 → 3.12.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 +26 -13
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/models/product.d.ts +4 -1
- package/domain/catalog/models/types/index.d.ts +1 -0
- package/domain/catalog/models/types/product-evaluation.type.d.ts +6 -0
- package/domain/catalog/repositories/index.d.ts +1 -0
- package/esm2015/domain/catalog/models/product.js +19 -1
- package/esm2015/domain/catalog/models/types/index.js +2 -1
- package/esm2015/domain/catalog/models/types/product-evaluation.type.js +2 -0
- package/esm2015/domain/catalog/repositories/index.js +2 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-collection-children-hasura-graphql.repository.js +3 -3
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +3 -12
- package/fesm2015/infrab4a-connect.js +22 -13
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
|
@@ -1373,6 +1373,28 @@
|
|
|
1373
1373
|
function Product() {
|
|
1374
1374
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1375
1375
|
}
|
|
1376
|
+
Object.defineProperty(Product.prototype, "evaluation", {
|
|
1377
|
+
get: function () {
|
|
1378
|
+
return {
|
|
1379
|
+
reviews: this.reviews,
|
|
1380
|
+
count: this.reviewsTotal,
|
|
1381
|
+
rating: this.rate,
|
|
1382
|
+
};
|
|
1383
|
+
},
|
|
1384
|
+
set: function (evaluation) {
|
|
1385
|
+
if (!evaluation) {
|
|
1386
|
+
this.reviews = null;
|
|
1387
|
+
this.reviewsTotal = null;
|
|
1388
|
+
this.rate = null;
|
|
1389
|
+
return;
|
|
1390
|
+
}
|
|
1391
|
+
this.reviews = evaluation.reviews || this.reviews;
|
|
1392
|
+
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
1393
|
+
this.rate = evaluation.rating || this.rate;
|
|
1394
|
+
},
|
|
1395
|
+
enumerable: false,
|
|
1396
|
+
configurable: true
|
|
1397
|
+
});
|
|
1376
1398
|
Product.prototype.identifierFields = function () {
|
|
1377
1399
|
return ['id'];
|
|
1378
1400
|
};
|
|
@@ -3939,8 +3961,8 @@
|
|
|
3939
3961
|
fields: [
|
|
3940
3962
|
'collection_id',
|
|
3941
3963
|
'category_id',
|
|
3942
|
-
'
|
|
3943
|
-
'
|
|
3964
|
+
'parent_collection_id',
|
|
3965
|
+
'parent_category_id',
|
|
3944
3966
|
'name',
|
|
3945
3967
|
'reference',
|
|
3946
3968
|
'slug',
|
|
@@ -4804,17 +4826,8 @@
|
|
|
4804
4826
|
{ isKit: { columnName: 'is_kit' } },
|
|
4805
4827
|
{ createdAt: { columnName: 'created_at' } },
|
|
4806
4828
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
4807
|
-
{
|
|
4808
|
-
|
|
4809
|
-
columnName: 'reviews_aggregate',
|
|
4810
|
-
filters: {
|
|
4811
|
-
filters: { status: true },
|
|
4812
|
-
filterType: 'product_review_bool_exp',
|
|
4813
|
-
},
|
|
4814
|
-
fields: [{ aggregate: [{ avg: ['rate'] }] }],
|
|
4815
|
-
from: function (value) { return value.aggregate.avg.rate; },
|
|
4816
|
-
},
|
|
4817
|
-
},
|
|
4829
|
+
{ rate: { columnName: 'rating' } },
|
|
4830
|
+
{ reviewsTotal: { columnName: 'reviews_total' } },
|
|
4818
4831
|
{ shoppingCount: { columnName: 'shopping_count' } },
|
|
4819
4832
|
{ categoryId: { columnName: 'category_id' } },
|
|
4820
4833
|
{
|