@infrab4a/connect 4.9.7-beta.2 → 4.9.7-beta.20
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 +284 -81
- package/index.esm.js +283 -82
- package/package.json +1 -1
- package/src/domain/catalog/models/category-base.d.ts +17 -1
- package/src/domain/catalog/models/filter.d.ts +3 -1
- package/src/domain/catalog/models/types/category-images.type.d.ts +8 -0
- package/src/domain/catalog/models/types/category-metadata.type.d.ts +2 -0
- package/src/domain/catalog/models/types/category-most-relevant.type.d.ts +4 -0
- package/src/domain/catalog/models/types/index.d.ts +3 -0
- package/src/domain/catalog/models/types/report-stock-notification.type.d.ts +21 -0
- package/src/domain/catalog/models/wishlist.d.ts +3 -0
- package/src/domain/catalog/repositories/product-stock-notification.repository.d.ts +9 -1
- package/src/domain/catalog/repositories/wishlist.repository.d.ts +3 -0
- package/src/domain/shopping/index.d.ts +1 -0
- package/src/domain/shopping/models/coupons/coupon.d.ts +1 -1
- package/src/domain/shopping/models/index.d.ts +1 -0
- package/src/domain/shopping/models/order-blocked.d.ts +26 -0
- package/src/domain/shopping/repositories/index.d.ts +1 -0
- package/src/domain/shopping/repositories/order-blocked.repository.d.ts +6 -0
- package/src/domain/shopping/types/index.d.ts +1 -0
- package/src/domain/shopping/types/payment-card-info.type.d.ts +4 -0
- package/src/domain/users/models/enums/index.d.ts +1 -0
- package/src/domain/users/models/enums/person-types.enum.d.ts +5 -0
- package/src/domain/users/models/index.d.ts +3 -2
- package/src/domain/users/models/types/index.d.ts +1 -0
- package/src/domain/users/models/types/person.type.d.ts +2 -0
- package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/shopping/order-blocked-firestore.repository.ts.d.ts +9 -0
- package/src/infra/hasura-graphql/models/wishlist-hasura-graphql.d.ts +4 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-stock-notification-hasura-graphql.repository.d.ts +8 -1
- package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts +11 -9
package/index.esm.js
CHANGED
|
@@ -36,6 +36,21 @@ class BaseModel {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
var GenderDestination;
|
|
40
|
+
(function (GenderDestination) {
|
|
41
|
+
GenderDestination["FEMALE"] = "female";
|
|
42
|
+
GenderDestination["MALE"] = "male";
|
|
43
|
+
GenderDestination["UNISEX"] = "unisex";
|
|
44
|
+
})(GenderDestination || (GenderDestination = {}));
|
|
45
|
+
|
|
46
|
+
var Shops;
|
|
47
|
+
(function (Shops) {
|
|
48
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
49
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
50
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
51
|
+
Shops["ALL"] = "ALL";
|
|
52
|
+
})(Shops || (Shops = {}));
|
|
53
|
+
|
|
39
54
|
class Filter extends BaseModel {
|
|
40
55
|
static get identifiersFields() {
|
|
41
56
|
return ['id'];
|
|
@@ -50,6 +65,33 @@ class CategoryBase extends BaseModel {
|
|
|
50
65
|
static get identifiersFields() {
|
|
51
66
|
return ['id'];
|
|
52
67
|
}
|
|
68
|
+
get glamImages() {
|
|
69
|
+
return this.images && this.images[Shops.GLAMSHOP]
|
|
70
|
+
? this.images[Shops.GLAMSHOP]
|
|
71
|
+
: {
|
|
72
|
+
brandBanner: null,
|
|
73
|
+
brandBannerMobile: null,
|
|
74
|
+
image: null,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
get mensImages() {
|
|
78
|
+
return this.images && this.images[Shops.MENSMARKET]
|
|
79
|
+
? this.images[Shops.MENSMARKET]
|
|
80
|
+
: {
|
|
81
|
+
brandBanner: null,
|
|
82
|
+
brandBannerMobile: null,
|
|
83
|
+
image: null,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
get glamMetadata() {
|
|
87
|
+
return this.metadatas.find((metadata) => metadata.shop === Shops.GLAMSHOP);
|
|
88
|
+
}
|
|
89
|
+
get mensMetadata() {
|
|
90
|
+
return this.metadatas.find((metadata) => metadata.shop === Shops.MENSMARKET);
|
|
91
|
+
}
|
|
92
|
+
getMostRelevantByShop(shop) {
|
|
93
|
+
return this.mostRelevants && this.mostRelevants[shop] ? this.mostRelevants[shop] : [];
|
|
94
|
+
}
|
|
53
95
|
}
|
|
54
96
|
__decorate([
|
|
55
97
|
Type(() => CategoryBase),
|
|
@@ -158,21 +200,6 @@ __decorate([
|
|
|
158
200
|
__metadata("design:type", Category)
|
|
159
201
|
], CategoryFilter.prototype, "category", void 0);
|
|
160
202
|
|
|
161
|
-
var GenderDestination;
|
|
162
|
-
(function (GenderDestination) {
|
|
163
|
-
GenderDestination["FEMALE"] = "female";
|
|
164
|
-
GenderDestination["MALE"] = "male";
|
|
165
|
-
GenderDestination["UNISEX"] = "unisex";
|
|
166
|
-
})(GenderDestination || (GenderDestination = {}));
|
|
167
|
-
|
|
168
|
-
var Shops;
|
|
169
|
-
(function (Shops) {
|
|
170
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
171
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
172
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
173
|
-
Shops["ALL"] = "ALL";
|
|
174
|
-
})(Shops || (Shops = {}));
|
|
175
|
-
|
|
176
203
|
class FilterOption extends BaseModel {
|
|
177
204
|
static get identifiersFields() {
|
|
178
205
|
return ['id'];
|
|
@@ -265,6 +292,17 @@ class CampaignHashtag extends BaseModel {
|
|
|
265
292
|
}
|
|
266
293
|
}
|
|
267
294
|
|
|
295
|
+
class BeautyProfile extends BaseModel {
|
|
296
|
+
toPlain() {
|
|
297
|
+
const plain = super.toPlain();
|
|
298
|
+
delete plain.id;
|
|
299
|
+
return plain;
|
|
300
|
+
}
|
|
301
|
+
static get identifiersFields() {
|
|
302
|
+
return ['id', 'userId'];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
268
306
|
var AccessoryImportances;
|
|
269
307
|
(function (AccessoryImportances) {
|
|
270
308
|
AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
@@ -441,6 +479,13 @@ var OfficePosition;
|
|
|
441
479
|
OfficePosition["Director"] = "Diretor";
|
|
442
480
|
})(OfficePosition || (OfficePosition = {}));
|
|
443
481
|
|
|
482
|
+
var PersonTypes;
|
|
483
|
+
(function (PersonTypes) {
|
|
484
|
+
PersonTypes["GLAMGIRL"] = "glamgirl";
|
|
485
|
+
PersonTypes["BFLU"] = "bflu";
|
|
486
|
+
PersonTypes["NONE"] = "none";
|
|
487
|
+
})(PersonTypes || (PersonTypes = {}));
|
|
488
|
+
|
|
444
489
|
var ProductSpents;
|
|
445
490
|
(function (ProductSpents) {
|
|
446
491
|
ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
|
|
@@ -461,6 +506,12 @@ var UserType;
|
|
|
461
506
|
UserType["Influencer"] = "Influencer";
|
|
462
507
|
})(UserType || (UserType = {}));
|
|
463
508
|
|
|
509
|
+
class Lead extends BaseModel {
|
|
510
|
+
static get identifiersFields() {
|
|
511
|
+
return ['id'];
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
464
515
|
class Edition extends BaseModel {
|
|
465
516
|
static get identifiersFields() {
|
|
466
517
|
return ['id', 'subscriptionId'];
|
|
@@ -1859,17 +1910,6 @@ class SubscriptionPlan extends BaseModel {
|
|
|
1859
1910
|
}
|
|
1860
1911
|
}
|
|
1861
1912
|
|
|
1862
|
-
class BeautyProfile extends BaseModel {
|
|
1863
|
-
toPlain() {
|
|
1864
|
-
const plain = super.toPlain();
|
|
1865
|
-
delete plain.id;
|
|
1866
|
-
return plain;
|
|
1867
|
-
}
|
|
1868
|
-
static get identifiersFields() {
|
|
1869
|
-
return ['id', 'userId'];
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
1913
|
class User extends BaseModel {
|
|
1874
1914
|
static toInstance(data) {
|
|
1875
1915
|
const instance = super.toInstance(data);
|
|
@@ -1983,12 +2023,6 @@ class UserPaymentMethod extends BaseModel {
|
|
|
1983
2023
|
}
|
|
1984
2024
|
}
|
|
1985
2025
|
|
|
1986
|
-
class Lead extends BaseModel {
|
|
1987
|
-
static get identifiersFields() {
|
|
1988
|
-
return ['id'];
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
2026
|
class UnauthorizedError extends CustomError {
|
|
1993
2027
|
constructor(message) {
|
|
1994
2028
|
super(message);
|
|
@@ -2161,6 +2195,12 @@ __decorate([
|
|
|
2161
2195
|
__metadata("design:type", Payment)
|
|
2162
2196
|
], Order.prototype, "payment", void 0);
|
|
2163
2197
|
|
|
2198
|
+
class OrderBlocked extends BaseModel {
|
|
2199
|
+
static get identifiersFields() {
|
|
2200
|
+
return ['id'];
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2164
2204
|
class CheckoutSubscription extends BaseModel {
|
|
2165
2205
|
static get identifiersFields() {
|
|
2166
2206
|
return ['id'];
|
|
@@ -2986,6 +3026,8 @@ const withUpdateFirestore = (MixinBase) => {
|
|
|
2986
3026
|
try {
|
|
2987
3027
|
const identifiers = getValueFromParams(data, keyField);
|
|
2988
3028
|
const docRef = this.collection(collectionName).getDoc(identifiers.toString());
|
|
3029
|
+
if (!(await docRef.get()).data())
|
|
3030
|
+
throw new NotFoundError(`Document '${collectionName}/${Object.values(identifiers.toString())}' not found`);
|
|
2989
3031
|
const plainFromData = this.model.toInstance(this.paramsToPlain(data));
|
|
2990
3032
|
const intercepted = await ((_b = (_a = this.interceptors) === null || _a === void 0 ? void 0 : _a.request) === null || _b === void 0 ? void 0 : _b.call(_a, { instance: plainFromData }));
|
|
2991
3033
|
const builded = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.instance) || plainFromData;
|
|
@@ -3550,6 +3592,47 @@ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
|
3550
3592
|
}
|
|
3551
3593
|
}
|
|
3552
3594
|
|
|
3595
|
+
class OrderBlockedFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3596
|
+
constructor({ firestore, interceptors, }) {
|
|
3597
|
+
super({
|
|
3598
|
+
firestore,
|
|
3599
|
+
collectionName: 'paymentBlockedAttempts',
|
|
3600
|
+
model: OrderBlocked,
|
|
3601
|
+
interceptors,
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3604
|
+
async createBlockedOrderOrPayment(checkout, blockType, type, limiteRange, card = null) {
|
|
3605
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3606
|
+
return this.create(OrderBlocked.toInstance({
|
|
3607
|
+
customer: {
|
|
3608
|
+
name: ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.displayName) || '',
|
|
3609
|
+
cpf: ((_b = checkout.user) === null || _b === void 0 ? void 0 : _b.cpf) || '',
|
|
3610
|
+
id: (_c = checkout.user) === null || _c === void 0 ? void 0 : _c.id,
|
|
3611
|
+
email: ((_d = checkout.user) === null || _d === void 0 ? void 0 : _d.email) || '',
|
|
3612
|
+
phoneNumber: '+55' + ((_e = checkout.user) === null || _e === void 0 ? void 0 : _e.phone),
|
|
3613
|
+
isSubscriber: (_f = checkout.user) === null || _f === void 0 ? void 0 : _f.isSubscriber,
|
|
3614
|
+
subscriptionPlan: ((_g = checkout.user) === null || _g === void 0 ? void 0 : _g.subscriptionPlan) || '',
|
|
3615
|
+
shippingAddress: Object.assign(Object.assign({}, checkout.shippingAddress), { zip: this.formatZip((_h = checkout.shippingAddress) === null || _h === void 0 ? void 0 : _h.zip) }),
|
|
3616
|
+
},
|
|
3617
|
+
blockType,
|
|
3618
|
+
limiteRange,
|
|
3619
|
+
type,
|
|
3620
|
+
card,
|
|
3621
|
+
checkout: {
|
|
3622
|
+
id: checkout.id,
|
|
3623
|
+
shop: checkout.shop,
|
|
3624
|
+
total: checkout.totalPrice,
|
|
3625
|
+
},
|
|
3626
|
+
date: new Date(),
|
|
3627
|
+
}));
|
|
3628
|
+
}
|
|
3629
|
+
formatZip(zip) {
|
|
3630
|
+
if (zip.length === 8)
|
|
3631
|
+
return zip.substring(0, 5) + '-' + zip.substring(5, 8);
|
|
3632
|
+
return zip;
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3553
3636
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3554
3637
|
constructor({ firestore, interceptors }) {
|
|
3555
3638
|
super({
|
|
@@ -4205,7 +4288,7 @@ const withHasuraGraphQL = (MixinBase) => {
|
|
|
4205
4288
|
const response = await axios(request);
|
|
4206
4289
|
if (!isNil(response.data.errors)) {
|
|
4207
4290
|
this.logger.error({ req: request, res: response.data.errors });
|
|
4208
|
-
throw new Error(response.data.errors);
|
|
4291
|
+
throw new Error(JSON.stringify(response.data.errors));
|
|
4209
4292
|
}
|
|
4210
4293
|
this.logger.log({ req: request, res: response.data });
|
|
4211
4294
|
return response.data.data;
|
|
@@ -4572,6 +4655,7 @@ class CategoryFilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
4572
4655
|
fields: [
|
|
4573
4656
|
'id',
|
|
4574
4657
|
'description',
|
|
4658
|
+
'title',
|
|
4575
4659
|
'slug',
|
|
4576
4660
|
'enabled',
|
|
4577
4661
|
{ createdAt: { columnName: 'created_at' } },
|
|
@@ -4683,6 +4767,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4683
4767
|
'name',
|
|
4684
4768
|
'description',
|
|
4685
4769
|
'image',
|
|
4770
|
+
{ images: { columnName: 'images', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4686
4771
|
'published',
|
|
4687
4772
|
'shop',
|
|
4688
4773
|
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
@@ -4715,7 +4800,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4715
4800
|
filters: {
|
|
4716
4801
|
columnName: 'filters',
|
|
4717
4802
|
foreignKeyColumn: { filter_id: 'id' },
|
|
4718
|
-
fields: [{ filter: ['id', 'description', 'slug', 'enabled'] }],
|
|
4803
|
+
fields: [{ filter: ['id', 'title', 'description', 'slug', 'enabled'] }],
|
|
4719
4804
|
bindPersistData: (value) => ({
|
|
4720
4805
|
filters: { data: value.map((filter) => ({ filter_id: filter.id })) },
|
|
4721
4806
|
}),
|
|
@@ -4738,12 +4823,21 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4738
4823
|
{
|
|
4739
4824
|
metadata: {
|
|
4740
4825
|
columnName: 'metadata',
|
|
4741
|
-
fields: ['title', 'description'],
|
|
4826
|
+
fields: ['shop', 'title', 'description'],
|
|
4742
4827
|
bindPersistData: (value) => ({
|
|
4743
4828
|
metadata: { data: value },
|
|
4744
4829
|
}),
|
|
4745
4830
|
},
|
|
4746
4831
|
},
|
|
4832
|
+
{
|
|
4833
|
+
metadatas: {
|
|
4834
|
+
columnName: 'metadatas',
|
|
4835
|
+
fields: ['shop', 'title', 'description'],
|
|
4836
|
+
bindPersistData: (value) => ({
|
|
4837
|
+
metadatas: { data: value },
|
|
4838
|
+
}),
|
|
4839
|
+
},
|
|
4840
|
+
},
|
|
4747
4841
|
{ isCollection: { columnName: 'is_collection' } },
|
|
4748
4842
|
{ isWishlist: { columnName: 'is_wishlist' } },
|
|
4749
4843
|
'reference',
|
|
@@ -4758,14 +4852,29 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4758
4852
|
'theme',
|
|
4759
4853
|
{ bannerUrl: { columnName: 'banner_url' } },
|
|
4760
4854
|
{ mostRelevant: { columnName: 'most_relevant', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4855
|
+
{ mostRelevants: { columnName: 'most_relevants', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4761
4856
|
],
|
|
4762
4857
|
});
|
|
4763
4858
|
this.productRepository = productRepository;
|
|
4764
4859
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
4765
4860
|
}
|
|
4766
4861
|
async create(params) {
|
|
4767
|
-
const {
|
|
4768
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false,
|
|
4862
|
+
const { images, mostRelevants, metadatas } = params, data = __rest(params, ["images", "mostRelevants", "metadatas"]);
|
|
4863
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadatas: metadatas || [{ shop: null, description: null, title: null }], mostRelevants: mostRelevants || {
|
|
4864
|
+
[Shops.GLAMSHOP]: null,
|
|
4865
|
+
[Shops.MENSMARKET]: null,
|
|
4866
|
+
}, images: images || {
|
|
4867
|
+
[Shops.GLAMSHOP]: {
|
|
4868
|
+
brandBanner: null,
|
|
4869
|
+
brandBannerMobile: null,
|
|
4870
|
+
image: null,
|
|
4871
|
+
},
|
|
4872
|
+
[Shops.MENSMARKET]: {
|
|
4873
|
+
brandBanner: null,
|
|
4874
|
+
brandBannerMobile: null,
|
|
4875
|
+
image: null,
|
|
4876
|
+
},
|
|
4877
|
+
} }));
|
|
4769
4878
|
}
|
|
4770
4879
|
async get(identifiers) {
|
|
4771
4880
|
var _a;
|
|
@@ -4774,12 +4883,12 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4774
4883
|
: super.get(identifiers);
|
|
4775
4884
|
}
|
|
4776
4885
|
async update(params) {
|
|
4777
|
-
const { products, id: checkId,
|
|
4886
|
+
const { products, id: checkId, metadatas, filters } = params, data = __rest(params, ["products", "id", "metadatas", "filters"]);
|
|
4778
4887
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
4779
4888
|
const id = await this.getId(plainData.id);
|
|
4780
4889
|
const category = await super.update(Object.assign(Object.assign({ id }, data), { isWishlist: false }));
|
|
4781
4890
|
category.products = products && (await this.updateProducts(+id, { products }));
|
|
4782
|
-
category.
|
|
4891
|
+
category.metadatas = metadatas && (await this.updateMetadata(+id, { metadatas }));
|
|
4783
4892
|
category.filters = filters && (await this.updateFilters(+id, { filters }));
|
|
4784
4893
|
return category;
|
|
4785
4894
|
}
|
|
@@ -4875,7 +4984,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4875
4984
|
return products;
|
|
4876
4985
|
}
|
|
4877
4986
|
async getChildren(parentId) {
|
|
4878
|
-
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference'], {
|
|
4987
|
+
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference', 'published', 'shops'], {
|
|
4879
4988
|
args: {
|
|
4880
4989
|
type: 'category_tree_args',
|
|
4881
4990
|
value: { parentid: parentId },
|
|
@@ -4955,23 +5064,36 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4955
5064
|
});
|
|
4956
5065
|
return plainData.products;
|
|
4957
5066
|
}
|
|
4958
|
-
async updateMetadata(categoryId, {
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
5067
|
+
async updateMetadata(categoryId, { metadatas }) {
|
|
5068
|
+
if (Array.isArray(metadatas) && !metadatas.length)
|
|
5069
|
+
return [];
|
|
5070
|
+
if (Array.isArray(metadatas) && metadatas.length) {
|
|
5071
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5072
|
+
where: {
|
|
5073
|
+
type: 'category_metadata_bool_exp',
|
|
5074
|
+
required: true,
|
|
5075
|
+
value: { category_id: { _eq: categoryId } },
|
|
5076
|
+
},
|
|
5077
|
+
});
|
|
5078
|
+
await this.mutation('insert_category_metadata', ['affected_rows'], {
|
|
5079
|
+
objects: {
|
|
5080
|
+
type: '[category_metadata_insert_input!]',
|
|
5081
|
+
required: true,
|
|
5082
|
+
value: metadatas.map((m) => (Object.assign({ category_id: categoryId }, m))),
|
|
5083
|
+
},
|
|
5084
|
+
});
|
|
5085
|
+
return metadatas;
|
|
5086
|
+
}
|
|
5087
|
+
if ('action' in metadatas && metadatas.action === 'remove' && metadatas.value.length) {
|
|
5088
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5089
|
+
where: {
|
|
5090
|
+
type: 'category_metadata_bool_exp',
|
|
5091
|
+
required: true,
|
|
5092
|
+
value: { category_id: { _eq: categoryId } },
|
|
5093
|
+
},
|
|
5094
|
+
});
|
|
5095
|
+
return [];
|
|
5096
|
+
}
|
|
4975
5097
|
}
|
|
4976
5098
|
async updateFilters(categoryId, { filters }) {
|
|
4977
5099
|
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
@@ -5065,6 +5187,7 @@ class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGrap
|
|
|
5065
5187
|
interceptors,
|
|
5066
5188
|
fields: [
|
|
5067
5189
|
'id',
|
|
5190
|
+
'title',
|
|
5068
5191
|
'description',
|
|
5069
5192
|
'slug',
|
|
5070
5193
|
'enabled',
|
|
@@ -5452,6 +5575,8 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5452
5575
|
enableCount: false,
|
|
5453
5576
|
},
|
|
5454
5577
|
});
|
|
5578
|
+
if (!result.data.length)
|
|
5579
|
+
return null;
|
|
5455
5580
|
const product = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
5456
5581
|
RoundProductPricesHelper.roundProductPrices(product);
|
|
5457
5582
|
return product;
|
|
@@ -5805,6 +5930,31 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5805
5930
|
email,
|
|
5806
5931
|
});
|
|
5807
5932
|
}
|
|
5933
|
+
async getNotificationsReport(params, orderBy, pagination) {
|
|
5934
|
+
const query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (params.productId && { product_id: { _eq: params.productId } })), (params.ean && { ean: { _eq: params.ean } })), (params.sku && { sku: { _eq: params.sku } })), (params.name && { name: { _iregex: params.name } })), (params.categoryId && { category_id: { _eq: params.categoryId } })), (params.category && { category: { _iregex: params.category } })), (params.reference && { category_reference: { _eq: params.reference } })), (params.emailsCount && { emails_registered: { _eq: params.emailsCount } }));
|
|
5935
|
+
const orderByField = {
|
|
5936
|
+
[orderBy.field]: orderBy.direction,
|
|
5937
|
+
};
|
|
5938
|
+
const { report_stock_notification } = await this.query('report_stock_notification', ['product_id', 'ean', 'sku', 'name', 'stock', 'category_id', 'category', 'reference', 'emails_registered'], {
|
|
5939
|
+
where: {
|
|
5940
|
+
type: 'report_stock_notification_bool_exp',
|
|
5941
|
+
value: query,
|
|
5942
|
+
required: true,
|
|
5943
|
+
},
|
|
5944
|
+
order_by: {
|
|
5945
|
+
type: '[report_stock_notification_order_by]',
|
|
5946
|
+
value: orderByField,
|
|
5947
|
+
required: true,
|
|
5948
|
+
},
|
|
5949
|
+
});
|
|
5950
|
+
const data = (pagination === null || pagination === void 0 ? void 0 : pagination.limit)
|
|
5951
|
+
? report_stock_notification.slice(pagination === null || pagination === void 0 ? void 0 : pagination.offset, (pagination === null || pagination === void 0 ? void 0 : pagination.offset) + (pagination === null || pagination === void 0 ? void 0 : pagination.limit))
|
|
5952
|
+
: report_stock_notification;
|
|
5953
|
+
return {
|
|
5954
|
+
data,
|
|
5955
|
+
count: report_stock_notification.length,
|
|
5956
|
+
};
|
|
5957
|
+
}
|
|
5808
5958
|
}
|
|
5809
5959
|
|
|
5810
5960
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
@@ -5913,11 +6063,14 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5913
6063
|
}
|
|
5914
6064
|
}
|
|
5915
6065
|
|
|
6066
|
+
class WishlistHasuraGraphQL extends Wishlist {
|
|
6067
|
+
}
|
|
6068
|
+
|
|
5916
6069
|
class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5917
6070
|
constructor({ endpoint, authOptions, interceptors, }, categoryFilterRepository) {
|
|
5918
6071
|
super({
|
|
5919
6072
|
tableName: 'category',
|
|
5920
|
-
model:
|
|
6073
|
+
model: WishlistHasuraGraphQL,
|
|
5921
6074
|
endpoint,
|
|
5922
6075
|
authOptions,
|
|
5923
6076
|
interceptors,
|
|
@@ -5978,7 +6131,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5978
6131
|
{
|
|
5979
6132
|
metadata: {
|
|
5980
6133
|
columnName: 'metadata',
|
|
5981
|
-
fields: ['title', 'description'],
|
|
6134
|
+
fields: ['shop', 'title', 'description'],
|
|
5982
6135
|
bindPersistData: (value) => ({
|
|
5983
6136
|
metadata: { data: value },
|
|
5984
6137
|
}),
|
|
@@ -5998,15 +6151,33 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5998
6151
|
{ personId: { columnName: 'person_id' } },
|
|
5999
6152
|
{ personName: { columnName: 'person_name' } },
|
|
6000
6153
|
{ personPhoto: { columnName: 'person_photo' } },
|
|
6154
|
+
{ personType: { columnName: 'person_type' } },
|
|
6155
|
+
{ personIsSubscriber: { columnName: 'person_is_subscriber' } },
|
|
6001
6156
|
'theme',
|
|
6002
6157
|
{ bannerUrl: { columnName: 'banner_url' } },
|
|
6158
|
+
{ personHasPhoto: { columnName: 'person_has_photo' } },
|
|
6003
6159
|
],
|
|
6004
6160
|
});
|
|
6005
6161
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
6006
6162
|
}
|
|
6007
6163
|
async create(params) {
|
|
6008
|
-
|
|
6009
|
-
|
|
6164
|
+
var _a;
|
|
6165
|
+
const { images, mostRelevants, metadatas } = params, data = __rest(params, ["images", "mostRelevants", "metadatas"]);
|
|
6166
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadatas: metadatas || [{ shop: (_a = data.shop) !== null && _a !== void 0 ? _a : null, description: data.description, title: data.name }], mostRelevants: mostRelevants || {
|
|
6167
|
+
[Shops.GLAMSHOP]: null,
|
|
6168
|
+
[Shops.MENSMARKET]: null,
|
|
6169
|
+
}, images: images || {
|
|
6170
|
+
[Shops.GLAMSHOP]: {
|
|
6171
|
+
brandBanner: null,
|
|
6172
|
+
brandBannerMobile: null,
|
|
6173
|
+
image: null,
|
|
6174
|
+
},
|
|
6175
|
+
[Shops.MENSMARKET]: {
|
|
6176
|
+
brandBanner: null,
|
|
6177
|
+
brandBannerMobile: null,
|
|
6178
|
+
image: null,
|
|
6179
|
+
},
|
|
6180
|
+
} }));
|
|
6010
6181
|
}
|
|
6011
6182
|
async get(identifiers) {
|
|
6012
6183
|
const data = await super.get(identifiers);
|
|
@@ -6019,12 +6190,12 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6019
6190
|
return await super.find(Object.assign(Object.assign({}, rest), { filters: Object.assign(Object.assign({}, filters), { isWishlist: { operator: Where.EQUALS, value: true } }) }));
|
|
6020
6191
|
}
|
|
6021
6192
|
async update(params) {
|
|
6022
|
-
const { products, id: checkId,
|
|
6193
|
+
const { products, id: checkId, metadatas, filters } = params, data = __rest(params, ["products", "id", "metadatas", "filters"]);
|
|
6023
6194
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
6024
6195
|
const id = plainData.id;
|
|
6025
6196
|
const category = await super.update(Object.assign(Object.assign({ id }, data), { isWishlist: true, isCollection: true, brandCategory: false }));
|
|
6026
6197
|
category.products = products && (await this.updateProducts(+id, { products }));
|
|
6027
|
-
category.
|
|
6198
|
+
category.metadatas = metadatas && (await this.updateMetadata(+id, { metadatas }));
|
|
6028
6199
|
return category;
|
|
6029
6200
|
}
|
|
6030
6201
|
async getWishlistBySlug(slug) {
|
|
@@ -6061,7 +6232,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6061
6232
|
throw new NotFoundError(`Wishlists from person ${personId} not found`);
|
|
6062
6233
|
return data;
|
|
6063
6234
|
}
|
|
6064
|
-
getCategoryBySlug(slug, _shop) {
|
|
6235
|
+
async getCategoryBySlug(slug, _shop) {
|
|
6065
6236
|
return this.getWishlistBySlug(slug);
|
|
6066
6237
|
}
|
|
6067
6238
|
async getCategoryByShop(shop) {
|
|
@@ -6079,6 +6250,13 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6079
6250
|
});
|
|
6080
6251
|
return data;
|
|
6081
6252
|
}
|
|
6253
|
+
async findBfluOrGlamgirlWishlists(params, shops) {
|
|
6254
|
+
var _a, _b;
|
|
6255
|
+
return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true, shops: { operator: Where.LIKE, value: shops }, personType: (_b = (_a = params.filters) === null || _a === void 0 ? void 0 : _a.personType) !== null && _b !== void 0 ? _b : {
|
|
6256
|
+
operator: Where.IN,
|
|
6257
|
+
value: [PersonTypes.BFLU, PersonTypes.GLAMGIRL],
|
|
6258
|
+
} }), orderBy: Object.assign({ personHasPhoto: 'desc' }, omit(params.orderBy, ['personHasPhoto'])) }));
|
|
6259
|
+
}
|
|
6082
6260
|
getCategoriesForHome(categoryIds, limit, gender) {
|
|
6083
6261
|
return;
|
|
6084
6262
|
}
|
|
@@ -6129,23 +6307,40 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6129
6307
|
});
|
|
6130
6308
|
return plainData.products;
|
|
6131
6309
|
}
|
|
6132
|
-
async updateMetadata(categoryId, {
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6310
|
+
async updateMetadata(categoryId, { metadatas }) {
|
|
6311
|
+
if (Array.isArray(metadatas) && !metadatas.length)
|
|
6312
|
+
return [];
|
|
6313
|
+
if (Array.isArray(metadatas) && metadatas.length) {
|
|
6314
|
+
const metadataUpdated = [];
|
|
6315
|
+
for (const data of metadatas) {
|
|
6316
|
+
const update = await this.mutation('update_category_metadata_by_pk', ['category_id', 'shop'], {
|
|
6317
|
+
pk_columns: {
|
|
6318
|
+
value: { category_id: categoryId, shop: data.shop },
|
|
6319
|
+
type: 'category_metadata_pk_columns_input',
|
|
6320
|
+
required: true,
|
|
6321
|
+
},
|
|
6322
|
+
_set: {
|
|
6323
|
+
value: omit(data, ['category_id', 'shop']),
|
|
6324
|
+
type: 'category_metadata_set_input',
|
|
6325
|
+
required: true,
|
|
6326
|
+
},
|
|
6327
|
+
});
|
|
6328
|
+
metadataUpdated.push(update);
|
|
6329
|
+
}
|
|
6330
|
+
return metadataUpdated;
|
|
6331
|
+
}
|
|
6332
|
+
if ('action' in metadatas && metadatas.action === 'remove' && metadatas.value.length) {
|
|
6333
|
+
for (let i = 0; i < metadatas.value.length; i++) {
|
|
6334
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
6335
|
+
where: {
|
|
6336
|
+
type: 'category_metadata_bool_exp',
|
|
6337
|
+
required: true,
|
|
6338
|
+
value: { category_id: { _eq: categoryId }, shop: metadatas.value[i].shop },
|
|
6339
|
+
},
|
|
6340
|
+
});
|
|
6341
|
+
}
|
|
6342
|
+
return [];
|
|
6343
|
+
}
|
|
6149
6344
|
}
|
|
6150
6345
|
}
|
|
6151
6346
|
__decorate([
|
|
@@ -6166,5 +6361,11 @@ __decorate([
|
|
|
6166
6361
|
__metadata("design:paramtypes", [String]),
|
|
6167
6362
|
__metadata("design:returntype", Promise)
|
|
6168
6363
|
], WishlistHasuraGraphQLRepository.prototype, "getCategoryByShop", null);
|
|
6364
|
+
__decorate([
|
|
6365
|
+
Log(),
|
|
6366
|
+
__metadata("design:type", Function),
|
|
6367
|
+
__metadata("design:paramtypes", [Object, Array]),
|
|
6368
|
+
__metadata("design:returntype", Promise)
|
|
6369
|
+
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
6169
6370
|
|
|
6170
|
-
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
6371
|
+
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, PersonTypes, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier, ModelBaseStructure } from '../../generic/model';
|
|
2
2
|
import { Shops } from './enums';
|
|
3
3
|
import { Filter } from './filter';
|
|
4
|
-
import { CategoryCondition, CategoryMetadata } from './types';
|
|
4
|
+
import { CategoryCondition, CategoryImages, CategoryMetadata, CategoryMostRelevant } from './types';
|
|
5
5
|
export declare class CategoryBase<ChildCategory extends ModelBaseStructure<ChildCategory, Identifiers> = ModelBaseStructure<any, any>, Identifiers = ChildCategory['identifiersFields']> extends BaseModel<ChildCategory, Identifiers> {
|
|
6
6
|
id: string;
|
|
7
7
|
brandCategory: boolean;
|
|
@@ -9,6 +9,7 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
|
|
|
9
9
|
name: string;
|
|
10
10
|
slug: string;
|
|
11
11
|
image?: string;
|
|
12
|
+
images?: CategoryImages;
|
|
12
13
|
brandCategoryBanner?: string;
|
|
13
14
|
brandCategoryBannerMobile?: string;
|
|
14
15
|
description: string;
|
|
@@ -20,6 +21,7 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
|
|
|
20
21
|
shops?: string[];
|
|
21
22
|
published: boolean;
|
|
22
23
|
metadata: CategoryMetadata;
|
|
24
|
+
metadatas: CategoryMetadata[];
|
|
23
25
|
isCollection?: boolean;
|
|
24
26
|
isWishlist?: boolean;
|
|
25
27
|
reference?: string;
|
|
@@ -27,7 +29,21 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
|
|
|
27
29
|
theme?: string;
|
|
28
30
|
bannerUrl?: string;
|
|
29
31
|
mostRelevant?: string[];
|
|
32
|
+
mostRelevants?: CategoryMostRelevant;
|
|
30
33
|
parent?: CategoryBase;
|
|
31
34
|
filters?: Filter[];
|
|
32
35
|
static get identifiersFields(): GenericIdentifier[];
|
|
36
|
+
get glamImages(): {
|
|
37
|
+
image: string;
|
|
38
|
+
brandBanner: string;
|
|
39
|
+
brandBannerMobile: string;
|
|
40
|
+
};
|
|
41
|
+
get mensImages(): {
|
|
42
|
+
image: string;
|
|
43
|
+
brandBanner: string;
|
|
44
|
+
brandBannerMobile: string;
|
|
45
|
+
};
|
|
46
|
+
get glamMetadata(): CategoryMetadata;
|
|
47
|
+
get mensMetadata(): CategoryMetadata;
|
|
48
|
+
getMostRelevantByShop(shop: Shops): string[];
|
|
33
49
|
}
|