@infrab4a/connect 3.10.0 → 3.11.0-beta.0
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 +24 -11
- 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/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/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +3 -12
- package/fesm2015/infrab4a-connect.js +20 -11
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
|
@@ -1351,6 +1351,28 @@
|
|
|
1351
1351
|
function Product() {
|
|
1352
1352
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1353
1353
|
}
|
|
1354
|
+
Object.defineProperty(Product.prototype, "evaluation", {
|
|
1355
|
+
get: function () {
|
|
1356
|
+
return {
|
|
1357
|
+
reviews: this.reviews,
|
|
1358
|
+
count: this.reviewsTotal,
|
|
1359
|
+
rating: this.rate,
|
|
1360
|
+
};
|
|
1361
|
+
},
|
|
1362
|
+
set: function (evaluation) {
|
|
1363
|
+
if (!evaluation) {
|
|
1364
|
+
this.reviews = null;
|
|
1365
|
+
this.reviewsTotal = null;
|
|
1366
|
+
this.rate = null;
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
this.reviews = evaluation.reviews || this.reviews;
|
|
1370
|
+
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
1371
|
+
this.rate = evaluation.rating || this.rate;
|
|
1372
|
+
},
|
|
1373
|
+
enumerable: false,
|
|
1374
|
+
configurable: true
|
|
1375
|
+
});
|
|
1354
1376
|
Product.prototype.identifierFields = function () {
|
|
1355
1377
|
return ['id'];
|
|
1356
1378
|
};
|
|
@@ -4745,17 +4767,8 @@
|
|
|
4745
4767
|
{ isKit: { columnName: 'is_kit' } },
|
|
4746
4768
|
{ createdAt: { columnName: 'created_at' } },
|
|
4747
4769
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
4748
|
-
{
|
|
4749
|
-
|
|
4750
|
-
columnName: 'reviews_aggregate',
|
|
4751
|
-
filters: {
|
|
4752
|
-
filters: { status: true },
|
|
4753
|
-
filterType: 'product_review_bool_exp',
|
|
4754
|
-
},
|
|
4755
|
-
fields: [{ aggregate: [{ avg: ['rate'] }] }],
|
|
4756
|
-
from: function (value) { return value.aggregate.avg.rate; },
|
|
4757
|
-
},
|
|
4758
|
-
},
|
|
4770
|
+
{ rate: { columnName: 'rating' } },
|
|
4771
|
+
{ reviewsTotal: { columnName: 'reviews_total' } },
|
|
4759
4772
|
{ shoppingCount: { columnName: 'shopping_count' } },
|
|
4760
4773
|
{ categoryId: { columnName: 'category_id' } },
|
|
4761
4774
|
{
|