@merkaly/api 0.34.0 → 0.35.0
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/dist/integration/payment/account.d.ts +4 -4
- package/dist/integration/payment/account.enum.d.ts +1 -1
- package/dist/integration/payment/account.enum.js +5 -5
- package/dist/integration/payment/payment.account.entity.d.ts +3 -18
- package/dist/integration/payment/request.validator.d.ts +2 -2
- package/dist/integration/payment/request.validator.js +5 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentAccountApprovalEnum, PaymentAccountCompanyTypeEnum, PaymentAccountDocumentStatusEnum,
|
|
1
|
+
import type { PaymentAccountApprovalEnum, PaymentAccountCompanyTypeEnum, PaymentAccountDocumentStatusEnum, PaymentAccountTypeEnum, PaymentPixKeyTypeEnum } from './account.enum.js';
|
|
2
2
|
import type { PaymentProviderEnum } from './provider.enum.js';
|
|
3
3
|
export interface PaymentAccountApproval {
|
|
4
4
|
general: PaymentAccountApprovalEnum;
|
|
@@ -13,8 +13,8 @@ export interface PaymentAccountWithdrawal {
|
|
|
13
13
|
export interface PaymentAccountSummary {
|
|
14
14
|
accountId: string;
|
|
15
15
|
walletId: string;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
accountType: PaymentAccountTypeEnum;
|
|
17
|
+
document: string;
|
|
18
18
|
name: string;
|
|
19
19
|
email: string;
|
|
20
20
|
approval: PaymentAccountApproval | null;
|
|
@@ -79,7 +79,7 @@ export type PaymentWithdrawalAuthorization = {
|
|
|
79
79
|
refuseReason: string;
|
|
80
80
|
};
|
|
81
81
|
export interface PaymentAccountCommercialInfo {
|
|
82
|
-
|
|
82
|
+
accountType: PaymentAccountTypeEnum;
|
|
83
83
|
cpfCnpj: string;
|
|
84
84
|
name: string | null;
|
|
85
85
|
companyName: string | null;
|
|
@@ -5,11 +5,11 @@ export var PaymentAccountApprovalEnum;
|
|
|
5
5
|
PaymentAccountApprovalEnum["APPROVED"] = "APPROVED";
|
|
6
6
|
PaymentAccountApprovalEnum["REJECTED"] = "REJECTED";
|
|
7
7
|
})(PaymentAccountApprovalEnum || (PaymentAccountApprovalEnum = {}));
|
|
8
|
-
export var
|
|
9
|
-
(function (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(
|
|
8
|
+
export var PaymentAccountTypeEnum;
|
|
9
|
+
(function (PaymentAccountTypeEnum) {
|
|
10
|
+
PaymentAccountTypeEnum["INDIVIDUAL"] = "INDIVIDUAL";
|
|
11
|
+
PaymentAccountTypeEnum["COMPANY"] = "COMPANY";
|
|
12
|
+
})(PaymentAccountTypeEnum || (PaymentAccountTypeEnum = {}));
|
|
13
13
|
export var PaymentAccountCompanyTypeEnum;
|
|
14
14
|
(function (PaymentAccountCompanyTypeEnum) {
|
|
15
15
|
PaymentAccountCompanyTypeEnum["MEI"] = "MEI";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as MongoSchema } from 'mongoose';
|
|
2
|
-
import { PaymentAccountApprovalEnum,
|
|
2
|
+
import { PaymentAccountApprovalEnum, PaymentAccountTypeEnum, PaymentPixKeyTypeEnum } from './account.enum.js';
|
|
3
3
|
export declare class IntegrationPaymentAccountApprovalEntity {
|
|
4
4
|
general: PaymentAccountApprovalEnum;
|
|
5
5
|
commercialInfo: PaymentAccountApprovalEnum;
|
|
@@ -28,30 +28,15 @@ export declare const IntegrationPaymentAccountWithdrawalSchema: MongoSchema<Inte
|
|
|
28
28
|
} & {
|
|
29
29
|
__v: number;
|
|
30
30
|
}>;
|
|
31
|
-
export declare class IntegrationPaymentAccountPixEntity {
|
|
32
|
-
ready: boolean;
|
|
33
|
-
error?: string | null;
|
|
34
|
-
checkedAt: Date;
|
|
35
|
-
}
|
|
36
|
-
export declare const IntegrationPaymentAccountPixSchema: MongoSchema<IntegrationPaymentAccountPixEntity, import("mongoose").Model<IntegrationPaymentAccountPixEntity, any, any, any, import("mongoose").Document<unknown, any, IntegrationPaymentAccountPixEntity, any, {}> & IntegrationPaymentAccountPixEntity & {
|
|
37
|
-
_id: import("mongoose").Types.ObjectId;
|
|
38
|
-
} & {
|
|
39
|
-
__v: number;
|
|
40
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IntegrationPaymentAccountPixEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IntegrationPaymentAccountPixEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<IntegrationPaymentAccountPixEntity> & {
|
|
41
|
-
_id: import("mongoose").Types.ObjectId;
|
|
42
|
-
} & {
|
|
43
|
-
__v: number;
|
|
44
|
-
}>;
|
|
45
31
|
export declare class IntegrationPaymentAccountEntity {
|
|
46
32
|
accountId: string;
|
|
47
33
|
walletId: string;
|
|
48
34
|
apiKey?: string | null;
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
accountType: PaymentAccountTypeEnum;
|
|
36
|
+
document: string;
|
|
51
37
|
name: string;
|
|
52
38
|
email: string;
|
|
53
39
|
approval?: IntegrationPaymentAccountApprovalEntity | null;
|
|
54
|
-
pix?: IntegrationPaymentAccountPixEntity | null;
|
|
55
40
|
withdrawal?: IntegrationPaymentAccountWithdrawalEntity | null;
|
|
56
41
|
createdAt: Date;
|
|
57
42
|
syncedAt: Date;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractRequestValidator } from '../../abstract.validator.js';
|
|
2
|
-
import { PaymentAccountCompanyTypeEnum,
|
|
2
|
+
import { PaymentAccountCompanyTypeEnum, PaymentAccountTypeEnum, PaymentPixKeyTypeEnum } from './account.enum.js';
|
|
3
3
|
export declare function isCnpj(value: unknown): boolean;
|
|
4
4
|
export declare function IsCnpj(): PropertyDecorator;
|
|
5
5
|
export declare function isPixKey(type: unknown, key: unknown): boolean;
|
|
@@ -17,7 +17,7 @@ declare abstract class PaymentAccountContactRequestValidator extends AbstractReq
|
|
|
17
17
|
address: PaymentAccountAddressRequestValidator;
|
|
18
18
|
}
|
|
19
19
|
export declare class CreatePaymentAccountRequestValidator extends PaymentAccountContactRequestValidator {
|
|
20
|
-
|
|
20
|
+
accountType: PaymentAccountTypeEnum;
|
|
21
21
|
name?: string;
|
|
22
22
|
cpfCnpj?: string;
|
|
23
23
|
birthDate?: string;
|
|
@@ -66,7 +66,7 @@ const pixKey = ({ value, obj }) => {
|
|
|
66
66
|
}
|
|
67
67
|
return type === account_enum_1.PaymentPixKeyTypeEnum.EMAIL ? value.trim().toLowerCase() : value.trim();
|
|
68
68
|
};
|
|
69
|
-
const isCompany = (body) => body.
|
|
69
|
+
const isCompany = (body) => body.accountType === account_enum_1.PaymentAccountTypeEnum.COMPANY;
|
|
70
70
|
export class PaymentAccountAddressRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
71
71
|
postalCode;
|
|
72
72
|
street;
|
|
@@ -133,21 +133,21 @@ __decorate([
|
|
|
133
133
|
__metadata("design:type", PaymentAccountAddressRequestValidator)
|
|
134
134
|
], PaymentAccountContactRequestValidator.prototype, "address", void 0);
|
|
135
135
|
export class CreatePaymentAccountRequestValidator extends PaymentAccountContactRequestValidator {
|
|
136
|
-
|
|
136
|
+
accountType;
|
|
137
137
|
name;
|
|
138
138
|
cpfCnpj;
|
|
139
139
|
birthDate;
|
|
140
140
|
companyType;
|
|
141
141
|
constructor() {
|
|
142
142
|
super();
|
|
143
|
-
this.
|
|
143
|
+
this.accountType = account_enum_1.PaymentAccountTypeEnum.INDIVIDUAL;
|
|
144
144
|
this.address = new PaymentAccountAddressRequestValidator();
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
__decorate([
|
|
148
|
-
(0, class_validator_1.IsEnum)(account_enum_1.
|
|
148
|
+
(0, class_validator_1.IsEnum)(account_enum_1.PaymentAccountTypeEnum),
|
|
149
149
|
__metadata("design:type", String)
|
|
150
|
-
], CreatePaymentAccountRequestValidator.prototype, "
|
|
150
|
+
], CreatePaymentAccountRequestValidator.prototype, "accountType", void 0);
|
|
151
151
|
__decorate([
|
|
152
152
|
(0, class_validator_1.ValidateIf)(isCompany),
|
|
153
153
|
(0, class_validator_1.IsString)(),
|