@infrab4a/connect 3.10.1-beta1 → 3.11.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.
@@ -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
- rate: {
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
  {