@infrab4a/connect 5.4.0-beta.2 → 5.4.0-beta.21
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 +638 -619
- package/index.esm.js +637 -617
- package/package.json +3 -3
- package/src/domain/catalog/models/category-brand.d.ts +17 -0
- package/src/domain/catalog/models/index.d.ts +1 -0
- package/src/domain/catalog/models/product.d.ts +0 -1
- package/src/domain/catalog/models/variant.d.ts +0 -2
- package/src/domain/catalog/repositories/category-brand.repository.d.ts +4 -0
- package/src/domain/catalog/repositories/index.d.ts +1 -1
- package/src/domain/shopping/enums/payment-providers.enum.d.ts +2 -1
- package/src/domain/shopping/factories/index.d.ts +1 -0
- package/src/domain/shopping/factories/mercado-pago-payment-method.factory.d.ts +10 -0
- package/src/domain/shopping/factories/payment-provider.factory.d.ts +2 -0
- package/src/domain/shopping/models/order.d.ts +7 -0
- package/src/domain/shopping/models/payment-transaction.d.ts +2 -0
- package/src/domain/shopping/models/payment.d.ts +1 -0
- package/src/domain/shopping/services/antifraud-card.service.d.ts +2 -0
- package/src/domain/shopping/types/checkout-paylod-request.type.d.ts +2 -7
- package/src/domain/shopping/types/index.d.ts +2 -0
- package/src/domain/shopping/types/mercado-pago-card.type.d.ts +3 -0
- package/src/domain/shopping/types/mercado-pago-credentials.type.d.ts +5 -0
- package/src/domain/shopping/types/payment-card-info.type.d.ts +2 -0
- package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/catalog/category-brand-firestore.repository.d.ts +7 -0
- package/src/infra/firebase/firestore/repositories/catalog/index.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +0 -1
- package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +0 -1
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +0 -1
- package/src/infra/index.d.ts +1 -0
- package/src/infra/mercado-pago/adapters/index.d.ts +3 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-boleto-payment-axios.adapter.d.ts +8 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-card-payment-axios.adapter.d.ts +19 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-pix-payment-axios.adapter.d.ts +7 -0
- package/src/infra/mercado-pago/helpers/index.d.ts +2 -0
- package/src/infra/mercado-pago/helpers/mercado-pago-request.helper.d.ts +69 -0
- package/src/infra/mercado-pago/helpers/mercado-pago-response.helper.d.ts +8 -0
- package/src/infra/mercado-pago/index.d.ts +3 -0
- package/src/infra/mercado-pago/types/index.d.ts +2 -0
- package/src/infra/mercado-pago/types/mercado-pago-request.type.d.ts +1 -0
- package/src/infra/mercado-pago/types/mercado-pago-response.type.d.ts +180 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-request.helper.d.ts +1 -0
- package/src/infra/pagarme/types/v5/pagarmev5-order-request-payload.type.d.ts +1 -0
- package/src/utils/index.d.ts +2 -2
- package/src/domain/catalog/repositories/product-catalog.repository.d.ts +0 -13
- package/src/infra/hasura-graphql/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts +0 -20
package/index.esm.js
CHANGED
|
@@ -3,8 +3,8 @@ import { __decorate, __metadata } from 'tslib';
|
|
|
3
3
|
import { plainToInstance, instanceToPlain, Type } from 'class-transformer';
|
|
4
4
|
import { parseISO, startOfDay, endOfDay, addHours, subDays, format, addDays } from 'date-fns';
|
|
5
5
|
export { add, addBusinessDays, addDays, addMonths, addYears, endOfDay, format, formatISO9075, parseISO, startOfDay, sub, subDays } from 'date-fns';
|
|
6
|
-
import {
|
|
7
|
-
export { formatInTimeZone
|
|
6
|
+
import { utcToZonedTime } from 'date-fns-tz';
|
|
7
|
+
export { formatInTimeZone } from 'date-fns-tz';
|
|
8
8
|
import { compact, get, isNil, isArray, first, last, flatten, isString, omit, each, unset, isObject, isEmpty, isDate, isBoolean, isInteger, isNumber, isNaN as isNaN$1, set, chunk, sortBy } from 'lodash';
|
|
9
9
|
export { chunk, each, get, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set, sortBy, unset } from 'lodash';
|
|
10
10
|
import { debug } from 'debug';
|
|
@@ -90,6 +90,7 @@ var PaymentProviders;
|
|
|
90
90
|
PaymentProviders["PAGARME"] = "pagarMe";
|
|
91
91
|
PaymentProviders["ADYEN"] = "adyen";
|
|
92
92
|
PaymentProviders["GLAMPOINTS"] = "glampoints";
|
|
93
|
+
PaymentProviders["MERCADOPAGO"] = "mercadoPago";
|
|
93
94
|
})(PaymentProviders || (PaymentProviders = {}));
|
|
94
95
|
|
|
95
96
|
var TransactionPaymentMethods;
|
|
@@ -123,6 +124,9 @@ class AntifraudProviderFactory {
|
|
|
123
124
|
class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
class MercadoPagoPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
128
|
+
}
|
|
129
|
+
|
|
126
130
|
class PagarmePaymentMethodFactory extends BasePaymentMethodFactory {
|
|
127
131
|
}
|
|
128
132
|
|
|
@@ -733,6 +737,30 @@ __decorate([
|
|
|
733
737
|
], Category.prototype, "filters", void 0);
|
|
734
738
|
registerClass('Category', Category);
|
|
735
739
|
|
|
740
|
+
class BrandCategory extends BaseModel {
|
|
741
|
+
get glamImages() {
|
|
742
|
+
return this.images?.[Shops.GLAMSHOP]
|
|
743
|
+
? this.images[Shops.GLAMSHOP]
|
|
744
|
+
: {
|
|
745
|
+
brandBanner: null,
|
|
746
|
+
brandBannerMobile: null,
|
|
747
|
+
image: null,
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
get mensImages() {
|
|
751
|
+
return this.images?.[Shops.MENSMARKET]
|
|
752
|
+
? this.images[Shops.MENSMARKET]
|
|
753
|
+
: {
|
|
754
|
+
brandBanner: null,
|
|
755
|
+
brandBannerMobile: null,
|
|
756
|
+
image: null,
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
static get identifiersFields() {
|
|
760
|
+
return ['id'];
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
736
764
|
class CategoryCollectionChildren extends BaseModel {
|
|
737
765
|
static get identifiersFields() {
|
|
738
766
|
return ['collectionId', 'categoryId'];
|
|
@@ -847,12 +875,7 @@ class Variant extends ProductBase {
|
|
|
847
875
|
static get identifiersFields() {
|
|
848
876
|
return ['id', 'productId'];
|
|
849
877
|
}
|
|
850
|
-
}
|
|
851
|
-
__decorate([
|
|
852
|
-
Type(() => Product),
|
|
853
|
-
__metadata("design:type", Product)
|
|
854
|
-
], Variant.prototype, "product", void 0);
|
|
855
|
-
registerClass('Product', Product);
|
|
878
|
+
}
|
|
856
879
|
|
|
857
880
|
class Product extends ProductBase {
|
|
858
881
|
}
|
|
@@ -1741,19 +1764,58 @@ class AntifraudCardService {
|
|
|
1741
1764
|
constructor(orderRepository, orderBlockedRepository) {
|
|
1742
1765
|
this.orderRepository = orderRepository;
|
|
1743
1766
|
this.orderBlockedRepository = orderBlockedRepository;
|
|
1744
|
-
this.LIMIT_ORDERS_DAY =
|
|
1745
|
-
this.LIMIT_ORDERS_WEEK =
|
|
1746
|
-
this.LIMIT_BLOCKED_ORDERS_DAY = 5;
|
|
1767
|
+
this.LIMIT_ORDERS_DAY = null;
|
|
1768
|
+
this.LIMIT_ORDERS_WEEK = null;
|
|
1747
1769
|
}
|
|
1748
1770
|
async validate(checkout, card) {
|
|
1771
|
+
this.setLimitsByUserType(checkout.user.isSubscriber);
|
|
1749
1772
|
await this.validateBlockedOrderAttempts(checkout, card);
|
|
1750
1773
|
await this.validateDayAndWeekOrderLimits(checkout, card);
|
|
1751
1774
|
return true;
|
|
1752
1775
|
}
|
|
1776
|
+
setLimitsByUserType(isSubscriber) {
|
|
1777
|
+
this.LIMIT_ORDERS_DAY = {
|
|
1778
|
+
subscriber: {
|
|
1779
|
+
cpf: 4,
|
|
1780
|
+
email: 4,
|
|
1781
|
+
phone: 4,
|
|
1782
|
+
card: 4,
|
|
1783
|
+
zip: 4,
|
|
1784
|
+
},
|
|
1785
|
+
nonSubscriber: {
|
|
1786
|
+
cpf: 2,
|
|
1787
|
+
email: 2,
|
|
1788
|
+
phone: 2,
|
|
1789
|
+
card: 2,
|
|
1790
|
+
zip: 2,
|
|
1791
|
+
},
|
|
1792
|
+
};
|
|
1793
|
+
this.LIMIT_ORDERS_WEEK = {
|
|
1794
|
+
subscriber: {
|
|
1795
|
+
cpf: 12,
|
|
1796
|
+
email: 12,
|
|
1797
|
+
phone: 12,
|
|
1798
|
+
card: 12,
|
|
1799
|
+
zip: Infinity,
|
|
1800
|
+
},
|
|
1801
|
+
nonSubscriber: {
|
|
1802
|
+
cpf: 7,
|
|
1803
|
+
email: 7,
|
|
1804
|
+
phone: 7,
|
|
1805
|
+
card: 7,
|
|
1806
|
+
zip: Infinity,
|
|
1807
|
+
},
|
|
1808
|
+
};
|
|
1809
|
+
this.LIMIT_BLOCKED_ORDERS_DAY = isSubscriber ? 7 : 5;
|
|
1810
|
+
}
|
|
1811
|
+
getLimitsByUserType(type, isSubscriber) {
|
|
1812
|
+
const limits = type === 'day' ? this.LIMIT_ORDERS_DAY : this.LIMIT_ORDERS_WEEK;
|
|
1813
|
+
return isSubscriber ? limits['subscriber'] : limits['nonSubscriber'];
|
|
1814
|
+
}
|
|
1753
1815
|
async validateBlockedOrderAttempts(checkout, card) {
|
|
1754
1816
|
const isValid = await this.verifyBlockedOrderAttempts(checkout, card);
|
|
1755
1817
|
if (!isValid) {
|
|
1756
|
-
throw new FraudValidationError(
|
|
1818
|
+
throw new FraudValidationError(`Cliente com mais de ${this.LIMIT_BLOCKED_ORDERS_DAY} compras negadas/bloqueadas no dia`, {
|
|
1757
1819
|
checkoutId: checkout.id,
|
|
1758
1820
|
userEmail: checkout.user.email,
|
|
1759
1821
|
info: {
|
|
@@ -1767,7 +1829,7 @@ class AntifraudCardService {
|
|
|
1767
1829
|
async validateDayAndWeekOrderLimits(checkout, card) {
|
|
1768
1830
|
const isValid = await this.verifyDayAndWeekOrders(checkout, card);
|
|
1769
1831
|
if (!isValid) {
|
|
1770
|
-
throw new FraudValidationError('Cliente tentando comprar mais
|
|
1832
|
+
throw new FraudValidationError('Cliente tentando comprar mais do que o permitido no dia/semana', {
|
|
1771
1833
|
checkoutId: checkout.id,
|
|
1772
1834
|
userEmail: checkout.user.email,
|
|
1773
1835
|
info: {
|
|
@@ -1786,7 +1848,7 @@ class AntifraudCardService {
|
|
|
1786
1848
|
await this.createBlockedOrderRecord({
|
|
1787
1849
|
checkout,
|
|
1788
1850
|
card,
|
|
1789
|
-
reason:
|
|
1851
|
+
reason: `More than ${this.LIMIT_BLOCKED_ORDERS_DAY} attempts have failed`,
|
|
1790
1852
|
key: 'Failed attempts',
|
|
1791
1853
|
period: 'day',
|
|
1792
1854
|
});
|
|
@@ -1796,7 +1858,7 @@ class AntifraudCardService {
|
|
|
1796
1858
|
}
|
|
1797
1859
|
getTodayDateRange() {
|
|
1798
1860
|
const timeZone = 'America/Sao_Paulo';
|
|
1799
|
-
const today =
|
|
1861
|
+
const today = utcToZonedTime(new Date(), timeZone);
|
|
1800
1862
|
const day = startOfDay(today);
|
|
1801
1863
|
const endOfDay$1 = endOfDay(today);
|
|
1802
1864
|
return { day: addHours(day, 3), endOfDay: addHours(endOfDay$1, 3) };
|
|
@@ -1907,26 +1969,28 @@ class AntifraudCardService {
|
|
|
1907
1969
|
}
|
|
1908
1970
|
async validateDayOrderLimits(checkout, params) {
|
|
1909
1971
|
const ordersPerDay = await this.validateOrdersByRange(params, this.getDateRange('day'));
|
|
1972
|
+
const limits = this.getLimitsByUserType('day', checkout.user.isSubscriber);
|
|
1910
1973
|
return this.checkOrderLimitsAndBlock({
|
|
1911
1974
|
checkout,
|
|
1912
1975
|
orderCounts: ordersPerDay,
|
|
1913
|
-
limit:
|
|
1976
|
+
limit: limits,
|
|
1914
1977
|
period: 'day',
|
|
1915
1978
|
});
|
|
1916
1979
|
}
|
|
1917
1980
|
async validateWeekOrderLimits(checkout, params) {
|
|
1918
1981
|
const ordersPerWeek = await this.validateOrdersByRange(params, this.getDateRange('week'));
|
|
1982
|
+
const limits = this.getLimitsByUserType('week', checkout.user.isSubscriber);
|
|
1919
1983
|
return this.checkOrderLimitsAndBlock({
|
|
1920
1984
|
checkout,
|
|
1921
1985
|
orderCounts: ordersPerWeek,
|
|
1922
|
-
limit:
|
|
1986
|
+
limit: limits,
|
|
1923
1987
|
period: 'week',
|
|
1924
1988
|
});
|
|
1925
1989
|
}
|
|
1926
1990
|
async checkOrderLimitsAndBlock(params) {
|
|
1927
1991
|
const { checkout, orderCounts, limit, period } = params;
|
|
1928
1992
|
for (const key in orderCounts) {
|
|
1929
|
-
if (orderCounts[key] >= limit) {
|
|
1993
|
+
if (orderCounts[key] >= limit[key]) {
|
|
1930
1994
|
await this.createBlockedOrderRecord({
|
|
1931
1995
|
checkout,
|
|
1932
1996
|
card: null,
|
|
@@ -3373,8 +3437,6 @@ class HasuraQueryBuilderHelper {
|
|
|
3373
3437
|
class HasuraRequestHelper {
|
|
3374
3438
|
static async fetch(params) {
|
|
3375
3439
|
const { variables, query, endpoint, headers, logger } = params;
|
|
3376
|
-
console.warn('variables', variables);
|
|
3377
|
-
console.warn('query', query);
|
|
3378
3440
|
const request = {
|
|
3379
3441
|
url: endpoint,
|
|
3380
3442
|
method: 'POST',
|
|
@@ -4746,6 +4808,17 @@ const withCrudFirestore = (MixinBase) => {
|
|
|
4746
4808
|
};
|
|
4747
4809
|
};
|
|
4748
4810
|
|
|
4811
|
+
class BrandCategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4812
|
+
constructor({ firestore, interceptors, }) {
|
|
4813
|
+
super({
|
|
4814
|
+
firestore,
|
|
4815
|
+
collectionName: 'brandsCategory',
|
|
4816
|
+
model: BrandCategory,
|
|
4817
|
+
interceptors,
|
|
4818
|
+
});
|
|
4819
|
+
}
|
|
4820
|
+
}
|
|
4821
|
+
|
|
4749
4822
|
class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4750
4823
|
constructor({ firestore, interceptors }) {
|
|
4751
4824
|
super({
|
|
@@ -7199,7 +7272,83 @@ class FilterOptionHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasu
|
|
|
7199
7272
|
}
|
|
7200
7273
|
}
|
|
7201
7274
|
|
|
7202
|
-
|
|
7275
|
+
class ProductErrorsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
7276
|
+
constructor({ endpoint, authOptions, interceptors, cache, }, productRepository) {
|
|
7277
|
+
super({
|
|
7278
|
+
tableName: 'product_errors',
|
|
7279
|
+
model: ProductErrorsHasuraGraphQL,
|
|
7280
|
+
endpoint,
|
|
7281
|
+
authOptions,
|
|
7282
|
+
interceptors,
|
|
7283
|
+
cache,
|
|
7284
|
+
fields: [
|
|
7285
|
+
{
|
|
7286
|
+
productId: {
|
|
7287
|
+
columnName: 'product_id',
|
|
7288
|
+
to: (value) => +value,
|
|
7289
|
+
from: (value) => value.toString(),
|
|
7290
|
+
},
|
|
7291
|
+
},
|
|
7292
|
+
'source',
|
|
7293
|
+
'error',
|
|
7294
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
7295
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
7296
|
+
{
|
|
7297
|
+
product: {
|
|
7298
|
+
columnName: 'product',
|
|
7299
|
+
foreignKeyColumn: { id: 'productId' },
|
|
7300
|
+
fields: [
|
|
7301
|
+
{ id: { columnName: 'id', from: (value) => value.toString() } },
|
|
7302
|
+
{ productId: { columnName: 'main_product_id' } },
|
|
7303
|
+
'name',
|
|
7304
|
+
'published',
|
|
7305
|
+
'group',
|
|
7306
|
+
'validity',
|
|
7307
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
7308
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
7309
|
+
],
|
|
7310
|
+
},
|
|
7311
|
+
},
|
|
7312
|
+
],
|
|
7313
|
+
});
|
|
7314
|
+
this.productRepository = productRepository;
|
|
7315
|
+
}
|
|
7316
|
+
async get(params) {
|
|
7317
|
+
const result = await super.get(params);
|
|
7318
|
+
if (result instanceof VariantHasuraGraphQL) {
|
|
7319
|
+
const product = await this.productRepository.get({ id: result.productId.toString() });
|
|
7320
|
+
result.product.name = product.name;
|
|
7321
|
+
result.product.group = product.group;
|
|
7322
|
+
}
|
|
7323
|
+
return result;
|
|
7324
|
+
}
|
|
7325
|
+
async find(params) {
|
|
7326
|
+
const result = await super.find(params);
|
|
7327
|
+
const variantsWithNoData = result.data.filter((item) => item.product instanceof VariantHasuraGraphQL &&
|
|
7328
|
+
(isEmpty(item.product.name) || isEmpty(item.product.group) || isEmpty(item.product)));
|
|
7329
|
+
if (variantsWithNoData.length > 0) {
|
|
7330
|
+
const { data: products } = await this.productRepository.find({
|
|
7331
|
+
filters: {
|
|
7332
|
+
id: {
|
|
7333
|
+
operator: Where.IN,
|
|
7334
|
+
value: Array.from(new Set(variantsWithNoData.map((item) => item.product.productId?.toString()))),
|
|
7335
|
+
},
|
|
7336
|
+
},
|
|
7337
|
+
});
|
|
7338
|
+
products.forEach((product) => {
|
|
7339
|
+
result.data
|
|
7340
|
+
.filter((variant) => variant.product.productId?.toString() === product.id.toString())
|
|
7341
|
+
.forEach((variant) => {
|
|
7342
|
+
variant.product.name = product.name;
|
|
7343
|
+
variant.product.group = product.group;
|
|
7344
|
+
});
|
|
7345
|
+
});
|
|
7346
|
+
}
|
|
7347
|
+
return result;
|
|
7348
|
+
}
|
|
7349
|
+
}
|
|
7350
|
+
|
|
7351
|
+
const commonFields = [
|
|
7203
7352
|
{
|
|
7204
7353
|
id: {
|
|
7205
7354
|
columnName: 'id',
|
|
@@ -7354,370 +7503,48 @@ const commonFields$1 = [
|
|
|
7354
7503
|
{ reviewsTotal: { columnName: 'reviews_total' } },
|
|
7355
7504
|
{ shoppingCount: { columnName: 'shopping_count' } },
|
|
7356
7505
|
{ categoryId: { columnName: 'category_id' } },
|
|
7506
|
+
{
|
|
7507
|
+
category: {
|
|
7508
|
+
columnName: 'category',
|
|
7509
|
+
foreignKeyColumn: { id: 'categoryId' },
|
|
7510
|
+
fields: ['id', 'name', 'reference', 'slug'],
|
|
7511
|
+
},
|
|
7512
|
+
},
|
|
7357
7513
|
'group',
|
|
7358
7514
|
'validity',
|
|
7359
7515
|
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7360
7516
|
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7361
7517
|
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7362
|
-
{ showVariants: { columnName: 'show_variants' } },
|
|
7363
7518
|
];
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
},
|
|
7382
|
-
limits: {
|
|
7383
|
-
limit: 1,
|
|
7384
|
-
},
|
|
7385
|
-
})
|
|
7386
|
-
.then((res) => res.data.at(0));
|
|
7387
|
-
}
|
|
7388
|
-
async getByEAN(EAN, options) {
|
|
7389
|
-
return super
|
|
7390
|
-
.find({
|
|
7391
|
-
filters: {
|
|
7392
|
-
EAN,
|
|
7393
|
-
},
|
|
7394
|
-
limits: {
|
|
7395
|
-
limit: 1,
|
|
7396
|
-
},
|
|
7397
|
-
})
|
|
7398
|
-
.then((res) => res.data.at(0));
|
|
7399
|
-
}
|
|
7400
|
-
async find(params, optionsParams) {
|
|
7401
|
-
const { filters, fields, ...options } = params || {};
|
|
7402
|
-
const bindFields = fields ||
|
|
7403
|
-
this.fields
|
|
7404
|
-
.map((field) => (typeof field === 'string' ? field : Object.keys(field).shift()))
|
|
7405
|
-
.filter((field) => field !== 'reviews' && field !== 'categories');
|
|
7406
|
-
if (options.options?.minimal?.includes('price'))
|
|
7407
|
-
options.options?.minimal.push('price.price', 'price.fullPrice', 'price.subscriberPrice');
|
|
7408
|
-
if (options.options?.maximum?.includes('price'))
|
|
7409
|
-
options.options?.maximum.push('price.price', 'price.fullPrice', 'price.subscriberPrice');
|
|
7410
|
-
options.options?.minimal?.splice(options.options?.minimal.indexOf('price'), 1);
|
|
7411
|
-
options.options?.maximum?.splice(options.options?.maximum.indexOf('price'), 1);
|
|
7412
|
-
return super.find({
|
|
7413
|
-
...options,
|
|
7414
|
-
filters: { ...filters },
|
|
7519
|
+
const fieldsConfiguration$2 = [
|
|
7520
|
+
...commonFields,
|
|
7521
|
+
{
|
|
7522
|
+
categories: {
|
|
7523
|
+
columnName: 'categories',
|
|
7524
|
+
fields: ['category_id'],
|
|
7525
|
+
bindPersistData: (value) => ({
|
|
7526
|
+
categories: { data: value.map((category) => ({ category_id: +category })) },
|
|
7527
|
+
}),
|
|
7528
|
+
to: (categories) => categories.map((categoryId) => +categoryId),
|
|
7529
|
+
from: (categories) => categories?.map((category) => category?.category_id?.toString()) || [],
|
|
7530
|
+
},
|
|
7531
|
+
},
|
|
7532
|
+
{
|
|
7533
|
+
kitProducts: {
|
|
7534
|
+
columnName: 'kit_products',
|
|
7535
|
+
foreignKeyColumn: { productId: 'id' },
|
|
7415
7536
|
fields: [
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
'subscriberDiscountPercentage',
|
|
7421
|
-
'fullPrice',
|
|
7422
|
-
]
|
|
7423
|
-
: []),
|
|
7537
|
+
{ productId: { columnName: 'product_id' } },
|
|
7538
|
+
{ kitProductId: { columnName: 'kit_product_id' } },
|
|
7539
|
+
'quantity',
|
|
7540
|
+
{ product: { columnName: 'product', foreignKeyColumn: { id: 'product_id' }, fields: commonFields } },
|
|
7424
7541
|
],
|
|
7425
|
-
},
|
|
7426
|
-
}
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
orderBy: {
|
|
7432
|
-
hasStock: 'desc',
|
|
7433
|
-
...(!mainGender ? {} : { intGender: mainGender === 'female' ? 'desc' : 'asc' }),
|
|
7434
|
-
...omit(params.orderBy, ['hasStock', 'intGender']),
|
|
7435
|
-
},
|
|
7436
|
-
}, options);
|
|
7437
|
-
return result;
|
|
7438
|
-
}
|
|
7439
|
-
}
|
|
7440
|
-
__decorate([
|
|
7441
|
-
Log(),
|
|
7442
|
-
__metadata("design:type", Function),
|
|
7443
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
7444
|
-
__metadata("design:returntype", Promise)
|
|
7445
|
-
], ProductCatalogHasuraGraphQLRepository.prototype, "findCatalog", null);
|
|
7446
|
-
|
|
7447
|
-
class ProductErrorsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
7448
|
-
constructor({ endpoint, authOptions, interceptors, cache, }, productRepository) {
|
|
7449
|
-
super({
|
|
7450
|
-
tableName: 'product_errors',
|
|
7451
|
-
model: ProductErrorsHasuraGraphQL,
|
|
7452
|
-
endpoint,
|
|
7453
|
-
authOptions,
|
|
7454
|
-
interceptors,
|
|
7455
|
-
cache,
|
|
7456
|
-
fields: [
|
|
7457
|
-
{
|
|
7458
|
-
productId: {
|
|
7459
|
-
columnName: 'product_id',
|
|
7460
|
-
to: (value) => +value,
|
|
7461
|
-
from: (value) => value.toString(),
|
|
7462
|
-
},
|
|
7463
|
-
},
|
|
7464
|
-
'source',
|
|
7465
|
-
'error',
|
|
7466
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
7467
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
7468
|
-
{
|
|
7469
|
-
product: {
|
|
7470
|
-
columnName: 'product',
|
|
7471
|
-
foreignKeyColumn: { id: 'productId' },
|
|
7472
|
-
fields: [
|
|
7473
|
-
{ id: { columnName: 'id', from: (value) => value.toString() } },
|
|
7474
|
-
{ productId: { columnName: 'main_product_id' } },
|
|
7475
|
-
'name',
|
|
7476
|
-
'published',
|
|
7477
|
-
'group',
|
|
7478
|
-
'validity',
|
|
7479
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
7480
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
7481
|
-
],
|
|
7482
|
-
},
|
|
7483
|
-
},
|
|
7484
|
-
],
|
|
7485
|
-
});
|
|
7486
|
-
this.productRepository = productRepository;
|
|
7487
|
-
}
|
|
7488
|
-
async get(params) {
|
|
7489
|
-
const result = await super.get(params);
|
|
7490
|
-
if (result instanceof VariantHasuraGraphQL) {
|
|
7491
|
-
const product = await this.productRepository.get({ id: result.productId.toString() });
|
|
7492
|
-
result.product.name = product.name;
|
|
7493
|
-
result.product.group = product.group;
|
|
7494
|
-
}
|
|
7495
|
-
return result;
|
|
7496
|
-
}
|
|
7497
|
-
async find(params) {
|
|
7498
|
-
const result = await super.find(params);
|
|
7499
|
-
const variantsWithNoData = result.data.filter((item) => item.product instanceof VariantHasuraGraphQL &&
|
|
7500
|
-
(isEmpty(item.product.name) || isEmpty(item.product.group) || isEmpty(item.product)));
|
|
7501
|
-
if (variantsWithNoData.length > 0) {
|
|
7502
|
-
const { data: products } = await this.productRepository.find({
|
|
7503
|
-
filters: {
|
|
7504
|
-
id: {
|
|
7505
|
-
operator: Where.IN,
|
|
7506
|
-
value: Array.from(new Set(variantsWithNoData.map((item) => item.product.productId?.toString()))),
|
|
7507
|
-
},
|
|
7508
|
-
},
|
|
7509
|
-
});
|
|
7510
|
-
products.forEach((product) => {
|
|
7511
|
-
result.data
|
|
7512
|
-
.filter((variant) => variant.product.productId?.toString() === product.id.toString())
|
|
7513
|
-
.forEach((variant) => {
|
|
7514
|
-
variant.product.name = product.name;
|
|
7515
|
-
variant.product.group = product.group;
|
|
7516
|
-
});
|
|
7517
|
-
});
|
|
7518
|
-
}
|
|
7519
|
-
return result;
|
|
7520
|
-
}
|
|
7521
|
-
}
|
|
7522
|
-
|
|
7523
|
-
const commonFields = [
|
|
7524
|
-
{
|
|
7525
|
-
id: {
|
|
7526
|
-
columnName: 'id',
|
|
7527
|
-
to: (value) => +value,
|
|
7528
|
-
from: (value) => value.toString(),
|
|
7529
|
-
},
|
|
7530
|
-
},
|
|
7531
|
-
{ firestoreId: { columnName: 'firestore_id' } },
|
|
7532
|
-
{ productId: { columnName: 'main_product_id' } },
|
|
7533
|
-
{ CEST: { columnName: 'cest' } },
|
|
7534
|
-
{ EAN: { columnName: 'ean' } },
|
|
7535
|
-
{ NCM: { columnName: 'ncm' } },
|
|
7536
|
-
'brand',
|
|
7537
|
-
{ costPrice: { columnName: 'cost_price' } },
|
|
7538
|
-
{
|
|
7539
|
-
description: {
|
|
7540
|
-
columnName: 'description',
|
|
7541
|
-
from: (description, data) => ({
|
|
7542
|
-
description,
|
|
7543
|
-
differentials: data.differentials,
|
|
7544
|
-
whoMustUse: data.who_must_use,
|
|
7545
|
-
howToUse: data.how_to_use,
|
|
7546
|
-
brand: data.brand_description,
|
|
7547
|
-
ingredients: data.ingredients,
|
|
7548
|
-
purpose: data.purpose,
|
|
7549
|
-
}),
|
|
7550
|
-
bindFindFilter: (filters) => {
|
|
7551
|
-
return {
|
|
7552
|
-
...(filters?.description && { description: filters.description }),
|
|
7553
|
-
...(filters.differentials && { differentials: filters.differentials }),
|
|
7554
|
-
...(filters.whoMustUse && {
|
|
7555
|
-
who_must_use: filters.whoMustUse,
|
|
7556
|
-
}),
|
|
7557
|
-
...(filters.howToUse && {
|
|
7558
|
-
how_to_use: filters.howToUse,
|
|
7559
|
-
}),
|
|
7560
|
-
...(filters.brand && {
|
|
7561
|
-
brand_description: filters.brand,
|
|
7562
|
-
}),
|
|
7563
|
-
...(filters.ingredients && {
|
|
7564
|
-
ingredients: filters.ingredients,
|
|
7565
|
-
}),
|
|
7566
|
-
...(filters.purpose && {
|
|
7567
|
-
purpose: filters.purpose,
|
|
7568
|
-
}),
|
|
7569
|
-
};
|
|
7570
|
-
},
|
|
7571
|
-
bindPersistData: (descriptionData) => ({
|
|
7572
|
-
...(descriptionData?.description && { description: descriptionData.description }),
|
|
7573
|
-
...(descriptionData.differentials && { differentials: descriptionData.differentials }),
|
|
7574
|
-
...(descriptionData.whoMustUse && {
|
|
7575
|
-
who_must_use: descriptionData.whoMustUse,
|
|
7576
|
-
}),
|
|
7577
|
-
...(descriptionData.howToUse && { how_to_use: descriptionData.howToUse }),
|
|
7578
|
-
...(descriptionData.brand && { brand_description: descriptionData.brand }),
|
|
7579
|
-
...(descriptionData.ingredients && { ingredients: descriptionData.ingredients }),
|
|
7580
|
-
...(descriptionData.purpose && { purpose: descriptionData.purpose }),
|
|
7581
|
-
}),
|
|
7582
|
-
},
|
|
7583
|
-
},
|
|
7584
|
-
{ differentials: { columnName: 'differentials' } },
|
|
7585
|
-
{ whoMustUse: { columnName: 'who_must_use' } },
|
|
7586
|
-
{ howToUse: { columnName: 'how_to_use' } },
|
|
7587
|
-
{ brandDescription: { columnName: 'brand_description' } },
|
|
7588
|
-
{ ingredients: { columnName: 'ingredients' } },
|
|
7589
|
-
{ purpose: { columnName: 'purpose' } },
|
|
7590
|
-
{ hasVariants: { columnName: 'has_variants' } },
|
|
7591
|
-
{
|
|
7592
|
-
images: {
|
|
7593
|
-
columnName: 'images',
|
|
7594
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
7595
|
-
},
|
|
7596
|
-
},
|
|
7597
|
-
{
|
|
7598
|
-
miniatures: {
|
|
7599
|
-
columnName: 'miniatures',
|
|
7600
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
7601
|
-
},
|
|
7602
|
-
},
|
|
7603
|
-
{
|
|
7604
|
-
imagesCard: {
|
|
7605
|
-
columnName: 'images_card',
|
|
7606
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
7607
|
-
},
|
|
7608
|
-
},
|
|
7609
|
-
'name',
|
|
7610
|
-
{
|
|
7611
|
-
price: {
|
|
7612
|
-
columnName: 'price',
|
|
7613
|
-
from: (price, data) => ({
|
|
7614
|
-
price,
|
|
7615
|
-
fullPrice: data.full_price,
|
|
7616
|
-
subscriberDiscountPercentage: data.subscriber_discount_percentage,
|
|
7617
|
-
fullPriceDiscountPercentage: data.full_price_discount_percentage,
|
|
7618
|
-
subscriberPrice: data.subscriber_price,
|
|
7619
|
-
}),
|
|
7620
|
-
bindFindFilter: (filters) => {
|
|
7621
|
-
return {
|
|
7622
|
-
...((filters?.price || filters?.price === 0) && { price: filters.price }),
|
|
7623
|
-
...((filters.fullPrice || filters.fullPrice === 0) && { full_price: filters.fullPrice }),
|
|
7624
|
-
...((filters.subscriberDiscountPercentage || filters.subscriberDiscountPercentage === 0) && {
|
|
7625
|
-
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
7626
|
-
}),
|
|
7627
|
-
...((filters.subscriberPrice || filters.subscriberPrice === 0) && {
|
|
7628
|
-
subscriber_price: filters.subscriberPrice,
|
|
7629
|
-
}),
|
|
7630
|
-
...((filters.fullPriceDiscountPercentage || filters.fullPriceDiscountPercentage === 0) && {
|
|
7631
|
-
full_price_discount_percentage: filters.fullPriceDiscountPercentage,
|
|
7632
|
-
}),
|
|
7633
|
-
};
|
|
7634
|
-
},
|
|
7635
|
-
bindPersistData: (priceData) => ({
|
|
7636
|
-
...(priceData?.price >= 0 && { price: priceData.price }),
|
|
7637
|
-
...(priceData.fullPrice >= 0 && { full_price: priceData.fullPrice }),
|
|
7638
|
-
...(priceData.subscriberDiscountPercentage >= 0 && {
|
|
7639
|
-
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
7640
|
-
}),
|
|
7641
|
-
...(priceData.subscriberPrice >= 0 && { subscriber_price: priceData.subscriberPrice }),
|
|
7642
|
-
...(priceData.fullPriceDiscountPercentage >= 0 && {
|
|
7643
|
-
full_price_discount_percentage: priceData.fullPriceDiscountPercentage,
|
|
7644
|
-
}),
|
|
7645
|
-
}),
|
|
7646
|
-
},
|
|
7647
|
-
},
|
|
7648
|
-
{ fullPrice: { columnName: 'full_price' } },
|
|
7649
|
-
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
7650
|
-
{ fullPriceDiscountPercentage: { columnName: 'full_price_discount_percentage' } },
|
|
7651
|
-
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
7652
|
-
'published',
|
|
7653
|
-
'outlet',
|
|
7654
|
-
'label',
|
|
7655
|
-
'sku',
|
|
7656
|
-
{
|
|
7657
|
-
stock: {
|
|
7658
|
-
columnName: 'stock',
|
|
7659
|
-
from: (quantity) => ({ quantity }),
|
|
7660
|
-
to: (value) => (isNil(value?.quantity) ? value : value?.quantity),
|
|
7661
|
-
},
|
|
7662
|
-
},
|
|
7663
|
-
{ hasStock: { columnName: 'has_stock' } },
|
|
7664
|
-
'slug',
|
|
7665
|
-
'type',
|
|
7666
|
-
'video',
|
|
7667
|
-
'weight',
|
|
7668
|
-
'gender',
|
|
7669
|
-
{ intGender: { columnName: 'int_gender' } },
|
|
7670
|
-
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7671
|
-
{ isKit: { columnName: 'is_kit' } },
|
|
7672
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
7673
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
7674
|
-
{ rate: { columnName: 'rating' } },
|
|
7675
|
-
{ reviewsTotal: { columnName: 'reviews_total' } },
|
|
7676
|
-
{ shoppingCount: { columnName: 'shopping_count' } },
|
|
7677
|
-
{ categoryId: { columnName: 'category_id' } },
|
|
7678
|
-
{
|
|
7679
|
-
category: {
|
|
7680
|
-
columnName: 'category',
|
|
7681
|
-
foreignKeyColumn: { id: 'categoryId' },
|
|
7682
|
-
fields: ['id', 'name', 'reference', 'slug'],
|
|
7683
|
-
},
|
|
7684
|
-
},
|
|
7685
|
-
'group',
|
|
7686
|
-
'validity',
|
|
7687
|
-
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7688
|
-
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7689
|
-
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7690
|
-
{ showVariants: { columnName: 'show_variants' } },
|
|
7691
|
-
];
|
|
7692
|
-
const fieldsConfiguration$2 = [
|
|
7693
|
-
...commonFields,
|
|
7694
|
-
{
|
|
7695
|
-
categories: {
|
|
7696
|
-
columnName: 'categories',
|
|
7697
|
-
fields: ['category_id'],
|
|
7698
|
-
bindPersistData: (value) => ({
|
|
7699
|
-
categories: { data: value.map((category) => ({ category_id: +category })) },
|
|
7700
|
-
}),
|
|
7701
|
-
to: (categories) => categories.map((categoryId) => +categoryId),
|
|
7702
|
-
from: (categories) => categories?.map((category) => category?.category_id?.toString()) || [],
|
|
7703
|
-
},
|
|
7704
|
-
},
|
|
7705
|
-
{
|
|
7706
|
-
kitProducts: {
|
|
7707
|
-
columnName: 'kit_products',
|
|
7708
|
-
foreignKeyColumn: { productId: 'id' },
|
|
7709
|
-
fields: [
|
|
7710
|
-
{ productId: { columnName: 'product_id' } },
|
|
7711
|
-
{ kitProductId: { columnName: 'kit_product_id' } },
|
|
7712
|
-
'quantity',
|
|
7713
|
-
{ product: { columnName: 'product', foreignKeyColumn: { id: 'product_id' }, fields: commonFields } },
|
|
7714
|
-
],
|
|
7715
|
-
},
|
|
7716
|
-
},
|
|
7717
|
-
{
|
|
7718
|
-
reviews: {
|
|
7719
|
-
columnName: 'reviews',
|
|
7720
|
-
foreignKeyColumn: { product_id: 'id' },
|
|
7542
|
+
},
|
|
7543
|
+
},
|
|
7544
|
+
{
|
|
7545
|
+
reviews: {
|
|
7546
|
+
columnName: 'reviews',
|
|
7547
|
+
foreignKeyColumn: { product_id: 'id' },
|
|
7721
7548
|
fields: [
|
|
7722
7549
|
'id',
|
|
7723
7550
|
'shop',
|
|
@@ -7751,61 +7578,9 @@ const fieldsConfiguration$2 = [
|
|
|
7751
7578
|
foreignKeyColumn: { product_id: 'id' },
|
|
7752
7579
|
fields: [
|
|
7753
7580
|
'id',
|
|
7754
|
-
'name',
|
|
7755
7581
|
'ean',
|
|
7756
7582
|
'sku',
|
|
7757
|
-
|
|
7758
|
-
description: {
|
|
7759
|
-
columnName: 'description',
|
|
7760
|
-
from: (description, data) => ({
|
|
7761
|
-
description,
|
|
7762
|
-
differentials: data.differentials,
|
|
7763
|
-
whoMustUse: data.who_must_use,
|
|
7764
|
-
howToUse: data.how_to_use,
|
|
7765
|
-
brand: data.brand_description,
|
|
7766
|
-
ingredients: data.ingredients,
|
|
7767
|
-
purpose: data.purpose,
|
|
7768
|
-
}),
|
|
7769
|
-
bindFindFilter: (filters) => {
|
|
7770
|
-
return {
|
|
7771
|
-
...(filters?.description && { description: filters.description }),
|
|
7772
|
-
...(filters.differentials && { differentials: filters.differentials }),
|
|
7773
|
-
...(filters.whoMustUse && {
|
|
7774
|
-
who_must_use: filters.whoMustUse,
|
|
7775
|
-
}),
|
|
7776
|
-
...(filters.howToUse && {
|
|
7777
|
-
how_to_use: filters.howToUse,
|
|
7778
|
-
}),
|
|
7779
|
-
...(filters.brand && {
|
|
7780
|
-
brand_description: filters.brand,
|
|
7781
|
-
}),
|
|
7782
|
-
...(filters.ingredients && {
|
|
7783
|
-
ingredients: filters.ingredients,
|
|
7784
|
-
}),
|
|
7785
|
-
...(filters.purpose && {
|
|
7786
|
-
purpose: filters.purpose,
|
|
7787
|
-
}),
|
|
7788
|
-
};
|
|
7789
|
-
},
|
|
7790
|
-
bindPersistData: (descriptionData) => ({
|
|
7791
|
-
...(descriptionData?.description && { description: descriptionData.description }),
|
|
7792
|
-
...(descriptionData.differentials && { differentials: descriptionData.differentials }),
|
|
7793
|
-
...(descriptionData.whoMustUse && {
|
|
7794
|
-
who_must_use: descriptionData.whoMustUse,
|
|
7795
|
-
}),
|
|
7796
|
-
...(descriptionData.howToUse && { how_to_use: descriptionData.howToUse }),
|
|
7797
|
-
...(descriptionData.brand && { brand_description: descriptionData.brand }),
|
|
7798
|
-
...(descriptionData.ingredients && { ingredients: descriptionData.ingredients }),
|
|
7799
|
-
...(descriptionData.purpose && { purpose: descriptionData.purpose }),
|
|
7800
|
-
}),
|
|
7801
|
-
},
|
|
7802
|
-
},
|
|
7803
|
-
{ differentials: { columnName: 'differentials' } },
|
|
7804
|
-
{ whoMustUse: { columnName: 'who_must_use' } },
|
|
7805
|
-
{ howToUse: { columnName: 'how_to_use' } },
|
|
7806
|
-
{ brandDescription: { columnName: 'brand_description' } },
|
|
7807
|
-
{ ingredients: { columnName: 'ingredients' } },
|
|
7808
|
-
{ purpose: { columnName: 'purpose' } },
|
|
7583
|
+
'description',
|
|
7809
7584
|
{
|
|
7810
7585
|
grade: {
|
|
7811
7586
|
columnName: 'grade',
|
|
@@ -7851,6 +7626,10 @@ const fieldsConfiguration$2 = [
|
|
|
7851
7626
|
}),
|
|
7852
7627
|
},
|
|
7853
7628
|
},
|
|
7629
|
+
{ fullPrice: { columnName: 'full_price' } },
|
|
7630
|
+
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
7631
|
+
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
7632
|
+
{ fullPriceDiscountPercentage: { columnName: 'full_price_discount_percentage' } },
|
|
7854
7633
|
'published',
|
|
7855
7634
|
{
|
|
7856
7635
|
stock: {
|
|
@@ -7942,10 +7721,9 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7942
7721
|
? (await this.find({ filters: { firestoreId: identifiers.id }, options: { enableCount: false } }, options))
|
|
7943
7722
|
.data?.[0]
|
|
7944
7723
|
: await super.get(identifiers, options);
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
(await this.findReviewsByProduct(product.productId ? +product.productId : +product.id, false, options));
|
|
7724
|
+
if (product.productId)
|
|
7725
|
+
throw new NotFoundError('Product not found, it is a variant');
|
|
7726
|
+
product.reviews = product.reviews || (await this.findReviewsByProduct(+product.id, options));
|
|
7949
7727
|
return product;
|
|
7950
7728
|
}
|
|
7951
7729
|
async find(params, optionsParams) {
|
|
@@ -7962,9 +7740,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7962
7740
|
options.options?.maximum?.splice(options.options?.maximum.indexOf('price'), 1);
|
|
7963
7741
|
return super.find({
|
|
7964
7742
|
...options,
|
|
7965
|
-
filters: { ...filters },
|
|
7966
|
-
// filters: { ...filters, hasVariants: { operator: Where.EQUALS, value: false } },
|
|
7967
|
-
// filters: { ...filters, productId: { operator: Where.ISNULL } },
|
|
7743
|
+
filters: { ...filters, productId: { operator: Where.ISNULL } },
|
|
7968
7744
|
fields: [
|
|
7969
7745
|
...bindFields,
|
|
7970
7746
|
...(bindFields.includes('price')
|
|
@@ -7998,13 +7774,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7998
7774
|
if (!result.data.length)
|
|
7999
7775
|
return null;
|
|
8000
7776
|
const product = result?.data?.shift();
|
|
8001
|
-
if (product.productId) ;
|
|
8002
|
-
console.warn('product getBySlug', product);
|
|
8003
|
-
console.warn('vai entrar', !product.reviews.length && product.rate > 0);
|
|
8004
|
-
if (!product.reviews.length && product.rate > 0) {
|
|
8005
|
-
console.warn('entrou');
|
|
8006
|
-
product.reviews = await this.findReviewsByProduct((product.productId ? product.productId : product.id), true);
|
|
8007
|
-
}
|
|
8008
7777
|
RoundProductPricesHelper.roundProductPrices(product);
|
|
8009
7778
|
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
8010
7779
|
const cacheKey = `${this.model.name.toLowerCase()}:slug:${slug}`;
|
|
@@ -8017,18 +7786,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8017
7786
|
}
|
|
8018
7787
|
return product;
|
|
8019
7788
|
}
|
|
8020
|
-
async getBySlugVariantData(product) {
|
|
8021
|
-
if (!product.reviews.length && product.rate > 0) {
|
|
8022
|
-
product.reviews = await this.findReviewsByProduct((product.productId ? product.productId : product.id), true);
|
|
8023
|
-
}
|
|
8024
|
-
// if (!product.metadata) {
|
|
8025
|
-
// product.metadata = await this.findReviewsByProduct(
|
|
8026
|
-
// (product.productId ? product.productId : product.id) as number,
|
|
8027
|
-
// true,
|
|
8028
|
-
// )
|
|
8029
|
-
// }
|
|
8030
|
-
return product;
|
|
8031
|
-
}
|
|
8032
7789
|
async getByEAN(EAN, options) {
|
|
8033
7790
|
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
8034
7791
|
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
@@ -8218,7 +7975,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8218
7975
|
return data?.[0]?.id;
|
|
8219
7976
|
throw new NotFoundError(`Product with id ${id} not found`);
|
|
8220
7977
|
}
|
|
8221
|
-
async findReviewsByProduct(productId,
|
|
7978
|
+
async findReviewsByProduct(productId, options) {
|
|
8222
7979
|
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
8223
7980
|
const cacheKey = `${this.model.name.toLowerCase()}:reviews:product:${productId}`;
|
|
8224
7981
|
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
@@ -8231,7 +7988,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8231
7988
|
where: {
|
|
8232
7989
|
value: {
|
|
8233
7990
|
product_id: { _eq: productId },
|
|
8234
|
-
...(onlyApproved && { status: { _eq: true } }),
|
|
8235
7991
|
},
|
|
8236
7992
|
type: 'product_review_bool_exp',
|
|
8237
7993
|
required: true,
|
|
@@ -8340,7 +8096,7 @@ __decorate([
|
|
|
8340
8096
|
__decorate([
|
|
8341
8097
|
Log(),
|
|
8342
8098
|
__metadata("design:type", Function),
|
|
8343
|
-
__metadata("design:paramtypes", [Number,
|
|
8099
|
+
__metadata("design:paramtypes", [Number, Object]),
|
|
8344
8100
|
__metadata("design:returntype", Promise)
|
|
8345
8101
|
], ProductHasuraGraphQLRepository.prototype, "findReviewsByProduct", null);
|
|
8346
8102
|
|
|
@@ -8524,147 +8280,70 @@ const fieldsConfiguration$1 = [
|
|
|
8524
8280
|
}),
|
|
8525
8281
|
...((filters.fullPriceDiscountPercentage || filters.fullPriceDiscountPercentage === 0) && {
|
|
8526
8282
|
full_price_discount_percentage: filters.fullPriceDiscountPercentage,
|
|
8527
|
-
}),
|
|
8528
|
-
};
|
|
8529
|
-
},
|
|
8530
|
-
bindPersistData: (priceData) => ({
|
|
8531
|
-
...((priceData?.price || 0) >= 0 && { price: priceData.price }),
|
|
8532
|
-
...((priceData?.fullPrice || 0) >= 0 && { full_price: priceData.fullPrice }),
|
|
8533
|
-
...((priceData?.subscriberDiscountPercentage || 0) >= 0 && {
|
|
8534
|
-
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
8535
|
-
}),
|
|
8536
|
-
...((priceData?.subscriberPrice || 0) >= 0 && { subscriber_price: priceData.subscriberPrice }),
|
|
8537
|
-
...(priceData.fullPriceDiscountPercentage >= 0 && {
|
|
8538
|
-
full_price_discount_percentage: priceData.fullPriceDiscountPercentage,
|
|
8539
|
-
}),
|
|
8540
|
-
}),
|
|
8541
|
-
},
|
|
8542
|
-
},
|
|
8543
|
-
{ fullPrice: { columnName: 'full_price' } },
|
|
8544
|
-
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
8545
|
-
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
8546
|
-
{ fullPriceDiscountPercentage: { columnName: 'full_price_discount_percentage' } },
|
|
8547
|
-
'sku',
|
|
8548
|
-
{
|
|
8549
|
-
stock: {
|
|
8550
|
-
columnName: 'stock',
|
|
8551
|
-
from: (quantity) => ({ quantity }),
|
|
8552
|
-
to: (value) => (isNil(value?.quantity) ? value : value?.quantity),
|
|
8553
|
-
},
|
|
8554
|
-
},
|
|
8555
|
-
{ hasStock: { columnName: 'has_stock' } },
|
|
8556
|
-
'weight',
|
|
8557
|
-
{ name: { to: () => '', from: () => undefined } },
|
|
8558
|
-
{ hasVariants: { columnName: 'has_variants', to: () => false, from: () => undefined } },
|
|
8559
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
8560
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
8561
|
-
{
|
|
8562
|
-
grade: {
|
|
8563
|
-
columnName: 'grade',
|
|
8564
|
-
type: HasuraGraphQLColumnType.Jsonb,
|
|
8565
|
-
},
|
|
8566
|
-
},
|
|
8567
|
-
'group',
|
|
8568
|
-
'validity',
|
|
8569
|
-
'published',
|
|
8570
|
-
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8571
|
-
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8572
|
-
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
8573
|
-
{
|
|
8574
|
-
images: {
|
|
8575
|
-
columnName: 'images',
|
|
8576
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8577
|
-
},
|
|
8578
|
-
},
|
|
8579
|
-
{
|
|
8580
|
-
miniatures: {
|
|
8581
|
-
columnName: 'miniatures',
|
|
8582
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8583
|
-
},
|
|
8584
|
-
},
|
|
8585
|
-
{
|
|
8586
|
-
imagesCard: {
|
|
8587
|
-
columnName: 'images_card',
|
|
8588
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8589
|
-
},
|
|
8590
|
-
},
|
|
8591
|
-
'slug',
|
|
8592
|
-
'brand',
|
|
8593
|
-
'name',
|
|
8594
|
-
'sku',
|
|
8595
|
-
{ NCM: { columnName: 'ncm' } },
|
|
8596
|
-
{ CEST: { columnName: 'cest' } },
|
|
8597
|
-
{
|
|
8598
|
-
description: {
|
|
8599
|
-
columnName: 'description',
|
|
8600
|
-
from: (description, data) => ({
|
|
8601
|
-
description,
|
|
8602
|
-
differentials: data.differentials,
|
|
8603
|
-
whoMustUse: data.who_must_use,
|
|
8604
|
-
howToUse: data.how_to_use,
|
|
8605
|
-
brand: data.brand_description,
|
|
8606
|
-
ingredients: data.ingredients,
|
|
8607
|
-
purpose: data.purpose,
|
|
8608
|
-
}),
|
|
8609
|
-
bindFindFilter: (filters) => {
|
|
8610
|
-
return {
|
|
8611
|
-
...(filters?.description && { description: filters.description }),
|
|
8612
|
-
...(filters.differentials && { differentials: filters.differentials }),
|
|
8613
|
-
...(filters.whoMustUse && {
|
|
8614
|
-
who_must_use: filters.whoMustUse,
|
|
8615
|
-
}),
|
|
8616
|
-
...(filters.howToUse && {
|
|
8617
|
-
how_to_use: filters.howToUse,
|
|
8618
|
-
}),
|
|
8619
|
-
...(filters.brand && {
|
|
8620
|
-
brand_description: filters.brand,
|
|
8621
|
-
}),
|
|
8622
|
-
...(filters.ingredients && {
|
|
8623
|
-
ingredients: filters.ingredients,
|
|
8624
|
-
}),
|
|
8625
|
-
...(filters.purpose && {
|
|
8626
|
-
purpose: filters.purpose,
|
|
8627
|
-
}),
|
|
8628
|
-
};
|
|
8629
|
-
},
|
|
8630
|
-
bindPersistData: (descriptionData) => ({
|
|
8631
|
-
...(descriptionData?.description && { description: descriptionData.description }),
|
|
8632
|
-
...(descriptionData.differentials && { differentials: descriptionData.differentials }),
|
|
8633
|
-
...(descriptionData.whoMustUse && {
|
|
8634
|
-
who_must_use: descriptionData.whoMustUse,
|
|
8635
|
-
}),
|
|
8636
|
-
...(descriptionData.howToUse && { how_to_use: descriptionData.howToUse }),
|
|
8637
|
-
...(descriptionData.brand && { brand_description: descriptionData.brand }),
|
|
8638
|
-
...(descriptionData.ingredients && { ingredients: descriptionData.ingredients }),
|
|
8639
|
-
...(descriptionData.purpose && { purpose: descriptionData.purpose }),
|
|
8640
|
-
}),
|
|
8641
|
-
},
|
|
8642
|
-
},
|
|
8643
|
-
{ differentials: { columnName: 'differentials' } },
|
|
8644
|
-
{ whoMustUse: { columnName: 'who_must_use' } },
|
|
8645
|
-
{ howToUse: { columnName: 'how_to_use' } },
|
|
8646
|
-
{ brandDescription: { columnName: 'brand_description' } },
|
|
8647
|
-
{ ingredients: { columnName: 'ingredients' } },
|
|
8648
|
-
{ purpose: { columnName: 'purpose' } },
|
|
8649
|
-
'gender',
|
|
8650
|
-
{ intGender: { columnName: 'int_gender' } },
|
|
8651
|
-
'label',
|
|
8652
|
-
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8653
|
-
{ rate: { columnName: 'rating' } },
|
|
8654
|
-
{ reviewsTotal: { columnName: 'reviews_total' } },
|
|
8655
|
-
{ shoppingCount: { columnName: 'shopping_count' } },
|
|
8656
|
-
{ categoryId: { columnName: 'category_id' } },
|
|
8657
|
-
{
|
|
8658
|
-
metadata: {
|
|
8659
|
-
columnName: 'metadata',
|
|
8660
|
-
fields: ['title', 'description'],
|
|
8661
|
-
bindPersistData: (value) => ({
|
|
8662
|
-
metadata: { data: value },
|
|
8283
|
+
}),
|
|
8284
|
+
};
|
|
8285
|
+
},
|
|
8286
|
+
bindPersistData: (priceData) => ({
|
|
8287
|
+
...((priceData?.price || 0) >= 0 && { price: priceData.price }),
|
|
8288
|
+
...((priceData?.fullPrice || 0) >= 0 && { full_price: priceData.fullPrice }),
|
|
8289
|
+
...((priceData?.subscriberDiscountPercentage || 0) >= 0 && {
|
|
8290
|
+
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
8291
|
+
}),
|
|
8292
|
+
...((priceData?.subscriberPrice || 0) >= 0 && { subscriber_price: priceData.subscriberPrice }),
|
|
8293
|
+
...(priceData.fullPriceDiscountPercentage >= 0 && {
|
|
8294
|
+
full_price_discount_percentage: priceData.fullPriceDiscountPercentage,
|
|
8295
|
+
}),
|
|
8663
8296
|
}),
|
|
8664
8297
|
},
|
|
8665
8298
|
},
|
|
8299
|
+
{ fullPrice: { columnName: 'full_price' } },
|
|
8300
|
+
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
8301
|
+
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
8302
|
+
{ fullPriceDiscountPercentage: { columnName: 'full_price_discount_percentage' } },
|
|
8303
|
+
'sku',
|
|
8304
|
+
{
|
|
8305
|
+
stock: {
|
|
8306
|
+
columnName: 'stock',
|
|
8307
|
+
from: (quantity) => ({ quantity }),
|
|
8308
|
+
to: (value) => (isNil(value?.quantity) ? value : value?.quantity),
|
|
8309
|
+
},
|
|
8310
|
+
},
|
|
8311
|
+
{ hasStock: { columnName: 'has_stock' } },
|
|
8312
|
+
'weight',
|
|
8313
|
+
{ name: { to: () => '', from: () => undefined } },
|
|
8314
|
+
{ hasVariants: { columnName: 'has_variants', to: () => false, from: () => undefined } },
|
|
8666
8315
|
{ createdAt: { columnName: 'created_at' } },
|
|
8667
8316
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
8317
|
+
{
|
|
8318
|
+
grade: {
|
|
8319
|
+
columnName: 'grade',
|
|
8320
|
+
type: HasuraGraphQLColumnType.Jsonb,
|
|
8321
|
+
},
|
|
8322
|
+
},
|
|
8323
|
+
'group',
|
|
8324
|
+
'validity',
|
|
8325
|
+
'published',
|
|
8326
|
+
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8327
|
+
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8328
|
+
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
8329
|
+
{
|
|
8330
|
+
images: {
|
|
8331
|
+
columnName: 'images',
|
|
8332
|
+
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8333
|
+
},
|
|
8334
|
+
},
|
|
8335
|
+
{
|
|
8336
|
+
miniatures: {
|
|
8337
|
+
columnName: 'miniatures',
|
|
8338
|
+
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8339
|
+
},
|
|
8340
|
+
},
|
|
8341
|
+
{
|
|
8342
|
+
imagesCard: {
|
|
8343
|
+
columnName: 'images_card',
|
|
8344
|
+
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8345
|
+
},
|
|
8346
|
+
},
|
|
8668
8347
|
];
|
|
8669
8348
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
8670
8349
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
@@ -8705,37 +8384,18 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8705
8384
|
return data.at(0);
|
|
8706
8385
|
}
|
|
8707
8386
|
async update(params) {
|
|
8708
|
-
const { productId, id: checkId,
|
|
8387
|
+
const { productId, id: checkId, ...data } = params;
|
|
8709
8388
|
const dataWithProductId = this.paramsToPlain({ id: checkId, productId });
|
|
8710
8389
|
if (!dataWithProductId.id) {
|
|
8711
8390
|
throw new NotFoundError('Variant ID is required for update');
|
|
8712
8391
|
}
|
|
8713
8392
|
const id = await this.getId(dataWithProductId.id);
|
|
8714
8393
|
const product = await super.update({ id, ...data });
|
|
8715
|
-
product.metadata = metadata && (await this.updateMetadata(+id, { metadata }));
|
|
8716
8394
|
if (dataWithProductId.productId) {
|
|
8717
8395
|
product.productId = dataWithProductId.productId;
|
|
8718
8396
|
}
|
|
8719
8397
|
return product;
|
|
8720
8398
|
}
|
|
8721
|
-
async updateMetadata(productId, { metadata }) {
|
|
8722
|
-
const plainData = this.paramsToPlain({ metadata });
|
|
8723
|
-
if (!plainData.metadata)
|
|
8724
|
-
return null;
|
|
8725
|
-
await this.mutation('update_product_metadata_by_pk', ['product_id'], {
|
|
8726
|
-
pk_columns: {
|
|
8727
|
-
value: { product_id: productId },
|
|
8728
|
-
type: 'product_metadata_pk_columns_input',
|
|
8729
|
-
required: true,
|
|
8730
|
-
},
|
|
8731
|
-
_set: {
|
|
8732
|
-
value: omit(metadata, ['product_id']),
|
|
8733
|
-
type: 'product_metadata_set_input',
|
|
8734
|
-
required: true,
|
|
8735
|
-
},
|
|
8736
|
-
});
|
|
8737
|
-
return plainData.metadata;
|
|
8738
|
-
}
|
|
8739
8399
|
async getId(id) {
|
|
8740
8400
|
if (!Number.isNaN(+id))
|
|
8741
8401
|
return id;
|
|
@@ -9079,6 +8739,356 @@ __decorate([
|
|
|
9079
8739
|
__metadata("design:returntype", Promise)
|
|
9080
8740
|
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
9081
8741
|
|
|
8742
|
+
class MercadoPagoRequestHelper {
|
|
8743
|
+
static build(data) {
|
|
8744
|
+
const { checkout, method, postback, card } = data;
|
|
8745
|
+
return {
|
|
8746
|
+
transaction_amount: +checkout.totalPrice.toFixed(2),
|
|
8747
|
+
notification_url: postback,
|
|
8748
|
+
metadata: {
|
|
8749
|
+
checkoutId: checkout.id,
|
|
8750
|
+
},
|
|
8751
|
+
payer: this.buildPayer(checkout),
|
|
8752
|
+
statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'Glam' : 'Mens Market',
|
|
8753
|
+
additional_info: {
|
|
8754
|
+
items: this.buildItems(checkout),
|
|
8755
|
+
payer: this.buildFullPayer(checkout),
|
|
8756
|
+
},
|
|
8757
|
+
...(method === 'credit_card' && this.buildCardPayment(card)),
|
|
8758
|
+
...(method === 'pix' && this.buildPixPayment()),
|
|
8759
|
+
...(method === 'boleto' && this.buildBoletoPayment(checkout)),
|
|
8760
|
+
};
|
|
8761
|
+
}
|
|
8762
|
+
static buildItems(checkout) {
|
|
8763
|
+
return checkout.lineItems
|
|
8764
|
+
.filter((item) => !item.isGift)
|
|
8765
|
+
.map((item) => {
|
|
8766
|
+
return {
|
|
8767
|
+
id: item.EAN,
|
|
8768
|
+
title: item.name,
|
|
8769
|
+
description: item.name,
|
|
8770
|
+
picture_url: item.image ?? null,
|
|
8771
|
+
category_id: item.category?.id ?? null,
|
|
8772
|
+
quantity: item.quantity,
|
|
8773
|
+
unit_price: +item.pricePaid.toFixed(2),
|
|
8774
|
+
};
|
|
8775
|
+
});
|
|
8776
|
+
}
|
|
8777
|
+
static buildPayer(checkout) {
|
|
8778
|
+
return {
|
|
8779
|
+
first_name: checkout.user.firstName,
|
|
8780
|
+
last_name: checkout.user.lastName,
|
|
8781
|
+
email: checkout.user.email,
|
|
8782
|
+
identification: {
|
|
8783
|
+
type: 'CPF',
|
|
8784
|
+
number: checkout.user.cpf.replace(/\D/g, ''),
|
|
8785
|
+
},
|
|
8786
|
+
};
|
|
8787
|
+
}
|
|
8788
|
+
static buildFullPayer(checkout) {
|
|
8789
|
+
return {
|
|
8790
|
+
first_name: checkout.user.firstName,
|
|
8791
|
+
last_name: checkout.user.lastName,
|
|
8792
|
+
phone: {
|
|
8793
|
+
area_code: checkout.user.phone.substring(0, 2),
|
|
8794
|
+
number: checkout.user.phone.substring(2),
|
|
8795
|
+
},
|
|
8796
|
+
address: {
|
|
8797
|
+
zip_code: checkout.shippingAddress.zip,
|
|
8798
|
+
street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
|
|
8799
|
+
street_number: checkout.shippingAddress.number,
|
|
8800
|
+
neighborhood: checkout.shippingAddress.district,
|
|
8801
|
+
city: checkout.shippingAddress.city,
|
|
8802
|
+
federal_unit: checkout.shippingAddress.state,
|
|
8803
|
+
},
|
|
8804
|
+
};
|
|
8805
|
+
}
|
|
8806
|
+
static buildCardPayment(card) {
|
|
8807
|
+
return {
|
|
8808
|
+
installments: card.installments,
|
|
8809
|
+
token: card.cardId,
|
|
8810
|
+
};
|
|
8811
|
+
}
|
|
8812
|
+
static buildPixPayment() {
|
|
8813
|
+
return {
|
|
8814
|
+
payment_method_id: 'pix',
|
|
8815
|
+
date_of_expiration: format(addDays(new Date(), 1), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
|
|
8816
|
+
};
|
|
8817
|
+
}
|
|
8818
|
+
static buildBoletoPayment(checkout) {
|
|
8819
|
+
return {
|
|
8820
|
+
payment_method_id: 'bolbradesco',
|
|
8821
|
+
date_of_expiration: format(addDays(new Date(), 1), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
|
|
8822
|
+
payer: {
|
|
8823
|
+
first_name: checkout.user.firstName,
|
|
8824
|
+
last_name: checkout.user.lastName,
|
|
8825
|
+
phone: {
|
|
8826
|
+
area_code: checkout.user.phone.substring(0, 2),
|
|
8827
|
+
number: checkout.user.phone.substring(2),
|
|
8828
|
+
},
|
|
8829
|
+
address: {
|
|
8830
|
+
zip_code: checkout.shippingAddress.zip,
|
|
8831
|
+
street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
|
|
8832
|
+
street_number: checkout.shippingAddress.number,
|
|
8833
|
+
neighborhood: checkout.shippingAddress.district,
|
|
8834
|
+
city: checkout.shippingAddress.city,
|
|
8835
|
+
federal_unit: checkout.shippingAddress.state,
|
|
8836
|
+
},
|
|
8837
|
+
},
|
|
8838
|
+
};
|
|
8839
|
+
}
|
|
8840
|
+
}
|
|
8841
|
+
|
|
8842
|
+
class MercadoPagoResponseHelper {
|
|
8843
|
+
static build(method, checkout, response) {
|
|
8844
|
+
return Payment.toInstance({
|
|
8845
|
+
createdAt: new Date(),
|
|
8846
|
+
updatedAt: new Date(),
|
|
8847
|
+
userId: checkout.user.id,
|
|
8848
|
+
checkoutId: checkout.id,
|
|
8849
|
+
totalPrice: checkout.totalPrice,
|
|
8850
|
+
paymentProvider: PaymentProviders.MERCADOPAGO,
|
|
8851
|
+
mercadoPagoId: response.id,
|
|
8852
|
+
transaction: this.buildPaymentTransaction(method, response),
|
|
8853
|
+
});
|
|
8854
|
+
}
|
|
8855
|
+
static buildPaymentTransaction(method, response) {
|
|
8856
|
+
return PaymentTransaction.toInstance({
|
|
8857
|
+
id: response.id.toString(),
|
|
8858
|
+
acquirer_name: PaymentProviders.MERCADOPAGO,
|
|
8859
|
+
amount: response.transaction_amount,
|
|
8860
|
+
status: response.status,
|
|
8861
|
+
status_reason: response.status_detail?.toString(),
|
|
8862
|
+
payment_method: method,
|
|
8863
|
+
currency: response.currency_id?.toString(),
|
|
8864
|
+
paid_amount: response.transaction_details?.total_paid_amount ?? null,
|
|
8865
|
+
paid_at: response.date_approved ?? null,
|
|
8866
|
+
charger_id: response.charges_details?.at(0)?.id?.toString() ?? null,
|
|
8867
|
+
...(method == TransactionPaymentMethods.PIX && this.getPixReponse(response)),
|
|
8868
|
+
...(method == TransactionPaymentMethods.CARD && this.getCardReponse(response)),
|
|
8869
|
+
});
|
|
8870
|
+
}
|
|
8871
|
+
// private static getBoletoReponse(transaction: MercadoPagoResponse): Partial<PaymentTransaction> {
|
|
8872
|
+
// return {
|
|
8873
|
+
// boleto_url: transaction.url?.toString(),
|
|
8874
|
+
// boleto_barcode: transaction.line?.toString(),
|
|
8875
|
+
// boleto_qr_code: transaction.qr_code?.toString(),
|
|
8876
|
+
// boleto_expiration_date: transaction.due_at?.toString(),
|
|
8877
|
+
// boleto_instructions: transaction.instructions?.toString(),
|
|
8878
|
+
// boleto_nosso_numero: transaction.nosso_numero?.toString(),
|
|
8879
|
+
// boleto_type: transaction.type?.toString(),
|
|
8880
|
+
// boleto_document_number: transaction.document_number?.toString(),
|
|
8881
|
+
// }
|
|
8882
|
+
// }
|
|
8883
|
+
static getPixReponse(response) {
|
|
8884
|
+
return {
|
|
8885
|
+
pix_qr_code: response.point_of_interaction?.transaction_data?.qr_code,
|
|
8886
|
+
pix_expiration_date: response.date_of_expiration?.toString(),
|
|
8887
|
+
};
|
|
8888
|
+
}
|
|
8889
|
+
static getCardReponse(response) {
|
|
8890
|
+
return {
|
|
8891
|
+
soft_descriptor: response.statement_descriptor?.toString(),
|
|
8892
|
+
installments: response.installments,
|
|
8893
|
+
card_brand: response.payment_method_id?.toString(),
|
|
8894
|
+
card_first_digits: response.card?.first_six_digits?.toString(),
|
|
8895
|
+
card_last_digits: response.card?.last_four_digits?.toString(),
|
|
8896
|
+
card_id: response.card?.id?.toString(),
|
|
8897
|
+
card_holder_name: response.card?.cardholder?.name?.toString(),
|
|
8898
|
+
card_expiration_month: response.card?.expiration_month?.toString(),
|
|
8899
|
+
card_expiration_year: response.card?.expiration_year?.toString(),
|
|
8900
|
+
capture_method: response.payment_type_id?.toString(),
|
|
8901
|
+
authorization_code: response.authorization_code?.toString(),
|
|
8902
|
+
};
|
|
8903
|
+
}
|
|
8904
|
+
}
|
|
8905
|
+
|
|
8906
|
+
class MercadoPagoBankSlipAxiosAdapter {
|
|
8907
|
+
constructor(credentials, paymentRepository) {
|
|
8908
|
+
this.credentials = credentials;
|
|
8909
|
+
this.paymentRepository = paymentRepository;
|
|
8910
|
+
}
|
|
8911
|
+
async pay(checkout) {
|
|
8912
|
+
try {
|
|
8913
|
+
const payload = MercadoPagoRequestHelper.build({
|
|
8914
|
+
checkout,
|
|
8915
|
+
method: 'boleto',
|
|
8916
|
+
postback: this.credentials.postback,
|
|
8917
|
+
});
|
|
8918
|
+
console.warn('[MERCADO PAGO BOLETO DATA TO SEND]', JSON.stringify(payload));
|
|
8919
|
+
const { data } = await axios({
|
|
8920
|
+
method: 'POST',
|
|
8921
|
+
url: `${this.credentials.url}/v1/payments`,
|
|
8922
|
+
headers: {
|
|
8923
|
+
'X-Idempotency-Key': `${checkout.id}-${new Date().getTime()}`,
|
|
8924
|
+
Authorization: `Bearer ${this.credentials.api_key}`,
|
|
8925
|
+
'Content-Type': 'application/json',
|
|
8926
|
+
},
|
|
8927
|
+
data: payload,
|
|
8928
|
+
});
|
|
8929
|
+
console.warn('[MERCADO PAGO RESPONSE BOLETO DATA]', JSON.stringify(data));
|
|
8930
|
+
const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(TransactionPaymentMethods.PIX, checkout, data));
|
|
8931
|
+
return payment;
|
|
8932
|
+
}
|
|
8933
|
+
catch (error) {
|
|
8934
|
+
if (error instanceof AxiosError) {
|
|
8935
|
+
console.warn(error.response);
|
|
8936
|
+
console.warn(error.response.data);
|
|
8937
|
+
console.warn(error.response.data.cause);
|
|
8938
|
+
}
|
|
8939
|
+
}
|
|
8940
|
+
}
|
|
8941
|
+
getBoletoTransaction(paymentId) {
|
|
8942
|
+
throw new Error('Method not implemented.');
|
|
8943
|
+
}
|
|
8944
|
+
}
|
|
8945
|
+
|
|
8946
|
+
class MercadoPagoCardAxiosAdapter {
|
|
8947
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
8948
|
+
this.credentials = credentials;
|
|
8949
|
+
this.paymentRepository = paymentRepository;
|
|
8950
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
8951
|
+
}
|
|
8952
|
+
async pay(checkout, card) {
|
|
8953
|
+
const payload = MercadoPagoRequestHelper.build({
|
|
8954
|
+
checkout,
|
|
8955
|
+
method: 'credit_card',
|
|
8956
|
+
postback: this.credentials.postback,
|
|
8957
|
+
card,
|
|
8958
|
+
});
|
|
8959
|
+
console.warn('[MERCADO PAGO CARD DATA TO SEND]', JSON.stringify(payload));
|
|
8960
|
+
const { data } = await axios({
|
|
8961
|
+
method: 'POST',
|
|
8962
|
+
url: `${this.credentials.url}/v1/payments`,
|
|
8963
|
+
headers: {
|
|
8964
|
+
'X-Idempotency-Key': `${checkout.id}-${new Date().getTime()}`,
|
|
8965
|
+
Authorization: `Bearer ${this.credentials.api_key}`,
|
|
8966
|
+
'Content-Type': 'application/json',
|
|
8967
|
+
},
|
|
8968
|
+
data: payload,
|
|
8969
|
+
});
|
|
8970
|
+
console.warn('[MERCADO PAGO RESPONSE CARD DATA]', JSON.stringify(data));
|
|
8971
|
+
if ((data.status !== 'approved' && data.status_detail !== 'accredited') || data.status !== 'authorized') {
|
|
8972
|
+
await this.orderBlockedRepository.createBlockedOrderOrPayment({
|
|
8973
|
+
checkout,
|
|
8974
|
+
blockType: 'Card not authorized',
|
|
8975
|
+
type: 'Card',
|
|
8976
|
+
limiteRange: 'day',
|
|
8977
|
+
card,
|
|
8978
|
+
});
|
|
8979
|
+
throw new PaymentError('Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito', {
|
|
8980
|
+
checkoutId: checkout.id,
|
|
8981
|
+
userEmail: checkout.user.email,
|
|
8982
|
+
info: data,
|
|
8983
|
+
});
|
|
8984
|
+
}
|
|
8985
|
+
const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(TransactionPaymentMethods.CARD, checkout, data));
|
|
8986
|
+
return payment;
|
|
8987
|
+
}
|
|
8988
|
+
async addCard(card, customer) {
|
|
8989
|
+
const { data } = await axios({
|
|
8990
|
+
method: 'POST',
|
|
8991
|
+
url: `${this.credentials.url}/v1/payments`,
|
|
8992
|
+
headers: {
|
|
8993
|
+
Authorization: `Bearer ${this.credentials.api_key}`,
|
|
8994
|
+
'Content-Type': 'application/json',
|
|
8995
|
+
},
|
|
8996
|
+
data: {
|
|
8997
|
+
email: customer.email,
|
|
8998
|
+
first_name: customer.firstName,
|
|
8999
|
+
last_name: customer.lastName,
|
|
9000
|
+
phone: {
|
|
9001
|
+
area_code: '55',
|
|
9002
|
+
number: '991234567',
|
|
9003
|
+
},
|
|
9004
|
+
identification: {
|
|
9005
|
+
type: 'CPF',
|
|
9006
|
+
number: '12345678900',
|
|
9007
|
+
},
|
|
9008
|
+
default_address: 'Home',
|
|
9009
|
+
address: {
|
|
9010
|
+
id: '123123',
|
|
9011
|
+
zip_code: '01234567',
|
|
9012
|
+
street_name: 'Rua Exemplo',
|
|
9013
|
+
street_number: 123,
|
|
9014
|
+
city: {},
|
|
9015
|
+
},
|
|
9016
|
+
},
|
|
9017
|
+
});
|
|
9018
|
+
return data;
|
|
9019
|
+
}
|
|
9020
|
+
getCardByToken(customerId, token) {
|
|
9021
|
+
return;
|
|
9022
|
+
}
|
|
9023
|
+
createCardHash(bu, shop, card) {
|
|
9024
|
+
return;
|
|
9025
|
+
}
|
|
9026
|
+
createTransaction(info) {
|
|
9027
|
+
return;
|
|
9028
|
+
}
|
|
9029
|
+
async createOrUpdateCustomer(customer) {
|
|
9030
|
+
const { data } = await axios({
|
|
9031
|
+
method: 'POST',
|
|
9032
|
+
url: `${this.credentials.url}/v1/customers`,
|
|
9033
|
+
headers: {
|
|
9034
|
+
Authorization: `Bearer ${this.credentials.api_key}`,
|
|
9035
|
+
'Content-Type': 'application/json',
|
|
9036
|
+
},
|
|
9037
|
+
data: {
|
|
9038
|
+
email: customer.email,
|
|
9039
|
+
first_name: customer.firstName,
|
|
9040
|
+
last_name: customer.lastName,
|
|
9041
|
+
phone: {
|
|
9042
|
+
area_code: customer.phone.substring(0, 2),
|
|
9043
|
+
number: customer.phone.substring(2),
|
|
9044
|
+
},
|
|
9045
|
+
identification: {
|
|
9046
|
+
type: 'CPF',
|
|
9047
|
+
number: customer.cpf.replace(/\D/g, ''),
|
|
9048
|
+
},
|
|
9049
|
+
},
|
|
9050
|
+
});
|
|
9051
|
+
return data;
|
|
9052
|
+
}
|
|
9053
|
+
}
|
|
9054
|
+
|
|
9055
|
+
class MercadoPagoPixAxiosAdapter {
|
|
9056
|
+
constructor(credentials, paymentRepository) {
|
|
9057
|
+
this.credentials = credentials;
|
|
9058
|
+
this.paymentRepository = paymentRepository;
|
|
9059
|
+
}
|
|
9060
|
+
async pay(checkout) {
|
|
9061
|
+
try {
|
|
9062
|
+
const payload = MercadoPagoRequestHelper.build({
|
|
9063
|
+
checkout,
|
|
9064
|
+
method: 'pix',
|
|
9065
|
+
postback: this.credentials.postback,
|
|
9066
|
+
});
|
|
9067
|
+
console.warn('[MERCADO PAGO PIX DATA TO SEND]', JSON.stringify(payload));
|
|
9068
|
+
const { data } = await axios({
|
|
9069
|
+
method: 'POST',
|
|
9070
|
+
url: `${this.credentials.url}/v1/payments`,
|
|
9071
|
+
headers: {
|
|
9072
|
+
'X-Idempotency-Key': `${checkout.id}-${new Date().getTime()}`,
|
|
9073
|
+
Authorization: `Bearer ${this.credentials.api_key}`,
|
|
9074
|
+
'Content-Type': 'application/json',
|
|
9075
|
+
},
|
|
9076
|
+
data: payload,
|
|
9077
|
+
});
|
|
9078
|
+
console.warn('[MERCADO PAGO RESPONSE PIX DATA]', JSON.stringify(data));
|
|
9079
|
+
const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(TransactionPaymentMethods.PIX, checkout, data));
|
|
9080
|
+
return payment;
|
|
9081
|
+
}
|
|
9082
|
+
catch (error) {
|
|
9083
|
+
if (error instanceof AxiosError) {
|
|
9084
|
+
console.warn(error.response);
|
|
9085
|
+
console.warn(error.response.data);
|
|
9086
|
+
console.warn(error.response.data.cause);
|
|
9087
|
+
}
|
|
9088
|
+
}
|
|
9089
|
+
}
|
|
9090
|
+
}
|
|
9091
|
+
|
|
9082
9092
|
class PagarmeBankSlipAxiosAdapter {
|
|
9083
9093
|
constructor(credentials, paymentRepository) {
|
|
9084
9094
|
this.credentials = credentials;
|
|
@@ -9226,15 +9236,17 @@ class PagarMeV5RequestHelper {
|
|
|
9226
9236
|
customer: this.buildCustomer(checkout),
|
|
9227
9237
|
shipping: this.buildShipping(checkout),
|
|
9228
9238
|
payments: this.buildPayment(checkout, method, card),
|
|
9239
|
+
...this.buildAdditionalInfo(checkout),
|
|
9229
9240
|
};
|
|
9230
9241
|
}
|
|
9231
9242
|
static buildItems(checkout) {
|
|
9243
|
+
const isSubscriber = checkout.user?.isSubscriber ?? false;
|
|
9232
9244
|
return checkout.lineItems
|
|
9233
9245
|
.filter((item) => !item.isGift)
|
|
9234
9246
|
.map((item) => {
|
|
9235
9247
|
return {
|
|
9236
9248
|
amount: Math.floor(item.pricePaid * 100),
|
|
9237
|
-
description: item.name,
|
|
9249
|
+
description: isSubscriber ? `${item.name} - ASSINANTE` : item.name,
|
|
9238
9250
|
quantity: item.quantity,
|
|
9239
9251
|
code: item.EAN,
|
|
9240
9252
|
};
|
|
@@ -9331,6 +9343,14 @@ class PagarMeV5RequestHelper {
|
|
|
9331
9343
|
},
|
|
9332
9344
|
};
|
|
9333
9345
|
}
|
|
9346
|
+
static buildAdditionalInfo(checkout) {
|
|
9347
|
+
const isSubscriber = checkout.user?.isSubscriber ?? false;
|
|
9348
|
+
if (isSubscriber)
|
|
9349
|
+
return {
|
|
9350
|
+
antifraude_enabled: false,
|
|
9351
|
+
};
|
|
9352
|
+
return {};
|
|
9353
|
+
}
|
|
9334
9354
|
}
|
|
9335
9355
|
|
|
9336
9356
|
class PagarMeV5ResponseHelper {
|
|
@@ -10063,4 +10083,4 @@ class ProductsVertexSearch {
|
|
|
10063
10083
|
}
|
|
10064
10084
|
}
|
|
10065
10085
|
|
|
10066
|
-
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product,
|
|
10086
|
+
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandCategory, BrandCategoryFirestoreRepository, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, MercadoPagoBankSlipAxiosAdapter, MercadoPagoCardAxiosAdapter, MercadoPagoPaymentMethodFactory, MercadoPagoPixAxiosAdapter, MercadoPagoRequestHelper, MercadoPagoResponseHelper, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|