@postpaybr/protos 1.1.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.
Files changed (79) hide show
  1. package/package.json +28 -0
  2. package/src/account-entry.proto +86 -0
  3. package/src/address.proto +64 -0
  4. package/src/admin-card-verification.proto +90 -0
  5. package/src/administrator.proto +192 -0
  6. package/src/anticipation.proto +86 -0
  7. package/src/asset.proto +44 -0
  8. package/src/auth.proto +29 -0
  9. package/src/bank-account.proto +62 -0
  10. package/src/card-vault.proto +36 -0
  11. package/src/card-verification.proto +30 -0
  12. package/src/card.proto +138 -0
  13. package/src/charge-schedule.proto +22 -0
  14. package/src/charge.proto +610 -0
  15. package/src/context.proto +174 -0
  16. package/src/customer.proto +234 -0
  17. package/src/daily-balance.proto +32 -0
  18. package/src/document-verification.proto +111 -0
  19. package/src/email.proto +76 -0
  20. package/src/expo-push.proto +27 -0
  21. package/src/fee.proto +65 -0
  22. package/src/location.proto +40 -0
  23. package/src/notification.proto +207 -0
  24. package/src/order.proto +189 -0
  25. package/src/payable.proto +246 -0
  26. package/src/payer.proto +24 -0
  27. package/src/payment-calculator.proto +165 -0
  28. package/src/payment-card.proto +217 -0
  29. package/src/payment-gateway.proto +94 -0
  30. package/src/payment-pix.proto +115 -0
  31. package/src/receipt.proto +212 -0
  32. package/src/recipient-payment-gateway.proto +101 -0
  33. package/src/recipient.proto +237 -0
  34. package/src/role.proto +57 -0
  35. package/src/sms.proto +36 -0
  36. package/src/tax.proto +323 -0
  37. package/src/transfer.proto +206 -0
  38. package/src/two-factor.proto +67 -0
  39. package/src/typescript/account-entry.ts +177 -0
  40. package/src/typescript/address.ts +133 -0
  41. package/src/typescript/admin-card-verification.ts +181 -0
  42. package/src/typescript/administrator.ts +375 -0
  43. package/src/typescript/anticipation.ts +187 -0
  44. package/src/typescript/asset.ts +123 -0
  45. package/src/typescript/auth.ts +84 -0
  46. package/src/typescript/bank-account.ts +157 -0
  47. package/src/typescript/card-vault.ts +92 -0
  48. package/src/typescript/card-verification.ts +93 -0
  49. package/src/typescript/card.ts +283 -0
  50. package/src/typescript/charge-schedule.ts +86 -0
  51. package/src/typescript/charge.ts +930 -0
  52. package/src/typescript/context.ts +296 -0
  53. package/src/typescript/customer.ts +425 -0
  54. package/src/typescript/daily-balance.ts +94 -0
  55. package/src/typescript/document-verification.ts +219 -0
  56. package/src/typescript/email.ts +183 -0
  57. package/src/typescript/expo-push.ts +75 -0
  58. package/src/typescript/fee.ts +131 -0
  59. package/src/typescript/location.ts +96 -0
  60. package/src/typescript/notification.ts +372 -0
  61. package/src/typescript/order.ts +311 -0
  62. package/src/typescript/payable.ts +414 -0
  63. package/src/typescript/payer.ts +68 -0
  64. package/src/typescript/payment-calculator.ts +252 -0
  65. package/src/typescript/payment-card.ts +290 -0
  66. package/src/typescript/payment-gateway.ts +209 -0
  67. package/src/typescript/payment-pix.ts +170 -0
  68. package/src/typescript/receipt.ts +344 -0
  69. package/src/typescript/recipient-payment-gateway.ts +209 -0
  70. package/src/typescript/recipient.ts +413 -0
  71. package/src/typescript/role.ts +144 -0
  72. package/src/typescript/sms.ts +96 -0
  73. package/src/typescript/tax.ts +463 -0
  74. package/src/typescript/transfer.ts +260 -0
  75. package/src/typescript/two-factor.ts +177 -0
  76. package/src/typescript/user.ts +413 -0
  77. package/src/typescript/wallet.ts +63 -0
  78. package/src/user.proto +214 -0
  79. package/src/wallet.proto +18 -0
@@ -0,0 +1,260 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc v6.32.0
5
+ // source: transfer.proto
6
+
7
+ /* eslint-disable */
8
+ import {
9
+ ChargeStatus,
10
+ GatewayIdentification,
11
+ } from '@postpaybr/contracts/types';
12
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
13
+ import { Observable } from 'rxjs';
14
+
15
+ export const protobufPackage = 'transfer';
16
+
17
+ export interface UpdateTransferStatusRequest {
18
+ transferId: string;
19
+ status: ChargeStatus;
20
+ responsePayload?: Record<string, any>;
21
+ }
22
+
23
+ export interface UpdateTransferStatusResponse {
24
+ success: boolean;
25
+ }
26
+
27
+ export interface Transfer {
28
+ id: string;
29
+ amount: number;
30
+ recipientId: string;
31
+ chargeId: string;
32
+ description: string;
33
+ status: ChargeStatus;
34
+ processedAt: string;
35
+ gatewayId: GatewayIdentification;
36
+ bankAccountId: string;
37
+ requestPayload: Record<string, any>;
38
+ responsePayload?: Record<string, any>;
39
+ createdAt: Date;
40
+ updatedAt: Date;
41
+ }
42
+
43
+ export interface BankAccount {
44
+ id: string;
45
+ recipientId: string;
46
+ bankCode: string;
47
+ branch: string;
48
+ account: string;
49
+ accountType: string;
50
+ pixKey: string;
51
+ pixKeyType: string;
52
+ balance: number;
53
+ transfers: string[];
54
+ isMain: boolean;
55
+ createdAt: Date;
56
+ updatedAt: Date;
57
+ }
58
+
59
+ export interface Recipient {
60
+ id: string;
61
+ code: string;
62
+ commercialName: string;
63
+ socialReason: string;
64
+ holderType: string;
65
+ document: string;
66
+ cnaeId: string;
67
+ legalType: string;
68
+ foundation: string;
69
+ contactName: string;
70
+ contactEmail: string;
71
+ contactPhone: string;
72
+ isAutomaticAnticipationEnabled: boolean;
73
+ avatarUrl: string;
74
+ isActive: boolean;
75
+ providerStatus: string;
76
+ payableIds: string[];
77
+ addressId: string;
78
+ createdAt: Date;
79
+ updatedAt: Date;
80
+ }
81
+
82
+ export interface Charge {
83
+ id: string;
84
+ amount: number;
85
+ paymentMethod: string;
86
+ status: string;
87
+ type: string;
88
+ dueAt: string;
89
+ txid: string;
90
+ endToEndId: string;
91
+ brcode: string;
92
+ pushToken: string;
93
+ installmentNumber: number;
94
+ installmentValue: number;
95
+ fee: number;
96
+ baseFee: number;
97
+ feePercentage: number;
98
+ isScheduled: boolean;
99
+ discountPercentage: number;
100
+ discountAmount: number;
101
+ createdAt: Date;
102
+ gatewayId: GatewayIdentification;
103
+ cardId: string;
104
+ orderId: string;
105
+ orderScheduleId: string;
106
+ payableIds: string[];
107
+ taxId: string;
108
+ metadata: string;
109
+ }
110
+
111
+ export interface Payable {
112
+ id: string;
113
+ amount: number;
114
+ installment: number;
115
+ status: string;
116
+ dueAt: string;
117
+ isAnticipated: boolean;
118
+ processedAt: string;
119
+ createdAt: Date;
120
+ chargeId: string;
121
+ recipientId: string;
122
+ }
123
+
124
+ export interface BankTransferData {
125
+ pixKey: string;
126
+ amount: number;
127
+ chargeId: string;
128
+ recipient: Recipient | undefined;
129
+ routingKey: string;
130
+ gatewayId: GatewayIdentification;
131
+ payables: Payable[];
132
+ bankAccountId: string;
133
+ }
134
+
135
+ export interface UpdateBankAccountBalanceRequest {
136
+ bankAccountId: string;
137
+ amount: number;
138
+ operation: string;
139
+ }
140
+
141
+ export interface UpdateBankAccountBalanceResponse {
142
+ success: boolean;
143
+ newBalance: number;
144
+ }
145
+
146
+ export interface GetMainAccountRequest {}
147
+
148
+ export interface GetMainAccountResponse {
149
+ bankAccount: BankAccount | undefined;
150
+ }
151
+
152
+ export interface GetBankAccountByRecipientIdRequest {
153
+ recipientId: string;
154
+ }
155
+
156
+ export interface GetBankAccountByRecipientIdResponse {
157
+ bankAccount: BankAccount[];
158
+ }
159
+
160
+ export interface GetRecipientByIdRequest {
161
+ id: string;
162
+ }
163
+
164
+ export interface GetRecipientByIdResponse {
165
+ recipient: Recipient | undefined;
166
+ }
167
+
168
+ export interface GetLiquidatedChargesForTransferRequest {}
169
+
170
+ export interface GetLiquidatedChargesForTransferResponse {
171
+ charges: Charge[];
172
+ }
173
+
174
+ export interface UpdatePayablesStatusRequest {
175
+ payableIds: string[];
176
+ status: string;
177
+ }
178
+
179
+ export interface UpdatePayablesStatusResponse {
180
+ success: boolean;
181
+ affected: number;
182
+ }
183
+
184
+ export interface GetPayableByIdRequest {
185
+ payableId: string;
186
+ }
187
+
188
+ export interface GetPayableByIdResponse {
189
+ payable: Payable | undefined;
190
+ }
191
+
192
+ export interface RoutingInfoRequest {
193
+ method: string;
194
+ recipientId: string;
195
+ operationType: string;
196
+ }
197
+
198
+ export interface RoutingInfoResponse {
199
+ gatewayId: GatewayIdentification;
200
+ pixKey: string;
201
+ routingKey: string;
202
+ }
203
+
204
+ export interface CreatePaymentPixRequest {
205
+ data: BankTransferData | undefined;
206
+ routingKey: string;
207
+ }
208
+
209
+ export interface CreatePaymentPixResponse {
210
+ success: boolean;
211
+ paymentId: string;
212
+ }
213
+
214
+ export const TRANSFER_PACKAGE_NAME = 'transfer';
215
+
216
+ export interface TransferServiceClient {
217
+ updateTransferStatus(
218
+ request: UpdateTransferStatusRequest,
219
+ ): Observable<UpdateTransferStatusResponse>;
220
+ }
221
+
222
+ export interface TransferServiceController {
223
+ updateTransferStatus(
224
+ request: UpdateTransferStatusRequest,
225
+ ):
226
+ | Promise<UpdateTransferStatusResponse>
227
+ | Observable<UpdateTransferStatusResponse>
228
+ | UpdateTransferStatusResponse;
229
+ }
230
+
231
+ export function TransferServiceControllerMethods() {
232
+ return function (constructor: Function) {
233
+ const grpcMethods: string[] = ['updateTransferStatus'];
234
+ for (const method of grpcMethods) {
235
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
236
+ constructor.prototype,
237
+ method,
238
+ );
239
+ GrpcMethod('TransferService', method)(
240
+ constructor.prototype[method],
241
+ method,
242
+ descriptor,
243
+ );
244
+ }
245
+ const grpcStreamMethods: string[] = [];
246
+ for (const method of grpcStreamMethods) {
247
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
248
+ constructor.prototype,
249
+ method,
250
+ );
251
+ GrpcStreamMethod('TransferService', method)(
252
+ constructor.prototype[method],
253
+ method,
254
+ descriptor,
255
+ );
256
+ }
257
+ };
258
+ }
259
+
260
+ export const TRANSFER_SERVICE_NAME = 'TransferService';
@@ -0,0 +1,177 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc v6.32.1
5
+ // source: two-factor.proto
6
+
7
+ /* eslint-disable */
8
+ import { AccountTypeEnum } from '@postpaybr/contracts/types';
9
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
10
+ import { Observable } from 'rxjs';
11
+
12
+ export const protobufPackage = 'twoFactor';
13
+
14
+ export interface EnableTwoFactorRequest {
15
+ accountId: string;
16
+ accountType: AccountTypeEnum;
17
+ }
18
+
19
+ export interface TwoFactorResponse {
20
+ qrCodeUrl: string;
21
+ backupCodes: string[];
22
+ }
23
+
24
+ export interface VerifyTwoFactorRequest {
25
+ accountId: string;
26
+ accountType: AccountTypeEnum;
27
+ token: string;
28
+ }
29
+
30
+ export interface VerifyTwoFactorResponse {
31
+ success: boolean;
32
+ }
33
+
34
+ export interface DisableTwoFactorRequest {
35
+ accountId: string;
36
+ accountType: AccountTypeEnum;
37
+ backupCode: string;
38
+ }
39
+
40
+ export interface DisableTwoFactorResponse {
41
+ success: boolean;
42
+ }
43
+
44
+ export interface VerifyTwoFactorTokenRequest {
45
+ accountId: string;
46
+ accountType: AccountTypeEnum;
47
+ token: string;
48
+ }
49
+
50
+ export interface GenerateBackupCodesRequest {
51
+ accountId: string;
52
+ accountType: AccountTypeEnum;
53
+ }
54
+
55
+ export interface GenerateBackupCodesResponse {
56
+ backupCodes: string[];
57
+ }
58
+
59
+ export interface GetTwoFactorStatusRequest {
60
+ accountId: string;
61
+ accountType: AccountTypeEnum;
62
+ }
63
+
64
+ export interface TwoFactorStatusResponse {
65
+ isEnabled: boolean;
66
+ hasBackupCodes: boolean;
67
+ }
68
+
69
+ export const TWO_FACTOR_PACKAGE_NAME = 'twoFactor';
70
+
71
+ export interface TwoFactorServiceClient {
72
+ enableTwoFactor(
73
+ request: EnableTwoFactorRequest,
74
+ ): Observable<TwoFactorResponse>;
75
+
76
+ verifyAndEnableTwoFactor(
77
+ request: VerifyTwoFactorRequest,
78
+ ): Observable<VerifyTwoFactorResponse>;
79
+
80
+ disableTwoFactor(
81
+ request: DisableTwoFactorRequest,
82
+ ): Observable<DisableTwoFactorResponse>;
83
+
84
+ verifyTwoFactorToken(
85
+ request: VerifyTwoFactorTokenRequest,
86
+ ): Observable<VerifyTwoFactorResponse>;
87
+
88
+ generateNewBackupCodes(
89
+ request: GenerateBackupCodesRequest,
90
+ ): Observable<GenerateBackupCodesResponse>;
91
+
92
+ getTwoFactorStatus(
93
+ request: GetTwoFactorStatusRequest,
94
+ ): Observable<TwoFactorStatusResponse>;
95
+ }
96
+
97
+ export interface TwoFactorServiceController {
98
+ enableTwoFactor(
99
+ request: EnableTwoFactorRequest,
100
+ ):
101
+ | Promise<TwoFactorResponse>
102
+ | Observable<TwoFactorResponse>
103
+ | TwoFactorResponse;
104
+
105
+ verifyAndEnableTwoFactor(
106
+ request: VerifyTwoFactorRequest,
107
+ ):
108
+ | Promise<VerifyTwoFactorResponse>
109
+ | Observable<VerifyTwoFactorResponse>
110
+ | VerifyTwoFactorResponse;
111
+
112
+ disableTwoFactor(
113
+ request: DisableTwoFactorRequest,
114
+ ):
115
+ | Promise<DisableTwoFactorResponse>
116
+ | Observable<DisableTwoFactorResponse>
117
+ | DisableTwoFactorResponse;
118
+
119
+ verifyTwoFactorToken(
120
+ request: VerifyTwoFactorTokenRequest,
121
+ ):
122
+ | Promise<VerifyTwoFactorResponse>
123
+ | Observable<VerifyTwoFactorResponse>
124
+ | VerifyTwoFactorResponse;
125
+
126
+ generateNewBackupCodes(
127
+ request: GenerateBackupCodesRequest,
128
+ ):
129
+ | Promise<GenerateBackupCodesResponse>
130
+ | Observable<GenerateBackupCodesResponse>
131
+ | GenerateBackupCodesResponse;
132
+
133
+ getTwoFactorStatus(
134
+ request: GetTwoFactorStatusRequest,
135
+ ):
136
+ | Promise<TwoFactorStatusResponse>
137
+ | Observable<TwoFactorStatusResponse>
138
+ | TwoFactorStatusResponse;
139
+ }
140
+
141
+ export function TwoFactorServiceControllerMethods() {
142
+ return function (constructor: Function) {
143
+ const grpcMethods: string[] = [
144
+ 'enableTwoFactor',
145
+ 'verifyAndEnableTwoFactor',
146
+ 'disableTwoFactor',
147
+ 'verifyTwoFactorToken',
148
+ 'generateNewBackupCodes',
149
+ 'getTwoFactorStatus',
150
+ ];
151
+ for (const method of grpcMethods) {
152
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
153
+ constructor.prototype,
154
+ method,
155
+ );
156
+ GrpcMethod('TwoFactorService', method)(
157
+ constructor.prototype[method],
158
+ method,
159
+ descriptor,
160
+ );
161
+ }
162
+ const grpcStreamMethods: string[] = [];
163
+ for (const method of grpcStreamMethods) {
164
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
165
+ constructor.prototype,
166
+ method,
167
+ );
168
+ GrpcStreamMethod('TwoFactorService', method)(
169
+ constructor.prototype[method],
170
+ method,
171
+ descriptor,
172
+ );
173
+ }
174
+ };
175
+ }
176
+
177
+ export const TWO_FACTOR_SERVICE_NAME = 'TwoFactorService';