@infrab4a/connect 4.10.1-beta.3 → 4.10.1
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 +127 -144
- package/index.esm.js +126 -145
- package/package.json +1 -1
- package/src/domain/catalog/models/category-base.d.ts +3 -21
- package/src/domain/catalog/models/types/category-metadata.type.d.ts +0 -2
- package/src/domain/catalog/models/types/index.d.ts +1 -2
- package/src/domain/catalog/models/types/report-stock-notification.type.d.ts +21 -0
- package/src/domain/catalog/repositories/product-stock-notification.repository.d.ts +9 -1
- package/src/domain/shopping/index.d.ts +1 -0
- 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/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/repositories/catalog/product-stock-notification-hasura-graphql.repository.d.ts +8 -1
- package/src/domain/catalog/models/types/category-images.type.d.ts +0 -8
- package/src/domain/catalog/models/types/category-most-relevant.type.d.ts +0 -4
package/index.cjs.js
CHANGED
|
@@ -42,21 +42,6 @@ class BaseModel {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
exports.GenderDestination = void 0;
|
|
46
|
-
(function (GenderDestination) {
|
|
47
|
-
GenderDestination["FEMALE"] = "female";
|
|
48
|
-
GenderDestination["MALE"] = "male";
|
|
49
|
-
GenderDestination["UNISEX"] = "unisex";
|
|
50
|
-
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
51
|
-
|
|
52
|
-
exports.Shops = void 0;
|
|
53
|
-
(function (Shops) {
|
|
54
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
55
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
56
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
57
|
-
Shops["ALL"] = "ALL";
|
|
58
|
-
})(exports.Shops || (exports.Shops = {}));
|
|
59
|
-
|
|
60
45
|
class Filter extends BaseModel {
|
|
61
46
|
static get identifiersFields() {
|
|
62
47
|
return ['id'];
|
|
@@ -71,37 +56,6 @@ class CategoryBase extends BaseModel {
|
|
|
71
56
|
static get identifiersFields() {
|
|
72
57
|
return ['id'];
|
|
73
58
|
}
|
|
74
|
-
get glamImages() {
|
|
75
|
-
return this.images && this.images[exports.Shops.GLAMSHOP]
|
|
76
|
-
? this.images[exports.Shops.GLAMSHOP]
|
|
77
|
-
: {
|
|
78
|
-
[exports.Shops.GLAMSHOP]: {
|
|
79
|
-
brandBanner: null,
|
|
80
|
-
brandBannerMobile: null,
|
|
81
|
-
image: null,
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
get mensImages() {
|
|
86
|
-
return this.images && this.images[exports.Shops.MENSMARKET]
|
|
87
|
-
? this.images[exports.Shops.MENSMARKET]
|
|
88
|
-
: {
|
|
89
|
-
[exports.Shops.MENSMARKET]: {
|
|
90
|
-
brandBanner: null,
|
|
91
|
-
brandBannerMobile: null,
|
|
92
|
-
image: null,
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
get glamMetadata() {
|
|
97
|
-
return this.metadata.find((metadata) => metadata.shop === exports.Shops.GLAMSHOP);
|
|
98
|
-
}
|
|
99
|
-
get mensMetadata() {
|
|
100
|
-
return this.metadata.find((metadata) => metadata.shop === exports.Shops.MENSMARKET);
|
|
101
|
-
}
|
|
102
|
-
getMostRelevantByShop(shop) {
|
|
103
|
-
return this.mostRelevant && this.mostRelevant[shop] ? this.mostRelevant[shop] : [];
|
|
104
|
-
}
|
|
105
59
|
}
|
|
106
60
|
tslib.__decorate([
|
|
107
61
|
classTransformer.Type(() => CategoryBase),
|
|
@@ -210,6 +164,21 @@ tslib.__decorate([
|
|
|
210
164
|
tslib.__metadata("design:type", Category)
|
|
211
165
|
], CategoryFilter.prototype, "category", void 0);
|
|
212
166
|
|
|
167
|
+
exports.GenderDestination = void 0;
|
|
168
|
+
(function (GenderDestination) {
|
|
169
|
+
GenderDestination["FEMALE"] = "female";
|
|
170
|
+
GenderDestination["MALE"] = "male";
|
|
171
|
+
GenderDestination["UNISEX"] = "unisex";
|
|
172
|
+
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
173
|
+
|
|
174
|
+
exports.Shops = void 0;
|
|
175
|
+
(function (Shops) {
|
|
176
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
177
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
178
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
179
|
+
Shops["ALL"] = "ALL";
|
|
180
|
+
})(exports.Shops || (exports.Shops = {}));
|
|
181
|
+
|
|
213
182
|
class FilterOption extends BaseModel {
|
|
214
183
|
static get identifiersFields() {
|
|
215
184
|
return ['id'];
|
|
@@ -2205,6 +2174,12 @@ tslib.__decorate([
|
|
|
2205
2174
|
tslib.__metadata("design:type", Payment)
|
|
2206
2175
|
], Order.prototype, "payment", void 0);
|
|
2207
2176
|
|
|
2177
|
+
class OrderBlocked extends BaseModel {
|
|
2178
|
+
static get identifiersFields() {
|
|
2179
|
+
return ['id'];
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2208
2183
|
class CheckoutSubscription extends BaseModel {
|
|
2209
2184
|
static get identifiersFields() {
|
|
2210
2185
|
return ['id'];
|
|
@@ -3596,6 +3571,47 @@ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
|
3596
3571
|
}
|
|
3597
3572
|
}
|
|
3598
3573
|
|
|
3574
|
+
class OrderBlockedFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3575
|
+
constructor({ firestore, interceptors, }) {
|
|
3576
|
+
super({
|
|
3577
|
+
firestore,
|
|
3578
|
+
collectionName: 'paymentBlockedAttempts',
|
|
3579
|
+
model: OrderBlocked,
|
|
3580
|
+
interceptors,
|
|
3581
|
+
});
|
|
3582
|
+
}
|
|
3583
|
+
async createBlockedOrderOrPayment(checkout, blockType, type, limiteRange, card = null) {
|
|
3584
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3585
|
+
return this.create(OrderBlocked.toInstance({
|
|
3586
|
+
customer: {
|
|
3587
|
+
name: ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.displayName) || '',
|
|
3588
|
+
cpf: ((_b = checkout.user) === null || _b === void 0 ? void 0 : _b.cpf) || '',
|
|
3589
|
+
id: (_c = checkout.user) === null || _c === void 0 ? void 0 : _c.id,
|
|
3590
|
+
email: ((_d = checkout.user) === null || _d === void 0 ? void 0 : _d.email) || '',
|
|
3591
|
+
phoneNumber: '+55' + ((_e = checkout.user) === null || _e === void 0 ? void 0 : _e.phone),
|
|
3592
|
+
isSubscriber: (_f = checkout.user) === null || _f === void 0 ? void 0 : _f.isSubscriber,
|
|
3593
|
+
subscriptionPlan: ((_g = checkout.user) === null || _g === void 0 ? void 0 : _g.subscriptionPlan) || '',
|
|
3594
|
+
shippingAddress: Object.assign(Object.assign({}, checkout.shippingAddress), { zip: this.formatZip((_h = checkout.shippingAddress) === null || _h === void 0 ? void 0 : _h.zip) }),
|
|
3595
|
+
},
|
|
3596
|
+
blockType,
|
|
3597
|
+
limiteRange,
|
|
3598
|
+
type,
|
|
3599
|
+
card,
|
|
3600
|
+
checkout: {
|
|
3601
|
+
id: checkout.id,
|
|
3602
|
+
shop: checkout.shop,
|
|
3603
|
+
total: checkout.totalPrice,
|
|
3604
|
+
},
|
|
3605
|
+
date: new Date(),
|
|
3606
|
+
}));
|
|
3607
|
+
}
|
|
3608
|
+
formatZip(zip) {
|
|
3609
|
+
if (zip.length === 8)
|
|
3610
|
+
return zip.substring(0, 5) + '-' + zip.substring(5, 8);
|
|
3611
|
+
return zip;
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3599
3615
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3600
3616
|
constructor({ firestore, interceptors }) {
|
|
3601
3617
|
super({
|
|
@@ -4729,7 +4745,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4729
4745
|
'name',
|
|
4730
4746
|
'description',
|
|
4731
4747
|
'image',
|
|
4732
|
-
{ images: { columnName: 'images', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4733
4748
|
'published',
|
|
4734
4749
|
'shop',
|
|
4735
4750
|
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
@@ -4785,7 +4800,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4785
4800
|
{
|
|
4786
4801
|
metadata: {
|
|
4787
4802
|
columnName: 'metadata',
|
|
4788
|
-
fields: ['
|
|
4803
|
+
fields: ['title', 'description'],
|
|
4789
4804
|
bindPersistData: (value) => ({
|
|
4790
4805
|
metadata: { data: value },
|
|
4791
4806
|
}),
|
|
@@ -4811,22 +4826,8 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4811
4826
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
4812
4827
|
}
|
|
4813
4828
|
async create(params) {
|
|
4814
|
-
const {
|
|
4815
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata ||
|
|
4816
|
-
[exports.Shops.GLAMSHOP]: null,
|
|
4817
|
-
[exports.Shops.MENSMARKET]: null,
|
|
4818
|
-
}, images: images || {
|
|
4819
|
-
[exports.Shops.GLAMSHOP]: {
|
|
4820
|
-
brandBanner: null,
|
|
4821
|
-
brandBannerMobile: null,
|
|
4822
|
-
image: null,
|
|
4823
|
-
},
|
|
4824
|
-
[exports.Shops.MENSMARKET]: {
|
|
4825
|
-
brandBanner: null,
|
|
4826
|
-
brandBannerMobile: null,
|
|
4827
|
-
image: null,
|
|
4828
|
-
},
|
|
4829
|
-
} }));
|
|
4829
|
+
const { metadata } = params, data = tslib.__rest(params, ["metadata"]);
|
|
4830
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || { description: null, title: null } }));
|
|
4830
4831
|
}
|
|
4831
4832
|
async get(identifiers) {
|
|
4832
4833
|
var _a;
|
|
@@ -5017,35 +5018,22 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5017
5018
|
return plainData.products;
|
|
5018
5019
|
}
|
|
5019
5020
|
async updateMetadata(categoryId, { metadata }) {
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
});
|
|
5037
|
-
return metadata;
|
|
5038
|
-
}
|
|
5039
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
5040
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5041
|
-
where: {
|
|
5042
|
-
type: 'category_metadata_bool_exp',
|
|
5043
|
-
required: true,
|
|
5044
|
-
value: { category_id: { _eq: categoryId } },
|
|
5045
|
-
},
|
|
5046
|
-
});
|
|
5047
|
-
return [];
|
|
5048
|
-
}
|
|
5021
|
+
const plainData = this.paramsToPlain({ metadata });
|
|
5022
|
+
if (!plainData.metadata)
|
|
5023
|
+
return null;
|
|
5024
|
+
await this.mutation('update_category_metadata_by_pk', ['category_id'], {
|
|
5025
|
+
pk_columns: {
|
|
5026
|
+
value: { category_id: categoryId },
|
|
5027
|
+
type: 'category_metadata_pk_columns_input',
|
|
5028
|
+
required: true,
|
|
5029
|
+
},
|
|
5030
|
+
_set: {
|
|
5031
|
+
value: lodash.omit(metadata, ['category_id']),
|
|
5032
|
+
type: 'category_metadata_set_input',
|
|
5033
|
+
required: true,
|
|
5034
|
+
},
|
|
5035
|
+
});
|
|
5036
|
+
return plainData.metadata;
|
|
5049
5037
|
}
|
|
5050
5038
|
async updateFilters(categoryId, { filters }) {
|
|
5051
5039
|
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
@@ -5879,6 +5867,31 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5879
5867
|
email,
|
|
5880
5868
|
});
|
|
5881
5869
|
}
|
|
5870
|
+
async getNotificationsReport(params, orderBy, pagination) {
|
|
5871
|
+
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 } }));
|
|
5872
|
+
const orderByField = {
|
|
5873
|
+
[orderBy.field]: orderBy.direction,
|
|
5874
|
+
};
|
|
5875
|
+
const { report_stock_notification } = await this.query('report_stock_notification', ['product_id', 'ean', 'sku', 'name', 'stock', 'category_id', 'category', 'reference', 'emails_registered'], {
|
|
5876
|
+
where: {
|
|
5877
|
+
type: 'report_stock_notification_bool_exp',
|
|
5878
|
+
value: query,
|
|
5879
|
+
required: true,
|
|
5880
|
+
},
|
|
5881
|
+
order_by: {
|
|
5882
|
+
type: '[report_stock_notification_order_by]',
|
|
5883
|
+
value: orderByField,
|
|
5884
|
+
required: true,
|
|
5885
|
+
},
|
|
5886
|
+
});
|
|
5887
|
+
const data = (pagination === null || pagination === void 0 ? void 0 : pagination.limit)
|
|
5888
|
+
? 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))
|
|
5889
|
+
: report_stock_notification;
|
|
5890
|
+
return {
|
|
5891
|
+
data,
|
|
5892
|
+
count: report_stock_notification.length,
|
|
5893
|
+
};
|
|
5894
|
+
}
|
|
5882
5895
|
}
|
|
5883
5896
|
|
|
5884
5897
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
@@ -6055,7 +6068,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6055
6068
|
{
|
|
6056
6069
|
metadata: {
|
|
6057
6070
|
columnName: 'metadata',
|
|
6058
|
-
fields: ['
|
|
6071
|
+
fields: ['title', 'description'],
|
|
6059
6072
|
bindPersistData: (value) => ({
|
|
6060
6073
|
metadata: { data: value },
|
|
6061
6074
|
}),
|
|
@@ -6085,23 +6098,8 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6085
6098
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
6086
6099
|
}
|
|
6087
6100
|
async create(params) {
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || [{ shop: (_a = data.shop) !== null && _a !== void 0 ? _a : null, description: data.description, title: data.name }], mostRelevant: mostRelevant || {
|
|
6091
|
-
[exports.Shops.GLAMSHOP]: null,
|
|
6092
|
-
[exports.Shops.MENSMARKET]: null,
|
|
6093
|
-
}, images: images || {
|
|
6094
|
-
[exports.Shops.GLAMSHOP]: {
|
|
6095
|
-
brandBanner: null,
|
|
6096
|
-
brandBannerMobile: null,
|
|
6097
|
-
image: null,
|
|
6098
|
-
},
|
|
6099
|
-
[exports.Shops.MENSMARKET]: {
|
|
6100
|
-
brandBanner: null,
|
|
6101
|
-
brandBannerMobile: null,
|
|
6102
|
-
image: null,
|
|
6103
|
-
},
|
|
6104
|
-
} }));
|
|
6101
|
+
const { metadata } = params, data = tslib.__rest(params, ["metadata"]);
|
|
6102
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || { description: data.description, title: data.name } }));
|
|
6105
6103
|
}
|
|
6106
6104
|
async get(identifiers) {
|
|
6107
6105
|
const data = await super.get(identifiers);
|
|
@@ -6232,39 +6230,22 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6232
6230
|
return plainData.products;
|
|
6233
6231
|
}
|
|
6234
6232
|
async updateMetadata(categoryId, { metadata }) {
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
});
|
|
6252
|
-
metadataUpdated.push(update);
|
|
6253
|
-
}
|
|
6254
|
-
return metadataUpdated;
|
|
6255
|
-
}
|
|
6256
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
6257
|
-
for (let i = 0; i < metadata.value.length; i++) {
|
|
6258
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
6259
|
-
where: {
|
|
6260
|
-
type: 'category_metadata_bool_exp',
|
|
6261
|
-
required: true,
|
|
6262
|
-
value: { category_id: { _eq: categoryId }, shop: metadata.value[i].shop },
|
|
6263
|
-
},
|
|
6264
|
-
});
|
|
6265
|
-
}
|
|
6266
|
-
return [];
|
|
6267
|
-
}
|
|
6233
|
+
const plainData = this.paramsToPlain({ metadata });
|
|
6234
|
+
if (!plainData.metadata)
|
|
6235
|
+
return;
|
|
6236
|
+
await this.mutation('update_category_metadata_by_pk', ['category_id'], {
|
|
6237
|
+
pk_columns: {
|
|
6238
|
+
value: { category_id: categoryId },
|
|
6239
|
+
type: 'category_metadata_pk_columns_input',
|
|
6240
|
+
required: true,
|
|
6241
|
+
},
|
|
6242
|
+
_set: {
|
|
6243
|
+
value: lodash.omit(metadata, ['category_id']),
|
|
6244
|
+
type: 'category_metadata_set_input',
|
|
6245
|
+
required: true,
|
|
6246
|
+
},
|
|
6247
|
+
});
|
|
6248
|
+
return plainData.metadata;
|
|
6268
6249
|
}
|
|
6269
6250
|
}
|
|
6270
6251
|
tslib.__decorate([
|
|
@@ -6466,6 +6447,8 @@ exports.Log = Log;
|
|
|
6466
6447
|
exports.Logger = Logger;
|
|
6467
6448
|
exports.NotFoundError = NotFoundError;
|
|
6468
6449
|
exports.Order = Order;
|
|
6450
|
+
exports.OrderBlocked = OrderBlocked;
|
|
6451
|
+
exports.OrderBlockedFirestoreRepository = OrderBlockedFirestoreRepository;
|
|
6469
6452
|
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|
|
6470
6453
|
exports.Payment = Payment;
|
|
6471
6454
|
exports.PaymentFirestoreRepository = PaymentFirestoreRepository;
|
package/index.esm.js
CHANGED
|
@@ -36,21 +36,6 @@ 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
|
-
|
|
54
39
|
class Filter extends BaseModel {
|
|
55
40
|
static get identifiersFields() {
|
|
56
41
|
return ['id'];
|
|
@@ -65,37 +50,6 @@ class CategoryBase extends BaseModel {
|
|
|
65
50
|
static get identifiersFields() {
|
|
66
51
|
return ['id'];
|
|
67
52
|
}
|
|
68
|
-
get glamImages() {
|
|
69
|
-
return this.images && this.images[Shops.GLAMSHOP]
|
|
70
|
-
? this.images[Shops.GLAMSHOP]
|
|
71
|
-
: {
|
|
72
|
-
[Shops.GLAMSHOP]: {
|
|
73
|
-
brandBanner: null,
|
|
74
|
-
brandBannerMobile: null,
|
|
75
|
-
image: null,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
get mensImages() {
|
|
80
|
-
return this.images && this.images[Shops.MENSMARKET]
|
|
81
|
-
? this.images[Shops.MENSMARKET]
|
|
82
|
-
: {
|
|
83
|
-
[Shops.MENSMARKET]: {
|
|
84
|
-
brandBanner: null,
|
|
85
|
-
brandBannerMobile: null,
|
|
86
|
-
image: null,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
get glamMetadata() {
|
|
91
|
-
return this.metadata.find((metadata) => metadata.shop === Shops.GLAMSHOP);
|
|
92
|
-
}
|
|
93
|
-
get mensMetadata() {
|
|
94
|
-
return this.metadata.find((metadata) => metadata.shop === Shops.MENSMARKET);
|
|
95
|
-
}
|
|
96
|
-
getMostRelevantByShop(shop) {
|
|
97
|
-
return this.mostRelevant && this.mostRelevant[shop] ? this.mostRelevant[shop] : [];
|
|
98
|
-
}
|
|
99
53
|
}
|
|
100
54
|
__decorate([
|
|
101
55
|
Type(() => CategoryBase),
|
|
@@ -204,6 +158,21 @@ __decorate([
|
|
|
204
158
|
__metadata("design:type", Category)
|
|
205
159
|
], CategoryFilter.prototype, "category", void 0);
|
|
206
160
|
|
|
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
|
+
|
|
207
176
|
class FilterOption extends BaseModel {
|
|
208
177
|
static get identifiersFields() {
|
|
209
178
|
return ['id'];
|
|
@@ -2199,6 +2168,12 @@ __decorate([
|
|
|
2199
2168
|
__metadata("design:type", Payment)
|
|
2200
2169
|
], Order.prototype, "payment", void 0);
|
|
2201
2170
|
|
|
2171
|
+
class OrderBlocked extends BaseModel {
|
|
2172
|
+
static get identifiersFields() {
|
|
2173
|
+
return ['id'];
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2202
2177
|
class CheckoutSubscription extends BaseModel {
|
|
2203
2178
|
static get identifiersFields() {
|
|
2204
2179
|
return ['id'];
|
|
@@ -3590,6 +3565,47 @@ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
|
3590
3565
|
}
|
|
3591
3566
|
}
|
|
3592
3567
|
|
|
3568
|
+
class OrderBlockedFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3569
|
+
constructor({ firestore, interceptors, }) {
|
|
3570
|
+
super({
|
|
3571
|
+
firestore,
|
|
3572
|
+
collectionName: 'paymentBlockedAttempts',
|
|
3573
|
+
model: OrderBlocked,
|
|
3574
|
+
interceptors,
|
|
3575
|
+
});
|
|
3576
|
+
}
|
|
3577
|
+
async createBlockedOrderOrPayment(checkout, blockType, type, limiteRange, card = null) {
|
|
3578
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3579
|
+
return this.create(OrderBlocked.toInstance({
|
|
3580
|
+
customer: {
|
|
3581
|
+
name: ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.displayName) || '',
|
|
3582
|
+
cpf: ((_b = checkout.user) === null || _b === void 0 ? void 0 : _b.cpf) || '',
|
|
3583
|
+
id: (_c = checkout.user) === null || _c === void 0 ? void 0 : _c.id,
|
|
3584
|
+
email: ((_d = checkout.user) === null || _d === void 0 ? void 0 : _d.email) || '',
|
|
3585
|
+
phoneNumber: '+55' + ((_e = checkout.user) === null || _e === void 0 ? void 0 : _e.phone),
|
|
3586
|
+
isSubscriber: (_f = checkout.user) === null || _f === void 0 ? void 0 : _f.isSubscriber,
|
|
3587
|
+
subscriptionPlan: ((_g = checkout.user) === null || _g === void 0 ? void 0 : _g.subscriptionPlan) || '',
|
|
3588
|
+
shippingAddress: Object.assign(Object.assign({}, checkout.shippingAddress), { zip: this.formatZip((_h = checkout.shippingAddress) === null || _h === void 0 ? void 0 : _h.zip) }),
|
|
3589
|
+
},
|
|
3590
|
+
blockType,
|
|
3591
|
+
limiteRange,
|
|
3592
|
+
type,
|
|
3593
|
+
card,
|
|
3594
|
+
checkout: {
|
|
3595
|
+
id: checkout.id,
|
|
3596
|
+
shop: checkout.shop,
|
|
3597
|
+
total: checkout.totalPrice,
|
|
3598
|
+
},
|
|
3599
|
+
date: new Date(),
|
|
3600
|
+
}));
|
|
3601
|
+
}
|
|
3602
|
+
formatZip(zip) {
|
|
3603
|
+
if (zip.length === 8)
|
|
3604
|
+
return zip.substring(0, 5) + '-' + zip.substring(5, 8);
|
|
3605
|
+
return zip;
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
|
|
3593
3609
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3594
3610
|
constructor({ firestore, interceptors }) {
|
|
3595
3611
|
super({
|
|
@@ -4723,7 +4739,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4723
4739
|
'name',
|
|
4724
4740
|
'description',
|
|
4725
4741
|
'image',
|
|
4726
|
-
{ images: { columnName: 'images', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4727
4742
|
'published',
|
|
4728
4743
|
'shop',
|
|
4729
4744
|
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
@@ -4779,7 +4794,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4779
4794
|
{
|
|
4780
4795
|
metadata: {
|
|
4781
4796
|
columnName: 'metadata',
|
|
4782
|
-
fields: ['
|
|
4797
|
+
fields: ['title', 'description'],
|
|
4783
4798
|
bindPersistData: (value) => ({
|
|
4784
4799
|
metadata: { data: value },
|
|
4785
4800
|
}),
|
|
@@ -4805,22 +4820,8 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4805
4820
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
4806
4821
|
}
|
|
4807
4822
|
async create(params) {
|
|
4808
|
-
const {
|
|
4809
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata ||
|
|
4810
|
-
[Shops.GLAMSHOP]: null,
|
|
4811
|
-
[Shops.MENSMARKET]: null,
|
|
4812
|
-
}, images: images || {
|
|
4813
|
-
[Shops.GLAMSHOP]: {
|
|
4814
|
-
brandBanner: null,
|
|
4815
|
-
brandBannerMobile: null,
|
|
4816
|
-
image: null,
|
|
4817
|
-
},
|
|
4818
|
-
[Shops.MENSMARKET]: {
|
|
4819
|
-
brandBanner: null,
|
|
4820
|
-
brandBannerMobile: null,
|
|
4821
|
-
image: null,
|
|
4822
|
-
},
|
|
4823
|
-
} }));
|
|
4823
|
+
const { metadata } = params, data = __rest(params, ["metadata"]);
|
|
4824
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || { description: null, title: null } }));
|
|
4824
4825
|
}
|
|
4825
4826
|
async get(identifiers) {
|
|
4826
4827
|
var _a;
|
|
@@ -5011,35 +5012,22 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5011
5012
|
return plainData.products;
|
|
5012
5013
|
}
|
|
5013
5014
|
async updateMetadata(categoryId, { metadata }) {
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
});
|
|
5031
|
-
return metadata;
|
|
5032
|
-
}
|
|
5033
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
5034
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5035
|
-
where: {
|
|
5036
|
-
type: 'category_metadata_bool_exp',
|
|
5037
|
-
required: true,
|
|
5038
|
-
value: { category_id: { _eq: categoryId } },
|
|
5039
|
-
},
|
|
5040
|
-
});
|
|
5041
|
-
return [];
|
|
5042
|
-
}
|
|
5015
|
+
const plainData = this.paramsToPlain({ metadata });
|
|
5016
|
+
if (!plainData.metadata)
|
|
5017
|
+
return null;
|
|
5018
|
+
await this.mutation('update_category_metadata_by_pk', ['category_id'], {
|
|
5019
|
+
pk_columns: {
|
|
5020
|
+
value: { category_id: categoryId },
|
|
5021
|
+
type: 'category_metadata_pk_columns_input',
|
|
5022
|
+
required: true,
|
|
5023
|
+
},
|
|
5024
|
+
_set: {
|
|
5025
|
+
value: omit(metadata, ['category_id']),
|
|
5026
|
+
type: 'category_metadata_set_input',
|
|
5027
|
+
required: true,
|
|
5028
|
+
},
|
|
5029
|
+
});
|
|
5030
|
+
return plainData.metadata;
|
|
5043
5031
|
}
|
|
5044
5032
|
async updateFilters(categoryId, { filters }) {
|
|
5045
5033
|
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
@@ -5873,6 +5861,31 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5873
5861
|
email,
|
|
5874
5862
|
});
|
|
5875
5863
|
}
|
|
5864
|
+
async getNotificationsReport(params, orderBy, pagination) {
|
|
5865
|
+
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 } }));
|
|
5866
|
+
const orderByField = {
|
|
5867
|
+
[orderBy.field]: orderBy.direction,
|
|
5868
|
+
};
|
|
5869
|
+
const { report_stock_notification } = await this.query('report_stock_notification', ['product_id', 'ean', 'sku', 'name', 'stock', 'category_id', 'category', 'reference', 'emails_registered'], {
|
|
5870
|
+
where: {
|
|
5871
|
+
type: 'report_stock_notification_bool_exp',
|
|
5872
|
+
value: query,
|
|
5873
|
+
required: true,
|
|
5874
|
+
},
|
|
5875
|
+
order_by: {
|
|
5876
|
+
type: '[report_stock_notification_order_by]',
|
|
5877
|
+
value: orderByField,
|
|
5878
|
+
required: true,
|
|
5879
|
+
},
|
|
5880
|
+
});
|
|
5881
|
+
const data = (pagination === null || pagination === void 0 ? void 0 : pagination.limit)
|
|
5882
|
+
? 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))
|
|
5883
|
+
: report_stock_notification;
|
|
5884
|
+
return {
|
|
5885
|
+
data,
|
|
5886
|
+
count: report_stock_notification.length,
|
|
5887
|
+
};
|
|
5888
|
+
}
|
|
5876
5889
|
}
|
|
5877
5890
|
|
|
5878
5891
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
@@ -6049,7 +6062,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6049
6062
|
{
|
|
6050
6063
|
metadata: {
|
|
6051
6064
|
columnName: 'metadata',
|
|
6052
|
-
fields: ['
|
|
6065
|
+
fields: ['title', 'description'],
|
|
6053
6066
|
bindPersistData: (value) => ({
|
|
6054
6067
|
metadata: { data: value },
|
|
6055
6068
|
}),
|
|
@@ -6079,23 +6092,8 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6079
6092
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
6080
6093
|
}
|
|
6081
6094
|
async create(params) {
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || [{ shop: (_a = data.shop) !== null && _a !== void 0 ? _a : null, description: data.description, title: data.name }], mostRelevant: mostRelevant || {
|
|
6085
|
-
[Shops.GLAMSHOP]: null,
|
|
6086
|
-
[Shops.MENSMARKET]: null,
|
|
6087
|
-
}, images: images || {
|
|
6088
|
-
[Shops.GLAMSHOP]: {
|
|
6089
|
-
brandBanner: null,
|
|
6090
|
-
brandBannerMobile: null,
|
|
6091
|
-
image: null,
|
|
6092
|
-
},
|
|
6093
|
-
[Shops.MENSMARKET]: {
|
|
6094
|
-
brandBanner: null,
|
|
6095
|
-
brandBannerMobile: null,
|
|
6096
|
-
image: null,
|
|
6097
|
-
},
|
|
6098
|
-
} }));
|
|
6095
|
+
const { metadata } = params, data = __rest(params, ["metadata"]);
|
|
6096
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || { description: data.description, title: data.name } }));
|
|
6099
6097
|
}
|
|
6100
6098
|
async get(identifiers) {
|
|
6101
6099
|
const data = await super.get(identifiers);
|
|
@@ -6226,39 +6224,22 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6226
6224
|
return plainData.products;
|
|
6227
6225
|
}
|
|
6228
6226
|
async updateMetadata(categoryId, { metadata }) {
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
});
|
|
6246
|
-
metadataUpdated.push(update);
|
|
6247
|
-
}
|
|
6248
|
-
return metadataUpdated;
|
|
6249
|
-
}
|
|
6250
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
6251
|
-
for (let i = 0; i < metadata.value.length; i++) {
|
|
6252
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
6253
|
-
where: {
|
|
6254
|
-
type: 'category_metadata_bool_exp',
|
|
6255
|
-
required: true,
|
|
6256
|
-
value: { category_id: { _eq: categoryId }, shop: metadata.value[i].shop },
|
|
6257
|
-
},
|
|
6258
|
-
});
|
|
6259
|
-
}
|
|
6260
|
-
return [];
|
|
6261
|
-
}
|
|
6227
|
+
const plainData = this.paramsToPlain({ metadata });
|
|
6228
|
+
if (!plainData.metadata)
|
|
6229
|
+
return;
|
|
6230
|
+
await this.mutation('update_category_metadata_by_pk', ['category_id'], {
|
|
6231
|
+
pk_columns: {
|
|
6232
|
+
value: { category_id: categoryId },
|
|
6233
|
+
type: 'category_metadata_pk_columns_input',
|
|
6234
|
+
required: true,
|
|
6235
|
+
},
|
|
6236
|
+
_set: {
|
|
6237
|
+
value: omit(metadata, ['category_id']),
|
|
6238
|
+
type: 'category_metadata_set_input',
|
|
6239
|
+
required: true,
|
|
6240
|
+
},
|
|
6241
|
+
});
|
|
6242
|
+
return plainData.metadata;
|
|
6262
6243
|
}
|
|
6263
6244
|
}
|
|
6264
6245
|
__decorate([
|
|
@@ -6286,4 +6267,4 @@ __decorate([
|
|
|
6286
6267
|
__metadata("design:returntype", Promise)
|
|
6287
6268
|
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
6288
6269
|
|
|
6289
|
-
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, 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 };
|
|
6270
|
+
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,
|
|
4
|
+
import { CategoryCondition, CategoryMetadata } 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,7 +9,6 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
|
|
|
9
9
|
name: string;
|
|
10
10
|
slug: string;
|
|
11
11
|
image?: string;
|
|
12
|
-
images?: CategoryImages;
|
|
13
12
|
brandCategoryBanner?: string;
|
|
14
13
|
brandCategoryBannerMobile?: string;
|
|
15
14
|
description: string;
|
|
@@ -20,32 +19,15 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
|
|
|
20
19
|
shop?: Shops;
|
|
21
20
|
shops?: string[];
|
|
22
21
|
published: boolean;
|
|
23
|
-
metadata: CategoryMetadata
|
|
22
|
+
metadata: CategoryMetadata;
|
|
24
23
|
isCollection?: boolean;
|
|
25
24
|
isWishlist?: boolean;
|
|
26
25
|
reference?: string;
|
|
27
26
|
parentId?: number;
|
|
28
27
|
theme?: string;
|
|
29
28
|
bannerUrl?: string;
|
|
30
|
-
mostRelevant?:
|
|
29
|
+
mostRelevant?: string[];
|
|
31
30
|
parent?: CategoryBase;
|
|
32
31
|
filters?: Filter[];
|
|
33
32
|
static get identifiersFields(): GenericIdentifier[];
|
|
34
|
-
get glamImages(): {
|
|
35
|
-
image: string;
|
|
36
|
-
brandBanner: string;
|
|
37
|
-
brandBannerMobile: string;
|
|
38
|
-
} | {
|
|
39
|
-
Glamshop: CategoryImages;
|
|
40
|
-
};
|
|
41
|
-
get mensImages(): {
|
|
42
|
-
image: string;
|
|
43
|
-
brandBanner: string;
|
|
44
|
-
brandBannerMobile: string;
|
|
45
|
-
} | {
|
|
46
|
-
mensmarket: CategoryImages;
|
|
47
|
-
};
|
|
48
|
-
get glamMetadata(): CategoryMetadata;
|
|
49
|
-
get mensMetadata(): CategoryMetadata;
|
|
50
|
-
getMostRelevantByShop(shop: Shops): string[];
|
|
51
33
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export * from './category-condition.type';
|
|
2
|
-
export * from './category-images.type';
|
|
3
2
|
export * from './category-metadata.type';
|
|
4
|
-
export * from './category-most-relevant.type';
|
|
5
3
|
export * from './category-product';
|
|
6
4
|
export * from './product-evaluation.type';
|
|
7
5
|
export * from './product-gender.type';
|
|
8
6
|
export * from './product-metadata.type';
|
|
9
7
|
export * from './product-review.type';
|
|
8
|
+
export * from './report-stock-notification.type';
|
|
10
9
|
export * from './shop-description.type';
|
|
11
10
|
export * from './shop-price.type';
|
|
12
11
|
export * from './stock.type';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type ReportStockNotification = {
|
|
2
|
+
product_id: string;
|
|
3
|
+
ean: string;
|
|
4
|
+
sku: string;
|
|
5
|
+
name: string;
|
|
6
|
+
stock: number;
|
|
7
|
+
category: string;
|
|
8
|
+
category_id: string;
|
|
9
|
+
category_reference: string;
|
|
10
|
+
emails_registered: number;
|
|
11
|
+
};
|
|
12
|
+
export type ReportStockNotificationInput = {
|
|
13
|
+
productId?: string;
|
|
14
|
+
ean?: string;
|
|
15
|
+
sku?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
category?: string;
|
|
18
|
+
categoryId?: string;
|
|
19
|
+
reference?: string;
|
|
20
|
+
emailsCount?: number;
|
|
21
|
+
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { RepositoryFindResult } from '../../generic';
|
|
1
2
|
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
-
import { ProductStockNotification, Shops } from '../models';
|
|
3
|
+
import { ProductStockNotification, ReportStockNotification, ReportStockNotificationInput, Shops } from '../models';
|
|
3
4
|
export interface ProductStockNotificationRepository extends CrudRepository<ProductStockNotification> {
|
|
4
5
|
addCustomerEmail(shop: Shops, productId: string, name: string, email: string): Promise<void>;
|
|
6
|
+
getNotificationsReport(params: ReportStockNotificationInput, orderBy: {
|
|
7
|
+
field: string;
|
|
8
|
+
direction: string;
|
|
9
|
+
}, pagination?: {
|
|
10
|
+
offset: number;
|
|
11
|
+
limit: number;
|
|
12
|
+
}): Promise<RepositoryFindResult<ReportStockNotification>>;
|
|
5
13
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic';
|
|
2
|
+
import { UserAddress } from '../../users';
|
|
3
|
+
export declare class OrderBlocked extends BaseModel<OrderBlocked> {
|
|
4
|
+
id?: string;
|
|
5
|
+
customer: {
|
|
6
|
+
name: string;
|
|
7
|
+
cpf: string;
|
|
8
|
+
id: string;
|
|
9
|
+
email: string;
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
isSubscriber: boolean;
|
|
12
|
+
subscriptionPlan: string;
|
|
13
|
+
shippingAddress: UserAddress;
|
|
14
|
+
};
|
|
15
|
+
blockType: string;
|
|
16
|
+
limiteRange: string;
|
|
17
|
+
type: string;
|
|
18
|
+
card?: any;
|
|
19
|
+
checkout: {
|
|
20
|
+
id: string;
|
|
21
|
+
shop: string;
|
|
22
|
+
total: number;
|
|
23
|
+
};
|
|
24
|
+
date: Date;
|
|
25
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
26
|
+
}
|
|
@@ -4,6 +4,7 @@ export * from './campaign-hashtag.repository';
|
|
|
4
4
|
export * from './checkout.repository';
|
|
5
5
|
export * from './coupon.repository';
|
|
6
6
|
export * from './legacy-order.repository';
|
|
7
|
+
export * from './order-blocked.repository';
|
|
7
8
|
export * from './order.repository';
|
|
8
9
|
export * from './payment.repository';
|
|
9
10
|
export * from './subscription';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
+
import { Checkout, OrderBlocked } from '../models';
|
|
3
|
+
import { PaymentCardInfo } from '../types';
|
|
4
|
+
export interface OrderBlockedRepository extends CrudRepository<OrderBlocked> {
|
|
5
|
+
createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: string, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './payment-card-info.type';
|
|
@@ -5,6 +5,7 @@ export * from './checkout-firestore.repository';
|
|
|
5
5
|
export * from './checkout-subscription-firestore.repository';
|
|
6
6
|
export * from './coupon-firestore.repository';
|
|
7
7
|
export * from './legacy-order-firestore.repository';
|
|
8
|
+
export * from './order-blocked-firestore.repository.ts';
|
|
8
9
|
export * from './order-firestore.repository';
|
|
9
10
|
export * from './payment-firestore.repository';
|
|
10
11
|
export * from './subscription-plan-firestore.repository';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Checkout, OrderBlocked, OrderBlockedRepository, PaymentCardInfo } from '../../../../../domain';
|
|
2
|
+
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
|
+
declare const OrderBlockedFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<OrderBlocked> & import("../../../../../domain").CrudRepository<OrderBlocked, import("../../../../../domain").CrudParams<OrderBlocked>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<OrderBlocked>, ...any[]]>;
|
|
4
|
+
export declare class OrderBlockedFirestoreRepository extends OrderBlockedFirestoreRepository_base implements OrderBlockedRepository {
|
|
5
|
+
constructor({ firestore, interceptors, }: Pick<FirestoreConstructorParams<OrderBlocked>, 'firestore' | 'interceptors'>);
|
|
6
|
+
createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: string, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
|
|
7
|
+
private formatZip;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Filter, ProductStockNotification, Shops } from '../../../../domain';
|
|
1
|
+
import { Filter, ProductStockNotification, ReportStockNotification, ReportStockNotificationInput, RepositoryFindResult, Shops } from '../../../../domain';
|
|
2
2
|
import { ProductStockNotificationRepository } from '../../../../domain/catalog/repositories';
|
|
3
3
|
import { HasuraConstructorParams } from '../../mixins';
|
|
4
4
|
declare const ProductStockNotificationHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../..").GraphQLRepository<ProductStockNotification> & import("../../../../domain").CrudRepository<ProductStockNotification, import("../../../../domain").CrudParams<ProductStockNotification>> & import("../../../../domain").UpdateRepository<ProductStockNotification, import("../../../../domain").RepositoryUpdateParams<ProductStockNotification>> & {
|
|
@@ -7,5 +7,12 @@ declare const ProductStockNotificationHasuraGraphQLRepository_base: import("../.
|
|
|
7
7
|
export declare class ProductStockNotificationHasuraGraphQLRepository extends ProductStockNotificationHasuraGraphQLRepository_base implements ProductStockNotificationRepository {
|
|
8
8
|
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<Filter>, 'endpoint' | 'authOptions' | 'interceptors'>);
|
|
9
9
|
addCustomerEmail(shop: Shops, productId: string, name: string, email: string): Promise<void>;
|
|
10
|
+
getNotificationsReport(params: ReportStockNotificationInput, orderBy: {
|
|
11
|
+
field: string;
|
|
12
|
+
direction: string;
|
|
13
|
+
}, pagination?: {
|
|
14
|
+
offset: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
}): Promise<RepositoryFindResult<ReportStockNotification>>;
|
|
10
17
|
}
|
|
11
18
|
export {};
|