@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.
- package/package.json +28 -0
- package/src/account-entry.proto +86 -0
- package/src/address.proto +64 -0
- package/src/admin-card-verification.proto +90 -0
- package/src/administrator.proto +192 -0
- package/src/anticipation.proto +86 -0
- package/src/asset.proto +44 -0
- package/src/auth.proto +29 -0
- package/src/bank-account.proto +62 -0
- package/src/card-vault.proto +36 -0
- package/src/card-verification.proto +30 -0
- package/src/card.proto +138 -0
- package/src/charge-schedule.proto +22 -0
- package/src/charge.proto +610 -0
- package/src/context.proto +174 -0
- package/src/customer.proto +234 -0
- package/src/daily-balance.proto +32 -0
- package/src/document-verification.proto +111 -0
- package/src/email.proto +76 -0
- package/src/expo-push.proto +27 -0
- package/src/fee.proto +65 -0
- package/src/location.proto +40 -0
- package/src/notification.proto +207 -0
- package/src/order.proto +189 -0
- package/src/payable.proto +246 -0
- package/src/payer.proto +24 -0
- package/src/payment-calculator.proto +165 -0
- package/src/payment-card.proto +217 -0
- package/src/payment-gateway.proto +94 -0
- package/src/payment-pix.proto +115 -0
- package/src/receipt.proto +212 -0
- package/src/recipient-payment-gateway.proto +101 -0
- package/src/recipient.proto +237 -0
- package/src/role.proto +57 -0
- package/src/sms.proto +36 -0
- package/src/tax.proto +323 -0
- package/src/transfer.proto +206 -0
- package/src/two-factor.proto +67 -0
- package/src/typescript/account-entry.ts +177 -0
- package/src/typescript/address.ts +133 -0
- package/src/typescript/admin-card-verification.ts +181 -0
- package/src/typescript/administrator.ts +375 -0
- package/src/typescript/anticipation.ts +187 -0
- package/src/typescript/asset.ts +123 -0
- package/src/typescript/auth.ts +84 -0
- package/src/typescript/bank-account.ts +157 -0
- package/src/typescript/card-vault.ts +92 -0
- package/src/typescript/card-verification.ts +93 -0
- package/src/typescript/card.ts +283 -0
- package/src/typescript/charge-schedule.ts +86 -0
- package/src/typescript/charge.ts +930 -0
- package/src/typescript/context.ts +296 -0
- package/src/typescript/customer.ts +425 -0
- package/src/typescript/daily-balance.ts +94 -0
- package/src/typescript/document-verification.ts +219 -0
- package/src/typescript/email.ts +183 -0
- package/src/typescript/expo-push.ts +75 -0
- package/src/typescript/fee.ts +131 -0
- package/src/typescript/location.ts +96 -0
- package/src/typescript/notification.ts +372 -0
- package/src/typescript/order.ts +311 -0
- package/src/typescript/payable.ts +414 -0
- package/src/typescript/payer.ts +68 -0
- package/src/typescript/payment-calculator.ts +252 -0
- package/src/typescript/payment-card.ts +290 -0
- package/src/typescript/payment-gateway.ts +209 -0
- package/src/typescript/payment-pix.ts +170 -0
- package/src/typescript/receipt.ts +344 -0
- package/src/typescript/recipient-payment-gateway.ts +209 -0
- package/src/typescript/recipient.ts +413 -0
- package/src/typescript/role.ts +144 -0
- package/src/typescript/sms.ts +96 -0
- package/src/typescript/tax.ts +463 -0
- package/src/typescript/transfer.ts +260 -0
- package/src/typescript/two-factor.ts +177 -0
- package/src/typescript/user.ts +413 -0
- package/src/typescript/wallet.ts +63 -0
- package/src/user.proto +214 -0
- package/src/wallet.proto +18 -0
|
@@ -0,0 +1,930 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.7.7
|
|
4
|
+
// protoc v6.33.1
|
|
5
|
+
// source: charge.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { TaxPayload } from '@common/dtos/service-tax';
|
|
9
|
+
import {
|
|
10
|
+
brandType,
|
|
11
|
+
ChargeMetadata,
|
|
12
|
+
ChargeStatus,
|
|
13
|
+
ChargeSummaryStatus,
|
|
14
|
+
ChargeType,
|
|
15
|
+
GatewayIdentification,
|
|
16
|
+
Meta,
|
|
17
|
+
OrderType,
|
|
18
|
+
PayableStatus,
|
|
19
|
+
PaymentMethods,
|
|
20
|
+
TaxTypes,
|
|
21
|
+
} from '@postpaybr/contracts/types';
|
|
22
|
+
import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
|
|
23
|
+
import { Observable } from 'rxjs';
|
|
24
|
+
|
|
25
|
+
export const protobufPackage = 'charge';
|
|
26
|
+
|
|
27
|
+
export interface DateFilter {
|
|
28
|
+
startDate?: Date | undefined;
|
|
29
|
+
endDate?: Date | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface PaginationFilter {
|
|
33
|
+
limit?: number | undefined;
|
|
34
|
+
offset?: number | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface Charge {
|
|
38
|
+
id: string;
|
|
39
|
+
amount: number;
|
|
40
|
+
paymentMethod: PaymentMethods;
|
|
41
|
+
status: ChargeStatus;
|
|
42
|
+
dueAt: string;
|
|
43
|
+
txid: string;
|
|
44
|
+
brcode: string;
|
|
45
|
+
pushToken: string;
|
|
46
|
+
installmentNumber: number;
|
|
47
|
+
installmentValue: number;
|
|
48
|
+
fee: number;
|
|
49
|
+
baseFee: number;
|
|
50
|
+
feePercentage: number;
|
|
51
|
+
isScheduled: boolean;
|
|
52
|
+
discountPercentage: number;
|
|
53
|
+
discountAmount: number;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
gatewayId: GatewayIdentification;
|
|
56
|
+
cardId: string;
|
|
57
|
+
orderId: string;
|
|
58
|
+
orderScheduleId: string;
|
|
59
|
+
payableIds: string[];
|
|
60
|
+
taxId?: string;
|
|
61
|
+
recipientId?: string;
|
|
62
|
+
chargeSchedule?: ChargeSchedule | undefined;
|
|
63
|
+
endToEndId: string;
|
|
64
|
+
type: ChargeType;
|
|
65
|
+
metadata: ChargeMetadata | undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ChargeSchedule {
|
|
69
|
+
id: string;
|
|
70
|
+
executionDate: Date;
|
|
71
|
+
isExecuted: boolean;
|
|
72
|
+
createdAt: Date;
|
|
73
|
+
updatedAt: Date;
|
|
74
|
+
charge: Charge | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CreateChargeRequest {
|
|
78
|
+
amount: number;
|
|
79
|
+
paymentMethod: PaymentMethods;
|
|
80
|
+
gatewayId: GatewayIdentification;
|
|
81
|
+
dueAt: string;
|
|
82
|
+
orderId: string;
|
|
83
|
+
orderType: OrderType;
|
|
84
|
+
baseFee: number;
|
|
85
|
+
feePercentage: number;
|
|
86
|
+
fee: number;
|
|
87
|
+
taxId?: string;
|
|
88
|
+
discountPercentage: number;
|
|
89
|
+
discountAmount: number;
|
|
90
|
+
cardId: string;
|
|
91
|
+
txid?: string | undefined;
|
|
92
|
+
pushToken: string;
|
|
93
|
+
installmentNumber: number;
|
|
94
|
+
installmentValue: number;
|
|
95
|
+
recipientId: string;
|
|
96
|
+
}
|
|
97
|
+
export interface UpdateChargeRequest {
|
|
98
|
+
id: string;
|
|
99
|
+
amount?: number;
|
|
100
|
+
paymentMethod?: PaymentMethods;
|
|
101
|
+
status?: ChargeStatus;
|
|
102
|
+
pushToken?: string;
|
|
103
|
+
txid?: string;
|
|
104
|
+
brcode?: string;
|
|
105
|
+
endToEndId?: string;
|
|
106
|
+
metadata?: Record<string, any> | undefined;
|
|
107
|
+
orderId?: string;
|
|
108
|
+
gatewayId?: string;
|
|
109
|
+
installmentNumber?: number;
|
|
110
|
+
installmentValue?: number;
|
|
111
|
+
cardId?: string;
|
|
112
|
+
fee?: number;
|
|
113
|
+
baseFee?: number;
|
|
114
|
+
feePercentage?: number;
|
|
115
|
+
discountPercentage?: number;
|
|
116
|
+
discountAmount?: number;
|
|
117
|
+
taxId?: string;
|
|
118
|
+
dueAt?: string;
|
|
119
|
+
orderType?: string;
|
|
120
|
+
isRetry?: boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface GetChargeByIdRequest {
|
|
124
|
+
id: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface GetAllChargesRequest {
|
|
128
|
+
pageIndex?: number | undefined;
|
|
129
|
+
pageSize?: number | undefined;
|
|
130
|
+
statuses?: ChargeStatus[];
|
|
131
|
+
globalFilter?: string | undefined;
|
|
132
|
+
startDate?: Date | undefined;
|
|
133
|
+
endDate?: Date | undefined;
|
|
134
|
+
recipientId?: string | undefined;
|
|
135
|
+
gatewayIds?: GatewayIdentification[] | undefined;
|
|
136
|
+
isScheduled?: boolean | undefined;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface GetAllChargesResponse {
|
|
140
|
+
charges: Charge[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface GetChargesByOrderIdRequest {
|
|
144
|
+
id: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface GetChargesByOrderIdResponse {
|
|
148
|
+
charges: Charge[];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface GetChargeByTxidRequest {
|
|
152
|
+
txid: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface ChargeResponse {
|
|
156
|
+
charge: Charge | undefined;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface GetScheduledChargeDetailRequest {
|
|
160
|
+
id: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface ScheduledChargeDetailResponse {
|
|
164
|
+
scheduledChargeDetail: ScheduledChargeDetail | undefined;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface ScheduledChargeDetail {
|
|
168
|
+
id: string;
|
|
169
|
+
amount: number;
|
|
170
|
+
method: string;
|
|
171
|
+
status: ChargeStatus;
|
|
172
|
+
dueAt: string;
|
|
173
|
+
createdAt: Date;
|
|
174
|
+
executionDate: string;
|
|
175
|
+
fee: number;
|
|
176
|
+
card?: CardDetails | undefined;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface CardDetails {
|
|
180
|
+
id: string;
|
|
181
|
+
brand: brandType;
|
|
182
|
+
shadowNumber: string;
|
|
183
|
+
nickname: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface getLiquidatedChargesForTransferRequest {}
|
|
187
|
+
|
|
188
|
+
export interface getLiquidatedChargesForTransferResponse {
|
|
189
|
+
charges: Charge[];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface ChargeDetailResponse {
|
|
193
|
+
id: string;
|
|
194
|
+
customer: string;
|
|
195
|
+
status: ChargeStatus;
|
|
196
|
+
createdAt: Date;
|
|
197
|
+
amount: number;
|
|
198
|
+
dueAt: string;
|
|
199
|
+
paymentMethod: PaymentMethods;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface ChargeScheduleDetail {
|
|
203
|
+
executionDate: Date;
|
|
204
|
+
isExecuted: boolean;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface ChargeSplit {
|
|
208
|
+
id: string;
|
|
209
|
+
recipientAccount: string;
|
|
210
|
+
amount: number;
|
|
211
|
+
status: PayableStatus;
|
|
212
|
+
installment: number;
|
|
213
|
+
dueAt: string;
|
|
214
|
+
isAnticipated: boolean;
|
|
215
|
+
processedAt: Date;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface Tax {
|
|
219
|
+
id: string;
|
|
220
|
+
type: string;
|
|
221
|
+
status: ChargeStatus;
|
|
222
|
+
description: string;
|
|
223
|
+
amount: number;
|
|
224
|
+
year: number;
|
|
225
|
+
dueAt?: string | undefined;
|
|
226
|
+
documentId: string;
|
|
227
|
+
code: string;
|
|
228
|
+
isSingleQuota: boolean;
|
|
229
|
+
quota: number;
|
|
230
|
+
fee: number;
|
|
231
|
+
fine: number;
|
|
232
|
+
discountPercentage: number;
|
|
233
|
+
discountAmount: number;
|
|
234
|
+
state: number;
|
|
235
|
+
city: number;
|
|
236
|
+
recipientId: string;
|
|
237
|
+
metaType: string;
|
|
238
|
+
meta: Meta | undefined;
|
|
239
|
+
payer: Payer | undefined;
|
|
240
|
+
orderItem: OrderItemEntity | undefined;
|
|
241
|
+
receipt?: Receipt | undefined;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface Payer {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
document: string;
|
|
248
|
+
phone: string;
|
|
249
|
+
taxes: Tax[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface Order {
|
|
253
|
+
id: string;
|
|
254
|
+
totalAmount: number;
|
|
255
|
+
status: ChargeStatus;
|
|
256
|
+
createdAt: Date;
|
|
257
|
+
items: OrderItemEntity[];
|
|
258
|
+
charges: Charge[];
|
|
259
|
+
customer: Customer | undefined;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface OrderItemEntity {
|
|
263
|
+
id: string;
|
|
264
|
+
recipient: Recipient | undefined;
|
|
265
|
+
tax: Tax | undefined;
|
|
266
|
+
order: Order | undefined;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface Receipt {
|
|
270
|
+
id: string;
|
|
271
|
+
amount: number;
|
|
272
|
+
protocol: string;
|
|
273
|
+
transactionId?: string | undefined;
|
|
274
|
+
createdAt: Date;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface Customer {
|
|
278
|
+
id: string;
|
|
279
|
+
username: string;
|
|
280
|
+
otherName: string;
|
|
281
|
+
document: string;
|
|
282
|
+
email: string;
|
|
283
|
+
emailVerified: boolean;
|
|
284
|
+
phone: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface Recipient {
|
|
288
|
+
id: string;
|
|
289
|
+
code: string;
|
|
290
|
+
commercialName: string;
|
|
291
|
+
socialReason: string;
|
|
292
|
+
holderType: string;
|
|
293
|
+
document: string;
|
|
294
|
+
cnaeId: string;
|
|
295
|
+
legalType: string;
|
|
296
|
+
contactName: string;
|
|
297
|
+
contactEmail: string;
|
|
298
|
+
contactPhone: string;
|
|
299
|
+
isAutomaticAnticipationEnabled: boolean;
|
|
300
|
+
foundation: string;
|
|
301
|
+
avatarUrl?: string | undefined;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface ForceConfirmRequest {
|
|
305
|
+
chargeId: string;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface ForceDueDateRequest {
|
|
309
|
+
chargeId: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface GetChargeCustomerNameRequest {
|
|
313
|
+
id: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface GetChargeCustomerNameResponse {
|
|
317
|
+
customerName: string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface GetConfirmedChargesByIdsRequest {
|
|
321
|
+
ids: string[];
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export interface GetConfirmedChargesByIdsResponse {
|
|
325
|
+
charges: Charge[];
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface cancelScheduledChargeRequest {
|
|
329
|
+
customerId: string;
|
|
330
|
+
id: string;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export interface CreateVerificationCardChargeRequest {
|
|
334
|
+
amount: number;
|
|
335
|
+
cardId: string;
|
|
336
|
+
gatewayId: GatewayIdentification;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export interface cancelChargeByTxidRequest {
|
|
340
|
+
txid: string;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface CancelPaymentResponse {
|
|
344
|
+
success: boolean;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export interface ForceLiquidationRequest {
|
|
348
|
+
chargeId: string;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface ForceLiquidationResponse {
|
|
352
|
+
success: boolean;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface AddPayableToChargeRequest {
|
|
356
|
+
chargeId: string;
|
|
357
|
+
payableId: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface ChargeClientDetailsResponse {
|
|
361
|
+
id: string;
|
|
362
|
+
status: ChargeStatus;
|
|
363
|
+
createdAt: Date;
|
|
364
|
+
amount: number;
|
|
365
|
+
dueAt: string;
|
|
366
|
+
paymentMethod: PaymentMethods;
|
|
367
|
+
txid: string;
|
|
368
|
+
gatewayId: GatewayIdentification;
|
|
369
|
+
failureReason?: string | undefined;
|
|
370
|
+
failureDetails?: string | undefined;
|
|
371
|
+
fee: number;
|
|
372
|
+
baseFee: number;
|
|
373
|
+
feePercentage: number;
|
|
374
|
+
installmentNumber?: number | undefined;
|
|
375
|
+
installmentValue?: number | undefined;
|
|
376
|
+
card?: CardDetails | undefined;
|
|
377
|
+
discountPercentage: number;
|
|
378
|
+
discountAmount: number;
|
|
379
|
+
tax?: TaxPayload | undefined;
|
|
380
|
+
schedule?: ChargeScheduleDetail | undefined;
|
|
381
|
+
orderId?: string | undefined;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface GetChargesHistoryRequest {
|
|
385
|
+
data: ChargeHistoryFilter | undefined;
|
|
386
|
+
pagination: PaginationFilter | undefined;
|
|
387
|
+
date: DateFilter | undefined;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export interface ChargeHistoryFilter {
|
|
391
|
+
customerId: string;
|
|
392
|
+
status: ChargeSummaryStatus;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export interface GetChargesHistoryResponse {
|
|
396
|
+
charges: ChargeCardItem[];
|
|
397
|
+
count: number;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export interface ChargeCardItem {
|
|
401
|
+
id: string;
|
|
402
|
+
createdAt: Date;
|
|
403
|
+
paymentMethod: PaymentMethods;
|
|
404
|
+
propertyDocument: string;
|
|
405
|
+
propertyDetail: string;
|
|
406
|
+
installmentNumber: number;
|
|
407
|
+
installmentValue: number;
|
|
408
|
+
schedule?: ChargeScheduleDetail | undefined;
|
|
409
|
+
taxType: TaxTypes;
|
|
410
|
+
status: ChargeStatus;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface getChargeAdministratorDetailsResponse {
|
|
414
|
+
id: string;
|
|
415
|
+
customer: string;
|
|
416
|
+
status: ChargeStatus;
|
|
417
|
+
createdAt: Date;
|
|
418
|
+
amount: number;
|
|
419
|
+
dueAt: string;
|
|
420
|
+
paymentMethod: PaymentMethods;
|
|
421
|
+
fee: number;
|
|
422
|
+
baseFee: number;
|
|
423
|
+
feePercentage: number;
|
|
424
|
+
installmentNumber: number;
|
|
425
|
+
installmentValue: number;
|
|
426
|
+
discountPercentage: number;
|
|
427
|
+
discountAmount: number;
|
|
428
|
+
txid: string;
|
|
429
|
+
gatewayId: GatewayIdentification;
|
|
430
|
+
cardId?: string | undefined;
|
|
431
|
+
orderId?: string | undefined;
|
|
432
|
+
orderScheduleId?: string | undefined;
|
|
433
|
+
metadata: ChargeMetadata;
|
|
434
|
+
failureReason?: string | undefined;
|
|
435
|
+
failureDetails?: string | undefined;
|
|
436
|
+
splits: ChargeSplit[];
|
|
437
|
+
tax?: TaxPayload | undefined;
|
|
438
|
+
schedule?: ChargeScheduleDetail | undefined;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export interface GetLastChargesRequest {
|
|
442
|
+
customerId: string;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export interface GetLastChargesResponse {
|
|
446
|
+
charges: ChargeCardItem[];
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export interface cancelChargeByIdRequest {
|
|
450
|
+
id: string;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface GetChargeRecipientIdResponse {
|
|
454
|
+
recipientId: string;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export interface GetChargesTimelineRequest {
|
|
458
|
+
recipientId?: string | undefined;
|
|
459
|
+
startDate?: Date | undefined;
|
|
460
|
+
endDate?: Date | undefined;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export interface TimelineDataPoint {
|
|
464
|
+
date: string;
|
|
465
|
+
liquidated: number;
|
|
466
|
+
processing: number;
|
|
467
|
+
scheduled: number;
|
|
468
|
+
pending: number;
|
|
469
|
+
cancelled: number;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export interface ComparisonDataPoint {
|
|
473
|
+
date: string;
|
|
474
|
+
liquidated: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export interface GetChargesTimelineResponse {
|
|
478
|
+
timeline: TimelineDataPoint[];
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface GetChargesComparisonTimelineRequest {
|
|
482
|
+
recipientId?: string | undefined;
|
|
483
|
+
primaryPeriodStart?: Date | undefined;
|
|
484
|
+
primaryPeriodEnd?: Date | undefined;
|
|
485
|
+
secondaryPeriodStart?: Date | undefined;
|
|
486
|
+
secondaryPeriodEnd?: Date | undefined;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export interface ChargeComparisonTimeline {
|
|
490
|
+
primary: ComparisonDataPoint[];
|
|
491
|
+
secondary: ComparisonDataPoint[];
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export interface GetChargesComparisonTimelineResponse {
|
|
495
|
+
comparisonTimeline: ChargeComparisonTimeline | undefined;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export interface getLiquidTotalAmountRequest {
|
|
499
|
+
recipientId: string;
|
|
500
|
+
startDate?: Date | undefined;
|
|
501
|
+
endDate?: Date | undefined;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export interface getLiquidTotalAmountResponse {
|
|
505
|
+
total: number;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export interface ConfirmChargesRequest {
|
|
509
|
+
chargeIds: string[];
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export interface ForceChargesDueDateRequest {
|
|
513
|
+
chargeIds: string[];
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export interface ForceChargesLiquidationRequest {
|
|
517
|
+
chargeIds: string[];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export interface CancelChargesRequest {
|
|
521
|
+
chargeIds: string[];
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export interface ChargesBatchResponse {
|
|
525
|
+
successful: number;
|
|
526
|
+
failed: number;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export interface GetOrderPaymentSummaryRequest {
|
|
530
|
+
orderId: string;
|
|
531
|
+
orderType: OrderType;
|
|
532
|
+
customerId: string;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export interface GetOrderPaymentSummaryResponse {
|
|
536
|
+
totalPaid: number;
|
|
537
|
+
totalPending: number;
|
|
538
|
+
paymentsMade: IndividualPayment[];
|
|
539
|
+
scheduledPayments: IndividualPayment[];
|
|
540
|
+
nextPayment: IndividualPayment | undefined;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export interface IndividualPayment {
|
|
544
|
+
id: string;
|
|
545
|
+
createdAt: Date;
|
|
546
|
+
paymentMethod: string;
|
|
547
|
+
propertyDocument: string;
|
|
548
|
+
propertyDetail: string;
|
|
549
|
+
installmentNumber: number;
|
|
550
|
+
installmentValue: number;
|
|
551
|
+
status: string;
|
|
552
|
+
schedule?: PaymentSchedule | undefined;
|
|
553
|
+
taxType: string;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export interface PaymentSchedule {
|
|
557
|
+
executionDate: Date;
|
|
558
|
+
isExecuted: boolean;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export const CHARGE_PACKAGE_NAME = 'charge';
|
|
562
|
+
|
|
563
|
+
export interface ChargeServiceClient {
|
|
564
|
+
createCharge(request: CreateChargeRequest): Observable<ChargeResponse>;
|
|
565
|
+
|
|
566
|
+
updateCharge(request: UpdateChargeRequest): Observable<ChargeResponse>;
|
|
567
|
+
|
|
568
|
+
getChargeById(request: GetChargeByIdRequest): Observable<ChargeResponse>;
|
|
569
|
+
|
|
570
|
+
getChargeAdministratorDetails(
|
|
571
|
+
request: GetChargeByIdRequest,
|
|
572
|
+
): Observable<getChargeAdministratorDetailsResponse>;
|
|
573
|
+
|
|
574
|
+
getAllCharges(
|
|
575
|
+
request: GetAllChargesRequest,
|
|
576
|
+
): Observable<GetAllChargesResponse>;
|
|
577
|
+
|
|
578
|
+
getChargesByOrderId(
|
|
579
|
+
request: GetChargesByOrderIdRequest,
|
|
580
|
+
): Observable<GetChargesByOrderIdResponse>;
|
|
581
|
+
|
|
582
|
+
getChargeByTxid(request: GetChargeByTxidRequest): Observable<ChargeResponse>;
|
|
583
|
+
|
|
584
|
+
getScheduledChargeDetail(
|
|
585
|
+
request: GetScheduledChargeDetailRequest,
|
|
586
|
+
): Observable<ScheduledChargeDetailResponse>;
|
|
587
|
+
|
|
588
|
+
getLiquidatedChargesForTransfer(
|
|
589
|
+
request: getLiquidatedChargesForTransferRequest,
|
|
590
|
+
): Observable<getLiquidatedChargesForTransferResponse>;
|
|
591
|
+
|
|
592
|
+
forceConfirm(request: ForceConfirmRequest): Observable<ChargeResponse>;
|
|
593
|
+
|
|
594
|
+
forceDueDate(request: ForceDueDateRequest): Observable<ChargeResponse>;
|
|
595
|
+
|
|
596
|
+
getChargeCustomerName(
|
|
597
|
+
request: GetChargeCustomerNameRequest,
|
|
598
|
+
): Observable<GetChargeCustomerNameResponse>;
|
|
599
|
+
|
|
600
|
+
getConfirmedChargesByIds(
|
|
601
|
+
request: GetConfirmedChargesByIdsRequest,
|
|
602
|
+
): Observable<GetConfirmedChargesByIdsResponse>;
|
|
603
|
+
|
|
604
|
+
cancelScheduledCharge(
|
|
605
|
+
request: cancelScheduledChargeRequest,
|
|
606
|
+
): Observable<ChargeResponse>;
|
|
607
|
+
|
|
608
|
+
createVerificationCardCharge(
|
|
609
|
+
request: CreateVerificationCardChargeRequest,
|
|
610
|
+
): Observable<ChargeResponse>;
|
|
611
|
+
|
|
612
|
+
cancelChargeByTxid(
|
|
613
|
+
request: cancelChargeByTxidRequest,
|
|
614
|
+
): Observable<CancelPaymentResponse>;
|
|
615
|
+
|
|
616
|
+
forceLiquidation(
|
|
617
|
+
request: ForceLiquidationRequest,
|
|
618
|
+
): Observable<ForceLiquidationResponse>;
|
|
619
|
+
|
|
620
|
+
addPayableToCharge(
|
|
621
|
+
request: AddPayableToChargeRequest,
|
|
622
|
+
): Observable<ChargeResponse>;
|
|
623
|
+
|
|
624
|
+
getChargeClientDetails(
|
|
625
|
+
request: GetChargeByIdRequest,
|
|
626
|
+
): Observable<ChargeClientDetailsResponse>;
|
|
627
|
+
|
|
628
|
+
getChargesHistory(
|
|
629
|
+
request: GetChargesHistoryRequest,
|
|
630
|
+
): Observable<GetChargesHistoryResponse>;
|
|
631
|
+
|
|
632
|
+
getLastChargesByCustomerId(
|
|
633
|
+
request: GetLastChargesRequest,
|
|
634
|
+
): Observable<GetLastChargesResponse>;
|
|
635
|
+
|
|
636
|
+
cancelChargeById(
|
|
637
|
+
request: cancelChargeByIdRequest,
|
|
638
|
+
): Observable<CancelPaymentResponse>;
|
|
639
|
+
|
|
640
|
+
getChargeRecipientId(
|
|
641
|
+
request: GetChargeByIdRequest,
|
|
642
|
+
): Observable<GetChargeRecipientIdResponse>;
|
|
643
|
+
|
|
644
|
+
getChargesTimeline(
|
|
645
|
+
request: GetChargesTimelineRequest,
|
|
646
|
+
): Observable<GetChargesTimelineResponse>;
|
|
647
|
+
|
|
648
|
+
getChargesComparisonTimeline(
|
|
649
|
+
request: GetChargesComparisonTimelineRequest,
|
|
650
|
+
): Observable<GetChargesComparisonTimelineResponse>;
|
|
651
|
+
|
|
652
|
+
getLiquidTotalAmount(
|
|
653
|
+
request: getLiquidTotalAmountRequest,
|
|
654
|
+
): Observable<getLiquidTotalAmountResponse>;
|
|
655
|
+
|
|
656
|
+
confirmCharges(
|
|
657
|
+
request: ConfirmChargesRequest,
|
|
658
|
+
): Observable<ChargesBatchResponse>;
|
|
659
|
+
|
|
660
|
+
forceChargesDueDate(
|
|
661
|
+
request: ForceChargesDueDateRequest,
|
|
662
|
+
): Observable<ChargesBatchResponse>;
|
|
663
|
+
|
|
664
|
+
forceChargesLiquidation(
|
|
665
|
+
request: ForceChargesLiquidationRequest,
|
|
666
|
+
): Observable<ChargesBatchResponse>;
|
|
667
|
+
|
|
668
|
+
cancelCharges(
|
|
669
|
+
request: CancelChargesRequest,
|
|
670
|
+
): Observable<ChargesBatchResponse>;
|
|
671
|
+
|
|
672
|
+
getOrderPaymentSummary(
|
|
673
|
+
request: GetOrderPaymentSummaryRequest,
|
|
674
|
+
): Observable<GetOrderPaymentSummaryResponse>;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface ChargeServiceController {
|
|
678
|
+
createCharge(
|
|
679
|
+
request: CreateChargeRequest,
|
|
680
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
681
|
+
|
|
682
|
+
updateCharge(
|
|
683
|
+
request: UpdateChargeRequest,
|
|
684
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
685
|
+
|
|
686
|
+
getChargeById(
|
|
687
|
+
request: GetChargeByIdRequest,
|
|
688
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
689
|
+
|
|
690
|
+
getChargeAdministratorDetails(
|
|
691
|
+
request: GetChargeByIdRequest,
|
|
692
|
+
):
|
|
693
|
+
| Promise<getChargeAdministratorDetailsResponse>
|
|
694
|
+
| Observable<getChargeAdministratorDetailsResponse>
|
|
695
|
+
| getChargeAdministratorDetailsResponse;
|
|
696
|
+
|
|
697
|
+
getAllCharges(
|
|
698
|
+
request: GetAllChargesRequest,
|
|
699
|
+
):
|
|
700
|
+
| Promise<GetAllChargesResponse>
|
|
701
|
+
| Observable<GetAllChargesResponse>
|
|
702
|
+
| GetAllChargesResponse;
|
|
703
|
+
|
|
704
|
+
getChargesByOrderId(
|
|
705
|
+
request: GetChargesByOrderIdRequest,
|
|
706
|
+
):
|
|
707
|
+
| Promise<GetChargesByOrderIdResponse>
|
|
708
|
+
| Observable<GetChargesByOrderIdResponse>
|
|
709
|
+
| GetChargesByOrderIdResponse;
|
|
710
|
+
|
|
711
|
+
getChargeByTxid(
|
|
712
|
+
request: GetChargeByTxidRequest,
|
|
713
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
714
|
+
|
|
715
|
+
getScheduledChargeDetail(
|
|
716
|
+
request: GetScheduledChargeDetailRequest,
|
|
717
|
+
):
|
|
718
|
+
| Promise<ScheduledChargeDetailResponse>
|
|
719
|
+
| Observable<ScheduledChargeDetailResponse>
|
|
720
|
+
| ScheduledChargeDetailResponse;
|
|
721
|
+
|
|
722
|
+
getLiquidatedChargesForTransfer(
|
|
723
|
+
request: getLiquidatedChargesForTransferRequest,
|
|
724
|
+
):
|
|
725
|
+
| Promise<getLiquidatedChargesForTransferResponse>
|
|
726
|
+
| Observable<getLiquidatedChargesForTransferResponse>
|
|
727
|
+
| getLiquidatedChargesForTransferResponse;
|
|
728
|
+
|
|
729
|
+
forceConfirm(
|
|
730
|
+
request: ForceConfirmRequest,
|
|
731
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
732
|
+
|
|
733
|
+
forceDueDate(
|
|
734
|
+
request: ForceDueDateRequest,
|
|
735
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
736
|
+
|
|
737
|
+
getChargeCustomerName(
|
|
738
|
+
request: GetChargeCustomerNameRequest,
|
|
739
|
+
):
|
|
740
|
+
| Promise<GetChargeCustomerNameResponse>
|
|
741
|
+
| Observable<GetChargeCustomerNameResponse>
|
|
742
|
+
| GetChargeCustomerNameResponse;
|
|
743
|
+
|
|
744
|
+
getConfirmedChargesByIds(
|
|
745
|
+
request: GetConfirmedChargesByIdsRequest,
|
|
746
|
+
):
|
|
747
|
+
| Promise<GetConfirmedChargesByIdsResponse>
|
|
748
|
+
| Observable<GetConfirmedChargesByIdsResponse>
|
|
749
|
+
| GetConfirmedChargesByIdsResponse;
|
|
750
|
+
|
|
751
|
+
cancelScheduledCharge(
|
|
752
|
+
request: cancelScheduledChargeRequest,
|
|
753
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
754
|
+
|
|
755
|
+
createVerificationCardCharge(
|
|
756
|
+
request: CreateVerificationCardChargeRequest,
|
|
757
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
758
|
+
|
|
759
|
+
cancelChargeByTxid(
|
|
760
|
+
request: cancelChargeByTxidRequest,
|
|
761
|
+
):
|
|
762
|
+
| Promise<CancelPaymentResponse>
|
|
763
|
+
| Observable<CancelPaymentResponse>
|
|
764
|
+
| CancelPaymentResponse;
|
|
765
|
+
|
|
766
|
+
forceLiquidation(
|
|
767
|
+
request: ForceLiquidationRequest,
|
|
768
|
+
):
|
|
769
|
+
| Promise<ForceLiquidationResponse>
|
|
770
|
+
| Observable<ForceLiquidationResponse>
|
|
771
|
+
| ForceLiquidationResponse;
|
|
772
|
+
|
|
773
|
+
addPayableToCharge(
|
|
774
|
+
request: AddPayableToChargeRequest,
|
|
775
|
+
): Promise<ChargeResponse> | Observable<ChargeResponse> | ChargeResponse;
|
|
776
|
+
|
|
777
|
+
getChargeClientDetails(
|
|
778
|
+
request: GetChargeByIdRequest,
|
|
779
|
+
):
|
|
780
|
+
| Promise<ChargeClientDetailsResponse>
|
|
781
|
+
| Observable<ChargeClientDetailsResponse>
|
|
782
|
+
| ChargeClientDetailsResponse;
|
|
783
|
+
|
|
784
|
+
getChargesHistory(
|
|
785
|
+
request: GetChargesHistoryRequest,
|
|
786
|
+
):
|
|
787
|
+
| Promise<GetChargesHistoryResponse>
|
|
788
|
+
| Observable<GetChargesHistoryResponse>
|
|
789
|
+
| GetChargesHistoryResponse;
|
|
790
|
+
|
|
791
|
+
getLastChargesByCustomerId(
|
|
792
|
+
request: GetLastChargesRequest,
|
|
793
|
+
):
|
|
794
|
+
| Promise<GetLastChargesResponse>
|
|
795
|
+
| Observable<GetLastChargesResponse>
|
|
796
|
+
| GetLastChargesResponse;
|
|
797
|
+
|
|
798
|
+
cancelChargeById(
|
|
799
|
+
request: cancelChargeByIdRequest,
|
|
800
|
+
):
|
|
801
|
+
| Promise<CancelPaymentResponse>
|
|
802
|
+
| Observable<CancelPaymentResponse>
|
|
803
|
+
| CancelPaymentResponse;
|
|
804
|
+
|
|
805
|
+
getChargeRecipientId(
|
|
806
|
+
request: GetChargeByIdRequest,
|
|
807
|
+
):
|
|
808
|
+
| Promise<GetChargeRecipientIdResponse>
|
|
809
|
+
| Observable<GetChargeRecipientIdResponse>
|
|
810
|
+
| GetChargeRecipientIdResponse;
|
|
811
|
+
|
|
812
|
+
getChargesTimeline(
|
|
813
|
+
request: GetChargesTimelineRequest,
|
|
814
|
+
):
|
|
815
|
+
| Promise<GetChargesTimelineResponse>
|
|
816
|
+
| Observable<GetChargesTimelineResponse>
|
|
817
|
+
| GetChargesTimelineResponse;
|
|
818
|
+
|
|
819
|
+
getChargesComparisonTimeline(
|
|
820
|
+
request: GetChargesComparisonTimelineRequest,
|
|
821
|
+
):
|
|
822
|
+
| Promise<GetChargesComparisonTimelineResponse>
|
|
823
|
+
| Observable<GetChargesComparisonTimelineResponse>
|
|
824
|
+
| GetChargesComparisonTimelineResponse;
|
|
825
|
+
|
|
826
|
+
getLiquidTotalAmount(
|
|
827
|
+
request: getLiquidTotalAmountRequest,
|
|
828
|
+
):
|
|
829
|
+
| Promise<getLiquidTotalAmountResponse>
|
|
830
|
+
| Observable<getLiquidTotalAmountResponse>
|
|
831
|
+
| getLiquidTotalAmountResponse;
|
|
832
|
+
|
|
833
|
+
confirmCharges(
|
|
834
|
+
request: ConfirmChargesRequest,
|
|
835
|
+
):
|
|
836
|
+
| Promise<ChargesBatchResponse>
|
|
837
|
+
| Observable<ChargesBatchResponse>
|
|
838
|
+
| ChargesBatchResponse;
|
|
839
|
+
|
|
840
|
+
forceChargesDueDate(
|
|
841
|
+
request: ForceChargesDueDateRequest,
|
|
842
|
+
):
|
|
843
|
+
| Promise<ChargesBatchResponse>
|
|
844
|
+
| Observable<ChargesBatchResponse>
|
|
845
|
+
| ChargesBatchResponse;
|
|
846
|
+
|
|
847
|
+
forceChargesLiquidation(
|
|
848
|
+
request: ForceChargesLiquidationRequest,
|
|
849
|
+
):
|
|
850
|
+
| Promise<ChargesBatchResponse>
|
|
851
|
+
| Observable<ChargesBatchResponse>
|
|
852
|
+
| ChargesBatchResponse;
|
|
853
|
+
|
|
854
|
+
cancelCharges(
|
|
855
|
+
request: CancelChargesRequest,
|
|
856
|
+
):
|
|
857
|
+
| Promise<ChargesBatchResponse>
|
|
858
|
+
| Observable<ChargesBatchResponse>
|
|
859
|
+
| ChargesBatchResponse;
|
|
860
|
+
|
|
861
|
+
getOrderPaymentSummary(
|
|
862
|
+
request: GetOrderPaymentSummaryRequest,
|
|
863
|
+
):
|
|
864
|
+
| Promise<GetOrderPaymentSummaryResponse>
|
|
865
|
+
| Observable<GetOrderPaymentSummaryResponse>
|
|
866
|
+
| GetOrderPaymentSummaryResponse;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export function ChargeServiceControllerMethods() {
|
|
870
|
+
return function (constructor: Function) {
|
|
871
|
+
const grpcMethods: string[] = [
|
|
872
|
+
'createCharge',
|
|
873
|
+
'updateCharge',
|
|
874
|
+
'getChargeById',
|
|
875
|
+
'getChargeAdministratorDetails',
|
|
876
|
+
'getAllCharges',
|
|
877
|
+
'getChargesByOrderId',
|
|
878
|
+
'getChargeByTxid',
|
|
879
|
+
'getScheduledChargeDetail',
|
|
880
|
+
'getLiquidatedChargesForTransfer',
|
|
881
|
+
'forceConfirm',
|
|
882
|
+
'forceDueDate',
|
|
883
|
+
'getChargeCustomerName',
|
|
884
|
+
'getConfirmedChargesByIds',
|
|
885
|
+
'cancelScheduledCharge',
|
|
886
|
+
'createVerificationCardCharge',
|
|
887
|
+
'cancelChargeByTxid',
|
|
888
|
+
'forceLiquidation',
|
|
889
|
+
'addPayableToCharge',
|
|
890
|
+
'getChargeClientDetails',
|
|
891
|
+
'getChargesHistory',
|
|
892
|
+
'getLastChargesByCustomerId',
|
|
893
|
+
'cancelChargeById',
|
|
894
|
+
'getChargeRecipientId',
|
|
895
|
+
'getChargesTimeline',
|
|
896
|
+
'getChargesComparisonTimeline',
|
|
897
|
+
'getLiquidTotalAmount',
|
|
898
|
+
'confirmCharges',
|
|
899
|
+
'forceChargesDueDate',
|
|
900
|
+
'forceChargesLiquidation',
|
|
901
|
+
'cancelCharges',
|
|
902
|
+
'getOrderPaymentSummary',
|
|
903
|
+
];
|
|
904
|
+
for (const method of grpcMethods) {
|
|
905
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
906
|
+
constructor.prototype,
|
|
907
|
+
method,
|
|
908
|
+
);
|
|
909
|
+
GrpcMethod('ChargeService', method)(
|
|
910
|
+
constructor.prototype[method],
|
|
911
|
+
method,
|
|
912
|
+
descriptor,
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
const grpcStreamMethods: string[] = [];
|
|
916
|
+
for (const method of grpcStreamMethods) {
|
|
917
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
918
|
+
constructor.prototype,
|
|
919
|
+
method,
|
|
920
|
+
);
|
|
921
|
+
GrpcStreamMethod('ChargeService', method)(
|
|
922
|
+
constructor.prototype[method],
|
|
923
|
+
method,
|
|
924
|
+
descriptor,
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
export const CHARGE_SERVICE_NAME = 'ChargeService';
|