@merkaly/api 0.34.0 → 0.35.1
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 +8 -4
- package/dist/integration/payment/account.enum.d.ts +7 -1
- package/dist/integration/payment/account.enum.js +12 -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/dist/integration/supplier/provider.enum.d.ts +4 -0
- package/dist/integration/supplier/provider.enum.js +5 -0
- package/dist/settings/organization/organization.contract.d.ts +8 -0
- package/dist/settings/organization/organization.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentAccountApprovalEnum, PaymentAccountCompanyTypeEnum, PaymentAccountDocumentStatusEnum,
|
|
1
|
+
import type { PaymentAccountApprovalEnum, PaymentAccountCompanyTypeEnum, PaymentAccountDocumentStatusEnum, PaymentAccountReadinessEnum, 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;
|
|
@@ -34,6 +34,10 @@ export interface PaymentAccountStatus {
|
|
|
34
34
|
warnings: string[];
|
|
35
35
|
accountError: string | null;
|
|
36
36
|
}
|
|
37
|
+
export interface PaymentAccountReadiness {
|
|
38
|
+
canSell: boolean;
|
|
39
|
+
payments: PaymentAccountReadinessEnum;
|
|
40
|
+
}
|
|
37
41
|
export interface PaymentAccountDocument {
|
|
38
42
|
id: string;
|
|
39
43
|
type: string | null;
|
|
@@ -79,7 +83,7 @@ export type PaymentWithdrawalAuthorization = {
|
|
|
79
83
|
refuseReason: string;
|
|
80
84
|
};
|
|
81
85
|
export interface PaymentAccountCommercialInfo {
|
|
82
|
-
|
|
86
|
+
accountType: PaymentAccountTypeEnum;
|
|
83
87
|
cpfCnpj: string;
|
|
84
88
|
name: string | null;
|
|
85
89
|
companyName: string | null;
|
|
@@ -4,7 +4,7 @@ export declare enum PaymentAccountApprovalEnum {
|
|
|
4
4
|
APPROVED = "APPROVED",
|
|
5
5
|
REJECTED = "REJECTED"
|
|
6
6
|
}
|
|
7
|
-
export declare enum
|
|
7
|
+
export declare enum PaymentAccountTypeEnum {
|
|
8
8
|
INDIVIDUAL = "INDIVIDUAL",
|
|
9
9
|
COMPANY = "COMPANY"
|
|
10
10
|
}
|
|
@@ -28,3 +28,9 @@ export declare enum PaymentPixKeyTypeEnum {
|
|
|
28
28
|
PHONE = "PHONE",
|
|
29
29
|
EVP = "EVP"
|
|
30
30
|
}
|
|
31
|
+
export declare enum PaymentAccountReadinessEnum {
|
|
32
|
+
NOT_CONNECTED = "NOT_CONNECTED",
|
|
33
|
+
PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
34
|
+
REJECTED = "REJECTED",
|
|
35
|
+
READY = "READY"
|
|
36
|
+
}
|
|
@@ -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";
|
|
@@ -33,3 +33,10 @@ export var PaymentPixKeyTypeEnum;
|
|
|
33
33
|
PaymentPixKeyTypeEnum["PHONE"] = "PHONE";
|
|
34
34
|
PaymentPixKeyTypeEnum["EVP"] = "EVP";
|
|
35
35
|
})(PaymentPixKeyTypeEnum || (PaymentPixKeyTypeEnum = {}));
|
|
36
|
+
export var PaymentAccountReadinessEnum;
|
|
37
|
+
(function (PaymentAccountReadinessEnum) {
|
|
38
|
+
PaymentAccountReadinessEnum["NOT_CONNECTED"] = "NOT_CONNECTED";
|
|
39
|
+
PaymentAccountReadinessEnum["PENDING_APPROVAL"] = "PENDING_APPROVAL";
|
|
40
|
+
PaymentAccountReadinessEnum["REJECTED"] = "REJECTED";
|
|
41
|
+
PaymentAccountReadinessEnum["READY"] = "READY";
|
|
42
|
+
})(PaymentAccountReadinessEnum || (PaymentAccountReadinessEnum = {}));
|
|
@@ -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)(),
|
|
@@ -2,3 +2,8 @@ export var SupplierProviderEnum;
|
|
|
2
2
|
(function (SupplierProviderEnum) {
|
|
3
3
|
SupplierProviderEnum["ALIEXPRESS"] = "aliexpress";
|
|
4
4
|
})(SupplierProviderEnum || (SupplierProviderEnum = {}));
|
|
5
|
+
export var SupplierReadinessEnum;
|
|
6
|
+
(function (SupplierReadinessEnum) {
|
|
7
|
+
SupplierReadinessEnum["NOT_CONNECTED"] = "NOT_CONNECTED";
|
|
8
|
+
SupplierReadinessEnum["READY"] = "READY";
|
|
9
|
+
})(SupplierReadinessEnum || (SupplierReadinessEnum = {}));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SettingsOrganizationEnum, SettingsOrganizationSocialEnum } from './organization.enum.js';
|
|
2
|
+
import type { PaymentAccountReadinessEnum } from '../../integration/payment';
|
|
3
|
+
import type { SupplierReadinessEnum } from '../../integration/supplier';
|
|
2
4
|
export interface SettingsOrganizationLocationContract {
|
|
3
5
|
lat?: number;
|
|
4
6
|
lng?: number;
|
|
@@ -57,7 +59,13 @@ export interface SettingsOrganizationProfileContract {
|
|
|
57
59
|
identity: SettingsOrganizationIdentityContract;
|
|
58
60
|
localization: SettingsOrganizationLocalizationContract;
|
|
59
61
|
}
|
|
62
|
+
export interface SettingsOrganizationReadinessContract {
|
|
63
|
+
canSell: boolean;
|
|
64
|
+
payments: PaymentAccountReadinessEnum;
|
|
65
|
+
supplier: SupplierReadinessEnum;
|
|
66
|
+
}
|
|
60
67
|
export interface SettingsOrganizationProfileResponse extends SettingsOrganizationProfileContract {
|
|
68
|
+
readiness: SettingsOrganizationReadinessContract;
|
|
61
69
|
store: SettingsOrganizationStoreContract;
|
|
62
70
|
}
|
|
63
71
|
export interface SettingsOrganizationValueMap {
|
|
@@ -17,3 +17,8 @@ export interface SettingsOrganizationStoreProfile {
|
|
|
17
17
|
primaryColor?: string;
|
|
18
18
|
social?: SettingsOrganizationSocialContract;
|
|
19
19
|
}
|
|
20
|
+
export interface SettingsOrganizationStoreCompany extends SettingsOrganizationStoreProfile {
|
|
21
|
+
checkout: {
|
|
22
|
+
available: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkaly/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared TypeScript interfaces and enums for Merkaly API",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^26.6.1",
|
|
33
33
|
"changelogen": "^0.6.2",
|
|
34
|
-
"oxlint": "^1.
|
|
34
|
+
"oxlint": "^1.93.0",
|
|
35
35
|
"tsx": "^4.23.0",
|
|
36
36
|
"typescript": "^7.0.2"
|
|
37
37
|
},
|