@infrab4a/connect 4.10.1-beta.4 → 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 -140
- package/index.esm.js +126 -141
- package/package.json +1 -1
- package/src/domain/catalog/models/category-base.d.ts +3 -17
- 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,33 +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
|
-
brandBanner: null,
|
|
79
|
-
brandBannerMobile: null,
|
|
80
|
-
image: null,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
get mensImages() {
|
|
84
|
-
return this.images && this.images[exports.Shops.MENSMARKET]
|
|
85
|
-
? this.images[exports.Shops.MENSMARKET]
|
|
86
|
-
: {
|
|
87
|
-
brandBanner: null,
|
|
88
|
-
brandBannerMobile: null,
|
|
89
|
-
image: null,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
get glamMetadata() {
|
|
93
|
-
return this.metadata.find((metadata) => metadata.shop === exports.Shops.GLAMSHOP);
|
|
94
|
-
}
|
|
95
|
-
get mensMetadata() {
|
|
96
|
-
return this.metadata.find((metadata) => metadata.shop === exports.Shops.MENSMARKET);
|
|
97
|
-
}
|
|
98
|
-
getMostRelevantByShop(shop) {
|
|
99
|
-
return this.mostRelevant && this.mostRelevant[shop] ? this.mostRelevant[shop] : [];
|
|
100
|
-
}
|
|
101
59
|
}
|
|
102
60
|
tslib.__decorate([
|
|
103
61
|
classTransformer.Type(() => CategoryBase),
|
|
@@ -206,6 +164,21 @@ tslib.__decorate([
|
|
|
206
164
|
tslib.__metadata("design:type", Category)
|
|
207
165
|
], CategoryFilter.prototype, "category", void 0);
|
|
208
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
|
+
|
|
209
182
|
class FilterOption extends BaseModel {
|
|
210
183
|
static get identifiersFields() {
|
|
211
184
|
return ['id'];
|
|
@@ -2201,6 +2174,12 @@ tslib.__decorate([
|
|
|
2201
2174
|
tslib.__metadata("design:type", Payment)
|
|
2202
2175
|
], Order.prototype, "payment", void 0);
|
|
2203
2176
|
|
|
2177
|
+
class OrderBlocked extends BaseModel {
|
|
2178
|
+
static get identifiersFields() {
|
|
2179
|
+
return ['id'];
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2204
2183
|
class CheckoutSubscription extends BaseModel {
|
|
2205
2184
|
static get identifiersFields() {
|
|
2206
2185
|
return ['id'];
|
|
@@ -3592,6 +3571,47 @@ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
|
3592
3571
|
}
|
|
3593
3572
|
}
|
|
3594
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
|
+
|
|
3595
3615
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3596
3616
|
constructor({ firestore, interceptors }) {
|
|
3597
3617
|
super({
|
|
@@ -4725,7 +4745,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4725
4745
|
'name',
|
|
4726
4746
|
'description',
|
|
4727
4747
|
'image',
|
|
4728
|
-
{ images: { columnName: 'images', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4729
4748
|
'published',
|
|
4730
4749
|
'shop',
|
|
4731
4750
|
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
@@ -4781,7 +4800,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4781
4800
|
{
|
|
4782
4801
|
metadata: {
|
|
4783
4802
|
columnName: 'metadata',
|
|
4784
|
-
fields: ['
|
|
4803
|
+
fields: ['title', 'description'],
|
|
4785
4804
|
bindPersistData: (value) => ({
|
|
4786
4805
|
metadata: { data: value },
|
|
4787
4806
|
}),
|
|
@@ -4807,22 +4826,8 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4807
4826
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
4808
4827
|
}
|
|
4809
4828
|
async create(params) {
|
|
4810
|
-
const {
|
|
4811
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata ||
|
|
4812
|
-
[exports.Shops.GLAMSHOP]: null,
|
|
4813
|
-
[exports.Shops.MENSMARKET]: null,
|
|
4814
|
-
}, images: images || {
|
|
4815
|
-
[exports.Shops.GLAMSHOP]: {
|
|
4816
|
-
brandBanner: null,
|
|
4817
|
-
brandBannerMobile: null,
|
|
4818
|
-
image: null,
|
|
4819
|
-
},
|
|
4820
|
-
[exports.Shops.MENSMARKET]: {
|
|
4821
|
-
brandBanner: null,
|
|
4822
|
-
brandBannerMobile: null,
|
|
4823
|
-
image: null,
|
|
4824
|
-
},
|
|
4825
|
-
} }));
|
|
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 } }));
|
|
4826
4831
|
}
|
|
4827
4832
|
async get(identifiers) {
|
|
4828
4833
|
var _a;
|
|
@@ -5013,35 +5018,22 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5013
5018
|
return plainData.products;
|
|
5014
5019
|
}
|
|
5015
5020
|
async updateMetadata(categoryId, { metadata }) {
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
});
|
|
5033
|
-
return metadata;
|
|
5034
|
-
}
|
|
5035
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
5036
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5037
|
-
where: {
|
|
5038
|
-
type: 'category_metadata_bool_exp',
|
|
5039
|
-
required: true,
|
|
5040
|
-
value: { category_id: { _eq: categoryId } },
|
|
5041
|
-
},
|
|
5042
|
-
});
|
|
5043
|
-
return [];
|
|
5044
|
-
}
|
|
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;
|
|
5045
5037
|
}
|
|
5046
5038
|
async updateFilters(categoryId, { filters }) {
|
|
5047
5039
|
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
@@ -5875,6 +5867,31 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5875
5867
|
email,
|
|
5876
5868
|
});
|
|
5877
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
|
+
}
|
|
5878
5895
|
}
|
|
5879
5896
|
|
|
5880
5897
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
@@ -6051,7 +6068,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6051
6068
|
{
|
|
6052
6069
|
metadata: {
|
|
6053
6070
|
columnName: 'metadata',
|
|
6054
|
-
fields: ['
|
|
6071
|
+
fields: ['title', 'description'],
|
|
6055
6072
|
bindPersistData: (value) => ({
|
|
6056
6073
|
metadata: { data: value },
|
|
6057
6074
|
}),
|
|
@@ -6081,23 +6098,8 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6081
6098
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
6082
6099
|
}
|
|
6083
6100
|
async create(params) {
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
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 || {
|
|
6087
|
-
[exports.Shops.GLAMSHOP]: null,
|
|
6088
|
-
[exports.Shops.MENSMARKET]: null,
|
|
6089
|
-
}, images: images || {
|
|
6090
|
-
[exports.Shops.GLAMSHOP]: {
|
|
6091
|
-
brandBanner: null,
|
|
6092
|
-
brandBannerMobile: null,
|
|
6093
|
-
image: null,
|
|
6094
|
-
},
|
|
6095
|
-
[exports.Shops.MENSMARKET]: {
|
|
6096
|
-
brandBanner: null,
|
|
6097
|
-
brandBannerMobile: null,
|
|
6098
|
-
image: null,
|
|
6099
|
-
},
|
|
6100
|
-
} }));
|
|
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 } }));
|
|
6101
6103
|
}
|
|
6102
6104
|
async get(identifiers) {
|
|
6103
6105
|
const data = await super.get(identifiers);
|
|
@@ -6228,39 +6230,22 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6228
6230
|
return plainData.products;
|
|
6229
6231
|
}
|
|
6230
6232
|
async updateMetadata(categoryId, { metadata }) {
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
});
|
|
6248
|
-
metadataUpdated.push(update);
|
|
6249
|
-
}
|
|
6250
|
-
return metadataUpdated;
|
|
6251
|
-
}
|
|
6252
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
6253
|
-
for (let i = 0; i < metadata.value.length; i++) {
|
|
6254
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
6255
|
-
where: {
|
|
6256
|
-
type: 'category_metadata_bool_exp',
|
|
6257
|
-
required: true,
|
|
6258
|
-
value: { category_id: { _eq: categoryId }, shop: metadata.value[i].shop },
|
|
6259
|
-
},
|
|
6260
|
-
});
|
|
6261
|
-
}
|
|
6262
|
-
return [];
|
|
6263
|
-
}
|
|
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;
|
|
6264
6249
|
}
|
|
6265
6250
|
}
|
|
6266
6251
|
tslib.__decorate([
|
|
@@ -6462,6 +6447,8 @@ exports.Log = Log;
|
|
|
6462
6447
|
exports.Logger = Logger;
|
|
6463
6448
|
exports.NotFoundError = NotFoundError;
|
|
6464
6449
|
exports.Order = Order;
|
|
6450
|
+
exports.OrderBlocked = OrderBlocked;
|
|
6451
|
+
exports.OrderBlockedFirestoreRepository = OrderBlockedFirestoreRepository;
|
|
6465
6452
|
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|
|
6466
6453
|
exports.Payment = Payment;
|
|
6467
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,33 +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
|
-
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.metadata.find((metadata) => metadata.shop === Shops.GLAMSHOP);
|
|
88
|
-
}
|
|
89
|
-
get mensMetadata() {
|
|
90
|
-
return this.metadata.find((metadata) => metadata.shop === Shops.MENSMARKET);
|
|
91
|
-
}
|
|
92
|
-
getMostRelevantByShop(shop) {
|
|
93
|
-
return this.mostRelevant && this.mostRelevant[shop] ? this.mostRelevant[shop] : [];
|
|
94
|
-
}
|
|
95
53
|
}
|
|
96
54
|
__decorate([
|
|
97
55
|
Type(() => CategoryBase),
|
|
@@ -200,6 +158,21 @@ __decorate([
|
|
|
200
158
|
__metadata("design:type", Category)
|
|
201
159
|
], CategoryFilter.prototype, "category", void 0);
|
|
202
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
|
+
|
|
203
176
|
class FilterOption extends BaseModel {
|
|
204
177
|
static get identifiersFields() {
|
|
205
178
|
return ['id'];
|
|
@@ -2195,6 +2168,12 @@ __decorate([
|
|
|
2195
2168
|
__metadata("design:type", Payment)
|
|
2196
2169
|
], Order.prototype, "payment", void 0);
|
|
2197
2170
|
|
|
2171
|
+
class OrderBlocked extends BaseModel {
|
|
2172
|
+
static get identifiersFields() {
|
|
2173
|
+
return ['id'];
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2198
2177
|
class CheckoutSubscription extends BaseModel {
|
|
2199
2178
|
static get identifiersFields() {
|
|
2200
2179
|
return ['id'];
|
|
@@ -3586,6 +3565,47 @@ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
|
3586
3565
|
}
|
|
3587
3566
|
}
|
|
3588
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
|
+
|
|
3589
3609
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3590
3610
|
constructor({ firestore, interceptors }) {
|
|
3591
3611
|
super({
|
|
@@ -4719,7 +4739,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4719
4739
|
'name',
|
|
4720
4740
|
'description',
|
|
4721
4741
|
'image',
|
|
4722
|
-
{ images: { columnName: 'images', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4723
4742
|
'published',
|
|
4724
4743
|
'shop',
|
|
4725
4744
|
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
@@ -4775,7 +4794,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4775
4794
|
{
|
|
4776
4795
|
metadata: {
|
|
4777
4796
|
columnName: 'metadata',
|
|
4778
|
-
fields: ['
|
|
4797
|
+
fields: ['title', 'description'],
|
|
4779
4798
|
bindPersistData: (value) => ({
|
|
4780
4799
|
metadata: { data: value },
|
|
4781
4800
|
}),
|
|
@@ -4801,22 +4820,8 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4801
4820
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
4802
4821
|
}
|
|
4803
4822
|
async create(params) {
|
|
4804
|
-
const {
|
|
4805
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata ||
|
|
4806
|
-
[Shops.GLAMSHOP]: null,
|
|
4807
|
-
[Shops.MENSMARKET]: null,
|
|
4808
|
-
}, images: images || {
|
|
4809
|
-
[Shops.GLAMSHOP]: {
|
|
4810
|
-
brandBanner: null,
|
|
4811
|
-
brandBannerMobile: null,
|
|
4812
|
-
image: null,
|
|
4813
|
-
},
|
|
4814
|
-
[Shops.MENSMARKET]: {
|
|
4815
|
-
brandBanner: null,
|
|
4816
|
-
brandBannerMobile: null,
|
|
4817
|
-
image: null,
|
|
4818
|
-
},
|
|
4819
|
-
} }));
|
|
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 } }));
|
|
4820
4825
|
}
|
|
4821
4826
|
async get(identifiers) {
|
|
4822
4827
|
var _a;
|
|
@@ -5007,35 +5012,22 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5007
5012
|
return plainData.products;
|
|
5008
5013
|
}
|
|
5009
5014
|
async updateMetadata(categoryId, { metadata }) {
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
});
|
|
5027
|
-
return metadata;
|
|
5028
|
-
}
|
|
5029
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
5030
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5031
|
-
where: {
|
|
5032
|
-
type: 'category_metadata_bool_exp',
|
|
5033
|
-
required: true,
|
|
5034
|
-
value: { category_id: { _eq: categoryId } },
|
|
5035
|
-
},
|
|
5036
|
-
});
|
|
5037
|
-
return [];
|
|
5038
|
-
}
|
|
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;
|
|
5039
5031
|
}
|
|
5040
5032
|
async updateFilters(categoryId, { filters }) {
|
|
5041
5033
|
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
@@ -5869,6 +5861,31 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5869
5861
|
email,
|
|
5870
5862
|
});
|
|
5871
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
|
+
}
|
|
5872
5889
|
}
|
|
5873
5890
|
|
|
5874
5891
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
@@ -6045,7 +6062,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6045
6062
|
{
|
|
6046
6063
|
metadata: {
|
|
6047
6064
|
columnName: 'metadata',
|
|
6048
|
-
fields: ['
|
|
6065
|
+
fields: ['title', 'description'],
|
|
6049
6066
|
bindPersistData: (value) => ({
|
|
6050
6067
|
metadata: { data: value },
|
|
6051
6068
|
}),
|
|
@@ -6075,23 +6092,8 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6075
6092
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
6076
6093
|
}
|
|
6077
6094
|
async create(params) {
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
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 || {
|
|
6081
|
-
[Shops.GLAMSHOP]: null,
|
|
6082
|
-
[Shops.MENSMARKET]: null,
|
|
6083
|
-
}, images: images || {
|
|
6084
|
-
[Shops.GLAMSHOP]: {
|
|
6085
|
-
brandBanner: null,
|
|
6086
|
-
brandBannerMobile: null,
|
|
6087
|
-
image: null,
|
|
6088
|
-
},
|
|
6089
|
-
[Shops.MENSMARKET]: {
|
|
6090
|
-
brandBanner: null,
|
|
6091
|
-
brandBannerMobile: null,
|
|
6092
|
-
image: null,
|
|
6093
|
-
},
|
|
6094
|
-
} }));
|
|
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 } }));
|
|
6095
6097
|
}
|
|
6096
6098
|
async get(identifiers) {
|
|
6097
6099
|
const data = await super.get(identifiers);
|
|
@@ -6222,39 +6224,22 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6222
6224
|
return plainData.products;
|
|
6223
6225
|
}
|
|
6224
6226
|
async updateMetadata(categoryId, { metadata }) {
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
});
|
|
6242
|
-
metadataUpdated.push(update);
|
|
6243
|
-
}
|
|
6244
|
-
return metadataUpdated;
|
|
6245
|
-
}
|
|
6246
|
-
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
6247
|
-
for (let i = 0; i < metadata.value.length; i++) {
|
|
6248
|
-
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
6249
|
-
where: {
|
|
6250
|
-
type: 'category_metadata_bool_exp',
|
|
6251
|
-
required: true,
|
|
6252
|
-
value: { category_id: { _eq: categoryId }, shop: metadata.value[i].shop },
|
|
6253
|
-
},
|
|
6254
|
-
});
|
|
6255
|
-
}
|
|
6256
|
-
return [];
|
|
6257
|
-
}
|
|
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;
|
|
6258
6243
|
}
|
|
6259
6244
|
}
|
|
6260
6245
|
__decorate([
|
|
@@ -6282,4 +6267,4 @@ __decorate([
|
|
|
6282
6267
|
__metadata("design:returntype", Promise)
|
|
6283
6268
|
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
6284
6269
|
|
|
6285
|
-
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,28 +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
|
-
get mensImages(): {
|
|
40
|
-
image: string;
|
|
41
|
-
brandBanner: string;
|
|
42
|
-
brandBannerMobile: string;
|
|
43
|
-
};
|
|
44
|
-
get glamMetadata(): CategoryMetadata;
|
|
45
|
-
get mensMetadata(): CategoryMetadata;
|
|
46
|
-
getMostRelevantByShop(shop: Shops): string[];
|
|
47
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 {};
|