@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.
- package/domain/catalog/repositories/product.repository.d.ts +3 -1
- package/esm2020/domain/catalog/repositories/product.repository.mjs +1 -1
- package/esm2020/infra/firebase/firestore/repositories/catalog/product-firestore.repository.mjs +5 -2
- package/esm2020/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.mjs +4 -2
- package/esm2020/infra/hasura-graphql/models/product-hasura-graphql.mjs +1 -1
- package/esm2020/infra/hasura-graphql/models/variant-hasura-graphql.mjs +1 -1
- package/esm2020/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.mjs +14 -1
- package/esm2020/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.mjs +2 -1
- package/fesm2015/infrab4a-connect.mjs +14 -1
- package/fesm2015/infrab4a-connect.mjs.map +1 -1
- package/fesm2020/infrab4a-connect.mjs +20 -1
- package/fesm2020/infrab4a-connect.mjs.map +1 -1
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +2 -1
- package/infra/hasura-graphql/models/product-hasura-graphql.d.ts +2 -0
- package/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +1 -0
- package/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2305,6 +2305,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
2305
2305
|
cleanShoppingCountFromIds() {
|
|
2306
2306
|
return;
|
|
2307
2307
|
}
|
|
2308
|
+
findCatalog(params) {
|
|
2309
|
+
return this.find(params);
|
|
2310
|
+
}
|
|
2308
2311
|
}
|
|
2309
2312
|
|
|
2310
2313
|
class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
|
|
@@ -3170,7 +3173,9 @@ const withFindHasuraGraphQL = (MixinBase) => {
|
|
|
3170
3173
|
this.bindOrderByAttributes = (orderBy, fields) => Object.keys(orderBy).reduce((acc, current) => ({
|
|
3171
3174
|
...acc,
|
|
3172
3175
|
[AttributeOptionHelper.FindByAttribute(current, fields)
|
|
3173
|
-
.columnName]: orderBy[current]
|
|
3176
|
+
.columnName]: orderBy[current] === 'asc'
|
|
3177
|
+
? 'asc_nulls_last'
|
|
3178
|
+
: 'desc_nulls_last',
|
|
3174
3179
|
}), {});
|
|
3175
3180
|
this.bindAggretageAttributes = (aggregates, fields) => [
|
|
3176
3181
|
...(aggregates?.minimal?.length
|
|
@@ -3998,11 +4003,13 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
3998
4003
|
to: (value) => (isNil(value?.quantity) ? value : value?.quantity),
|
|
3999
4004
|
},
|
|
4000
4005
|
},
|
|
4006
|
+
{ hasStock: { columnName: 'has_stock' } },
|
|
4001
4007
|
'slug',
|
|
4002
4008
|
'type',
|
|
4003
4009
|
'video',
|
|
4004
4010
|
'weight',
|
|
4005
4011
|
'gender',
|
|
4012
|
+
{ intGender: { columnName: 'int_gender' } },
|
|
4006
4013
|
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4007
4014
|
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4008
4015
|
{ isKit: { columnName: 'is_kit' } },
|
|
@@ -4177,6 +4184,17 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4177
4184
|
})),
|
|
4178
4185
|
], []);
|
|
4179
4186
|
}
|
|
4187
|
+
async findCatalog(params, mainGender) {
|
|
4188
|
+
return this.find({
|
|
4189
|
+
...params,
|
|
4190
|
+
filters: { ...params.filters, published: true },
|
|
4191
|
+
orderBy: {
|
|
4192
|
+
hasStock: 'desc',
|
|
4193
|
+
intGender: mainGender === 'female' ? 'desc' : 'asc',
|
|
4194
|
+
...omit(params.orderBy, ['hasStock', 'intGender']),
|
|
4195
|
+
},
|
|
4196
|
+
});
|
|
4197
|
+
}
|
|
4180
4198
|
async updateCategories(productId, { categories }) {
|
|
4181
4199
|
if ('action' in categories && categories.action === 'remove') {
|
|
4182
4200
|
await this.mutation('delete_category_product', ['affected_rows'], {
|
|
@@ -4424,6 +4442,7 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4424
4442
|
to: (value) => (isNil(value?.quantity) ? value : value?.quantity),
|
|
4425
4443
|
},
|
|
4426
4444
|
},
|
|
4445
|
+
{ hasStock: { columnName: 'has_stock' } },
|
|
4427
4446
|
'weight',
|
|
4428
4447
|
{ name: { to: () => '', from: () => undefined } },
|
|
4429
4448
|
{ hasVariants: { columnName: 'has_variants', to: () => false, from: () => undefined } },
|