@fiado/api-invoker 3.0.0 → 3.0.2
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/bin/credit-payment/CreditPaymentApi.d.ts +8 -13
- package/bin/credit-payment/CreditPaymentApi.js +16 -16
- package/bin/credit-payment/interfaces/ICreditPaymentApi.d.ts +8 -13
- package/package.json +1 -1
- package/src/credit-payment/CreditPaymentApi.ts +24 -29
- package/src/credit-payment/interfaces/ICreditPaymentApi.ts +8 -14
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { ICreditPaymentApi } from "./interfaces/ICreditPaymentApi";
|
|
3
|
-
import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
|
|
4
|
-
import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
|
|
5
|
-
import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
|
|
6
|
-
import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
|
|
7
|
-
import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
|
|
8
3
|
export declare class CreditPaymentApi implements ICreditPaymentApi {
|
|
9
4
|
private httpRequest;
|
|
10
5
|
private readonly baseUrl;
|
|
11
6
|
constructor(httpRequest: IHttpRequest);
|
|
12
|
-
disburse(request:
|
|
13
|
-
collect(request:
|
|
14
|
-
collectPartial(request:
|
|
15
|
-
collectLien(request:
|
|
16
|
-
earlyPayment(request:
|
|
17
|
-
transferLoanco(request:
|
|
18
|
-
reverse(request:
|
|
19
|
-
getBalance(creditId: string): Promise<
|
|
7
|
+
disburse(request: any): Promise<any>;
|
|
8
|
+
collect(request: any): Promise<any>;
|
|
9
|
+
collectPartial(request: any): Promise<any>;
|
|
10
|
+
collectLien(request: any): Promise<any>;
|
|
11
|
+
earlyPayment(request: any): Promise<any>;
|
|
12
|
+
transferLoanco(request: any): Promise<any>;
|
|
13
|
+
reverse(request: any): Promise<any>;
|
|
14
|
+
getBalance(creditId: string): Promise<any>;
|
|
20
15
|
getHistory(creditId: string): Promise<any>;
|
|
21
16
|
}
|
|
@@ -25,43 +25,43 @@ let CreditPaymentApi = class CreditPaymentApi {
|
|
|
25
25
|
this.baseUrl = process.env.CREDIT_PAYMENT_LAMBDA_URL || "";
|
|
26
26
|
}
|
|
27
27
|
async disburse(request) {
|
|
28
|
-
const url = `${this.baseUrl}credit/disburse`;
|
|
29
|
-
const operationName = "
|
|
28
|
+
const url = `${this.baseUrl}credit-payment/disburse`;
|
|
29
|
+
const operationName = "privateDisburse";
|
|
30
30
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
31
31
|
}
|
|
32
32
|
async collect(request) {
|
|
33
|
-
const url = `${this.baseUrl}credit/collect`;
|
|
34
|
-
const operationName = "
|
|
33
|
+
const url = `${this.baseUrl}credit-payment/collect`;
|
|
34
|
+
const operationName = "privateCollect";
|
|
35
35
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
36
36
|
}
|
|
37
37
|
async collectPartial(request) {
|
|
38
|
-
const url = `${this.baseUrl}credit/collect-partial`;
|
|
39
|
-
const operationName = "
|
|
38
|
+
const url = `${this.baseUrl}credit-payment/collect-partial`;
|
|
39
|
+
const operationName = "privateCollectPartial";
|
|
40
40
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
41
41
|
}
|
|
42
42
|
async collectLien(request) {
|
|
43
|
-
const url = `${this.baseUrl}credit/collect-lien`;
|
|
44
|
-
const operationName = "
|
|
43
|
+
const url = `${this.baseUrl}credit-payment/collect-lien`;
|
|
44
|
+
const operationName = "privateCollectLien";
|
|
45
45
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
46
46
|
}
|
|
47
47
|
async earlyPayment(request) {
|
|
48
|
-
const url = `${this.baseUrl}credit/early-payment`;
|
|
49
|
-
const operationName = "
|
|
48
|
+
const url = `${this.baseUrl}credit-payment/early-payment`;
|
|
49
|
+
const operationName = "privateEarlyPayment";
|
|
50
50
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
51
51
|
}
|
|
52
52
|
async transferLoanco(request) {
|
|
53
|
-
const url = `${this.baseUrl}credit/transfer-loanco`;
|
|
54
|
-
const operationName = "
|
|
53
|
+
const url = `${this.baseUrl}credit-payment/transfer-loanco`;
|
|
54
|
+
const operationName = "privateTransferLoanco";
|
|
55
55
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
56
56
|
}
|
|
57
57
|
async reverse(request) {
|
|
58
|
-
const url = `${this.baseUrl}credit/reverse`;
|
|
59
|
-
const operationName = "
|
|
58
|
+
const url = `${this.baseUrl}credit-payment/reverse`;
|
|
59
|
+
const operationName = "privateReverse";
|
|
60
60
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
61
61
|
}
|
|
62
62
|
async getBalance(creditId) {
|
|
63
|
-
const url = `${this.baseUrl}credit/balance/${creditId}`;
|
|
64
|
-
const operationName = "
|
|
63
|
+
const url = `${this.baseUrl}credit-payment/balance/${creditId}`;
|
|
64
|
+
const operationName = "privateBalance";
|
|
65
65
|
return await this.httpRequest.post(url, null, { 'operationName': operationName });
|
|
66
66
|
}
|
|
67
67
|
async getHistory(creditId) {
|
|
@@ -1,41 +1,36 @@
|
|
|
1
|
-
import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
|
|
2
|
-
import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
|
|
3
|
-
import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
|
|
4
|
-
import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
|
|
5
|
-
import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
|
|
6
1
|
export interface ICreditPaymentApi {
|
|
7
2
|
/**
|
|
8
3
|
* Desembolsa el monto del crédito a la cuenta del usuario.
|
|
9
4
|
*/
|
|
10
|
-
disburse(request:
|
|
5
|
+
disburse(request: any): Promise<any>;
|
|
11
6
|
/**
|
|
12
7
|
* Cobra el cupón regular de un crédito.
|
|
13
8
|
*/
|
|
14
|
-
collect(request:
|
|
9
|
+
collect(request: any): Promise<any>;
|
|
15
10
|
/**
|
|
16
11
|
* Cobra un monto parcial (insuficiente para cupón completo).
|
|
17
12
|
*/
|
|
18
|
-
collectPartial(request:
|
|
13
|
+
collectPartial(request: any): Promise<any>;
|
|
19
14
|
/**
|
|
20
15
|
* Cobra por cobro latente (lien sobre depósito).
|
|
21
16
|
*/
|
|
22
|
-
collectLien(request:
|
|
17
|
+
collectLien(request: any): Promise<any>;
|
|
23
18
|
/**
|
|
24
19
|
* Procesa un pago anticipado/adelantado/liquidación.
|
|
25
20
|
*/
|
|
26
|
-
earlyPayment(request:
|
|
21
|
+
earlyPayment(request: any): Promise<any>;
|
|
27
22
|
/**
|
|
28
23
|
* Transfiere fondos recaudados a LoanCo.
|
|
29
24
|
*/
|
|
30
|
-
transferLoanco(request:
|
|
25
|
+
transferLoanco(request: any): Promise<any>;
|
|
31
26
|
/**
|
|
32
27
|
* Reversa una transacción de crédito.
|
|
33
28
|
*/
|
|
34
|
-
reverse(request:
|
|
29
|
+
reverse(request: any): Promise<any>;
|
|
35
30
|
/**
|
|
36
31
|
* Consulta el balance de un crédito.
|
|
37
32
|
*/
|
|
38
|
-
getBalance(creditId: string): Promise<
|
|
33
|
+
getBalance(creditId: string): Promise<any>;
|
|
39
34
|
/**
|
|
40
35
|
* Obtiene historial de transacciones de un crédito.
|
|
41
36
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -2,11 +2,6 @@ import dotenv from 'dotenv';
|
|
|
2
2
|
import { inject, injectable } from "inversify";
|
|
3
3
|
import { IHttpRequest } from "@fiado/http-client";
|
|
4
4
|
import { ICreditPaymentApi } from "./interfaces/ICreditPaymentApi";
|
|
5
|
-
import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
|
|
6
|
-
import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
|
|
7
|
-
import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
|
|
8
|
-
import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
|
|
9
|
-
import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
|
|
10
5
|
dotenv.config();
|
|
11
6
|
|
|
12
7
|
@injectable()
|
|
@@ -16,51 +11,51 @@ export class CreditPaymentApi implements ICreditPaymentApi {
|
|
|
16
11
|
|
|
17
12
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
18
13
|
|
|
19
|
-
public async disburse(request:
|
|
20
|
-
const url = `${this.baseUrl}credit/disburse`;
|
|
21
|
-
const operationName = "
|
|
14
|
+
public async disburse(request: any): Promise<any> {
|
|
15
|
+
const url = `${this.baseUrl}credit-payment/disburse`;
|
|
16
|
+
const operationName = "privateDisburse";
|
|
22
17
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
23
18
|
}
|
|
24
19
|
|
|
25
|
-
public async collect(request:
|
|
26
|
-
const url = `${this.baseUrl}credit/collect`;
|
|
27
|
-
const operationName = "
|
|
20
|
+
public async collect(request: any): Promise<any> {
|
|
21
|
+
const url = `${this.baseUrl}credit-payment/collect`;
|
|
22
|
+
const operationName = "privateCollect";
|
|
28
23
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
public async collectPartial(request:
|
|
32
|
-
const url = `${this.baseUrl}credit/collect-partial`;
|
|
33
|
-
const operationName = "
|
|
26
|
+
public async collectPartial(request: any): Promise<any> {
|
|
27
|
+
const url = `${this.baseUrl}credit-payment/collect-partial`;
|
|
28
|
+
const operationName = "privateCollectPartial";
|
|
34
29
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
35
30
|
}
|
|
36
31
|
|
|
37
|
-
public async collectLien(request:
|
|
38
|
-
const url = `${this.baseUrl}credit/collect-lien`;
|
|
39
|
-
const operationName = "
|
|
32
|
+
public async collectLien(request: any): Promise<any> {
|
|
33
|
+
const url = `${this.baseUrl}credit-payment/collect-lien`;
|
|
34
|
+
const operationName = "privateCollectLien";
|
|
40
35
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
41
36
|
}
|
|
42
37
|
|
|
43
|
-
public async earlyPayment(request:
|
|
44
|
-
const url = `${this.baseUrl}credit/early-payment`;
|
|
45
|
-
const operationName = "
|
|
38
|
+
public async earlyPayment(request: any): Promise<any> {
|
|
39
|
+
const url = `${this.baseUrl}credit-payment/early-payment`;
|
|
40
|
+
const operationName = "privateEarlyPayment";
|
|
46
41
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
47
42
|
}
|
|
48
43
|
|
|
49
|
-
public async transferLoanco(request:
|
|
50
|
-
const url = `${this.baseUrl}credit/transfer-loanco`;
|
|
51
|
-
const operationName = "
|
|
44
|
+
public async transferLoanco(request: any): Promise<any> {
|
|
45
|
+
const url = `${this.baseUrl}credit-payment/transfer-loanco`;
|
|
46
|
+
const operationName = "privateTransferLoanco";
|
|
52
47
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
public async reverse(request:
|
|
56
|
-
const url = `${this.baseUrl}credit/reverse`;
|
|
57
|
-
const operationName = "
|
|
50
|
+
public async reverse(request: any): Promise<any> {
|
|
51
|
+
const url = `${this.baseUrl}credit-payment/reverse`;
|
|
52
|
+
const operationName = "privateReverse";
|
|
58
53
|
return await this.httpRequest.post(url, request, { 'operationName': operationName });
|
|
59
54
|
}
|
|
60
55
|
|
|
61
|
-
public async getBalance(creditId: string): Promise<
|
|
62
|
-
const url = `${this.baseUrl}credit/balance/${creditId}`;
|
|
63
|
-
const operationName = "
|
|
56
|
+
public async getBalance(creditId: string): Promise<any> {
|
|
57
|
+
const url = `${this.baseUrl}credit-payment/balance/${creditId}`;
|
|
58
|
+
const operationName = "privateBalance";
|
|
64
59
|
return await this.httpRequest.post(url, null, { 'operationName': operationName });
|
|
65
60
|
}
|
|
66
61
|
|
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
|
|
2
|
-
import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
|
|
3
|
-
import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
|
|
4
|
-
import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
|
|
5
|
-
import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
|
|
6
|
-
|
|
7
1
|
export interface ICreditPaymentApi {
|
|
8
2
|
/**
|
|
9
3
|
* Desembolsa el monto del crédito a la cuenta del usuario.
|
|
10
4
|
*/
|
|
11
|
-
disburse(request:
|
|
5
|
+
disburse(request: any): Promise<any>;
|
|
12
6
|
|
|
13
7
|
/**
|
|
14
8
|
* Cobra el cupón regular de un crédito.
|
|
15
9
|
*/
|
|
16
|
-
collect(request:
|
|
10
|
+
collect(request: any): Promise<any>;
|
|
17
11
|
|
|
18
12
|
/**
|
|
19
13
|
* Cobra un monto parcial (insuficiente para cupón completo).
|
|
20
14
|
*/
|
|
21
|
-
collectPartial(request:
|
|
15
|
+
collectPartial(request: any): Promise<any>;
|
|
22
16
|
|
|
23
17
|
/**
|
|
24
18
|
* Cobra por cobro latente (lien sobre depósito).
|
|
25
19
|
*/
|
|
26
|
-
collectLien(request:
|
|
20
|
+
collectLien(request: any): Promise<any>;
|
|
27
21
|
|
|
28
22
|
/**
|
|
29
23
|
* Procesa un pago anticipado/adelantado/liquidación.
|
|
30
24
|
*/
|
|
31
|
-
earlyPayment(request:
|
|
25
|
+
earlyPayment(request: any): Promise<any>;
|
|
32
26
|
|
|
33
27
|
/**
|
|
34
28
|
* Transfiere fondos recaudados a LoanCo.
|
|
35
29
|
*/
|
|
36
|
-
transferLoanco(request:
|
|
30
|
+
transferLoanco(request: any): Promise<any>;
|
|
37
31
|
|
|
38
32
|
/**
|
|
39
33
|
* Reversa una transacción de crédito.
|
|
40
34
|
*/
|
|
41
|
-
reverse(request:
|
|
35
|
+
reverse(request: any): Promise<any>;
|
|
42
36
|
|
|
43
37
|
/**
|
|
44
38
|
* Consulta el balance de un crédito.
|
|
45
39
|
*/
|
|
46
|
-
getBalance(creditId: string): Promise<
|
|
40
|
+
getBalance(creditId: string): Promise<any>;
|
|
47
41
|
|
|
48
42
|
/**
|
|
49
43
|
* Obtiene historial de transacciones de un crédito.
|