@fiado/api-invoker 5.3.0 → 5.4.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.
@@ -22,6 +22,7 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
22
22
  quote(creditId: string, input: QuoteLoanCreditRequest, tenantId: string): Promise<StandardResponse<QuoteLoanCreditResponse>>;
23
23
  sign(creditId: string, input: SignLoanCreditRequest, tenantId: string): Promise<StandardResponse<SignLoanCreditResponse>>;
24
24
  activateCheck(creditId: string, input: ActivationCheckRequest, tenantId: string): Promise<StandardResponse<ActivationCheckResponse>>;
25
+ discard(creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditResponse>>;
25
26
  getCredit(creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditResponse>>;
26
27
  getBorrowerByRetailCustomer(retailCustomerId: string, tenantId: string): Promise<StandardResponse<LoanBorrowerResponse>>;
27
28
  upsertBorrower(input: UpsertLoanBorrowerRequest, tenantId: string): Promise<StandardResponse<LoanBorrowerResponse>>;
@@ -46,6 +46,10 @@ let LoanCreditBusinessApi = class LoanCreditBusinessApi {
46
46
  const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/activate-check?tenantId=${encodeURIComponent(tenantId)}`;
47
47
  return await this.httpRequest.post(url, input);
48
48
  }
49
+ async discard(creditId, tenantId) {
50
+ const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/discard?tenantId=${encodeURIComponent(tenantId)}`;
51
+ return await this.httpRequest.post(url, {});
52
+ }
49
53
  async getCredit(creditId, tenantId) {
50
54
  const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}?tenantId=${encodeURIComponent(tenantId)}`;
51
55
  return await this.httpRequest.get(url);
@@ -42,6 +42,13 @@ export interface ILoanCreditBusinessApi {
42
42
  * el crédito pasa a `ACTIVE` (vencimientos +7d, ventana de cancelación 7d).
43
43
  */
44
44
  activateCheck(creditId: string, input: ActivationCheckRequest, tenantId: string): Promise<StandardResponse<ActivationCheckResponse>>;
45
+ /**
46
+ * Descarta un crédito PENDING_ACTIVATION → DISCARDED (compensación del wizard al cancelar la
47
+ * venta — sin esto el crédito huérfano bloquea al cliente vía un-crédito-vivo). Idempotente.
48
+ * `400 CREDIT_NOT_PENDING` si el crédito ya avanzó (ACTIVE/IN_ARREARS jamás se descartan) ·
49
+ * `404 CREDIT_NOT_FOUND`.
50
+ */
51
+ discard(creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditResponse>>;
45
52
  /** Estado completo del crédito (checklist, status, términos). */
46
53
  getCredit(creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditResponse>>;
47
54
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.3.0",
3
+ "version": "5.4.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",
@@ -70,6 +70,14 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
70
70
  return await this.httpRequest.post(url, input);
71
71
  }
72
72
 
73
+ async discard(
74
+ creditId: string,
75
+ tenantId: string,
76
+ ): Promise<StandardResponse<LoanCreditResponse>> {
77
+ const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/discard?tenantId=${encodeURIComponent(tenantId)}`;
78
+ return await this.httpRequest.post(url, {});
79
+ }
80
+
73
81
  async getCredit(
74
82
  creditId: string,
75
83
  tenantId: string,
@@ -74,6 +74,17 @@ export interface ILoanCreditBusinessApi {
74
74
  tenantId: string,
75
75
  ): Promise<StandardResponse<ActivationCheckResponse>>;
76
76
 
77
+ /**
78
+ * Descarta un crédito PENDING_ACTIVATION → DISCARDED (compensación del wizard al cancelar la
79
+ * venta — sin esto el crédito huérfano bloquea al cliente vía un-crédito-vivo). Idempotente.
80
+ * `400 CREDIT_NOT_PENDING` si el crédito ya avanzó (ACTIVE/IN_ARREARS jamás se descartan) ·
81
+ * `404 CREDIT_NOT_FOUND`.
82
+ */
83
+ discard(
84
+ creditId: string,
85
+ tenantId: string,
86
+ ): Promise<StandardResponse<LoanCreditResponse>>;
87
+
77
88
  /** Estado completo del crédito (checklist, status, términos). */
78
89
  getCredit(
79
90
  creditId: string,