@fiado/api-invoker 5.91.0 → 5.92.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.
@@ -1,6 +1,6 @@
1
1
  import type { IHttpRequest } from "@fiado/http-client";
2
2
  import { StandardResponse } from "@fiado/gateway-adapter";
3
- import { ActivationCheckRequest, ActivationCheckResponse, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse } from "@fiado/type-kit/bin/loanCredit/index.js";
3
+ import { ActivationCheckRequest, ActivationCheckResponse, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse, CreateCustomerPaymentRequest, LoanCustomerPaymentOptions, LoanCustomerPaymentResult } from "@fiado/type-kit/bin/loanCredit/index.js";
4
4
  import { LoanCreditAnalyticsBatchRequest, LoanCreditAnalyticsBatchResponse } from "./dtos/LoanCreditAnalyticsBatch.js";
5
5
  import { CustomerCreditHistoryResponse } from "./dtos/CustomerCreditHistory.js";
6
6
  import { CreditLifecycleFactRequest, CreditLifecycleFactResponse } from "./dtos/CreditLifecycleFact.js";
@@ -45,4 +45,6 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
45
45
  }): Promise<StandardResponse<LoanPaymentListResponse>>;
46
46
  listCustomerCreditContracts(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanContractResponse[]>>;
47
47
  getCustomerCreditContractUrl(directoryId: string, creditId: string, contractId: string, tenantId: string): Promise<StandardResponse<LoanContractDownloadUrl>>;
48
+ getCustomerPaymentOptions(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanCustomerPaymentOptions>>;
49
+ createCustomerPayment(directoryId: string, creditId: string, tenantId: string, body: CreateCustomerPaymentRequest): Promise<StandardResponse<LoanCustomerPaymentResult>>;
48
50
  }
@@ -114,6 +114,13 @@ let LoanCreditBusinessApi = class LoanCreditBusinessApi {
114
114
  async getCustomerCreditContractUrl(directoryId, creditId, contractId, tenantId) {
115
115
  return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/contracts/${encodeURIComponent(contractId)}/url?tenantId=${encodeURIComponent(tenantId)}`);
116
116
  }
117
+ // ─── Pagos de cliente (retail-loan-business) ────────────────────────────────
118
+ async getCustomerPaymentOptions(directoryId, creditId, tenantId) {
119
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/payment-options?tenantId=${encodeURIComponent(tenantId)}`);
120
+ }
121
+ async createCustomerPayment(directoryId, creditId, tenantId, body) {
122
+ return await this.httpRequest.post(`${this.customerCreditsUrl(directoryId, creditId)}/payments?tenantId=${encodeURIComponent(tenantId)}`, body);
123
+ }
117
124
  };
118
125
  LoanCreditBusinessApi = __decorate([
119
126
  injectable(),
@@ -1,5 +1,5 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
- import { ActivationCheckRequest, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, ActivationCheckResponse, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse } from "@fiado/type-kit/bin/loanCredit/index.js";
2
+ import { ActivationCheckRequest, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, ActivationCheckResponse, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse, CreateCustomerPaymentRequest, LoanCustomerPaymentOptions, LoanCustomerPaymentResult } from "@fiado/type-kit/bin/loanCredit/index.js";
3
3
  import { LoanCreditAnalyticsBatchRequest, LoanCreditAnalyticsBatchResponse } from "../dtos/LoanCreditAnalyticsBatch.js";
4
4
  import { CustomerCreditHistoryResponse } from "../dtos/CustomerCreditHistory.js";
5
5
  import { CreditLifecycleFactRequest, CreditLifecycleFactResponse } from "../dtos/CreditLifecycleFact.js";
@@ -131,4 +131,13 @@ export interface ILoanCreditBusinessApi {
131
131
  listCustomerCreditContracts(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanContractResponse[]>>;
132
132
  /** URL prefirmada del PDF de un contrato. 404 CONTRACT_NOT_FOUND · 409 CONTRACT_PDF_NOT_READY. */
133
133
  getCustomerCreditContractUrl(directoryId: string, creditId: string, contractId: string, tenantId: string): Promise<StandardResponse<LoanContractDownloadUrl>>;
134
+ /** Opciones de pago de un crédito del cliente, con montos ya calculados. */
135
+ getCustomerPaymentOptions(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanCustomerPaymentOptions>>;
136
+ /**
137
+ * Pide el cobro de una opción de pago (202). Misma `idempotencyKey` y mismo cuerpo devuelven la
138
+ * misma respuesta. 404 CREDIT_NOT_FOUND · 409 AD_HOC_CHARGE_PENDING · 409 CREDIT_NOT_CURRENT ·
139
+ * 409 CUSTOMER_PAYMENT_AMOUNT_CHANGED · 422 PAYMENT_OPTION_UNAVAILABLE · 422 IDEMPOTENCY_KEY_MISMATCH ·
140
+ * 5xx si el motor de cobro no contesta.
141
+ */
142
+ createCustomerPayment(directoryId: string, creditId: string, tenantId: string, body: CreateCustomerPaymentRequest): Promise<StandardResponse<LoanCustomerPaymentResult>>;
134
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.91.0",
3
+ "version": "5.92.0",
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
  "type": "module",
6
6
  "main": "bin/index.js",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^3.9.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "3.461.0",
37
+ "@fiado/type-kit": "3.462.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -25,6 +25,9 @@ import {
25
25
  LoanCreditDetail,
26
26
  LoanInstallmentResponse,
27
27
  LoanPaymentListResponse,
28
+ CreateCustomerPaymentRequest,
29
+ LoanCustomerPaymentOptions,
30
+ LoanCustomerPaymentResult,
28
31
  } from "@fiado/type-kit/bin/loanCredit/index.js";
29
32
  import {
30
33
  LoanCreditAnalyticsBatchRequest,
@@ -238,4 +241,28 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
238
241
  `${this.customerCreditsUrl(directoryId, creditId)}/contracts/${encodeURIComponent(contractId)}/url?tenantId=${encodeURIComponent(tenantId)}`,
239
242
  );
240
243
  }
244
+
245
+ // ─── Pagos de cliente (retail-loan-business) ────────────────────────────────
246
+
247
+ async getCustomerPaymentOptions(
248
+ directoryId: string,
249
+ creditId: string,
250
+ tenantId: string,
251
+ ): Promise<StandardResponse<LoanCustomerPaymentOptions>> {
252
+ return await this.httpRequest.get(
253
+ `${this.customerCreditsUrl(directoryId, creditId)}/payment-options?tenantId=${encodeURIComponent(tenantId)}`,
254
+ );
255
+ }
256
+
257
+ async createCustomerPayment(
258
+ directoryId: string,
259
+ creditId: string,
260
+ tenantId: string,
261
+ body: CreateCustomerPaymentRequest,
262
+ ): Promise<StandardResponse<LoanCustomerPaymentResult>> {
263
+ return await this.httpRequest.post(
264
+ `${this.customerCreditsUrl(directoryId, creditId)}/payments?tenantId=${encodeURIComponent(tenantId)}`,
265
+ body,
266
+ );
267
+ }
241
268
  }
@@ -23,6 +23,9 @@ import {
23
23
  LoanCreditDetail,
24
24
  LoanInstallmentResponse,
25
25
  LoanPaymentListResponse,
26
+ CreateCustomerPaymentRequest,
27
+ LoanCustomerPaymentOptions,
28
+ LoanCustomerPaymentResult,
26
29
  } from "@fiado/type-kit/bin/loanCredit/index.js";
27
30
  import {
28
31
  LoanCreditAnalyticsBatchRequest,
@@ -255,4 +258,26 @@ export interface ILoanCreditBusinessApi {
255
258
  contractId: string,
256
259
  tenantId: string,
257
260
  ): Promise<StandardResponse<LoanContractDownloadUrl>>;
261
+
262
+ // ─── Pagos de cliente (retail-loan-business) ────────────────────────────────
263
+
264
+ /** Opciones de pago de un crédito del cliente, con montos ya calculados. */
265
+ getCustomerPaymentOptions(
266
+ directoryId: string,
267
+ creditId: string,
268
+ tenantId: string,
269
+ ): Promise<StandardResponse<LoanCustomerPaymentOptions>>;
270
+
271
+ /**
272
+ * Pide el cobro de una opción de pago (202). Misma `idempotencyKey` y mismo cuerpo devuelven la
273
+ * misma respuesta. 404 CREDIT_NOT_FOUND · 409 AD_HOC_CHARGE_PENDING · 409 CREDIT_NOT_CURRENT ·
274
+ * 409 CUSTOMER_PAYMENT_AMOUNT_CHANGED · 422 PAYMENT_OPTION_UNAVAILABLE · 422 IDEMPOTENCY_KEY_MISMATCH ·
275
+ * 5xx si el motor de cobro no contesta.
276
+ */
277
+ createCustomerPayment(
278
+ directoryId: string,
279
+ creditId: string,
280
+ tenantId: string,
281
+ body: CreateCustomerPaymentRequest,
282
+ ): Promise<StandardResponse<LoanCustomerPaymentResult>>;
258
283
  }