@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,68 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.6.0
4
+ // protoc v3.20.3
5
+ // source: payer.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
9
+ import { Observable } from 'rxjs';
10
+
11
+ export const protobufPackage = 'payer';
12
+
13
+ export interface PayerDto {
14
+ id?: string | undefined;
15
+ name: string;
16
+ document: string;
17
+ phone?: string | undefined;
18
+ }
19
+
20
+ export interface Payer {
21
+ id: string;
22
+ name: string;
23
+ document: string;
24
+ phone: string;
25
+ }
26
+
27
+ export const PAYER_PACKAGE_NAME = 'payer';
28
+
29
+ export interface PayerServiceClient {
30
+ findOrCreatePayer(request: PayerDto): Observable<Payer>;
31
+ }
32
+
33
+ export interface PayerServiceController {
34
+ findOrCreatePayer(
35
+ request: PayerDto,
36
+ ): Promise<Payer> | Observable<Payer> | Payer;
37
+ }
38
+
39
+ export function PayerServiceControllerMethods() {
40
+ return function (constructor: Function) {
41
+ const grpcMethods: string[] = ['findOrCreatePayer'];
42
+ for (const method of grpcMethods) {
43
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
44
+ constructor.prototype,
45
+ method,
46
+ );
47
+ GrpcMethod('PayerService', method)(
48
+ constructor.prototype[method],
49
+ method,
50
+ descriptor,
51
+ );
52
+ }
53
+ const grpcStreamMethods: string[] = [];
54
+ for (const method of grpcStreamMethods) {
55
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
56
+ constructor.prototype,
57
+ method,
58
+ );
59
+ GrpcStreamMethod('PayerService', method)(
60
+ constructor.prototype[method],
61
+ method,
62
+ descriptor,
63
+ );
64
+ }
65
+ };
66
+ }
67
+
68
+ export const PAYER_SERVICE_NAME = 'PayerService';
@@ -0,0 +1,252 @@
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: payment-calculator.proto
6
+
7
+ /* eslint-disable */
8
+ import {
9
+ brandType,
10
+ Meta,
11
+ MetaType,
12
+ PaymentMethods,
13
+ PaymentScheduleType,
14
+ TaxStatus,
15
+ TaxTypes,
16
+ } from '@postpaybr/contracts/types';
17
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
18
+ import { Observable } from 'rxjs';
19
+
20
+ export const protobufPackage = 'paymentCalculator';
21
+
22
+ export interface CalculateInstallmentsRequest {
23
+ customerId: string;
24
+ count: number;
25
+ }
26
+
27
+ export interface CalculateInstallmentsResponse {
28
+ installments: Installment[];
29
+ }
30
+
31
+ export interface Installment {
32
+ installment: number;
33
+ amount: number;
34
+ fee: number;
35
+ totalAmount: number;
36
+ baseAmount: number;
37
+ }
38
+
39
+ export interface GetPaymentMethodsRequest {
40
+ customerId: string;
41
+ paymentSchedule: PaymentSchedule | undefined;
42
+ }
43
+
44
+ export interface GetPaymentMethodsResponse {
45
+ methods: PaymentDetails[];
46
+ }
47
+
48
+ export interface PaymentDetails {
49
+ method: PaymentMethods;
50
+ amount: number;
51
+ fee: number;
52
+ discountPercentage?: number | undefined;
53
+ discountAmount?: number | undefined;
54
+ card?: CardDetails | undefined;
55
+ paymentSchedule: PaymentSchedule | undefined;
56
+ baseFee: number;
57
+ feePercentage: number;
58
+ chargeId?: string | undefined;
59
+ isRetry?: boolean | undefined;
60
+ orderId?: string | undefined;
61
+ }
62
+
63
+ export interface CardDetails {
64
+ id: string;
65
+ shadowNumber: string;
66
+ brand: brandType;
67
+ installments?: number | undefined;
68
+ installmentValue?: number | undefined;
69
+ nickname?: string | undefined;
70
+ }
71
+
72
+ export interface GetPrincipalMethodRequest {
73
+ customerId: string;
74
+ paymentSchedule: PaymentSchedule | undefined;
75
+ }
76
+
77
+ export interface GetPrincipalMethodResponse {
78
+ principalMethod: PaymentDetails | undefined;
79
+ }
80
+
81
+ export interface CalculatePostpayFeeRequest {
82
+ taxes: TaxDetail[];
83
+ paymentDetails: PaymentDetails | undefined;
84
+ }
85
+
86
+ export interface CalculatePostpayFeeResponse {
87
+ totalPostpayFee: number;
88
+ }
89
+
90
+ export interface TaxDetail {
91
+ tax: Tax | undefined;
92
+ payer: Payer | undefined;
93
+ location: LocationInfo | undefined;
94
+ metaType: MetaType;
95
+ meta: Meta | undefined;
96
+ }
97
+
98
+ export interface Tax {
99
+ id: string;
100
+ type: TaxTypes;
101
+ status: TaxStatus;
102
+ description: string;
103
+ amount: number;
104
+ year: number;
105
+ dueAt: string;
106
+ documentId: string;
107
+ code: string;
108
+ isSingleQuota: boolean;
109
+ quota?: number | undefined;
110
+ fee: number;
111
+ fine: number;
112
+ discountAmount: number;
113
+ }
114
+
115
+ export interface LocationInfo {
116
+ state: number;
117
+ city: number;
118
+ recipientId: string;
119
+ }
120
+
121
+ export interface Payer {
122
+ id?: string | undefined;
123
+ name: string;
124
+ document: string;
125
+ phone?: string | undefined;
126
+ }
127
+
128
+ export interface PaymentSchedule {
129
+ type: PaymentScheduleType;
130
+ date?: string | undefined;
131
+ }
132
+
133
+ export interface CalculateIndividualTaxFeesRequest {
134
+ taxes: TaxDetail[];
135
+ recipientId: string;
136
+ method: PaymentMethods;
137
+ brand?: brandType | undefined;
138
+ installment: number;
139
+ }
140
+
141
+ export interface CalculateIndividualTaxFeesResponse {
142
+ feesPerTax: IndividualFeePerTax[];
143
+ totalFee: number;
144
+ totalAmount: number;
145
+ baseFee: number;
146
+ feePercentage: number;
147
+ }
148
+
149
+ export interface IndividualFeePerTax {
150
+ taxId: string;
151
+ amount: number;
152
+ fee: number;
153
+ totalAmount: number;
154
+ }
155
+
156
+ export const PAYMENT_CALCULATOR_PACKAGE_NAME = 'paymentCalculator';
157
+
158
+ export interface PaymentCalculatorServiceClient {
159
+ calculateInstallments(
160
+ request: CalculateInstallmentsRequest,
161
+ ): Observable<CalculateInstallmentsResponse>;
162
+
163
+ getPaymentMethods(
164
+ request: GetPaymentMethodsRequest,
165
+ ): Observable<GetPaymentMethodsResponse>;
166
+
167
+ getPrincipalMethod(
168
+ request: GetPrincipalMethodRequest,
169
+ ): Observable<GetPrincipalMethodResponse>;
170
+
171
+ calculatePostpayFee(
172
+ request: CalculatePostpayFeeRequest,
173
+ ): Observable<CalculatePostpayFeeResponse>;
174
+
175
+ calculateIndividualTaxFees(
176
+ request: CalculateIndividualTaxFeesRequest,
177
+ ): Observable<CalculateIndividualTaxFeesResponse>;
178
+ }
179
+
180
+ export interface PaymentCalculatorServiceController {
181
+ calculateInstallments(
182
+ request: CalculateInstallmentsRequest,
183
+ ):
184
+ | Promise<CalculateInstallmentsResponse>
185
+ | Observable<CalculateInstallmentsResponse>
186
+ | CalculateInstallmentsResponse;
187
+
188
+ getPaymentMethods(
189
+ request: GetPaymentMethodsRequest,
190
+ ):
191
+ | Promise<GetPaymentMethodsResponse>
192
+ | Observable<GetPaymentMethodsResponse>
193
+ | GetPaymentMethodsResponse;
194
+
195
+ getPrincipalMethod(
196
+ request: GetPrincipalMethodRequest,
197
+ ):
198
+ | Promise<GetPrincipalMethodResponse>
199
+ | Observable<GetPrincipalMethodResponse>
200
+ | GetPrincipalMethodResponse;
201
+
202
+ calculatePostpayFee(
203
+ request: CalculatePostpayFeeRequest,
204
+ ):
205
+ | Promise<CalculatePostpayFeeResponse>
206
+ | Observable<CalculatePostpayFeeResponse>
207
+ | CalculatePostpayFeeResponse;
208
+
209
+ calculateIndividualTaxFees(
210
+ request: CalculateIndividualTaxFeesRequest,
211
+ ):
212
+ | Promise<CalculateIndividualTaxFeesResponse>
213
+ | Observable<CalculateIndividualTaxFeesResponse>
214
+ | CalculateIndividualTaxFeesResponse;
215
+ }
216
+
217
+ export function PaymentCalculatorServiceControllerMethods() {
218
+ return function (constructor: Function) {
219
+ const grpcMethods: string[] = [
220
+ 'calculateInstallments',
221
+ 'getPaymentMethods',
222
+ 'getPrincipalMethod',
223
+ 'calculatePostpayFee',
224
+ 'calculateIndividualTaxFees',
225
+ ];
226
+ for (const method of grpcMethods) {
227
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
228
+ constructor.prototype,
229
+ method,
230
+ );
231
+ GrpcMethod('PaymentCalculatorService', method)(
232
+ constructor.prototype[method],
233
+ method,
234
+ descriptor,
235
+ );
236
+ }
237
+ const grpcStreamMethods: string[] = [];
238
+ for (const method of grpcStreamMethods) {
239
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
240
+ constructor.prototype,
241
+ method,
242
+ );
243
+ GrpcStreamMethod('PaymentCalculatorService', method)(
244
+ constructor.prototype[method],
245
+ method,
246
+ descriptor,
247
+ );
248
+ }
249
+ };
250
+ }
251
+
252
+ export const PAYMENT_CALCULATOR_SERVICE_NAME = 'PaymentCalculatorService';
@@ -0,0 +1,290 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc v3.20.3
5
+ // source: payment-card.proto
6
+
7
+ /* eslint-disable */
8
+ import { HolderType, RecipientLegalType } from '@postpaybr/contracts/enums';
9
+ import {
10
+ brandType,
11
+ ChargeMetadata,
12
+ ChargeStatus,
13
+ ChargeType,
14
+ FailureReason,
15
+ GatewayIdentification,
16
+ Meta,
17
+ MetaType,
18
+ PaymentMethods,
19
+ PaymentScheduleType,
20
+ TaxStatus,
21
+ TaxTypes,
22
+ } from '@postpaybr/contracts/types';
23
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
24
+ import { Observable } from 'rxjs';
25
+
26
+ export const protobufPackage = 'paymentCard';
27
+
28
+ export interface CreatePaymentRequest {
29
+ customerId: string;
30
+ taxes: TaxPayload[];
31
+ payment: PaymentDetails | undefined;
32
+ closed?: boolean | undefined;
33
+ ip?: string | undefined;
34
+ sessionId?: string | undefined;
35
+ pushToken: string;
36
+ }
37
+
38
+ export interface TaxPayload {
39
+ tax: Tax | undefined;
40
+ payer: Payer | undefined;
41
+ location: Location | undefined;
42
+ metaType: MetaType;
43
+ meta: Meta | undefined;
44
+ }
45
+
46
+ export interface Tax {
47
+ id: string;
48
+ type: TaxTypes;
49
+ status: TaxStatus;
50
+ description: string;
51
+ amount: number;
52
+ year: number;
53
+ dueAt: string;
54
+ documentId: string;
55
+ code: string;
56
+ isSingleQuota: boolean;
57
+ quota?: number | undefined;
58
+ fee: number;
59
+ fine: number;
60
+ discountAmount: number;
61
+ }
62
+
63
+ export interface Payer {
64
+ id?: string | undefined;
65
+ name: string;
66
+ document: string;
67
+ phone?: string | undefined;
68
+ }
69
+
70
+ export interface Location {
71
+ state: number;
72
+ city: number;
73
+ recipientId: string;
74
+ }
75
+
76
+ export interface PaymentDetails {
77
+ method: PaymentMethods;
78
+ amount: number;
79
+ discountPercentage?: number | undefined;
80
+ fee: number;
81
+ discountAmount?: number | undefined;
82
+ gatewayId?: GatewayIdentification | undefined;
83
+ card?: Card | undefined;
84
+ paymentSchedule: PaymentSchedule | undefined;
85
+ baseFee: number;
86
+ feePercentage: number;
87
+ chargeId?: string | undefined;
88
+ isRetry?: boolean | undefined;
89
+ orderId?: string | undefined;
90
+ }
91
+
92
+ export interface PaymentSchedule {
93
+ type: PaymentScheduleType;
94
+ date?: string | undefined;
95
+ }
96
+
97
+ export interface Card {
98
+ id: string;
99
+ shadowNumber: string;
100
+ brand: brandType;
101
+ installments?: number | undefined;
102
+ installmentValue?: number | undefined;
103
+ }
104
+
105
+ export interface CreatePaymentResponse {
106
+ order: Order | undefined;
107
+ orderType: TaxTypes;
108
+ }
109
+
110
+ export interface ProcessScheduledPaymentRequest {
111
+ customerId: string;
112
+ tax: TaxPayload;
113
+ charge: Charge | undefined;
114
+ payment: PaymentDetails | undefined;
115
+ }
116
+
117
+ export interface ProcessScheduledPaymentResponse {}
118
+
119
+ export interface CreateVerificationPaymentRequest {
120
+ customerId: string;
121
+ card: CardDetails | undefined;
122
+ value: number;
123
+ cardVerificationId?: string | undefined;
124
+ }
125
+
126
+ export interface CardDetails {
127
+ id?: string;
128
+ vaultToken: string;
129
+ vaultTokenCvv: string;
130
+ }
131
+
132
+ export interface CreateVerificationPaymentResponse {}
133
+
134
+ export interface Charge {
135
+ id: string;
136
+ amount: number;
137
+ paymentMethod: PaymentMethods;
138
+ status: ChargeStatus;
139
+ dueAt: string;
140
+ txid: string;
141
+ brcode: string;
142
+ pushToken: string;
143
+ installmentNumber: number;
144
+ installmentValue: number;
145
+ fee: number;
146
+ baseFee: number;
147
+ feePercentage: number;
148
+ isScheduled: boolean;
149
+ discountPercentage: number;
150
+ discountAmount: number;
151
+ createdAt: Date;
152
+ gatewayId: GatewayIdentification;
153
+ cardId: string;
154
+ orderId: string;
155
+ orderScheduleId: string;
156
+ payableIds: string[];
157
+ taxId?: string;
158
+ recipientId?: string;
159
+ chargeSchedule?: ChargeSchedule | undefined;
160
+ endToEndId: string;
161
+ type: ChargeType;
162
+ metadata: ChargeMetadata | undefined;
163
+ }
164
+
165
+ export interface ChargeSchedule {
166
+ id: string;
167
+ executionDate: Date;
168
+ isExecuted: boolean;
169
+ createdAt: Date;
170
+ updatedAt: Date;
171
+ charge: Charge | undefined;
172
+ }
173
+
174
+ export interface Recipient {
175
+ id: string;
176
+ code: string;
177
+ commercialName: string;
178
+ socialReason: string;
179
+ holderType: HolderType;
180
+ document: string;
181
+ cnaeId: string;
182
+ legalType: RecipientLegalType;
183
+ contactName: string;
184
+ contactEmail: string;
185
+ contactPhone: string;
186
+ isAutomaticAnticipationEnabled: boolean;
187
+ foundation: string;
188
+ avatarUrl?: string | undefined;
189
+ }
190
+
191
+ export interface Order {
192
+ id: string;
193
+ totalAmount: number;
194
+ status: string;
195
+ createdAt: Date;
196
+ items: OrderItemEntity[];
197
+ charges: Charge[];
198
+ customer: Customer | undefined;
199
+ }
200
+
201
+ export interface OrderItemEntity {
202
+ id: string;
203
+ recipient: Recipient | undefined;
204
+ tax: Tax | undefined;
205
+ order: Order | undefined;
206
+ }
207
+
208
+ export interface Customer {
209
+ id: string;
210
+ firstName: string;
211
+ lastName: string;
212
+ document: string;
213
+ email: string;
214
+ isEmailVerified: boolean;
215
+ phone: string;
216
+ }
217
+
218
+ export const PAYMENT_CARD_PACKAGE_NAME = 'paymentCard';
219
+
220
+ export interface PaymentCardClient {
221
+ createPayment(
222
+ request: CreatePaymentRequest,
223
+ ): Observable<CreatePaymentResponse>;
224
+
225
+ processScheduledPayment(
226
+ request: ProcessScheduledPaymentRequest,
227
+ ): Observable<ProcessScheduledPaymentResponse>;
228
+
229
+ createVerificationPayment(
230
+ request: CreateVerificationPaymentRequest,
231
+ ): Observable<CreateVerificationPaymentResponse>;
232
+ }
233
+
234
+ export interface PaymentCardController {
235
+ createPayment(
236
+ request: CreatePaymentRequest,
237
+ ):
238
+ | Promise<CreatePaymentResponse>
239
+ | Observable<CreatePaymentResponse>
240
+ | CreatePaymentResponse;
241
+
242
+ processScheduledPayment(
243
+ request: ProcessScheduledPaymentRequest,
244
+ ):
245
+ | Promise<ProcessScheduledPaymentResponse>
246
+ | Observable<ProcessScheduledPaymentResponse>
247
+ | ProcessScheduledPaymentResponse;
248
+
249
+ createVerificationPayment(
250
+ request: CreateVerificationPaymentRequest,
251
+ ):
252
+ | Promise<CreateVerificationPaymentResponse>
253
+ | Observable<CreateVerificationPaymentResponse>
254
+ | CreateVerificationPaymentResponse;
255
+ }
256
+
257
+ export function PaymentCardControllerMethods() {
258
+ return function (constructor: Function) {
259
+ const grpcMethods: string[] = [
260
+ 'createPayment',
261
+ 'processScheduledPayment',
262
+ 'createVerificationPayment',
263
+ ];
264
+ for (const method of grpcMethods) {
265
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
266
+ constructor.prototype,
267
+ method,
268
+ );
269
+ GrpcMethod('PaymentCard', method)(
270
+ constructor.prototype[method],
271
+ method,
272
+ descriptor,
273
+ );
274
+ }
275
+ const grpcStreamMethods: string[] = [];
276
+ for (const method of grpcStreamMethods) {
277
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
278
+ constructor.prototype,
279
+ method,
280
+ );
281
+ GrpcStreamMethod('PaymentCard', method)(
282
+ constructor.prototype[method],
283
+ method,
284
+ descriptor,
285
+ );
286
+ }
287
+ };
288
+ }
289
+
290
+ export const PAYMENT_CARD_SERVICE_NAME = 'PaymentCard';