@infrab4a/connect 5.3.0-beta.1 → 5.3.0-beta.3
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 +89 -3
- package/index.esm.js +89 -3
- package/package.json +1 -1
- package/src/domain/catalog/models/product-base.d.ts +3 -1
- package/src/domain/catalog/repositories/product.repository.d.ts +3 -0
- package/src/domain/catalog/repositories/variant.repository.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +4 -1
- package/src/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +3 -0
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -4891,6 +4891,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
4891
4891
|
productVariantFullReport() {
|
|
4892
4892
|
return;
|
|
4893
4893
|
}
|
|
4894
|
+
getByEAN(EAN, options) {
|
|
4895
|
+
return;
|
|
4896
|
+
}
|
|
4894
4897
|
}
|
|
4895
4898
|
tslib.__decorate([
|
|
4896
4899
|
Log(),
|
|
@@ -4916,6 +4919,9 @@ class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirest
|
|
|
4916
4919
|
});
|
|
4917
4920
|
this.parentRepository = parentRepository;
|
|
4918
4921
|
}
|
|
4922
|
+
getByEAN(EAN) {
|
|
4923
|
+
return;
|
|
4924
|
+
}
|
|
4919
4925
|
}
|
|
4920
4926
|
|
|
4921
4927
|
class SubscriptionProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
@@ -6152,7 +6158,8 @@ class CategoryProductOperationsHelper {
|
|
|
6152
6158
|
'isKit',
|
|
6153
6159
|
'sku',
|
|
6154
6160
|
'rate',
|
|
6155
|
-
'
|
|
6161
|
+
'tagsProfile',
|
|
6162
|
+
'tagsCollection',
|
|
6156
6163
|
'type',
|
|
6157
6164
|
'shoppingCount',
|
|
6158
6165
|
'gender',
|
|
@@ -7373,7 +7380,7 @@ const commonFields = [
|
|
|
7373
7380
|
'weight',
|
|
7374
7381
|
'gender',
|
|
7375
7382
|
{ intGender: { columnName: 'int_gender' } },
|
|
7376
|
-
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7383
|
+
// { tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7377
7384
|
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7378
7385
|
{ isKit: { columnName: 'is_kit' } },
|
|
7379
7386
|
{ createdAt: { columnName: 'created_at' } },
|
|
@@ -7391,6 +7398,9 @@ const commonFields = [
|
|
|
7391
7398
|
},
|
|
7392
7399
|
'group',
|
|
7393
7400
|
'validity',
|
|
7401
|
+
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7402
|
+
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7403
|
+
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7394
7404
|
];
|
|
7395
7405
|
const fieldsConfiguration$2 = [
|
|
7396
7406
|
...commonFields,
|
|
@@ -7448,6 +7458,22 @@ const fieldsConfiguration$2 = [
|
|
|
7448
7458
|
}),
|
|
7449
7459
|
},
|
|
7450
7460
|
},
|
|
7461
|
+
{
|
|
7462
|
+
variants: {
|
|
7463
|
+
columnName: 'variants',
|
|
7464
|
+
foreignKeyColumn: { product_id: 'id' },
|
|
7465
|
+
fields: [
|
|
7466
|
+
'id',
|
|
7467
|
+
'ean',
|
|
7468
|
+
'grade',
|
|
7469
|
+
'price',
|
|
7470
|
+
'published',
|
|
7471
|
+
'stock',
|
|
7472
|
+
{ tagsCollection: { columnName: 'tags_collection' } },
|
|
7473
|
+
{ tagsProfile: { columnName: 'tags_profile' } },
|
|
7474
|
+
],
|
|
7475
|
+
},
|
|
7476
|
+
},
|
|
7451
7477
|
];
|
|
7452
7478
|
class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
7453
7479
|
get reviewsFields() {
|
|
@@ -7573,6 +7599,39 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7573
7599
|
}
|
|
7574
7600
|
return product;
|
|
7575
7601
|
}
|
|
7602
|
+
async getByEAN(EAN, options) {
|
|
7603
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
7604
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7605
|
+
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
7606
|
+
if (cachedData) {
|
|
7607
|
+
this.logger.log(`Dados recuperados do cache: ${cacheKey}`);
|
|
7608
|
+
return this.model.toInstance(deserialize(cachedData));
|
|
7609
|
+
}
|
|
7610
|
+
}
|
|
7611
|
+
const result = await this.find({
|
|
7612
|
+
filters: {
|
|
7613
|
+
EAN,
|
|
7614
|
+
},
|
|
7615
|
+
fields: this.fields.map((field) => typeof field === 'string' ? field : Object.keys(field).shift()),
|
|
7616
|
+
options: {
|
|
7617
|
+
enableCount: false,
|
|
7618
|
+
},
|
|
7619
|
+
});
|
|
7620
|
+
if (!result.data.length)
|
|
7621
|
+
return null;
|
|
7622
|
+
const product = result?.data?.shift();
|
|
7623
|
+
RoundProductPricesHelper.roundProductPrices(product);
|
|
7624
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
7625
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7626
|
+
await this.cache.cacheAdapter.set({
|
|
7627
|
+
key: cacheKey,
|
|
7628
|
+
data: serialize(product),
|
|
7629
|
+
expirationInSeconds: options?.cache?.ttl || this.cache.ttlDefault,
|
|
7630
|
+
});
|
|
7631
|
+
this.logger.log(`Dados salvos no cache: ${cacheKey}`);
|
|
7632
|
+
}
|
|
7633
|
+
return product;
|
|
7634
|
+
}
|
|
7576
7635
|
async update(params) {
|
|
7577
7636
|
const { kitProducts, reviews, id: checkId, metadata, ...data } = lodash.omit(params, ['categories', 'rate']);
|
|
7578
7637
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
@@ -7817,6 +7876,12 @@ tslib.__decorate([
|
|
|
7817
7876
|
tslib.__metadata("design:paramtypes", [String, Object]),
|
|
7818
7877
|
tslib.__metadata("design:returntype", Promise)
|
|
7819
7878
|
], ProductHasuraGraphQLRepository.prototype, "getBySlug", null);
|
|
7879
|
+
tslib.__decorate([
|
|
7880
|
+
Log(),
|
|
7881
|
+
tslib.__metadata("design:type", Function),
|
|
7882
|
+
tslib.__metadata("design:paramtypes", [String, Object]),
|
|
7883
|
+
tslib.__metadata("design:returntype", Promise)
|
|
7884
|
+
], ProductHasuraGraphQLRepository.prototype, "getByEAN", null);
|
|
7820
7885
|
tslib.__decorate([
|
|
7821
7886
|
Log(),
|
|
7822
7887
|
tslib.__metadata("design:type", Function),
|
|
@@ -7872,6 +7937,13 @@ class ProductReviewHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHas
|
|
|
7872
7937
|
{ orderId: { columnName: 'order_id' } },
|
|
7873
7938
|
{ createdAt: { columnName: 'created_at' } },
|
|
7874
7939
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
7940
|
+
{
|
|
7941
|
+
product: {
|
|
7942
|
+
columnName: 'product',
|
|
7943
|
+
foreignKeyColumn: { id: 'productId' },
|
|
7944
|
+
fields: ['id', 'ean', 'sku', 'name', 'brand', 'slug', 'images', 'grade', 'gender'],
|
|
7945
|
+
},
|
|
7946
|
+
},
|
|
7875
7947
|
],
|
|
7876
7948
|
cache,
|
|
7877
7949
|
});
|
|
@@ -8063,8 +8135,11 @@ const fieldsConfiguration$1 = [
|
|
|
8063
8135
|
},
|
|
8064
8136
|
'group',
|
|
8065
8137
|
'validity',
|
|
8066
|
-
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8138
|
+
// { tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8067
8139
|
'published',
|
|
8140
|
+
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8141
|
+
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8142
|
+
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
8068
8143
|
];
|
|
8069
8144
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
8070
8145
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
@@ -8093,6 +8168,17 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8093
8168
|
const { filters, ...options } = params || {};
|
|
8094
8169
|
return super.find({ ...options, filters: { productId: { operator: exports.Where.ISNOTNULL }, ...filters } });
|
|
8095
8170
|
}
|
|
8171
|
+
async getByEAN(EAN) {
|
|
8172
|
+
const { data } = await this.find({
|
|
8173
|
+
filters: {
|
|
8174
|
+
EAN,
|
|
8175
|
+
},
|
|
8176
|
+
options: {
|
|
8177
|
+
enableCount: false,
|
|
8178
|
+
},
|
|
8179
|
+
});
|
|
8180
|
+
return data.at(0);
|
|
8181
|
+
}
|
|
8096
8182
|
async update(params) {
|
|
8097
8183
|
const { productId, id: checkId, ...data } = params;
|
|
8098
8184
|
const dataWithProductId = this.paramsToPlain({ id: checkId, productId });
|
package/index.esm.js
CHANGED
|
@@ -4866,6 +4866,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
4866
4866
|
productVariantFullReport() {
|
|
4867
4867
|
return;
|
|
4868
4868
|
}
|
|
4869
|
+
getByEAN(EAN, options) {
|
|
4870
|
+
return;
|
|
4871
|
+
}
|
|
4869
4872
|
}
|
|
4870
4873
|
__decorate([
|
|
4871
4874
|
Log(),
|
|
@@ -4891,6 +4894,9 @@ class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirest
|
|
|
4891
4894
|
});
|
|
4892
4895
|
this.parentRepository = parentRepository;
|
|
4893
4896
|
}
|
|
4897
|
+
getByEAN(EAN) {
|
|
4898
|
+
return;
|
|
4899
|
+
}
|
|
4894
4900
|
}
|
|
4895
4901
|
|
|
4896
4902
|
class SubscriptionProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
@@ -6127,7 +6133,8 @@ class CategoryProductOperationsHelper {
|
|
|
6127
6133
|
'isKit',
|
|
6128
6134
|
'sku',
|
|
6129
6135
|
'rate',
|
|
6130
|
-
'
|
|
6136
|
+
'tagsProfile',
|
|
6137
|
+
'tagsCollection',
|
|
6131
6138
|
'type',
|
|
6132
6139
|
'shoppingCount',
|
|
6133
6140
|
'gender',
|
|
@@ -7348,7 +7355,7 @@ const commonFields = [
|
|
|
7348
7355
|
'weight',
|
|
7349
7356
|
'gender',
|
|
7350
7357
|
{ intGender: { columnName: 'int_gender' } },
|
|
7351
|
-
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7358
|
+
// { tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7352
7359
|
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7353
7360
|
{ isKit: { columnName: 'is_kit' } },
|
|
7354
7361
|
{ createdAt: { columnName: 'created_at' } },
|
|
@@ -7366,6 +7373,9 @@ const commonFields = [
|
|
|
7366
7373
|
},
|
|
7367
7374
|
'group',
|
|
7368
7375
|
'validity',
|
|
7376
|
+
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7377
|
+
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7378
|
+
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7369
7379
|
];
|
|
7370
7380
|
const fieldsConfiguration$2 = [
|
|
7371
7381
|
...commonFields,
|
|
@@ -7423,6 +7433,22 @@ const fieldsConfiguration$2 = [
|
|
|
7423
7433
|
}),
|
|
7424
7434
|
},
|
|
7425
7435
|
},
|
|
7436
|
+
{
|
|
7437
|
+
variants: {
|
|
7438
|
+
columnName: 'variants',
|
|
7439
|
+
foreignKeyColumn: { product_id: 'id' },
|
|
7440
|
+
fields: [
|
|
7441
|
+
'id',
|
|
7442
|
+
'ean',
|
|
7443
|
+
'grade',
|
|
7444
|
+
'price',
|
|
7445
|
+
'published',
|
|
7446
|
+
'stock',
|
|
7447
|
+
{ tagsCollection: { columnName: 'tags_collection' } },
|
|
7448
|
+
{ tagsProfile: { columnName: 'tags_profile' } },
|
|
7449
|
+
],
|
|
7450
|
+
},
|
|
7451
|
+
},
|
|
7426
7452
|
];
|
|
7427
7453
|
class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
7428
7454
|
get reviewsFields() {
|
|
@@ -7548,6 +7574,39 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7548
7574
|
}
|
|
7549
7575
|
return product;
|
|
7550
7576
|
}
|
|
7577
|
+
async getByEAN(EAN, options) {
|
|
7578
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
7579
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7580
|
+
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
7581
|
+
if (cachedData) {
|
|
7582
|
+
this.logger.log(`Dados recuperados do cache: ${cacheKey}`);
|
|
7583
|
+
return this.model.toInstance(deserialize(cachedData));
|
|
7584
|
+
}
|
|
7585
|
+
}
|
|
7586
|
+
const result = await this.find({
|
|
7587
|
+
filters: {
|
|
7588
|
+
EAN,
|
|
7589
|
+
},
|
|
7590
|
+
fields: this.fields.map((field) => typeof field === 'string' ? field : Object.keys(field).shift()),
|
|
7591
|
+
options: {
|
|
7592
|
+
enableCount: false,
|
|
7593
|
+
},
|
|
7594
|
+
});
|
|
7595
|
+
if (!result.data.length)
|
|
7596
|
+
return null;
|
|
7597
|
+
const product = result?.data?.shift();
|
|
7598
|
+
RoundProductPricesHelper.roundProductPrices(product);
|
|
7599
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
7600
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7601
|
+
await this.cache.cacheAdapter.set({
|
|
7602
|
+
key: cacheKey,
|
|
7603
|
+
data: serialize(product),
|
|
7604
|
+
expirationInSeconds: options?.cache?.ttl || this.cache.ttlDefault,
|
|
7605
|
+
});
|
|
7606
|
+
this.logger.log(`Dados salvos no cache: ${cacheKey}`);
|
|
7607
|
+
}
|
|
7608
|
+
return product;
|
|
7609
|
+
}
|
|
7551
7610
|
async update(params) {
|
|
7552
7611
|
const { kitProducts, reviews, id: checkId, metadata, ...data } = omit(params, ['categories', 'rate']);
|
|
7553
7612
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
@@ -7792,6 +7851,12 @@ __decorate([
|
|
|
7792
7851
|
__metadata("design:paramtypes", [String, Object]),
|
|
7793
7852
|
__metadata("design:returntype", Promise)
|
|
7794
7853
|
], ProductHasuraGraphQLRepository.prototype, "getBySlug", null);
|
|
7854
|
+
__decorate([
|
|
7855
|
+
Log(),
|
|
7856
|
+
__metadata("design:type", Function),
|
|
7857
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
7858
|
+
__metadata("design:returntype", Promise)
|
|
7859
|
+
], ProductHasuraGraphQLRepository.prototype, "getByEAN", null);
|
|
7795
7860
|
__decorate([
|
|
7796
7861
|
Log(),
|
|
7797
7862
|
__metadata("design:type", Function),
|
|
@@ -7847,6 +7912,13 @@ class ProductReviewHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHas
|
|
|
7847
7912
|
{ orderId: { columnName: 'order_id' } },
|
|
7848
7913
|
{ createdAt: { columnName: 'created_at' } },
|
|
7849
7914
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
7915
|
+
{
|
|
7916
|
+
product: {
|
|
7917
|
+
columnName: 'product',
|
|
7918
|
+
foreignKeyColumn: { id: 'productId' },
|
|
7919
|
+
fields: ['id', 'ean', 'sku', 'name', 'brand', 'slug', 'images', 'grade', 'gender'],
|
|
7920
|
+
},
|
|
7921
|
+
},
|
|
7850
7922
|
],
|
|
7851
7923
|
cache,
|
|
7852
7924
|
});
|
|
@@ -8038,8 +8110,11 @@ const fieldsConfiguration$1 = [
|
|
|
8038
8110
|
},
|
|
8039
8111
|
'group',
|
|
8040
8112
|
'validity',
|
|
8041
|
-
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8113
|
+
// { tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8042
8114
|
'published',
|
|
8115
|
+
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8116
|
+
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8117
|
+
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
8043
8118
|
];
|
|
8044
8119
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
8045
8120
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
@@ -8068,6 +8143,17 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8068
8143
|
const { filters, ...options } = params || {};
|
|
8069
8144
|
return super.find({ ...options, filters: { productId: { operator: Where.ISNOTNULL }, ...filters } });
|
|
8070
8145
|
}
|
|
8146
|
+
async getByEAN(EAN) {
|
|
8147
|
+
const { data } = await this.find({
|
|
8148
|
+
filters: {
|
|
8149
|
+
EAN,
|
|
8150
|
+
},
|
|
8151
|
+
options: {
|
|
8152
|
+
enableCount: false,
|
|
8153
|
+
},
|
|
8154
|
+
});
|
|
8155
|
+
return data.at(0);
|
|
8156
|
+
}
|
|
8071
8157
|
async update(params) {
|
|
8072
8158
|
const { productId, id: checkId, ...data } = params;
|
|
8073
8159
|
const dataWithProductId = this.paramsToPlain({ id: checkId, productId });
|
package/package.json
CHANGED
|
@@ -23,7 +23,8 @@ export declare class ProductBase<T extends ProductBase<T, I>, I = ProductIdentif
|
|
|
23
23
|
createdAt?: Date;
|
|
24
24
|
updatedAt?: Date;
|
|
25
25
|
brand: string;
|
|
26
|
-
|
|
26
|
+
tagsCollection?: string[];
|
|
27
|
+
tagsProfile?: string[];
|
|
27
28
|
filters?: string[];
|
|
28
29
|
type?: string;
|
|
29
30
|
categories?: string[];
|
|
@@ -37,6 +38,7 @@ export declare class ProductBase<T extends ProductBase<T, I>, I = ProductIdentif
|
|
|
37
38
|
label?: ProductLabel;
|
|
38
39
|
group?: number;
|
|
39
40
|
validity: boolean;
|
|
41
|
+
daysOfUse?: number;
|
|
40
42
|
category: Category;
|
|
41
43
|
kitProducts?: KitProduct[];
|
|
42
44
|
reviews?: ProductReview[];
|
|
@@ -23,6 +23,9 @@ export interface ProductRepository extends CrudRepository<Product> {
|
|
|
23
23
|
getBySlug(slug: string, options?: {
|
|
24
24
|
cache?: RepositoryCacheOptions;
|
|
25
25
|
}): Promise<Product>;
|
|
26
|
+
getByEAN(EAN: string, options?: {
|
|
27
|
+
cache?: RepositoryCacheOptions;
|
|
28
|
+
}): Promise<Product>;
|
|
26
29
|
fetchReviews(status: ReviewStatusParams, options?: {
|
|
27
30
|
cache?: RepositoryCacheOptions;
|
|
28
31
|
}): Promise<ReviewWithProductData[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FindRepositoryParams, PaginatedReviewFilters, Product, ProductRepository, ProductVariantReport, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
1
|
+
import { FindRepositoryParams, PaginatedReviewFilters, Product, ProductRepository, ProductVariantReport, RepositoryCacheOptions, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
2
2
|
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
3
|
declare const ProductFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<Product> & import("../../../../../domain").CrudRepository<Product, import("../../../../../domain").CrudParams<Product>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<Product>, ...any[]]>;
|
|
4
4
|
export declare class ProductFirestoreRepository extends ProductFirestoreRepository_base implements ProductRepository {
|
|
@@ -11,5 +11,8 @@ export declare class ProductFirestoreRepository extends ProductFirestoreReposito
|
|
|
11
11
|
findCatalog(params: FindRepositoryParams<Product>): Promise<RepositoryFindResult<Product>>;
|
|
12
12
|
fetchPaginatedReviews(): Promise<ReviewWithProductData[]>;
|
|
13
13
|
productVariantFullReport(): Promise<ProductVariantReport[]>;
|
|
14
|
+
getByEAN(EAN: string, options?: {
|
|
15
|
+
cache?: RepositoryCacheOptions;
|
|
16
|
+
}): Promise<Product>;
|
|
14
17
|
}
|
|
15
18
|
export {};
|
package/src/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ declare const ProductVariantFirestoreRepository_base: import("../../../../../uti
|
|
|
8
8
|
export declare class ProductVariantFirestoreRepository extends ProductVariantFirestoreRepository_base implements VariantRepository {
|
|
9
9
|
readonly parentRepository: ProductFirestoreRepository;
|
|
10
10
|
constructor({ firestore, interceptors }: Pick<FirestoreConstructorParams<Variant>, 'firestore' | 'interceptors'>, parentRepository: ProductFirestoreRepository);
|
|
11
|
+
getByEAN(EAN: string): Promise<Variant>;
|
|
11
12
|
}
|
|
12
13
|
export {};
|
package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQL
|
|
|
15
15
|
getBySlug(slug: string, options?: {
|
|
16
16
|
cache?: RepositoryCacheOptions;
|
|
17
17
|
}): Promise<ProductHasuraGraphQL>;
|
|
18
|
+
getByEAN(EAN: string, options?: {
|
|
19
|
+
cache?: RepositoryCacheOptions;
|
|
20
|
+
}): Promise<ProductHasuraGraphQL>;
|
|
18
21
|
update(params: UpdateRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
19
22
|
fetchProductReviews(filters: PaginatedReviewFilters, options?: {
|
|
20
23
|
cache?: RepositoryCacheOptions;
|
package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare class VariantHasuraGraphQLRepository extends VariantHasuraGraphQL
|
|
|
6
6
|
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<VariantHasuraGraphQL>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>);
|
|
7
7
|
get(identifiers: GetRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
8
8
|
find(params?: FindRepositoryParams<VariantHasuraGraphQL>): Promise<RepositoryFindResult<VariantHasuraGraphQL>>;
|
|
9
|
+
getByEAN(EAN: string): Promise<VariantHasuraGraphQL>;
|
|
9
10
|
update(params: UpdateRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
10
11
|
private getId;
|
|
11
12
|
}
|