@fiado/api-invoker 5.88.0 → 5.90.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,7 +1,7 @@
1
1
  import { IBenefitsMarketplaceApi } from "./interfaces/IBenefitsMarketplaceApi.js";
2
- import { IHttpRequest } from "@fiado/http-client";
3
- import { BenefitPaymentRequest, BenefitPaymentResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
4
- import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
+ import type { IHttpRequest } from "@fiado/http-client";
3
+ import { BenefitPaymentRequest, BenefitPaymentResponse, BenefitSuiteResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
4
+ import { ApiGatewayResponse, StandardResponse } from "@fiado/gateway-adapter";
5
5
  import { RemittanceOnboardingPrefillRequest, RemittanceOnboardingPrefillResponse } from "@fiado/type-kit/bin/remittance/index.js";
6
6
  import { BenefitLeafDisplayResponse } from "./dtos/BenefitLeafDisplayResponse.js";
7
7
  import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
@@ -15,4 +15,5 @@ export default class BenefitsMarketplaceApi implements IBenefitsMarketplaceApi {
15
15
  fundingCreate(moduleName: string, request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
16
16
  fundingList(moduleName: string, directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
17
17
  remittanceOnboardingPrefill(request: RemittanceOnboardingPrefillRequest): Promise<ApiGatewayResponse<RemittanceOnboardingPrefillResponse>>;
18
+ getBenefitSuite(benefitId: string): Promise<StandardResponse<BenefitSuiteResponse>>;
18
19
  }
@@ -44,6 +44,11 @@ let BenefitsMarketplaceApi = class BenefitsMarketplaceApi {
44
44
  const url = `${this.baseUrl}/remittance/onboarding/prefill`;
45
45
  return await this.httpRequest.post(url, request);
46
46
  }
47
+ async getBenefitSuite(benefitId) {
48
+ // La URL de SSM termina en "/": se normaliza para no armar "//benefits".
49
+ const url = `${this.baseUrl.replace(/\/+$/, "")}/benefits/${encodeURIComponent(benefitId)}/suite`;
50
+ return await this.httpRequest.get(url);
51
+ }
47
52
  };
48
53
  BenefitsMarketplaceApi = __decorate([
49
54
  injectable(),
@@ -1,5 +1,5 @@
1
- import { BenefitPaymentRequest, BenefitPaymentResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
2
- import { ApiGatewayResponse } from "@fiado/gateway-adapter";
1
+ import { BenefitPaymentRequest, BenefitPaymentResponse, BenefitSuiteResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
2
+ import { ApiGatewayResponse, StandardResponse } from "@fiado/gateway-adapter";
3
3
  import { RemittanceOnboardingPrefillRequest, RemittanceOnboardingPrefillResponse } from "@fiado/type-kit/bin/remittance/index.js";
4
4
  import { BenefitLeafDisplayResponse } from "../dtos/BenefitLeafDisplayResponse.js";
5
5
  import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
@@ -79,4 +79,11 @@ export interface IBenefitsMarketplaceApi {
79
79
  * para el reintento de registro desde el backoffice.
80
80
  */
81
81
  remittanceOnboardingPrefill(request: RemittanceOnboardingPrefillRequest): Promise<ApiGatewayResponse<RemittanceOnboardingPrefillResponse>>;
82
+ /**
83
+ * Suite del beneficio: status, flow, tenant de FiadoLend/FiadoRetail, nombre e ícono (I1).
84
+ * Backend: GET /benefits/{benefitId}/suite (privado). No evalúa visibilidad.
85
+ * Errores: 404 BENEFIT_NOT_FOUND.
86
+ * @param benefitId id del beneficio en BenefitCatalog_GT
87
+ */
88
+ getBenefitSuite(benefitId: string): Promise<StandardResponse<BenefitSuiteResponse>>;
82
89
  }
@@ -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 } 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 } 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";
@@ -35,4 +35,14 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
35
35
  upsertBorrower(input: UpsertLoanBorrowerRequest, tenantId: string): Promise<StandardResponse<LoanBorrowerResponse>>;
36
36
  notifyLifecycleFact(creditId: string, input: CreditLifecycleFactRequest, tenantId: string): Promise<StandardResponse<CreditLifecycleFactResponse>>;
37
37
  listMessagingCandidates(input: ListMessagingCandidatesRequest, tenantId: string): Promise<StandardResponse<ListMessagingCandidatesResponse>>;
38
+ private customerCreditsUrl;
39
+ listCustomerCredits(directoryId: string, tenantId: string): Promise<StandardResponse<LoanBorrowerCreditItem[]>>;
40
+ getCustomerCredit(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditDetail>>;
41
+ listCustomerCreditInstallments(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanInstallmentResponse[]>>;
42
+ listCustomerCreditPayments(directoryId: string, creditId: string, tenantId: string, page?: {
43
+ limit?: number;
44
+ nextToken?: string;
45
+ }): Promise<StandardResponse<LoanPaymentListResponse>>;
46
+ listCustomerCreditContracts(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanContractResponse[]>>;
47
+ getCustomerCreditContractUrl(directoryId: string, creditId: string, contractId: string, tenantId: string): Promise<StandardResponse<LoanContractDownloadUrl>>;
38
48
  }
@@ -86,6 +86,34 @@ let LoanCreditBusinessApi = class LoanCreditBusinessApi {
86
86
  const url = `${this.baseUrl}/private/messaging/candidates?tenantId=${encodeURIComponent(tenantId)}`;
87
87
  return await this.httpRequest.post(url, input);
88
88
  }
89
+ // ─── I1 · Lecturas de cliente (retail-loan-connector) ───────────────────────
90
+ customerCreditsUrl(directoryId, creditId) {
91
+ const base = `${this.baseUrl}/private/customers/${encodeURIComponent(directoryId)}/credits`;
92
+ return creditId === undefined ? base : `${base}/${encodeURIComponent(creditId)}`;
93
+ }
94
+ async listCustomerCredits(directoryId, tenantId) {
95
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId)}?tenantId=${encodeURIComponent(tenantId)}`);
96
+ }
97
+ async getCustomerCredit(directoryId, creditId, tenantId) {
98
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}?tenantId=${encodeURIComponent(tenantId)}`);
99
+ }
100
+ async listCustomerCreditInstallments(directoryId, creditId, tenantId) {
101
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/installments?tenantId=${encodeURIComponent(tenantId)}`);
102
+ }
103
+ async listCustomerCreditPayments(directoryId, creditId, tenantId, page) {
104
+ const query = new URLSearchParams({ tenantId });
105
+ if (page?.limit !== undefined)
106
+ query.set("limit", String(page.limit));
107
+ if (page?.nextToken)
108
+ query.set("nextToken", page.nextToken);
109
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/payments?${query.toString()}`);
110
+ }
111
+ async listCustomerCreditContracts(directoryId, creditId, tenantId) {
112
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/contracts?tenantId=${encodeURIComponent(tenantId)}`);
113
+ }
114
+ async getCustomerCreditContractUrl(directoryId, creditId, contractId, tenantId) {
115
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/contracts/${encodeURIComponent(contractId)}/url?tenantId=${encodeURIComponent(tenantId)}`);
116
+ }
89
117
  };
90
118
  LoanCreditBusinessApi = __decorate([
91
119
  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 } 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 } 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";
@@ -116,4 +116,19 @@ export interface ILoanCreditBusinessApi {
116
116
  * recibió su aviso del día no vuelve a salir. `nextCursor` en `null` significa que ya no queda nadie.
117
117
  */
118
118
  listMessagingCandidates(input: ListMessagingCandidatesRequest, tenantId: string): Promise<StandardResponse<ListMessagingCandidatesResponse>>;
119
+ /** Créditos del cliente: los de todos sus acreditados en el tenant. `[]` si no tiene. */
120
+ listCustomerCredits(directoryId: string, tenantId: string): Promise<StandardResponse<LoanBorrowerCreditItem[]>>;
121
+ /** Detalle de un crédito del cliente. */
122
+ getCustomerCredit(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditDetail>>;
123
+ /** Calendario de cuotas de un crédito del cliente, en orden. */
124
+ listCustomerCreditInstallments(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanInstallmentResponse[]>>;
125
+ /** Historial de pagos con desglose; `nextToken` opaco de la página anterior. 400 INVALID_NEXT_TOKEN. */
126
+ listCustomerCreditPayments(directoryId: string, creditId: string, tenantId: string, page?: {
127
+ limit?: number;
128
+ nextToken?: string;
129
+ }): Promise<StandardResponse<LoanPaymentListResponse>>;
130
+ /** Contratos de un crédito del cliente. */
131
+ listCustomerCreditContracts(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanContractResponse[]>>;
132
+ /** URL prefirmada del PDF de un contrato. 404 CONTRACT_NOT_FOUND · 409 CONTRACT_PDF_NOT_READY. */
133
+ getCustomerCreditContractUrl(directoryId: string, creditId: string, contractId: string, tenantId: string): Promise<StandardResponse<LoanContractDownloadUrl>>;
119
134
  }
@@ -35,4 +35,5 @@ export default class OnboardingBusinessApi implements IOnboardingBusinessApi {
35
35
  directoryId: string;
36
36
  side: string;
37
37
  }): Promise<any>;
38
+ getSteps(directoryId: string): Promise<any>;
38
39
  }
@@ -117,6 +117,16 @@ let OnboardingBusinessApi = class OnboardingBusinessApi {
117
117
  const url = `${this.baseUrl}private/issuance-readiness/${params.directoryId}?side=${encodeURIComponent(params.side)}`;
118
118
  return await this.httpRequest.get(`${url}`);
119
119
  }
120
+ //**
121
+ // Function: getSteps
122
+ // Description: Pasos y estado de cuentas del onboarding de un directorio (motor por scope).
123
+ // Parameters: directoryId
124
+ // Return: { steps, accounts }
125
+ // **/
126
+ async getSteps(directoryId) {
127
+ const url = `${this.baseUrl}private/steps/${directoryId}`;
128
+ return await this.httpRequest.get(`${url}`);
129
+ }
120
130
  };
121
131
  OnboardingBusinessApi = __decorate([
122
132
  injectable(),
@@ -43,4 +43,9 @@ export interface IOnboardingBusinessApi {
43
43
  directoryId: string;
44
44
  side: string;
45
45
  }): Promise<any>;
46
+ /**
47
+ * Pasos y estado de cuentas del onboarding de un directorio: `{ steps, accounts }`, el mismo
48
+ * motor que `GET /steps` de la app. `accounts[].status === "OPEN"` dice qué lado ya abrió.
49
+ */
50
+ getSteps(directoryId: string): Promise<any>;
46
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.88.0",
3
+ "version": "5.90.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.441.0",
37
+ "@fiado/type-kit": "^3.458.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -1,8 +1,8 @@
1
1
  import {IBenefitsMarketplaceApi} from "./interfaces/IBenefitsMarketplaceApi.js";
2
2
  import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {BenefitPaymentRequest, BenefitPaymentResponse} from "@fiado/type-kit/bin/benefitCenter/index.js";
5
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
+ import type {IHttpRequest} from "@fiado/http-client";
4
+ import {BenefitPaymentRequest, BenefitPaymentResponse, BenefitSuiteResponse} from "@fiado/type-kit/bin/benefitCenter/index.js";
5
+ import {ApiGatewayResponse, StandardResponse} from "@fiado/gateway-adapter";
6
6
  import {RemittanceOnboardingPrefillRequest, RemittanceOnboardingPrefillResponse} from "@fiado/type-kit/bin/remittance/index.js";
7
7
  import {BenefitLeafDisplayResponse} from "./dtos/BenefitLeafDisplayResponse.js";
8
8
  import {
@@ -64,4 +64,10 @@ export default class BenefitsMarketplaceApi implements IBenefitsMarketplaceApi {
64
64
  const url = `${this.baseUrl}/remittance/onboarding/prefill`;
65
65
  return await this.httpRequest.post(url, request);
66
66
  }
67
+
68
+ async getBenefitSuite(benefitId: string): Promise<StandardResponse<BenefitSuiteResponse>> {
69
+ // La URL de SSM termina en "/": se normaliza para no armar "//benefits".
70
+ const url = `${this.baseUrl.replace(/\/+$/, "")}/benefits/${encodeURIComponent(benefitId)}/suite`;
71
+ return await this.httpRequest.get(url);
72
+ }
67
73
  }
@@ -1,5 +1,5 @@
1
- import {BenefitPaymentRequest, BenefitPaymentResponse} from "@fiado/type-kit/bin/benefitCenter/index.js";
2
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
1
+ import {BenefitPaymentRequest, BenefitPaymentResponse, BenefitSuiteResponse} from "@fiado/type-kit/bin/benefitCenter/index.js";
2
+ import {ApiGatewayResponse, StandardResponse} from "@fiado/gateway-adapter";
3
3
  import {RemittanceOnboardingPrefillRequest, RemittanceOnboardingPrefillResponse} from "@fiado/type-kit/bin/remittance/index.js";
4
4
  import {BenefitLeafDisplayResponse} from "../dtos/BenefitLeafDisplayResponse.js";
5
5
  import {
@@ -101,4 +101,12 @@ export interface IBenefitsMarketplaceApi {
101
101
  remittanceOnboardingPrefill(
102
102
  request: RemittanceOnboardingPrefillRequest,
103
103
  ): Promise<ApiGatewayResponse<RemittanceOnboardingPrefillResponse>>;
104
+
105
+ /**
106
+ * Suite del beneficio: status, flow, tenant de FiadoLend/FiadoRetail, nombre e ícono (I1).
107
+ * Backend: GET /benefits/{benefitId}/suite (privado). No evalúa visibilidad.
108
+ * Errores: 404 BENEFIT_NOT_FOUND.
109
+ * @param benefitId id del beneficio en BenefitCatalog_GT
110
+ */
111
+ getBenefitSuite(benefitId: string): Promise<StandardResponse<BenefitSuiteResponse>>;
104
112
  }
@@ -19,6 +19,12 @@ import {
19
19
  SignLoanCreditRequest,
20
20
  SignLoanCreditResponse,
21
21
  UpsertLoanBorrowerRequest,
22
+ LoanBorrowerCreditItem,
23
+ LoanContractDownloadUrl,
24
+ LoanContractResponse,
25
+ LoanCreditDetail,
26
+ LoanInstallmentResponse,
27
+ LoanPaymentListResponse,
22
28
  } from "@fiado/type-kit/bin/loanCredit/index.js";
23
29
  import {
24
30
  LoanCreditAnalyticsBatchRequest,
@@ -167,4 +173,69 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
167
173
  const url = `${this.baseUrl}/private/messaging/candidates?tenantId=${encodeURIComponent(tenantId)}`;
168
174
  return await this.httpRequest.post(url, input);
169
175
  }
176
+
177
+ // ─── I1 · Lecturas de cliente (retail-loan-connector) ───────────────────────
178
+
179
+ private customerCreditsUrl(directoryId: string, creditId?: string): string {
180
+ const base = `${this.baseUrl}/private/customers/${encodeURIComponent(directoryId)}/credits`;
181
+ return creditId === undefined ? base : `${base}/${encodeURIComponent(creditId)}`;
182
+ }
183
+
184
+ async listCustomerCredits(
185
+ directoryId: string,
186
+ tenantId: string,
187
+ ): Promise<StandardResponse<LoanBorrowerCreditItem[]>> {
188
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId)}?tenantId=${encodeURIComponent(tenantId)}`);
189
+ }
190
+
191
+ async getCustomerCredit(
192
+ directoryId: string,
193
+ creditId: string,
194
+ tenantId: string,
195
+ ): Promise<StandardResponse<LoanCreditDetail>> {
196
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}?tenantId=${encodeURIComponent(tenantId)}`);
197
+ }
198
+
199
+ async listCustomerCreditInstallments(
200
+ directoryId: string,
201
+ creditId: string,
202
+ tenantId: string,
203
+ ): Promise<StandardResponse<LoanInstallmentResponse[]>> {
204
+ return await this.httpRequest.get(
205
+ `${this.customerCreditsUrl(directoryId, creditId)}/installments?tenantId=${encodeURIComponent(tenantId)}`,
206
+ );
207
+ }
208
+
209
+ async listCustomerCreditPayments(
210
+ directoryId: string,
211
+ creditId: string,
212
+ tenantId: string,
213
+ page?: { limit?: number; nextToken?: string },
214
+ ): Promise<StandardResponse<LoanPaymentListResponse>> {
215
+ const query = new URLSearchParams({ tenantId });
216
+ if (page?.limit !== undefined) query.set("limit", String(page.limit));
217
+ if (page?.nextToken) query.set("nextToken", page.nextToken);
218
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/payments?${query.toString()}`);
219
+ }
220
+
221
+ async listCustomerCreditContracts(
222
+ directoryId: string,
223
+ creditId: string,
224
+ tenantId: string,
225
+ ): Promise<StandardResponse<LoanContractResponse[]>> {
226
+ return await this.httpRequest.get(
227
+ `${this.customerCreditsUrl(directoryId, creditId)}/contracts?tenantId=${encodeURIComponent(tenantId)}`,
228
+ );
229
+ }
230
+
231
+ async getCustomerCreditContractUrl(
232
+ directoryId: string,
233
+ creditId: string,
234
+ contractId: string,
235
+ tenantId: string,
236
+ ): Promise<StandardResponse<LoanContractDownloadUrl>> {
237
+ return await this.httpRequest.get(
238
+ `${this.customerCreditsUrl(directoryId, creditId)}/contracts/${encodeURIComponent(contractId)}/url?tenantId=${encodeURIComponent(tenantId)}`,
239
+ );
240
+ }
170
241
  }
@@ -17,6 +17,12 @@ import {
17
17
  SignLoanCreditRequest,
18
18
  SignLoanCreditResponse,
19
19
  UpsertLoanBorrowerRequest,
20
+ LoanBorrowerCreditItem,
21
+ LoanContractDownloadUrl,
22
+ LoanContractResponse,
23
+ LoanCreditDetail,
24
+ LoanInstallmentResponse,
25
+ LoanPaymentListResponse,
20
26
  } from "@fiado/type-kit/bin/loanCredit/index.js";
21
27
  import {
22
28
  LoanCreditAnalyticsBatchRequest,
@@ -202,4 +208,51 @@ export interface ILoanCreditBusinessApi {
202
208
  input: ListMessagingCandidatesRequest,
203
209
  tenantId: string,
204
210
  ): Promise<StandardResponse<ListMessagingCandidatesResponse>>;
211
+
212
+ // ─── I1 · Lecturas de cliente (retail-loan-connector) ───────────────────────
213
+ // `directoryId` siempre sale del token de la app; loan-credit aplica el control de dueño y
214
+ // responde 404 CREDIT_NOT_FOUND si el crédito no existe o no es del cliente.
215
+
216
+ /** Créditos del cliente: los de todos sus acreditados en el tenant. `[]` si no tiene. */
217
+ listCustomerCredits(
218
+ directoryId: string,
219
+ tenantId: string,
220
+ ): Promise<StandardResponse<LoanBorrowerCreditItem[]>>;
221
+
222
+ /** Detalle de un crédito del cliente. */
223
+ getCustomerCredit(
224
+ directoryId: string,
225
+ creditId: string,
226
+ tenantId: string,
227
+ ): Promise<StandardResponse<LoanCreditDetail>>;
228
+
229
+ /** Calendario de cuotas de un crédito del cliente, en orden. */
230
+ listCustomerCreditInstallments(
231
+ directoryId: string,
232
+ creditId: string,
233
+ tenantId: string,
234
+ ): Promise<StandardResponse<LoanInstallmentResponse[]>>;
235
+
236
+ /** Historial de pagos con desglose; `nextToken` opaco de la página anterior. 400 INVALID_NEXT_TOKEN. */
237
+ listCustomerCreditPayments(
238
+ directoryId: string,
239
+ creditId: string,
240
+ tenantId: string,
241
+ page?: { limit?: number; nextToken?: string },
242
+ ): Promise<StandardResponse<LoanPaymentListResponse>>;
243
+
244
+ /** Contratos de un crédito del cliente. */
245
+ listCustomerCreditContracts(
246
+ directoryId: string,
247
+ creditId: string,
248
+ tenantId: string,
249
+ ): Promise<StandardResponse<LoanContractResponse[]>>;
250
+
251
+ /** URL prefirmada del PDF de un contrato. 404 CONTRACT_NOT_FOUND · 409 CONTRACT_PDF_NOT_READY. */
252
+ getCustomerCreditContractUrl(
253
+ directoryId: string,
254
+ creditId: string,
255
+ contractId: string,
256
+ tenantId: string,
257
+ ): Promise<StandardResponse<LoanContractDownloadUrl>>;
205
258
  }
@@ -119,6 +119,17 @@ export default class OnboardingBusinessApi implements IOnboardingBusinessApi {
119
119
  return await this.httpRequest.get(`${url}`);
120
120
  }
121
121
 
122
+ //**
123
+ // Function: getSteps
124
+ // Description: Pasos y estado de cuentas del onboarding de un directorio (motor por scope).
125
+ // Parameters: directoryId
126
+ // Return: { steps, accounts }
127
+ // **/
128
+ async getSteps(directoryId: string): Promise<any> {
129
+ const url = `${this.baseUrl}private/steps/${directoryId}`;
130
+ return await this.httpRequest.get(`${url}`);
131
+ }
132
+
122
133
  }
123
134
 
124
135
 
@@ -26,4 +26,10 @@ export interface IOnboardingBusinessApi {
26
26
  * `side` es "MEX" o "USA".
27
27
  */
28
28
  issuanceReadiness(params: { directoryId: string; side: string }): Promise<any>
29
+
30
+ /**
31
+ * Pasos y estado de cuentas del onboarding de un directorio: `{ steps, accounts }`, el mismo
32
+ * motor que `GET /steps` de la app. `accounts[].status === "OPEN"` dice qué lado ya abrió.
33
+ */
34
+ getSteps(directoryId: string): Promise<any>
29
35
  }