@infrab4a/connect 4.0.0-beta.33 → 4.0.0-beta.34
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/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 +11 -0
- package/fesm2015/infrab4a-connect.mjs.map +1 -1
- package/fesm2020/infrab4a-connect.mjs +17 -0
- 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) {
|
|
@@ -3998,11 +4001,13 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
3998
4001
|
to: (value) => (isNil(value?.quantity) ? value : value?.quantity),
|
|
3999
4002
|
},
|
|
4000
4003
|
},
|
|
4004
|
+
{ hasStock: { columnName: 'has_stock' } },
|
|
4001
4005
|
'slug',
|
|
4002
4006
|
'type',
|
|
4003
4007
|
'video',
|
|
4004
4008
|
'weight',
|
|
4005
4009
|
'gender',
|
|
4010
|
+
{ intGender: { columnName: 'int_gender' } },
|
|
4006
4011
|
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4007
4012
|
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4008
4013
|
{ isKit: { columnName: 'is_kit' } },
|
|
@@ -4177,6 +4182,17 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4177
4182
|
})),
|
|
4178
4183
|
], []);
|
|
4179
4184
|
}
|
|
4185
|
+
async findCatalog(params, mainGender) {
|
|
4186
|
+
return this.find({
|
|
4187
|
+
...params,
|
|
4188
|
+
filters: { ...params.filters, published: true },
|
|
4189
|
+
orderBy: {
|
|
4190
|
+
hasStock: 'desc',
|
|
4191
|
+
intGender: mainGender === 'female' ? 'desc' : 'asc',
|
|
4192
|
+
...omit(params.orderBy, ['hasStock', 'intGender']),
|
|
4193
|
+
},
|
|
4194
|
+
});
|
|
4195
|
+
}
|
|
4180
4196
|
async updateCategories(productId, { categories }) {
|
|
4181
4197
|
if ('action' in categories && categories.action === 'remove') {
|
|
4182
4198
|
await this.mutation('delete_category_product', ['affected_rows'], {
|
|
@@ -4424,6 +4440,7 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4424
4440
|
to: (value) => (isNil(value?.quantity) ? value : value?.quantity),
|
|
4425
4441
|
},
|
|
4426
4442
|
},
|
|
4443
|
+
{ hasStock: { columnName: 'has_stock' } },
|
|
4427
4444
|
'weight',
|
|
4428
4445
|
{ name: { to: () => '', from: () => undefined } },
|
|
4429
4446
|
{ hasVariants: { columnName: 'has_variants', to: () => false, from: () => undefined } },
|