@infrab4a/connect 4.0.0-beta.33 → 4.0.0-beta.35

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.
@@ -2360,6 +2360,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
2360
2360
  cleanShoppingCountFromIds() {
2361
2361
  return;
2362
2362
  }
2363
+ findCatalog(params) {
2364
+ return this.find(params);
2365
+ }
2363
2366
  }
2364
2367
 
2365
2368
  class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
@@ -3208,7 +3211,9 @@ const withFindHasuraGraphQL = (MixinBase) => {
3208
3211
  constructor() {
3209
3212
  super(...arguments);
3210
3213
  this.bindOrderByAttributes = (orderBy, fields) => Object.keys(orderBy).reduce((acc, current) => (Object.assign(Object.assign({}, acc), { [AttributeOptionHelper.FindByAttribute(current, fields)
3211
- .columnName]: orderBy[current] })), {});
3214
+ .columnName]: orderBy[current] === 'asc'
3215
+ ? 'asc_nulls_last'
3216
+ : 'desc_nulls_last' })), {});
3212
3217
  this.bindAggretageAttributes = (aggregates, fields) => {
3213
3218
  var _a, _b;
3214
3219
  return [
@@ -4039,11 +4044,13 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
4039
4044
  to: (value) => (isNil(value === null || value === void 0 ? void 0 : value.quantity) ? value : value === null || value === void 0 ? void 0 : value.quantity),
4040
4045
  },
4041
4046
  },
4047
+ { hasStock: { columnName: 'has_stock' } },
4042
4048
  'slug',
4043
4049
  'type',
4044
4050
  'video',
4045
4051
  'weight',
4046
4052
  'gender',
4053
+ { intGender: { columnName: 'int_gender' } },
4047
4054
  { tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
4048
4055
  { filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
4049
4056
  { isKit: { columnName: 'is_kit' } },
@@ -4236,6 +4243,11 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
4236
4243
  ], []);
4237
4244
  });
4238
4245
  }
4246
+ findCatalog(params, mainGender) {
4247
+ return __awaiter(this, void 0, void 0, function* () {
4248
+ return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign({ hasStock: 'desc', intGender: mainGender === 'female' ? 'desc' : 'asc' }, omit(params.orderBy, ['hasStock', 'intGender'])) }));
4249
+ });
4250
+ }
4239
4251
  updateCategories(productId, { categories }) {
4240
4252
  return __awaiter(this, void 0, void 0, function* () {
4241
4253
  if ('action' in categories && categories.action === 'remove') {
@@ -4485,6 +4497,7 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
4485
4497
  to: (value) => (isNil(value === null || value === void 0 ? void 0 : value.quantity) ? value : value === null || value === void 0 ? void 0 : value.quantity),
4486
4498
  },
4487
4499
  },
4500
+ { hasStock: { columnName: 'has_stock' } },
4488
4501
  'weight',
4489
4502
  { name: { to: () => '', from: () => undefined } },
4490
4503
  { hasVariants: { columnName: 'has_variants', to: () => false, from: () => undefined } },