@infrab4a/connect 4.3.9-beta.12 → 4.3.9-beta.14

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/index.cjs.js CHANGED
@@ -4114,7 +4114,7 @@ const withFindHasuraGraphQL = (MixinBase) => {
4114
4114
  ...acc,
4115
4115
  {
4116
4116
  [AttributeOptionHelper.FindByAttribute(current, fields)
4117
- .columnName]: orderBy[current] === 'asc' ? 'asc' : 'desc',
4117
+ .columnName]: orderBy[current],
4118
4118
  },
4119
4119
  ], []);
4120
4120
  this.bindAggretageAttributes = (aggregates, fields) => {
@@ -5175,7 +5175,12 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
5175
5175
  ], []);
5176
5176
  }
5177
5177
  async findCatalog(params, mainGender) {
5178
- return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign({ hasStock: 'desc' }, (!mainGender ? {} : { intGender: mainGender === 'female' ? 'desc' : 'asc' })), lodash.omit(params.orderBy, ['hasStock', 'intGender'])) }));
5178
+ return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign(Object.assign({}, lodash.omit(params.orderBy, ['hasStock', 'intGender'])), { hasStock: 'desc' }), (!mainGender ? {} : { intGender: mainGender === 'female' ? 'desc' : 'asc' })) }));
5179
+ // order by stock tbm maior menor
5180
+ // sempre duas condições
5181
+ // verificar se tem empate
5182
+ // null tá aparecendo primeiro no melhor rating
5183
+ // testear com desc null last e verificar empate
5179
5184
  }
5180
5185
  async updateCategories(productId, { categories }) {
5181
5186
  if ('action' in categories && categories.action === 'remove') {
package/index.esm.js CHANGED
@@ -4090,7 +4090,7 @@ const withFindHasuraGraphQL = (MixinBase) => {
4090
4090
  ...acc,
4091
4091
  {
4092
4092
  [AttributeOptionHelper.FindByAttribute(current, fields)
4093
- .columnName]: orderBy[current] === 'asc' ? 'asc' : 'desc',
4093
+ .columnName]: orderBy[current],
4094
4094
  },
4095
4095
  ], []);
4096
4096
  this.bindAggretageAttributes = (aggregates, fields) => {
@@ -5151,7 +5151,12 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
5151
5151
  ], []);
5152
5152
  }
5153
5153
  async findCatalog(params, mainGender) {
5154
- return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign({ hasStock: 'desc' }, (!mainGender ? {} : { intGender: mainGender === 'female' ? 'desc' : 'asc' })), omit(params.orderBy, ['hasStock', 'intGender'])) }));
5154
+ return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign(Object.assign({}, omit(params.orderBy, ['hasStock', 'intGender'])), { hasStock: 'desc' }), (!mainGender ? {} : { intGender: mainGender === 'female' ? 'desc' : 'asc' })) }));
5155
+ // order by stock tbm maior menor
5156
+ // sempre duas condições
5157
+ // verificar se tem empate
5158
+ // null tá aparecendo primeiro no melhor rating
5159
+ // testear com desc null last e verificar empate
5155
5160
  }
5156
5161
  async updateCategories(productId, { categories }) {
5157
5162
  if ('action' in categories && categories.action === 'remove') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.3.9-beta.12",
3
+ "version": "4.3.9-beta.14",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -1,5 +1,5 @@
1
1
  import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
2
2
  export type RepositoryOrderBy<Model> = {
3
- [key in NonFunctionAndIdentifierPropertyNames<Model>]?: 'asc' | 'desc';
3
+ [key in NonFunctionAndIdentifierPropertyNames<Model>]?: 'asc' | 'desc' | 'desc_nulls_last' | 'asc_nulls_last';
4
4
  };
5
5
  export type RepositoryOrderByList<Model> = RepositoryOrderBy<Model>[];