@infrab4a/connect 5.3.0-beta.1 → 5.3.0-beta.11
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 +1490 -208
- package/index.esm.js +1484 -210
- package/package.json +3 -2
- package/src/domain/catalog/models/product-base.d.ts +5 -1
- 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.repository.d.ts +1 -0
- package/src/domain/catalog/repositories/index.d.ts +1 -0
- package/src/domain/catalog/repositories/product-catalog.repository.d.ts +17 -0
- package/src/domain/catalog/repositories/product.repository.d.ts +3 -0
- package/src/domain/catalog/repositories/variant.repository.d.ts +1 -0
- package/src/domain/shopping/enums/index.d.ts +2 -0
- package/src/domain/shopping/enums/pagarme-v5-payment-status.enum.d.ts +24 -0
- package/src/domain/shopping/enums/transaction-payment-methods.enum.d.ts +5 -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 +17 -2
- package/src/domain/shopping/models/payment.d.ts +2 -1
- package/src/domain/shopping/types/card-info.type.d.ts +1 -0
- package/src/domain/shopping/types/index.d.ts +1 -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/users/models/user-payment-method.d.ts +2 -0
- package/src/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +4 -1
- package/src/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.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/product-hasura-graphql.repository.d.ts +3 -0
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +2 -0
- package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts +1 -0
- package/src/infra/pagarme/adapters/helpers/index.d.ts +2 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-request.helper.d.ts +12 -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 +89 -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect",
|
|
3
|
-
"version": "5.3.0-beta.
|
|
3
|
+
"version": "5.3.0-beta.11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -11,7 +11,8 @@
|
|
|
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",
|
|
@@ -19,11 +19,13 @@ export declare class ProductBase<T extends ProductBase<T, I>, I = ProductIdentif
|
|
|
19
19
|
costPrice: number;
|
|
20
20
|
images?: string[];
|
|
21
21
|
miniatures?: string[];
|
|
22
|
+
imagesCard?: string[];
|
|
22
23
|
published: boolean;
|
|
23
24
|
createdAt?: Date;
|
|
24
25
|
updatedAt?: Date;
|
|
25
26
|
brand: string;
|
|
26
|
-
|
|
27
|
+
tagsCollection?: string[];
|
|
28
|
+
tagsProfile?: string[];
|
|
27
29
|
filters?: string[];
|
|
28
30
|
type?: string;
|
|
29
31
|
categories?: string[];
|
|
@@ -37,6 +39,8 @@ export declare class ProductBase<T extends ProductBase<T, I>, I = ProductIdentif
|
|
|
37
39
|
label?: ProductLabel;
|
|
38
40
|
group?: number;
|
|
39
41
|
validity: boolean;
|
|
42
|
+
daysOfUse?: number;
|
|
43
|
+
variantSlug?: string;
|
|
40
44
|
category: Category;
|
|
41
45
|
kitProducts?: KitProduct[];
|
|
42
46
|
reviews?: ProductReview[];
|
|
@@ -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 {};
|
|
@@ -5,6 +5,7 @@ export * from './category.repository';
|
|
|
5
5
|
export * from './filter-option.repository';
|
|
6
6
|
export * from './filter.repository';
|
|
7
7
|
export * from './group.repository';
|
|
8
|
+
export * from './product-catalog.repository';
|
|
8
9
|
export * from './product-errors.repository';
|
|
9
10
|
export * from './product-reviews.repository';
|
|
10
11
|
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
|
+
}
|
|
@@ -23,6 +23,9 @@ export interface ProductRepository extends CrudRepository<Product> {
|
|
|
23
23
|
getBySlug(slug: string, options?: {
|
|
24
24
|
cache?: RepositoryCacheOptions;
|
|
25
25
|
}): Promise<Product>;
|
|
26
|
+
getByEAN(EAN: string, options?: {
|
|
27
|
+
cache?: RepositoryCacheOptions;
|
|
28
|
+
}): Promise<Product>;
|
|
26
29
|
fetchReviews(status: ReviewStatusParams, options?: {
|
|
27
30
|
cache?: RepositoryCacheOptions;
|
|
28
31
|
}): Promise<ReviewWithProductData[]>;
|
|
@@ -2,5 +2,7 @@ export * from './antifraud-providers.enum';
|
|
|
2
2
|
export * from './business-unit.enum';
|
|
3
3
|
export * from './order-blocked.enum';
|
|
4
4
|
export * from './pagarme-payment-status.enum';
|
|
5
|
+
export * from './pagarme-v5-payment-status.enum';
|
|
5
6
|
export * from './payment-methods.enum';
|
|
6
7
|
export * from './payment-providers.enum';
|
|
8
|
+
export * from './transaction-payment-methods.enum';
|
|
@@ -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,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,6 +42,7 @@ 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;
|
|
@@ -48,8 +55,14 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
48
55
|
capture_method?: string;
|
|
49
56
|
antifraud_score?: string;
|
|
50
57
|
boleto_url?: string;
|
|
58
|
+
boleto_line?: string;
|
|
51
59
|
boleto_barcode?: string;
|
|
60
|
+
boleto_qr_code?: string;
|
|
52
61
|
boleto_expiration_date?: string;
|
|
62
|
+
boleto_instructions?: string;
|
|
63
|
+
boleto_nosso_numero?: string;
|
|
64
|
+
boleto_type?: string;
|
|
65
|
+
boleto_document_number?: string;
|
|
53
66
|
subscription_id?: string;
|
|
54
67
|
split_rules?: string;
|
|
55
68
|
antifraud_metadata?: any;
|
|
@@ -59,9 +72,11 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
59
72
|
fraudCovered?: boolean;
|
|
60
73
|
fraud_reimbursed?: string;
|
|
61
74
|
order_id?: string;
|
|
75
|
+
charger_id?: string;
|
|
62
76
|
risk_level?: string;
|
|
63
77
|
receipt_url?: string;
|
|
64
78
|
private_label?: string;
|
|
65
79
|
pix_qr_code?: string;
|
|
80
|
+
pix_qr_code_url?: string;
|
|
66
81
|
pix_expiration_date?: string;
|
|
67
82
|
}
|
|
@@ -2,9 +2,10 @@ 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;
|
|
8
9
|
totalPrice: number;
|
|
9
10
|
userId: string;
|
|
10
11
|
paymentProvider: PaymentProvider;
|
|
@@ -8,6 +8,7 @@ export * from './checkout-stock-validation.type';
|
|
|
8
8
|
export * from './glam-credentials.type';
|
|
9
9
|
export * from './order-tracking-events.type';
|
|
10
10
|
export * from './pagarme-card.type';
|
|
11
|
+
export * from './pagarme-credentials-v5.type';
|
|
11
12
|
export * from './pagarme-credentials.type';
|
|
12
13
|
export * from './payment-card-info.type';
|
|
13
14
|
export * from './payment-method.type';
|
|
@@ -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-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,4 +1,4 @@
|
|
|
1
|
-
import { FindRepositoryParams, PaginatedReviewFilters, Product, ProductRepository, ProductVariantReport, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
1
|
+
import { FindRepositoryParams, PaginatedReviewFilters, Product, ProductRepository, ProductVariantReport, RepositoryCacheOptions, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
2
2
|
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
3
|
declare const ProductFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<Product> & import("../../../../../domain").CrudRepository<Product, import("../../../../../domain").CrudParams<Product>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<Product>, ...any[]]>;
|
|
4
4
|
export declare class ProductFirestoreRepository extends ProductFirestoreRepository_base implements ProductRepository {
|
|
@@ -11,5 +11,8 @@ export declare class ProductFirestoreRepository extends ProductFirestoreReposito
|
|
|
11
11
|
findCatalog(params: FindRepositoryParams<Product>): Promise<RepositoryFindResult<Product>>;
|
|
12
12
|
fetchPaginatedReviews(): Promise<ReviewWithProductData[]>;
|
|
13
13
|
productVariantFullReport(): Promise<ProductVariantReport[]>;
|
|
14
|
+
getByEAN(EAN: string, options?: {
|
|
15
|
+
cache?: RepositoryCacheOptions;
|
|
16
|
+
}): Promise<Product>;
|
|
14
17
|
}
|
|
15
18
|
export {};
|
package/src/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ declare const ProductVariantFirestoreRepository_base: import("../../../../../uti
|
|
|
8
8
|
export declare class ProductVariantFirestoreRepository extends ProductVariantFirestoreRepository_base implements VariantRepository {
|
|
9
9
|
readonly parentRepository: ProductFirestoreRepository;
|
|
10
10
|
constructor({ firestore, interceptors }: Pick<FirestoreConstructorParams<Variant>, 'firestore' | 'interceptors'>, parentRepository: ProductFirestoreRepository);
|
|
11
|
+
getByEAN(EAN: string): Promise<Variant>;
|
|
11
12
|
}
|
|
12
13
|
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/product-hasura-graphql.repository.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQL
|
|
|
15
15
|
getBySlug(slug: string, options?: {
|
|
16
16
|
cache?: RepositoryCacheOptions;
|
|
17
17
|
}): Promise<ProductHasuraGraphQL>;
|
|
18
|
+
getByEAN(EAN: string, options?: {
|
|
19
|
+
cache?: RepositoryCacheOptions;
|
|
20
|
+
}): Promise<ProductHasuraGraphQL>;
|
|
18
21
|
update(params: UpdateRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
19
22
|
fetchProductReviews(filters: PaginatedReviewFilters, options?: {
|
|
20
23
|
cache?: RepositoryCacheOptions;
|
package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ export declare class VariantHasuraGraphQLRepository extends VariantHasuraGraphQL
|
|
|
6
6
|
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<VariantHasuraGraphQL>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>);
|
|
7
7
|
get(identifiers: GetRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
8
8
|
find(params?: FindRepositoryParams<VariantHasuraGraphQL>): Promise<RepositoryFindResult<VariantHasuraGraphQL>>;
|
|
9
|
+
getByEAN(EAN: string): Promise<VariantHasuraGraphQL>;
|
|
9
10
|
update(params: UpdateRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
11
|
+
private updateMetadata;
|
|
10
12
|
private getId;
|
|
11
13
|
}
|
|
12
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 {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Checkout, PaymentCardInfo } from '../../../../domain';
|
|
2
|
+
import { PagarMeV5RequestPayload } from '../../types';
|
|
3
|
+
export declare class PagarMeV5RequestHelper {
|
|
4
|
+
static build(checkout: Checkout, method: 'pix' | 'boleto' | 'credit_card', card?: PaymentCardInfo): PagarMeV5RequestPayload;
|
|
5
|
+
private static buildItems;
|
|
6
|
+
private static buildCustomer;
|
|
7
|
+
private static buildShipping;
|
|
8
|
+
private static buildPayment;
|
|
9
|
+
private static getPixOrder;
|
|
10
|
+
private static getBoletoOrder;
|
|
11
|
+
private static getCardOrder;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Checkout, Payment, TransactionPaymentMethods } from '../../../../domain';
|
|
2
|
+
import { PagarMeV5Response } from '../../types';
|
|
3
|
+
export declare class PagarMeV5ResponseHelper {
|
|
4
|
+
static build(method: TransactionPaymentMethods, checkout: Checkout, response: PagarMeV5Response): Payment;
|
|
5
|
+
private static buildPaymentTransaction;
|
|
6
|
+
private static getPaymentStatus;
|
|
7
|
+
private static getBoletoReponse;
|
|
8
|
+
private static getPixReponse;
|
|
9
|
+
private static getCardReponse;
|
|
10
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './pagarme-pix-payment-axios.adapter';
|
|
1
|
+
export * from './v4';
|
|
2
|
+
export * from './v5';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PaymentProviderBankSlip } from '
|
|
2
|
-
import { Checkout, Payment, PaymentTransaction } from '
|
|
3
|
-
import { PaymentRepository } from '
|
|
4
|
-
import { PagarmeCredentials } from '
|
|
1
|
+
import { PaymentProviderBankSlip } from '../../../../domain/shopping/interfaces';
|
|
2
|
+
import { Checkout, Payment, PaymentTransaction } from '../../../../domain/shopping/models';
|
|
3
|
+
import { PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
4
|
+
import { PagarmeCredentials } from '../../../../domain/shopping/types';
|
|
5
5
|
export declare class PagarmeBankSlipAxiosAdapter implements PaymentProviderBankSlip {
|
|
6
6
|
private credentials;
|
|
7
7
|
private paymentRepository;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Shops } from '../../../../domain/catalog';
|
|
2
|
+
import { BusinessUnitEnum } from '../../../../domain/shopping/enums';
|
|
3
|
+
import { PaymentProviderCard } from '../../../../domain/shopping/interfaces';
|
|
4
|
+
import { Checkout, Payment, PaymentTransaction } from '../../../../domain/shopping/models';
|
|
5
|
+
import { OrderBlockedRepository, PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
6
|
+
import { CardInfo, PagarMeCard, PagarmeCredentials, PaymentCardInfo } from '../../../../domain/shopping/types';
|
|
6
7
|
export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<PagarMeCard> {
|
|
7
8
|
private credentials;
|
|
8
9
|
private paymentRepository;
|
|
@@ -10,7 +11,7 @@ export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<Paga
|
|
|
10
11
|
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
11
12
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
12
13
|
addCard(card: CardInfo): Promise<PagarMeCard>;
|
|
13
|
-
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum): Promise<PagarMeCardManualHash>;
|
|
14
|
+
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum, shop?: Shops): Promise<PagarMeCardManualHash>;
|
|
14
15
|
getCardByToken(id: string): Promise<PagarMeCard>;
|
|
15
16
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
16
17
|
private createCardPayment;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PaymentProviderPix } from '
|
|
2
|
-
import { Checkout, Payment } from '
|
|
3
|
-
import { PaymentRepository } from '
|
|
4
|
-
import { PagarmeCredentials } from '
|
|
1
|
+
import { PaymentProviderPix } from '../../../../domain/shopping/interfaces';
|
|
2
|
+
import { Checkout, Payment } from '../../../../domain/shopping/models';
|
|
3
|
+
import { PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
4
|
+
import { PagarmeCredentials } from '../../../../domain/shopping/types';
|
|
5
5
|
export declare class PagarmePixAxiosAdapter implements PaymentProviderPix {
|
|
6
6
|
private credentials;
|
|
7
7
|
private paymentRepository;
|