@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.
@@ -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
- 'parentCollection_id',
3943
- 'parentCategory_id',
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
- rate: {
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
  {