@infrab4a/connect 5.3.0-beta.2 → 5.3.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1990 -242
- package/index.esm.js +1976 -244
- package/package.json +4 -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-base.d.ts +1 -0
- package/src/domain/catalog/models/product-review.d.ts +2 -0
- package/src/domain/catalog/models/product.d.ts +1 -0
- package/src/domain/catalog/models/types/brands-shop-menu.type.d.ts +13 -0
- package/src/domain/catalog/models/types/index.d.ts +1 -0
- package/src/domain/catalog/repositories/category-brand.repository.d.ts +4 -0
- package/src/domain/catalog/repositories/category.repository.d.ts +1 -0
- package/src/domain/catalog/repositories/index.d.ts +2 -0
- package/src/domain/catalog/repositories/product-catalog.repository.d.ts +17 -0
- package/src/domain/shopping/enums/index.d.ts +3 -0
- package/src/domain/shopping/enums/order-payment-status.enum.d.ts +10 -0
- package/src/domain/shopping/enums/pagarme-v5-payment-status.enum.d.ts +24 -0
- package/src/domain/shopping/enums/payment-providers.enum.d.ts +2 -1
- package/src/domain/shopping/enums/transaction-payment-methods.enum.d.ts +5 -0
- package/src/domain/shopping/factories/index.d.ts +1 -0
- package/src/domain/shopping/factories/mercado-pago-payment-method.factory.d.ts +11 -0
- package/src/domain/shopping/factories/payment-provider.factory.d.ts +2 -0
- package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +10 -2
- package/src/domain/shopping/models/order.d.ts +7 -0
- package/src/domain/shopping/models/payment-transaction.d.ts +19 -2
- package/src/domain/shopping/models/payment.d.ts +3 -1
- package/src/domain/shopping/services/antifraud-card.service.d.ts +2 -0
- package/src/domain/shopping/types/card-info.type.d.ts +1 -0
- package/src/domain/shopping/types/checkout-paylod-request.type.d.ts +2 -7
- package/src/domain/shopping/types/index.d.ts +3 -0
- package/src/domain/shopping/types/mercado-pago-card.type.d.ts +14 -0
- package/src/domain/shopping/types/mercado-pago-credentials.type.d.ts +5 -0
- package/src/domain/shopping/types/pagarme-card.type.d.ts +9 -3
- package/src/domain/shopping/types/pagarme-credentials-v5.type.d.ts +4 -0
- package/src/domain/shopping/types/pagarme-credentials.type.d.ts +9 -3
- package/src/domain/shopping/types/payment-card-info.type.d.ts +3 -0
- package/src/domain/users/models/user-payment-method.d.ts +2 -0
- package/src/infra/firebase/firestore/repositories/catalog/category-brand-firestore.repository.d.ts +7 -0
- package/src/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/catalog/index.d.ts +1 -0
- package/src/infra/hasura-graphql/models/index.d.ts +1 -0
- package/src/infra/hasura-graphql/models/product-catalog-hasura-graphql.d.ts +16 -0
- package/src/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +7 -0
- package/src/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts +22 -0
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts +1 -0
- 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 +20 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-pix-payment-axios.adapter.d.ts +7 -0
- package/src/infra/mercado-pago/enums/index.d.ts +2 -0
- package/src/infra/mercado-pago/enums/mercado-pago-status-detail.enum.d.ts +33 -0
- package/src/infra/mercado-pago/enums/mercado-pago-status.enum.d.ts +10 -0
- package/src/infra/mercado-pago/helpers/index.d.ts +2 -0
- package/src/infra/mercado-pago/helpers/mercado-pago-request.helper.d.ts +60 -0
- package/src/infra/mercado-pago/helpers/mercado-pago-response.helper.d.ts +10 -0
- package/src/infra/mercado-pago/index.d.ts +4 -0
- package/src/infra/mercado-pago/types/index.d.ts +3 -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 +188 -0
- package/src/infra/mercado-pago/types/mercado-pago-status-detail.type.d.ts +2 -0
- package/src/infra/mercado-pago/types/mercado-pago-status.type.d.ts +2 -0
- package/src/infra/pagarme/adapters/helpers/index.d.ts +2 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-request.helper.d.ts +13 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-response.helper.d.ts +10 -0
- package/src/infra/pagarme/adapters/index.d.ts +2 -3
- package/src/infra/pagarme/adapters/v4/index.d.ts +3 -0
- package/src/infra/pagarme/adapters/{pagarme-bank-slip-payment-axios.adapter.d.ts → v4/pagarme-bank-slip-payment-axios.adapter.d.ts} +4 -4
- package/src/infra/pagarme/adapters/{pagarme-card-payment-axios.adapter.d.ts → v4/pagarme-card-payment-axios.adapter.d.ts} +7 -6
- package/src/infra/pagarme/adapters/{pagarme-pix-payment-axios.adapter.d.ts → v4/pagarme-pix-payment-axios.adapter.d.ts} +4 -4
- package/src/infra/pagarme/adapters/v5/index.d.ts +3 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-bank-slip-payment-axios.adapter.d.ts +11 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-card-payment-axios.adapter.d.ts +24 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-pix-payment-axios.adapter.d.ts +10 -0
- package/src/infra/pagarme/index.d.ts +1 -0
- package/src/infra/pagarme/types/index.d.ts +1 -0
- package/src/infra/pagarme/types/v5/index.d.ts +4 -0
- package/src/infra/pagarme/types/v5/pagarmev5-customer.type.d.ts +19 -0
- package/src/infra/pagarme/types/v5/pagarmev5-order-request-payload.type.d.ts +90 -0
- package/src/infra/pagarme/types/v5/pagarmev5-order-response.type.d.ts +126 -0
- package/src/infra/pagarme/types/v5/pagarmev5-postback-response.type.d.ts +11 -0
- package/src/utils/index.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect",
|
|
3
|
-
"version": "5.3.0-beta.
|
|
3
|
+
"version": "5.3.0-beta.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/B4AGroup/
|
|
9
|
+
"url": "https://github.com/B4AGroup/activation-services"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^0.27.2",
|
|
13
13
|
"class-transformer": "^0.5.1",
|
|
14
|
-
"date-fns": "
|
|
14
|
+
"date-fns": "2.28.0",
|
|
15
|
+
"date-fns-tz": "2.0.1",
|
|
15
16
|
"debug": "^4.3.4",
|
|
16
17
|
"firebase": "^10.12.0",
|
|
17
18
|
"gql-query-builder": "3.7.0",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
|
|
2
|
+
import { Shops } from './enums';
|
|
3
|
+
export declare class BrandCategory extends BaseModel<BrandCategory> {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
brand_category: boolean;
|
|
8
|
+
published: boolean;
|
|
9
|
+
images?: string[];
|
|
10
|
+
brand_logo?: string;
|
|
11
|
+
brand_banner?: string;
|
|
12
|
+
brand_banner_mobile?: string;
|
|
13
|
+
shops: Shops[];
|
|
14
|
+
get glamImages(): any;
|
|
15
|
+
get mensImages(): any;
|
|
16
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
17
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { Shops } from './enums';
|
|
3
|
+
import { Product } from './product';
|
|
3
4
|
export declare class ProductReview extends BaseModel<ProductReview> {
|
|
4
5
|
id: number;
|
|
5
6
|
productId: string;
|
|
@@ -16,5 +17,6 @@ export declare class ProductReview extends BaseModel<ProductReview> {
|
|
|
16
17
|
orderId?: string;
|
|
17
18
|
createdAt?: Date;
|
|
18
19
|
updatedAt?: Date;
|
|
20
|
+
product: Product;
|
|
19
21
|
static get identifiersFields(): GenericIdentifier[];
|
|
20
22
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CategoryImages } from './category-images.type';
|
|
2
|
+
export type BrandsShopMenu = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
brand_category: boolean;
|
|
7
|
+
published: boolean;
|
|
8
|
+
images: CategoryImages;
|
|
9
|
+
shops?: string[];
|
|
10
|
+
brand_logo?: string;
|
|
11
|
+
brand_banner?: string;
|
|
12
|
+
brand_banner_mobile?: string;
|
|
13
|
+
};
|
|
@@ -38,5 +38,6 @@ export interface CategoryRepository<T extends Category = Category> extends CrudR
|
|
|
38
38
|
cache?: RepositoryCacheOptions;
|
|
39
39
|
}): Promise<Category[]>;
|
|
40
40
|
isChild(id: number, parentId: number): Promise<boolean>;
|
|
41
|
+
getBrandsWithProducts(): Promise<Category[]>;
|
|
41
42
|
}
|
|
42
43
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './category-brand.repository';
|
|
1
2
|
export * from './category-collection-children.repository';
|
|
2
3
|
export * from './category-filter.repository';
|
|
3
4
|
export * from './category-product.repository';
|
|
@@ -5,6 +6,7 @@ export * from './category.repository';
|
|
|
5
6
|
export * from './filter-option.repository';
|
|
6
7
|
export * from './filter.repository';
|
|
7
8
|
export * from './group.repository';
|
|
9
|
+
export * from './product-catalog.repository';
|
|
8
10
|
export * from './product-errors.repository';
|
|
9
11
|
export * from './product-reviews.repository';
|
|
10
12
|
export * from './product-stock-notification.repository';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProductHasuraGraphQL } from '../../../infra';
|
|
2
|
+
import { FindRepositoryParams, RepositoryCacheOptions, RepositoryFindResult } from '../../generic';
|
|
3
|
+
import { Product, ProductGender } from '../models';
|
|
4
|
+
export interface ProductCatalogRepository {
|
|
5
|
+
get({ id }: {
|
|
6
|
+
id: string;
|
|
7
|
+
}): Promise<Product>;
|
|
8
|
+
find(params?: FindRepositoryParams<ProductHasuraGraphQL>, optionsParams?: {
|
|
9
|
+
cache?: RepositoryCacheOptions;
|
|
10
|
+
}): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
11
|
+
getByEAN(EAN: string, options?: {
|
|
12
|
+
cache?: RepositoryCacheOptions;
|
|
13
|
+
}): Promise<Product>;
|
|
14
|
+
findCatalog(params: FindRepositoryParams<Product>, mainGender?: Extract<ProductGender, 'female' | 'male' | 'unisex'>, options?: {
|
|
15
|
+
cache?: RepositoryCacheOptions;
|
|
16
|
+
}): Promise<RepositoryFindResult<Product>>;
|
|
17
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './antifraud-providers.enum';
|
|
2
2
|
export * from './business-unit.enum';
|
|
3
3
|
export * from './order-blocked.enum';
|
|
4
|
+
export * from './order-payment-status.enum';
|
|
4
5
|
export * from './pagarme-payment-status.enum';
|
|
6
|
+
export * from './pagarme-v5-payment-status.enum';
|
|
5
7
|
export * from './payment-methods.enum';
|
|
6
8
|
export * from './payment-providers.enum';
|
|
9
|
+
export * from './transaction-payment-methods.enum';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum OrderPaymentStatus {
|
|
2
|
+
'Em processamento' = "processing",
|
|
3
|
+
'Autorizada' = "authorized",
|
|
4
|
+
'Pago' = "paid",
|
|
5
|
+
'Estornada' = "refunded",
|
|
6
|
+
'Aguardando pagamento' = "waiting_payment",
|
|
7
|
+
'Aguardando estorno' = "pending_refund",
|
|
8
|
+
'Recusada/Não autorizada' = "refused",
|
|
9
|
+
'Chargedback' = "chargedback"
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum PagarMeV5PaymentStatus {
|
|
2
|
+
'Em processamento' = "processing",
|
|
3
|
+
'Gerado' = "generated",
|
|
4
|
+
'Visualizado' = "viewed",
|
|
5
|
+
'Pago a menor' = "underpaid",
|
|
6
|
+
'Pago a maior' = "overpaid",
|
|
7
|
+
'Aguardando pagamento' = "waiting_payment",
|
|
8
|
+
'Pago' = "paid",
|
|
9
|
+
'Aguardando estorno' = "pending_refund",
|
|
10
|
+
'Autorizada pendente de captura' = "authorized_pending_capture",
|
|
11
|
+
'Não autorizada' = "not_authorized",
|
|
12
|
+
'Capturada' = "captured",
|
|
13
|
+
'Aguardando captura' = "waiting_capture",
|
|
14
|
+
'Com erro' = "with_error",
|
|
15
|
+
'Estornado' = "refunded",
|
|
16
|
+
'Cancelado' = "voided",
|
|
17
|
+
'Falha' = "failed"
|
|
18
|
+
}
|
|
19
|
+
export declare enum PagarMeV5OrderStatus {
|
|
20
|
+
'Pendente' = "pending",
|
|
21
|
+
'Pago' = "paid",
|
|
22
|
+
'Cancelado' = "canceled",
|
|
23
|
+
'Falha' = "failed"
|
|
24
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './adyen-payment-method.factory';
|
|
2
2
|
export * from './antifraud-provider.factory';
|
|
3
3
|
export * from './glampoints-payment-method.factory';
|
|
4
|
+
export * from './mercado-pago-payment-method.factory';
|
|
4
5
|
export * from './pagarme-payment-method.factory';
|
|
5
6
|
export * from './payment-provider.factory';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PaymentProviderBankSlip, PaymentProviderCard, PaymentProviderPix } from '../interfaces';
|
|
2
|
+
import { MercadoPagoCard } from '../types';
|
|
3
|
+
import { BasePaymentMethodFactory } from './base-payment-method.factory';
|
|
4
|
+
type MercadoPagoPaymentFactoryMethods = {
|
|
5
|
+
card?: PaymentProviderCard<MercadoPagoCard>;
|
|
6
|
+
pix?: PaymentProviderPix;
|
|
7
|
+
bankSlip?: PaymentProviderBankSlip;
|
|
8
|
+
};
|
|
9
|
+
export declare class MercadoPagoPaymentMethodFactory extends BasePaymentMethodFactory<MercadoPagoPaymentFactoryMethods> {
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PaymentProvider } from '../types';
|
|
2
2
|
import { AdyenPaymentMethodFactory } from './adyen-payment-method.factory';
|
|
3
3
|
import { GlampointsPaymentMethodFactory } from './glampoints-payment-method.factory';
|
|
4
|
+
import { MercadoPagoPaymentMethodFactory } from './mercado-pago-payment-method.factory';
|
|
4
5
|
import { PagarmePaymentMethodFactory } from './pagarme-payment-method.factory';
|
|
5
6
|
type PaymentProviderFactoryFactories = {
|
|
6
7
|
pagarMe?: PagarmePaymentMethodFactory;
|
|
7
8
|
adyen?: AdyenPaymentMethodFactory;
|
|
8
9
|
glampoints?: GlampointsPaymentMethodFactory;
|
|
10
|
+
mercadoPago?: MercadoPagoPaymentMethodFactory;
|
|
9
11
|
};
|
|
10
12
|
export declare class PaymentProviderFactory {
|
|
11
13
|
private readonly paymentProviders;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Shops } from '../../catalog';
|
|
2
|
+
import { User, UserAddress } from '../../users';
|
|
1
3
|
import { BusinessUnitEnum } from '../enums';
|
|
2
4
|
import { PaymentTransaction } from '../models';
|
|
3
5
|
import { Checkout } from '../models/checkout';
|
|
@@ -6,8 +8,14 @@ import { CardInfo, PaymentCardInfo } from '../types';
|
|
|
6
8
|
import { BaseCard } from '../types/base-card.type';
|
|
7
9
|
export interface PaymentProviderCard<Card extends BaseCard = BaseCard> {
|
|
8
10
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
9
|
-
addCard(card: CardInfo
|
|
11
|
+
addCard?(card: CardInfo, customer: User & {
|
|
12
|
+
billingAddress: Partial<UserAddress>;
|
|
13
|
+
}): Promise<Card>;
|
|
10
14
|
getCardByToken(token: string): Promise<Card>;
|
|
11
|
-
|
|
15
|
+
getCardByToken(customerId: string, token: string): Promise<Card>;
|
|
16
|
+
createCardHash<T>(bu: BusinessUnitEnum, shop: Shops, card?: CardInfo): Promise<string | T>;
|
|
12
17
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
18
|
+
createOrUpdateCustomer?(customer: User & {
|
|
19
|
+
billingAddress: Partial<UserAddress>;
|
|
20
|
+
}): any;
|
|
13
21
|
}
|
|
@@ -11,7 +11,14 @@ export declare class Order extends Checkout {
|
|
|
11
11
|
deliveredAt?: string;
|
|
12
12
|
trackingEvents?: OrderTrackingEvent[];
|
|
13
13
|
payment: PaymentTransaction;
|
|
14
|
+
pedidov?: number;
|
|
14
15
|
reshipmentOrderId?: string;
|
|
15
16
|
isChange?: boolean;
|
|
16
17
|
isReshipment?: boolean;
|
|
18
|
+
metadata?: {
|
|
19
|
+
ip?: string;
|
|
20
|
+
userAgent?: string;
|
|
21
|
+
plataform?: string;
|
|
22
|
+
origin?: string;
|
|
23
|
+
};
|
|
17
24
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model/base.model';
|
|
2
2
|
import { PaymentBilling, PaymentCard, PaymentCustomer, PaymentItem, PaymentShipping } from './types';
|
|
3
3
|
export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
4
|
-
id?:
|
|
4
|
+
id?: string;
|
|
5
5
|
object?: string;
|
|
6
6
|
status?: string;
|
|
7
|
-
tid?:
|
|
7
|
+
tid?: string;
|
|
8
|
+
gateway_id?: string;
|
|
8
9
|
nsu?: number;
|
|
9
10
|
amount: number;
|
|
11
|
+
currency?: string;
|
|
10
12
|
cost: number;
|
|
11
13
|
installments?: number;
|
|
12
14
|
referer: string;
|
|
@@ -26,8 +28,12 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
26
28
|
refuse_reason?: string;
|
|
27
29
|
status_reason?: string;
|
|
28
30
|
acquirer_response_code?: string;
|
|
31
|
+
acquirer_auth_code?: string;
|
|
32
|
+
acquirer_return_code?: string;
|
|
29
33
|
acquirer_name?: string;
|
|
34
|
+
acquirer_message?: string;
|
|
30
35
|
acquirer_id?: string;
|
|
36
|
+
acquirer_nsu?: string;
|
|
31
37
|
authorization_code?: string;
|
|
32
38
|
soft_descriptor?: string;
|
|
33
39
|
date_created?: string;
|
|
@@ -36,20 +42,29 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
36
42
|
paid_amount?: number;
|
|
37
43
|
paid_at?: string;
|
|
38
44
|
refunded_amount?: number;
|
|
45
|
+
card_id?: string;
|
|
39
46
|
card_holder_name?: string;
|
|
40
47
|
card_last_digits?: string;
|
|
41
48
|
card_first_digits?: string;
|
|
42
49
|
card_brand?: string;
|
|
43
50
|
card_pin_mode?: string;
|
|
44
51
|
card_magstripe_fallback?: boolean;
|
|
52
|
+
card_expiration_month?: string;
|
|
53
|
+
card_expiration_year?: string;
|
|
45
54
|
cvm_pin?: boolean;
|
|
46
55
|
postback_url?: string;
|
|
47
56
|
payment_method?: string;
|
|
48
57
|
capture_method?: string;
|
|
49
58
|
antifraud_score?: string;
|
|
50
59
|
boleto_url?: string;
|
|
60
|
+
boleto_line?: string;
|
|
51
61
|
boleto_barcode?: string;
|
|
62
|
+
boleto_qr_code?: string;
|
|
52
63
|
boleto_expiration_date?: string;
|
|
64
|
+
boleto_instructions?: string;
|
|
65
|
+
boleto_nosso_numero?: string;
|
|
66
|
+
boleto_type?: string;
|
|
67
|
+
boleto_document_number?: string;
|
|
53
68
|
subscription_id?: string;
|
|
54
69
|
split_rules?: string;
|
|
55
70
|
antifraud_metadata?: any;
|
|
@@ -59,9 +74,11 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
59
74
|
fraudCovered?: boolean;
|
|
60
75
|
fraud_reimbursed?: string;
|
|
61
76
|
order_id?: string;
|
|
77
|
+
charger_id?: string;
|
|
62
78
|
risk_level?: string;
|
|
63
79
|
receipt_url?: string;
|
|
64
80
|
private_label?: string;
|
|
65
81
|
pix_qr_code?: string;
|
|
82
|
+
pix_qr_code_url?: string;
|
|
66
83
|
pix_expiration_date?: string;
|
|
67
84
|
}
|
|
@@ -2,9 +2,11 @@ import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
|
|
|
2
2
|
import { PaymentProvider } from '../types';
|
|
3
3
|
import { PaymentTransaction } from './payment-transaction';
|
|
4
4
|
export declare class Payment extends BaseModel<Payment> {
|
|
5
|
-
id: number;
|
|
5
|
+
id: string | number;
|
|
6
6
|
checkoutId: string;
|
|
7
7
|
orderId?: string;
|
|
8
|
+
pagarMeOrderId?: string;
|
|
9
|
+
mercadoPagoId?: number;
|
|
8
10
|
totalPrice: number;
|
|
9
11
|
userId: string;
|
|
10
12
|
paymentProvider: PaymentProvider;
|
|
@@ -10,6 +10,8 @@ export declare class AntifraudCardService implements AntifraudProvider {
|
|
|
10
10
|
private LIMIT_BLOCKED_ORDERS_DAY;
|
|
11
11
|
constructor(orderRepository: OrderRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
12
12
|
validate(checkout: Checkout, card: PaymentCardInfo): Promise<Boolean>;
|
|
13
|
+
private setLimitsByUserType;
|
|
14
|
+
private getLimitsByUserType;
|
|
13
15
|
private validateBlockedOrderAttempts;
|
|
14
16
|
private validateDayAndWeekOrderLimits;
|
|
15
17
|
private verifyBlockedOrderAttempts;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaymentCardInfo } from './payment-card-info.type';
|
|
2
2
|
export type CheckoutPayloadRequest = {
|
|
3
3
|
checkoutId: string;
|
|
4
4
|
shopId: string;
|
|
5
|
-
paymentProvider: PaymentProvider;
|
|
6
5
|
isChange?: boolean;
|
|
7
|
-
|
|
8
|
-
installments: number;
|
|
9
|
-
cardId: string;
|
|
10
|
-
cardCvv?: string;
|
|
11
|
-
};
|
|
6
|
+
cards?: PaymentCardInfo[];
|
|
12
7
|
boleto?: boolean;
|
|
13
8
|
pix?: boolean;
|
|
14
9
|
applicationVersion?: string;
|
|
@@ -6,8 +6,11 @@ export * from './checkout-paylod-request.type';
|
|
|
6
6
|
export * from './checkout-response.type';
|
|
7
7
|
export * from './checkout-stock-validation.type';
|
|
8
8
|
export * from './glam-credentials.type';
|
|
9
|
+
export * from './mercado-pago-card.type';
|
|
10
|
+
export * from './mercado-pago-credentials.type';
|
|
9
11
|
export * from './order-tracking-events.type';
|
|
10
12
|
export * from './pagarme-card.type';
|
|
13
|
+
export * from './pagarme-credentials-v5.type';
|
|
11
14
|
export * from './pagarme-credentials.type';
|
|
12
15
|
export * from './payment-card-info.type';
|
|
13
16
|
export * from './payment-method.type';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCard } from './base-card.type';
|
|
2
|
+
export interface MercadoPagoCard extends BaseCard {
|
|
3
|
+
}
|
|
4
|
+
export interface MercadoPagoCardTokenResponse {
|
|
5
|
+
id: string;
|
|
6
|
+
card_id: string;
|
|
7
|
+
status: boolean;
|
|
8
|
+
date_created: string;
|
|
9
|
+
date_last_updated: string;
|
|
10
|
+
date_due: string;
|
|
11
|
+
luhn_validation: boolean;
|
|
12
|
+
live_mode: boolean;
|
|
13
|
+
require_esc: boolean;
|
|
14
|
+
}
|
|
@@ -4,13 +4,19 @@ export interface PagarMeCard extends BaseCard {
|
|
|
4
4
|
id: string;
|
|
5
5
|
date_created: string;
|
|
6
6
|
date_updated: string;
|
|
7
|
-
brand
|
|
7
|
+
brand?: string;
|
|
8
8
|
holder_name: string;
|
|
9
|
-
first_digits
|
|
10
|
-
|
|
9
|
+
first_digits?: string;
|
|
10
|
+
first_six_digits?: string;
|
|
11
|
+
last_digits?: string;
|
|
12
|
+
last_four_digits?: string;
|
|
13
|
+
exp_month?: number;
|
|
14
|
+
exp_year?: number;
|
|
11
15
|
country: string;
|
|
12
16
|
fingerprint: string;
|
|
13
17
|
customer: string;
|
|
14
18
|
valid: boolean;
|
|
19
|
+
status?: string;
|
|
15
20
|
expiration_date: string;
|
|
21
|
+
type: string;
|
|
16
22
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export type PagarmeCredentials = {
|
|
2
2
|
URL: string;
|
|
3
|
-
URL_POSTBACK
|
|
3
|
+
URL_POSTBACK?: string;
|
|
4
4
|
API_KEY: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Glamshop: {
|
|
6
|
+
SUBSCRIPTION_API_KEY: string;
|
|
7
|
+
SHOP_API_KEY: string;
|
|
8
|
+
};
|
|
9
|
+
mensmarket: {
|
|
10
|
+
SUBSCRIPTION_API_KEY: string;
|
|
11
|
+
SHOP_API_KEY: string;
|
|
12
|
+
};
|
|
7
13
|
};
|
package/src/infra/firebase/firestore/repositories/catalog/category-brand-firestore.repository.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BrandCategory, BrandCategoryRepository } from '../../../../../domain';
|
|
2
|
+
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
|
+
declare const BrandCategoryFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<BrandCategory> & import("../../../../../domain").CrudRepository<BrandCategory, import("../../../../../domain").CrudParams<BrandCategory>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<BrandCategory>, ...any[]]>;
|
|
4
|
+
export declare class BrandCategoryFirestoreRepository extends BrandCategoryFirestoreRepository_base implements BrandCategoryRepository {
|
|
5
|
+
constructor({ firestore, interceptors, }: Pick<FirestoreConstructorParams<BrandCategory>, 'firestore' | 'interceptors'>);
|
|
6
|
+
}
|
|
7
|
+
export {};
|
package/src/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts
CHANGED
|
@@ -28,5 +28,6 @@ export declare class CategoryFirestoreRepository extends CategoryFirestoreReposi
|
|
|
28
28
|
getCategoryByShop(_shop: string): Promise<Category[]>;
|
|
29
29
|
getChildren(_parentId: number): Promise<Category[]>;
|
|
30
30
|
isChild(_id: number, _parentId: number): Promise<boolean>;
|
|
31
|
+
getBrandsWithProducts(): Promise<Category[]>;
|
|
31
32
|
}
|
|
32
33
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './category-hasura-graphql';
|
|
2
2
|
export * from './kit-product-hasura-graphql';
|
|
3
|
+
export * from './product-catalog-hasura-graphql';
|
|
3
4
|
export * from './product-errors-hasura-graphql';
|
|
4
5
|
export * from './product-hasura-graphql';
|
|
5
6
|
export * from './variant-hasura-graphql';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Product } from '../../../domain';
|
|
2
|
+
export declare class ProductCatalogHasuraGraphQL extends Product {
|
|
3
|
+
firestoreId?: string;
|
|
4
|
+
fullPrice?: number;
|
|
5
|
+
subscriberDiscountPercentage?: number;
|
|
6
|
+
subscriberPrice?: number;
|
|
7
|
+
productId?: number;
|
|
8
|
+
differentials?: string;
|
|
9
|
+
whoMustUse?: string;
|
|
10
|
+
howToUse?: string;
|
|
11
|
+
brandDescription?: string;
|
|
12
|
+
categoryId?: number;
|
|
13
|
+
ingredients?: string;
|
|
14
|
+
hasStock?: boolean;
|
|
15
|
+
intGender?: number;
|
|
16
|
+
}
|
|
@@ -5,4 +5,11 @@ export declare class VariantHasuraGraphQL extends Variant {
|
|
|
5
5
|
subscriberDiscountPercentage?: number;
|
|
6
6
|
subscriberPrice?: number;
|
|
7
7
|
hasStock?: boolean;
|
|
8
|
+
differentials?: string;
|
|
9
|
+
whoMustUse?: string;
|
|
10
|
+
howToUse?: string;
|
|
11
|
+
brandDescription?: string;
|
|
12
|
+
categoryId?: number;
|
|
13
|
+
ingredients?: string;
|
|
14
|
+
intGender?: number;
|
|
8
15
|
}
|
|
@@ -4,6 +4,7 @@ export * from './category-hasura-graphql.repository';
|
|
|
4
4
|
export * from './category-product-hasura-graphql.repository';
|
|
5
5
|
export * from './filter-hasura-graphql.repository';
|
|
6
6
|
export * from './filter-option-hasura-graphql.repository';
|
|
7
|
+
export * from './product-catalog-hasura-graphql.repository';
|
|
7
8
|
export * from './product-errors-hasura-graphql.repository';
|
|
8
9
|
export * from './product-hasura-graphql.repository';
|
|
9
10
|
export * from './product-review-hasura-graphql.repository';
|
package/src/infra/hasura-graphql/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FindRepositoryParams, Product, ProductCatalogRepository, ProductGender, RepositoryCacheOptions, RepositoryFindResult } from '../../../../domain';
|
|
2
|
+
import { HasuraConstructorParams } from '../../mixins';
|
|
3
|
+
import { ProductCatalogHasuraGraphQL, ProductHasuraGraphQL } from '../../models';
|
|
4
|
+
declare const ProductCatalogHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../../types").GraphQLRepository<ProductCatalogHasuraGraphQL> & import("../../../../domain").FindRepository<ProductCatalogHasuraGraphQL, FindRepositoryParams<ProductCatalogHasuraGraphQL>>, any[]>;
|
|
5
|
+
export declare class ProductCatalogHasuraGraphQLRepository extends ProductCatalogHasuraGraphQLRepository_base implements ProductCatalogRepository {
|
|
6
|
+
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<ProductCatalogHasuraGraphQL>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>);
|
|
7
|
+
get({ id }: {
|
|
8
|
+
id: string;
|
|
9
|
+
}, options?: {
|
|
10
|
+
cache?: RepositoryCacheOptions;
|
|
11
|
+
}): Promise<Product>;
|
|
12
|
+
getByEAN(EAN: string, options?: {
|
|
13
|
+
cache?: RepositoryCacheOptions;
|
|
14
|
+
}): Promise<Product>;
|
|
15
|
+
find(params?: FindRepositoryParams<ProductHasuraGraphQL>, optionsParams?: {
|
|
16
|
+
cache?: RepositoryCacheOptions;
|
|
17
|
+
}): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
18
|
+
findCatalog(params: FindRepositoryParams<ProductHasuraGraphQL>, mainGender?: Extract<ProductGender, 'female' | 'male'>, options?: {
|
|
19
|
+
cache?: RepositoryCacheOptions;
|
|
20
|
+
}): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare class VariantHasuraGraphQLRepository extends VariantHasuraGraphQL
|
|
|
8
8
|
find(params?: FindRepositoryParams<VariantHasuraGraphQL>): Promise<RepositoryFindResult<VariantHasuraGraphQL>>;
|
|
9
9
|
getByEAN(EAN: string): Promise<VariantHasuraGraphQL>;
|
|
10
10
|
update(params: UpdateRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
11
|
+
private updateMetadata;
|
|
11
12
|
private getId;
|
|
12
13
|
}
|
|
13
14
|
export {};
|
package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts
CHANGED
|
@@ -25,5 +25,6 @@ export declare class WishlistHasuraGraphQLRepository extends WishlistHasuraGraph
|
|
|
25
25
|
private updateMetadata;
|
|
26
26
|
addProduct(wishlistId: string, productId: string): Promise<void>;
|
|
27
27
|
removeProduct(wishlistId: string, productId: string): Promise<void>;
|
|
28
|
+
getBrandsWithProducts(): Promise<Category[]>;
|
|
28
29
|
}
|
|
29
30
|
export {};
|