@infrab4a/connect 5.3.0-beta.25 → 5.3.0-beta.27
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 +406 -67
- package/index.esm.js +402 -68
- package/package.json +1 -1
- package/src/domain/catalog/models/enums/shops.enum.d.ts +2 -0
- package/src/domain/catalog/models/product-group.d.ts +1 -1
- package/src/domain/catalog/models/product-price-log.d.ts +1 -1
- package/src/domain/catalog/models/types/product-competitors-price.d.ts +3 -2
- package/src/domain/catalog/repositories/category-product.repository.d.ts +2 -0
- package/src/domain/shop-settings/enums/shop-page-name.enum.d.ts +2 -1
- package/src/domain/shop-settings/models/shop-page-settings.d.ts +4 -1
- package/src/domain/shop-settings/models/types/shop-page-section.type.d.ts +140 -0
- package/src/domain/shopping/models/enums/index.d.ts +3 -0
- package/src/domain/shopping/models/enums/order-status.enum.d.ts +2 -1
- package/src/domain/shopping/models/enums/shopping-recurrence-cycle.enum.d.ts +5 -0
- package/src/domain/shopping/models/enums/shopping-recurrence-edition-status.enum.d.ts +11 -0
- package/src/domain/shopping/models/enums/shopping-recurrence-status.enum.d.ts +7 -0
- package/src/domain/shopping/models/index.d.ts +1 -0
- package/src/domain/shopping/models/order-blocked.d.ts +5 -1
- package/src/domain/shopping/models/order.d.ts +12 -0
- package/src/domain/shopping/models/recurrence/index.d.ts +2 -0
- package/src/domain/shopping/models/recurrence/shopping-recurrence-edition.d.ts +18 -0
- package/src/domain/shopping/models/recurrence/shopping-recurrence.d.ts +45 -0
- package/src/domain/shopping/models/shipping-method.d.ts +2 -0
- package/src/domain/shopping/models/types/index.d.ts +1 -0
- package/src/domain/shopping/models/types/line-item-recurrence.type.d.ts +2 -0
- package/src/domain/shopping/repositories/index.d.ts +1 -0
- package/src/domain/shopping/repositories/order-blocked.repository.d.ts +5 -1
- package/src/domain/shopping/repositories/recurrence/index.d.ts +2 -0
- package/src/domain/shopping/repositories/recurrence/shopping-recurrence-edition.repository.d.ts +4 -0
- package/src/domain/shopping/repositories/recurrence/shopping-recurrence.repository.d.ts +9 -0
- package/src/domain/shopping/types/create-recurrency-payload.type.d.ts +8 -0
- package/src/domain/shopping/types/index.d.ts +1 -0
- package/src/domain/shopping/types/payment-card-info.type.d.ts +5 -3
- package/src/domain/users/models/user.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +2 -0
- package/src/infra/firebase/firestore/repositories/shopping/shopping-recurrence-edition-firestore.repository.d.ts +7 -0
- package/src/infra/firebase/firestore/repositories/shopping/shopping-recurrence-firestore.repository.d.ts +10 -0
- package/src/infra/hasura-graphql/repositories/catalog/category-product-hasura-graphql.repository.d.ts +2 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-base-axios.d.ts +11 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-card-payment-axios.adapter.d.ts +5 -4
- package/src/infra/mercado-pago/adapters/mercado-pago-pix-payment-axios.adapter.d.ts +4 -3
- package/src/infra/mercado-pago/types/mercado-pago-response.type.d.ts +23 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-blocked-order.helper.d.ts +1 -0
- package/src/infra/pagarme/adapters/v5/index.d.ts +1 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-base-axios.d.ts +11 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-card-payment-axios.adapter.d.ts +5 -4
- package/src/infra/pagarme/adapters/v5/pagarmev5-pix-payment-axios.adapter.d.ts +4 -3
- package/src/infra/pagarme/types/v5/pagarmev5-order-response.type.d.ts +115 -0
|
@@ -7,6 +7,6 @@ export declare class ProductGroup extends BaseModel<ProductGroup> {
|
|
|
7
7
|
markupWithoutCompetitor?: number;
|
|
8
8
|
discountCompetitor?: number;
|
|
9
9
|
subscriberDiscountPercentage?: number;
|
|
10
|
-
|
|
10
|
+
dynamicPrecification: boolean;
|
|
11
11
|
static get identifiersFields(): GenericIdentifier[];
|
|
12
12
|
}
|
|
@@ -18,8 +18,8 @@ export declare class ProductPriceLog extends BaseModel<ProductPriceLog> {
|
|
|
18
18
|
groupId?: string;
|
|
19
19
|
competitorsAndPrices?: ProductCompetitorsPrice[];
|
|
20
20
|
competitorsPrices?: number[];
|
|
21
|
-
competitorsSellerMinPrice?: string;
|
|
22
21
|
competitorsMinPrice?: number;
|
|
22
|
+
competitorsSellerMinPrice?: string;
|
|
23
23
|
statusPrecificacao: string;
|
|
24
24
|
static get identifiersFields(): GenericIdentifier[];
|
|
25
25
|
}
|
|
@@ -8,4 +8,6 @@ export interface CategoryProductRepository extends CrudRepository<CategoryProduc
|
|
|
8
8
|
order: number;
|
|
9
9
|
}[]): Promise<void>;
|
|
10
10
|
addProductToCategories(productId: string, categoryIds: string[]): Promise<void>;
|
|
11
|
+
removeProductFromAllCategories(productId: string): Promise<void>;
|
|
12
|
+
removeCategoryFromAllProducts(categoryId: string): Promise<void>;
|
|
11
13
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { ShopPageName } from '../enums';
|
|
3
3
|
import { Section } from './types';
|
|
4
|
+
import { DisplayRules, SectionUnion, ShopPageSection } from './types/shop-page-section.type';
|
|
4
5
|
export declare class ShopSettings extends BaseModel<ShopSettings> {
|
|
5
6
|
id: string | ShopPageName;
|
|
6
7
|
name: string;
|
|
7
8
|
shop: string;
|
|
8
|
-
|
|
9
|
+
preview?: string;
|
|
10
|
+
sections: Section<any> | ShopPageSection[];
|
|
9
11
|
descriptionMeta?: string;
|
|
10
12
|
titleMeta?: string;
|
|
11
13
|
imageMeta?: string;
|
|
12
14
|
hasMultiples?: boolean;
|
|
13
15
|
pagePath?: string;
|
|
14
16
|
static get identifiersFields(): GenericIdentifier[];
|
|
17
|
+
getPageSections(displayRules: DisplayRules): SectionUnion[];
|
|
15
18
|
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export type ShopPageSection = Array<SectionUnion>;
|
|
2
|
+
export type SectionUnion = SectionLive | SectionCarousel | SectionBanner | SectionInfobars | SectionHighlights | SectionSubscriberInfo | SectionCollection | SectionBeautyProfileCollection | SectionPlans | SectionSinglePlan | SectionBrands | SectionNewsletter;
|
|
3
|
+
export declare enum ShopPageSectionType {
|
|
4
|
+
LIVE = "LIVE",
|
|
5
|
+
CAROUSEL = "CAROUSEL",
|
|
6
|
+
BANNER = "BANNER",
|
|
7
|
+
INFOBARS = "INFOBARS",
|
|
8
|
+
HIGHLIGHTS = "HIGHLIGHTS",
|
|
9
|
+
SUBSCRIBER_INFO = "SUBSCRIBER_INFO",
|
|
10
|
+
COLLECTION = "COLLECTION",
|
|
11
|
+
BEAUTY_PROFILE_COLLECTION = "BEAUTY_PROFILE_COLLECTION",
|
|
12
|
+
PLANS = "PLANS",
|
|
13
|
+
SINGLE_PLAN = "SINGLE_PLAN",
|
|
14
|
+
BRANDS = "BRANDS",
|
|
15
|
+
NEWSLETTER = "NEWSLETTER"
|
|
16
|
+
}
|
|
17
|
+
export type SectionLive = {
|
|
18
|
+
id: string;
|
|
19
|
+
type: ShopPageSectionType.LIVE;
|
|
20
|
+
fixed: boolean;
|
|
21
|
+
editable: boolean;
|
|
22
|
+
title: string;
|
|
23
|
+
link: string;
|
|
24
|
+
active: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type SectionCarousel = {
|
|
27
|
+
id: string;
|
|
28
|
+
type: ShopPageSectionType.CAROUSEL;
|
|
29
|
+
fixed: boolean;
|
|
30
|
+
editable: boolean;
|
|
31
|
+
banners: Banner[];
|
|
32
|
+
};
|
|
33
|
+
export type SectionInfobars = {
|
|
34
|
+
id: string;
|
|
35
|
+
type: ShopPageSectionType.INFOBARS;
|
|
36
|
+
fixed: boolean;
|
|
37
|
+
editable: boolean;
|
|
38
|
+
infobars: Infobar[];
|
|
39
|
+
};
|
|
40
|
+
export type Infobar = {
|
|
41
|
+
id: string;
|
|
42
|
+
link: string;
|
|
43
|
+
text: string;
|
|
44
|
+
active: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type SectionHighlights = {
|
|
47
|
+
id: string;
|
|
48
|
+
type: ShopPageSectionType.HIGHLIGHTS;
|
|
49
|
+
fixed: boolean;
|
|
50
|
+
editable: boolean;
|
|
51
|
+
highlights: Highlight[];
|
|
52
|
+
};
|
|
53
|
+
export type Highlight = {
|
|
54
|
+
id: string;
|
|
55
|
+
title: string;
|
|
56
|
+
subtitle: string;
|
|
57
|
+
link: string;
|
|
58
|
+
image: string;
|
|
59
|
+
altText: string;
|
|
60
|
+
highlighted: boolean;
|
|
61
|
+
starred: boolean;
|
|
62
|
+
displayRules?: Array<Partial<DisplayRules>>;
|
|
63
|
+
};
|
|
64
|
+
export type SectionSubscriberInfo = {
|
|
65
|
+
id: string;
|
|
66
|
+
type: ShopPageSectionType.SUBSCRIBER_INFO;
|
|
67
|
+
fixed: boolean;
|
|
68
|
+
editable: boolean;
|
|
69
|
+
};
|
|
70
|
+
export type Banner = {
|
|
71
|
+
id: string;
|
|
72
|
+
mobileImage: string;
|
|
73
|
+
desktopImage: string;
|
|
74
|
+
link: string;
|
|
75
|
+
altText: string;
|
|
76
|
+
countdown?: string;
|
|
77
|
+
displayRules?: Array<Partial<DisplayRules>>;
|
|
78
|
+
publishDate?: Date;
|
|
79
|
+
expirationDate?: Date;
|
|
80
|
+
};
|
|
81
|
+
export type SectionBanner = Banner & {
|
|
82
|
+
type: ShopPageSectionType.BANNER;
|
|
83
|
+
fixed: boolean;
|
|
84
|
+
editable: boolean;
|
|
85
|
+
};
|
|
86
|
+
export type SectionCollection = {
|
|
87
|
+
id: string;
|
|
88
|
+
type: ShopPageSectionType.COLLECTION;
|
|
89
|
+
fixed: boolean;
|
|
90
|
+
editable: boolean;
|
|
91
|
+
slug: string;
|
|
92
|
+
title: string;
|
|
93
|
+
categoryId: number;
|
|
94
|
+
displayRules?: Array<Partial<DisplayRules>>;
|
|
95
|
+
publishDate?: Date;
|
|
96
|
+
expirationDate?: Date;
|
|
97
|
+
};
|
|
98
|
+
export type SectionBeautyProfileCollection = {
|
|
99
|
+
id: string;
|
|
100
|
+
type: ShopPageSectionType.BEAUTY_PROFILE_COLLECTION;
|
|
101
|
+
fixed: boolean;
|
|
102
|
+
editable: boolean;
|
|
103
|
+
};
|
|
104
|
+
export type DisplayRules = {
|
|
105
|
+
subscriberBuyer: boolean;
|
|
106
|
+
notSubscriber: boolean;
|
|
107
|
+
subscriberNotBuyer: boolean;
|
|
108
|
+
topBadgeSubscriber: boolean;
|
|
109
|
+
beautyProfile?: boolean;
|
|
110
|
+
};
|
|
111
|
+
export type SectionPlans = {
|
|
112
|
+
id: string;
|
|
113
|
+
type: ShopPageSectionType.PLANS;
|
|
114
|
+
fixed: boolean;
|
|
115
|
+
editable: boolean;
|
|
116
|
+
};
|
|
117
|
+
export type SectionSinglePlan = {
|
|
118
|
+
id: string;
|
|
119
|
+
type: ShopPageSectionType.SINGLE_PLAN;
|
|
120
|
+
fixed: boolean;
|
|
121
|
+
editable: boolean;
|
|
122
|
+
};
|
|
123
|
+
export type Brand = {
|
|
124
|
+
slug: string;
|
|
125
|
+
image: string;
|
|
126
|
+
brandName: string;
|
|
127
|
+
};
|
|
128
|
+
export type SectionBrands = {
|
|
129
|
+
id: string;
|
|
130
|
+
type: ShopPageSectionType.BRANDS;
|
|
131
|
+
fixed: boolean;
|
|
132
|
+
editable: boolean;
|
|
133
|
+
brands: Brand[];
|
|
134
|
+
};
|
|
135
|
+
export type SectionNewsletter = {
|
|
136
|
+
id: string;
|
|
137
|
+
type: ShopPageSectionType.NEWSLETTER;
|
|
138
|
+
fixed: boolean;
|
|
139
|
+
editable: boolean;
|
|
140
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum ShoppingRecurrenceEditionStatus {
|
|
2
|
+
SCHEDULED = "scheduled",
|
|
3
|
+
PAUSED = "paused",
|
|
4
|
+
SKIPPED = "skipped",
|
|
5
|
+
PROCESSING = "processing",
|
|
6
|
+
FINISHED = "finished",
|
|
7
|
+
PAYMENT_FAIL = "payment_fail",
|
|
8
|
+
AWAITING_PAYMENT = "awaiting_payment",
|
|
9
|
+
STOCK_VALIDATION = "stock_validation",
|
|
10
|
+
CANCELLED = "cancelled"
|
|
11
|
+
}
|
|
@@ -9,6 +9,7 @@ export * from './order';
|
|
|
9
9
|
export * from './order-blocked';
|
|
10
10
|
export * from './payment';
|
|
11
11
|
export * from './payment-transaction';
|
|
12
|
+
export * from './recurrence';
|
|
12
13
|
export * from './shipping-method';
|
|
13
14
|
export * from './subscription';
|
|
14
15
|
export * from './types';
|
|
@@ -19,7 +19,11 @@ export declare class OrderBlocked extends BaseModel<OrderBlocked> {
|
|
|
19
19
|
type: OrderBlockedType;
|
|
20
20
|
card?: any;
|
|
21
21
|
checkout: Checkout;
|
|
22
|
-
gatewayInfo?:
|
|
22
|
+
gatewayInfo?: {
|
|
23
|
+
gateway?: string;
|
|
24
|
+
status?: string;
|
|
25
|
+
statusDetail?: string;
|
|
26
|
+
};
|
|
23
27
|
date: Date;
|
|
24
28
|
static get identifiersFields(): GenericIdentifier[];
|
|
25
29
|
}
|
|
@@ -12,13 +12,25 @@ export declare class Order extends Checkout {
|
|
|
12
12
|
trackingEvents?: OrderTrackingEvent[];
|
|
13
13
|
payment: PaymentTransaction;
|
|
14
14
|
pedidov?: number;
|
|
15
|
+
isEditionOrder?: boolean;
|
|
15
16
|
reshipmentOrderId?: string;
|
|
16
17
|
isChange?: boolean;
|
|
17
18
|
isReshipment?: boolean;
|
|
19
|
+
isRecurrenceOrder?: boolean;
|
|
20
|
+
recurrenceId?: string;
|
|
21
|
+
recurrenceExecutionId?: string;
|
|
18
22
|
metadata?: {
|
|
19
23
|
ip?: string;
|
|
20
24
|
userAgent?: string;
|
|
21
25
|
plataform?: string;
|
|
22
26
|
origin?: string;
|
|
23
27
|
};
|
|
28
|
+
updatedBy?: {
|
|
29
|
+
id?: string;
|
|
30
|
+
name: string;
|
|
31
|
+
email?: string;
|
|
32
|
+
origin: string;
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
};
|
|
35
|
+
reshipmentCancellationReason?: string;
|
|
24
36
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
|
|
2
|
+
import { ShoppingRecurrenceEditionStatus } from '../enums/shopping-recurrence-edition-status.enum';
|
|
3
|
+
export declare class ShoppingRecurrenceEdition extends BaseModel<ShoppingRecurrenceEdition> {
|
|
4
|
+
id: string;
|
|
5
|
+
recurrenceId: string;
|
|
6
|
+
scheduledDate: Date;
|
|
7
|
+
nextScheduledDate?: Date;
|
|
8
|
+
status: ShoppingRecurrenceEditionStatus;
|
|
9
|
+
errorCode?: string;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
orderId?: string;
|
|
12
|
+
paymentId?: string;
|
|
13
|
+
processedAt?: Date;
|
|
14
|
+
failedAttempts?: number;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Shops } from '../../../catalog/models/enums/shops.enum';
|
|
2
|
+
import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
|
|
3
|
+
import { User, UserAddress } from '../../../users';
|
|
4
|
+
import { PaymentMethod } from '../../types';
|
|
5
|
+
import { PaymentProvider } from '../../types/payment-provider.type';
|
|
6
|
+
import { Coupon } from '../coupons/coupon';
|
|
7
|
+
import { ShoppingRecurrenceCycle } from '../enums/shopping-recurrence-cycle.enum';
|
|
8
|
+
import { ShoppingRecurrenceStatus } from '../enums/shopping-recurrence-status.enum';
|
|
9
|
+
import { ShippingMethod } from '../shipping-method';
|
|
10
|
+
import { LineItemRecurrence } from '../types';
|
|
11
|
+
export declare class ShoppingRecurrence extends BaseModel<ShoppingRecurrence> {
|
|
12
|
+
id: string;
|
|
13
|
+
shop: Shops;
|
|
14
|
+
active: boolean;
|
|
15
|
+
status: ShoppingRecurrenceStatus;
|
|
16
|
+
recurrenceCycle: ShoppingRecurrenceCycle;
|
|
17
|
+
nextChargeDate: Date;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
updatedAt: Date;
|
|
20
|
+
cancelledAt?: Date;
|
|
21
|
+
shippingPrice: number;
|
|
22
|
+
subTotalPrice: number;
|
|
23
|
+
discount?: number;
|
|
24
|
+
totalPrice: number;
|
|
25
|
+
paymentMethod: PaymentMethod;
|
|
26
|
+
cards: Array<{
|
|
27
|
+
paymentProvider: PaymentProvider;
|
|
28
|
+
cardId: string;
|
|
29
|
+
}>;
|
|
30
|
+
originalOrderId: string;
|
|
31
|
+
lastOrderId?: string;
|
|
32
|
+
user: User;
|
|
33
|
+
lineItems: LineItemRecurrence[];
|
|
34
|
+
shippingAddress: UserAddress;
|
|
35
|
+
billingAddress?: UserAddress;
|
|
36
|
+
shipping: ShippingMethod;
|
|
37
|
+
coupon?: Coupon;
|
|
38
|
+
history?: Array<{
|
|
39
|
+
active: boolean;
|
|
40
|
+
status: ShoppingRecurrenceStatus;
|
|
41
|
+
date: Date;
|
|
42
|
+
description?: string;
|
|
43
|
+
}>;
|
|
44
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
45
|
+
}
|
|
@@ -17,5 +17,7 @@ export declare class ShippingMethod extends BaseModel<ShippingMethod> {
|
|
|
17
17
|
additionalDescription?: string;
|
|
18
18
|
serviceCode?: string;
|
|
19
19
|
isSubscriptionAddress?: boolean;
|
|
20
|
+
theme?: string;
|
|
21
|
+
editionId?: string;
|
|
20
22
|
static get identifiersFields(): GenericIdentifier[];
|
|
21
23
|
}
|
|
@@ -7,7 +7,11 @@ type CreateBlockedOrderParams = {
|
|
|
7
7
|
type: string;
|
|
8
8
|
limiteRange: string;
|
|
9
9
|
card?: PaymentCardInfo;
|
|
10
|
-
gatewayInfo?:
|
|
10
|
+
gatewayInfo?: {
|
|
11
|
+
gateway?: string;
|
|
12
|
+
status?: string;
|
|
13
|
+
statusDetail?: string;
|
|
14
|
+
};
|
|
11
15
|
};
|
|
12
16
|
export interface OrderBlockedRepository extends CrudRepository<OrderBlocked> {
|
|
13
17
|
createBlockedOrderOrPayment(params: CreateBlockedOrderParams): Promise<OrderBlocked>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Shops } from '../../../catalog';
|
|
2
|
+
import { CrudRepository } from '../../../generic/repository/crud.repository';
|
|
3
|
+
import { ShoppingRecurrenceStatus } from '../../models';
|
|
4
|
+
import { ShoppingRecurrence } from '../../models/recurrence/shopping-recurrence';
|
|
5
|
+
export interface ShoppingRecurrenceRepository extends CrudRepository<ShoppingRecurrence> {
|
|
6
|
+
findByUserId(userId: string): Promise<ShoppingRecurrence[]>;
|
|
7
|
+
findByUserIdAndStatus(userId: string, status: ShoppingRecurrenceStatus): Promise<ShoppingRecurrence[]>;
|
|
8
|
+
findByUserAndShop(userId: string, shop: Shops): Promise<ShoppingRecurrence[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ShoppingRecurrenceCycle } from '../models';
|
|
2
|
+
import { PaymentCardInfo } from './payment-card-info.type';
|
|
3
|
+
export type CreateShoppingRecurrencyPayload = {
|
|
4
|
+
shopId: string;
|
|
5
|
+
cards?: PaymentCardInfo[];
|
|
6
|
+
orderId: string;
|
|
7
|
+
recurrence: ShoppingRecurrenceCycle;
|
|
8
|
+
};
|
|
@@ -4,6 +4,7 @@ export * from './antifraud-provider.type';
|
|
|
4
4
|
export * from './card-info.type';
|
|
5
5
|
export * from './checkout-paylod-request.type';
|
|
6
6
|
export * from './checkout-response.type';
|
|
7
|
+
export * from './create-recurrency-payload.type';
|
|
7
8
|
export * from './checkout-stock-validation.type';
|
|
8
9
|
export * from './glam-credentials.type';
|
|
9
10
|
export * from './mercado-pago-card.type';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { PaymentProviders } from '../enums';
|
|
2
|
-
export type
|
|
2
|
+
export type CardForPaymentInfo = {
|
|
3
3
|
cardId: string;
|
|
4
|
+
paymentProvider: PaymentProviders;
|
|
5
|
+
customerId?: string;
|
|
6
|
+
};
|
|
7
|
+
export type PaymentCardInfo = CardForPaymentInfo & {
|
|
4
8
|
cardCvv?: string;
|
|
5
9
|
installments: number;
|
|
6
10
|
cpf?: string;
|
|
7
11
|
fingerprint?: string;
|
|
8
|
-
paymentProvider?: PaymentProviders;
|
|
9
|
-
customerId?: string;
|
|
10
12
|
};
|
|
@@ -8,4 +8,6 @@ export * from './legacy-order-firestore.repository';
|
|
|
8
8
|
export * from './order-blocked-firestore.repository';
|
|
9
9
|
export * from './order-firestore.repository';
|
|
10
10
|
export * from './payment-firestore.repository';
|
|
11
|
+
export * from './shopping-recurrence-edition-firestore.repository';
|
|
12
|
+
export * from './shopping-recurrence-firestore.repository';
|
|
11
13
|
export * from './subscription-plan-firestore.repository';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ShoppingRecurrenceEdition, ShoppingRecurrenceEditionRepository } from '../../../../../domain';
|
|
2
|
+
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
|
+
declare const ShoppingRecurrenceEditionFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<ShoppingRecurrenceEdition> & import("../../../../../domain").CrudRepository<ShoppingRecurrenceEdition, import("../../../../../domain").CrudParams<ShoppingRecurrenceEdition>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<ShoppingRecurrenceEdition>, ...any[]]>;
|
|
4
|
+
export declare class ShoppingRecurrenceEditionFirestoreRepository extends ShoppingRecurrenceEditionFirestoreRepository_base implements ShoppingRecurrenceEditionRepository {
|
|
5
|
+
constructor({ firestore, interceptors, cache, }: Pick<FirestoreConstructorParams<ShoppingRecurrenceEdition>, 'firestore' | 'interceptors' | 'cache'>);
|
|
6
|
+
}
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ShoppingRecurrence, ShoppingRecurrenceRepository, ShoppingRecurrenceStatus, Shops } from '../../../../../domain';
|
|
2
|
+
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
|
+
declare const ShoppingRecurrenceFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<ShoppingRecurrence> & import("../../../../../domain").CrudRepository<ShoppingRecurrence, import("../../../../../domain").CrudParams<ShoppingRecurrence>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<ShoppingRecurrence>, ...any[]]>;
|
|
4
|
+
export declare class ShoppingRecurrenceFirestoreRepository extends ShoppingRecurrenceFirestoreRepository_base implements ShoppingRecurrenceRepository {
|
|
5
|
+
constructor({ firestore, interceptors, cache, }: Pick<FirestoreConstructorParams<ShoppingRecurrence>, 'firestore' | 'interceptors' | 'cache'>);
|
|
6
|
+
findByUserId(userId: string): Promise<ShoppingRecurrence[]>;
|
|
7
|
+
findByUserIdAndStatus(userId: string, status: ShoppingRecurrenceStatus): Promise<ShoppingRecurrence[]>;
|
|
8
|
+
findByUserAndShop(userId: string, shop: Shops): Promise<ShoppingRecurrence[]>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -10,5 +10,7 @@ export declare class CategoryProductHasuraGraphQLRepository extends CategoryProd
|
|
|
10
10
|
order: number;
|
|
11
11
|
}[]): Promise<void>;
|
|
12
12
|
addProductToCategories(productId: string, categoryIds: string[]): Promise<void>;
|
|
13
|
+
removeProductFromAllCategories(productId: string): Promise<void>;
|
|
14
|
+
removeCategoryFromAllProducts(categoryId: string): Promise<void>;
|
|
13
15
|
}
|
|
14
16
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MercadoPagoCredentials, Order, PaymentRepository } from '../../../domain';
|
|
2
|
+
export declare class MercadoPagoBaseAxiosAdapter {
|
|
3
|
+
protected credentials: MercadoPagoCredentials;
|
|
4
|
+
protected paymentRepository: PaymentRepository;
|
|
5
|
+
constructor(credentials: MercadoPagoCredentials, paymentRepository: PaymentRepository);
|
|
6
|
+
refund(order: Order, amount: number): Promise<{
|
|
7
|
+
status: string;
|
|
8
|
+
success: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
private getRefundStatus;
|
|
11
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BusinessUnitEnum, CardInfo, Checkout, MercadoPagoCard, MercadoPagoCardTokenResponse, MercadoPagoCredentials, OrderBlockedRepository, Payment, PaymentCardInfo, PaymentProviderCard, PaymentRepository, PaymentTransaction, Shops, User, UserAddress } from '../../../domain';
|
|
2
2
|
import { MercadoPagoResponse } from '../types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { MercadoPagoBaseAxiosAdapter } from './mercado-pago-base-axios';
|
|
4
|
+
export declare class MercadoPagoCardAxiosAdapter extends MercadoPagoBaseAxiosAdapter implements PaymentProviderCard<MercadoPagoCard> {
|
|
5
|
+
protected credentials: MercadoPagoCredentials;
|
|
6
|
+
protected paymentRepository: PaymentRepository;
|
|
7
|
+
protected orderBlockedRepository: OrderBlockedRepository;
|
|
7
8
|
constructor(credentials: MercadoPagoCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
8
9
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
9
10
|
requestPayment(checkout: Checkout, payload: any): Promise<MercadoPagoResponse>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Checkout, MercadoPagoCredentials, Payment, PaymentProviderPix, PaymentRepository } from '../../../domain';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { MercadoPagoBaseAxiosAdapter } from './mercado-pago-base-axios';
|
|
3
|
+
export declare class MercadoPagoPixAxiosAdapter extends MercadoPagoBaseAxiosAdapter implements PaymentProviderPix {
|
|
4
|
+
protected credentials: MercadoPagoCredentials;
|
|
5
|
+
protected paymentRepository: PaymentRepository;
|
|
5
6
|
constructor(credentials: MercadoPagoCredentials, paymentRepository: PaymentRepository);
|
|
6
7
|
pay(checkout: Checkout): Promise<Payment>;
|
|
7
8
|
}
|
|
@@ -186,3 +186,26 @@ export type MercadoPagoResponse = {
|
|
|
186
186
|
accounts_info?: any;
|
|
187
187
|
tags?: any;
|
|
188
188
|
};
|
|
189
|
+
export type MercadoPagoRefundResponse = {
|
|
190
|
+
id: number;
|
|
191
|
+
payment_id: number;
|
|
192
|
+
amount: number;
|
|
193
|
+
metadata: Array<Record<string, unknown>>;
|
|
194
|
+
source: Array<{
|
|
195
|
+
name: {
|
|
196
|
+
en: string;
|
|
197
|
+
pt: string;
|
|
198
|
+
es: string;
|
|
199
|
+
};
|
|
200
|
+
id: string;
|
|
201
|
+
type: string;
|
|
202
|
+
}>;
|
|
203
|
+
date_created: string;
|
|
204
|
+
unique_sequence_number: string | null;
|
|
205
|
+
refund_mode: string;
|
|
206
|
+
adjustment_amount: number;
|
|
207
|
+
status: MercadoPagoStatus;
|
|
208
|
+
reason: string | null;
|
|
209
|
+
label: Array<Record<string, unknown>>;
|
|
210
|
+
partition_details: Array<Record<string, unknown>>;
|
|
211
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Order, PagarmeCredentialsV5, PaymentRepository } from '../../../../domain';
|
|
2
|
+
export declare class PagarmeV5BaseAxiosAdapter {
|
|
3
|
+
protected credentials: PagarmeCredentialsV5;
|
|
4
|
+
protected paymentRepository: PaymentRepository;
|
|
5
|
+
constructor(credentials: PagarmeCredentialsV5, paymentRepository: PaymentRepository);
|
|
6
|
+
refund(order: Order, amount: number): Promise<{
|
|
7
|
+
status: string;
|
|
8
|
+
success: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
private getRefundStatus;
|
|
11
|
+
}
|
|
@@ -5,10 +5,11 @@ import { Checkout, Payment, PaymentTransaction } from '../../../../domain/shoppi
|
|
|
5
5
|
import { OrderBlockedRepository, PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
6
6
|
import { CardInfo, PagarMeCard, PagarmeCredentialsV5, PaymentCardInfo } from '../../../../domain/shopping/types';
|
|
7
7
|
import { PagarMeV5Customer } from '../../types';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { PagarmeV5BaseAxiosAdapter } from './pagarmev5-base-axios';
|
|
9
|
+
export declare class PagarmeV5CardAxiosAdapter extends PagarmeV5BaseAxiosAdapter implements PaymentProviderCard<PagarMeCard> {
|
|
10
|
+
protected credentials: PagarmeCredentialsV5;
|
|
11
|
+
protected paymentRepository: PaymentRepository;
|
|
12
|
+
protected orderBlockedRepository: OrderBlockedRepository;
|
|
12
13
|
constructor(credentials: PagarmeCredentialsV5, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
13
14
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
14
15
|
addCard(card: CardInfo, customer: User & {
|