@fiado/api-invoker 5.91.0 → 5.93.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.
@@ -75,6 +75,7 @@ import PeopleBusinessApi from "./people-business/api/PeopleBusinessApi.js";
75
75
  import PlacesBusinessApi from "./places-business/api/PlacesBusinessApi.js";
76
76
  import STPBusinessApi from "./stp-business/api/STPBusinessApi.js";
77
77
  import MulticommServicePaymentApi from "./multicommServicePayment/api/MulticommServicePaymentApi.js";
78
+ import MoneyTransferConnectorApi from "./moneyTransferConnector/api/MoneyTransferConnectorApi.js";
78
79
  import ProductPaymentApi from "./product-payment/api/ProductPaymentApi.js";
79
80
  import { CommissionBusinessApi } from "./commission-business/index.js";
80
81
  import { CirculoCreditoApi } from "./circuloCredito/index.js";
@@ -173,6 +174,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
173
174
  bind("IStpSpeiApi").to(StpSpeiApi);
174
175
  bind("IStpServicePaymentApi").to(StpServicePaymentApi);
175
176
  bind("IMulticommServicePaymentApi").to(MulticommServicePaymentApi);
177
+ bind("IMoneyTransferConnectorApi").to(MoneyTransferConnectorApi);
176
178
  bind("IBBVARstApi").to(BBVARstApi);
177
179
  bind("IFraudPreventionEngineApi").to(FraudPreventionEngineApi);
178
180
  bind("IGroupApi").to(GroupApi);
package/bin/index.d.ts CHANGED
@@ -67,6 +67,7 @@ export * from "./people-business/index.js";
67
67
  export * from "./places-business/index.js";
68
68
  export * from "./stp-business/index.js";
69
69
  export * from "./multicommServicePayment/index.js";
70
+ export * from "./moneyTransferConnector/index.js";
70
71
  export * from "./product-payment/index.js";
71
72
  export * from "./credit-engine/index.js";
72
73
  export * from "./credit-payment/index.js";
package/bin/index.js CHANGED
@@ -67,6 +67,7 @@ export * from "./people-business/index.js";
67
67
  export * from "./places-business/index.js";
68
68
  export * from "./stp-business/index.js";
69
69
  export * from "./multicommServicePayment/index.js";
70
+ export * from "./moneyTransferConnector/index.js";
70
71
  export * from "./product-payment/index.js";
71
72
  export * from "./credit-engine/index.js";
72
73
  export * from "./credit-payment/index.js";
@@ -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
  }
@@ -0,0 +1,21 @@
1
+ import { IMoneyTransferConnectorApi } from "./interfaces/IMoneyTransferConnectorApi.js";
2
+ import type { IHttpRequest } from "@fiado/http-client";
3
+ import { BenefitPaymentRequest, BenefitPaymentResponse, ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
4
+ import { ApiGatewayResponse } from "@fiado/gateway-adapter";
5
+ /**
6
+ * Cliente del money-transfer-connector (Centro de Beneficios — envíos de dinero / SPEI consolidado).
7
+ * Consumido por benefits-marketplace-business.
8
+ */
9
+ export default class MoneyTransferConnectorApi implements IMoneyTransferConnectorApi {
10
+ private httpRequest;
11
+ private readonly baseUrl;
12
+ constructor(httpRequest: IHttpRequest);
13
+ getStandardCatalog(params?: {
14
+ benefitId?: string;
15
+ includeDisabled?: boolean;
16
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
17
+ payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
18
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
19
+ createService(payload: Record<string, unknown>): Promise<ApiGatewayResponse<any>>;
20
+ updateService(idServicio: number, patch: Record<string, unknown>): Promise<ApiGatewayResponse<any>>;
21
+ }
@@ -0,0 +1,58 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { inject, injectable } from "inversify";
14
+ /**
15
+ * Cliente del money-transfer-connector (Centro de Beneficios — envíos de dinero / SPEI consolidado).
16
+ * Consumido por benefits-marketplace-business.
17
+ */
18
+ let MoneyTransferConnectorApi = class MoneyTransferConnectorApi {
19
+ httpRequest;
20
+ baseUrl = process.env.MONEY_TRANSFER_CONNECTOR_LAMBDA_URL || "";
21
+ constructor(httpRequest) {
22
+ this.httpRequest = httpRequest;
23
+ }
24
+ async getStandardCatalog(params) {
25
+ let url = `${this.baseUrl}/catalog/standard`;
26
+ if (params) {
27
+ const query = Object.keys(params)
28
+ .filter(key => params[key] !== undefined)
29
+ .map(key => `${key}=${encodeURIComponent(String(params[key]))}`)
30
+ .join('&');
31
+ if (query)
32
+ url += `?${query}`;
33
+ }
34
+ return await this.httpRequest.get(url);
35
+ }
36
+ async payStandard(request) {
37
+ const url = `${this.baseUrl}/pay/standard`;
38
+ return await this.httpRequest.post(url, request);
39
+ }
40
+ async consultStandard(transactionNumber) {
41
+ const url = `${this.baseUrl}/pay/standard/transactions/${encodeURIComponent(transactionNumber)}`;
42
+ return await this.httpRequest.get(url);
43
+ }
44
+ async createService(payload) {
45
+ const url = `${this.baseUrl}/internal/services`;
46
+ return await this.httpRequest.post(url, payload);
47
+ }
48
+ async updateService(idServicio, patch) {
49
+ const url = `${this.baseUrl}/internal/services/${idServicio}`;
50
+ return await this.httpRequest.put(url, patch);
51
+ }
52
+ };
53
+ MoneyTransferConnectorApi = __decorate([
54
+ injectable(),
55
+ __param(0, inject("IHttpRequest")),
56
+ __metadata("design:paramtypes", [Object])
57
+ ], MoneyTransferConnectorApi);
58
+ export default MoneyTransferConnectorApi;
@@ -0,0 +1,17 @@
1
+ import { BenefitPaymentRequest, BenefitPaymentResponse, ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
2
+ import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
+ /**
4
+ * Contrato del money-transfer-connector (Centro de Beneficios — envíos de dinero / SPEI consolidado).
5
+ * Mismo shape que los métodos "standard" de IMulticommServicePaymentApi para que el
6
+ * PaymentRouter / CatalogTreeBuilder de benefits-marketplace-business lo consuman sin adaptar.
7
+ */
8
+ export interface IMoneyTransferConnectorApi {
9
+ getStandardCatalog(params?: {
10
+ benefitId?: string;
11
+ includeDisabled?: boolean;
12
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
13
+ payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
14
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
15
+ createService(payload: Record<string, unknown>): Promise<ApiGatewayResponse<any>>;
16
+ updateService(idServicio: number, patch: Record<string, unknown>): Promise<ApiGatewayResponse<any>>;
17
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IMoneyTransferConnectorApi.js';
2
+ export * from './api/MoneyTransferConnectorApi.js';
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IMoneyTransferConnectorApi.js';
2
+ export * from './api/MoneyTransferConnectorApi.js';
@@ -1,5 +1,5 @@
1
- import { IStpSpeiApi } from "./interfaces/IStpSpeiApi.js";
2
- import { IHttpRequest } from "@fiado/http-client";
1
+ import { IStpSpeiApi, StpConsultOrderRequest } from "./interfaces/IStpSpeiApi.js";
2
+ import type { IHttpRequest } from "@fiado/http-client";
3
3
  import { BusinessNameEnum, PutStpOrderRequest } from "@fiado/type-kit/bin/stpSpei/index.js";
4
4
  export declare class StpSpeiApi implements IStpSpeiApi {
5
5
  private httpRequest;
@@ -7,4 +7,5 @@ export declare class StpSpeiApi implements IStpSpeiApi {
7
7
  constructor(httpRequest: IHttpRequest);
8
8
  putStpOrder(request: PutStpOrderRequest): Promise<any>;
9
9
  getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any>;
10
+ consultOrder(request: StpConsultOrderRequest): Promise<any>;
10
11
  }
@@ -36,6 +36,14 @@ let StpSpeiApi = class StpSpeiApi {
36
36
  };
37
37
  return await this.httpRequest.post(url, request, headers);
38
38
  }
39
+ async consultOrder(request) {
40
+ const url = `${this.baseUrl}`;
41
+ const headers = {
42
+ 'Content-Type': 'application/json',
43
+ operationName: "postOrdersConsult"
44
+ };
45
+ return await this.httpRequest.post(url, request, headers);
46
+ }
39
47
  };
40
48
  StpSpeiApi = __decorate([
41
49
  injectable(),
@@ -1,5 +1,12 @@
1
- import { BusinessNameEnum, PutStpOrderRequest } from "@fiado/type-kit/bin/stpSpei/index.js";
1
+ import { BusinessNameEnum, ConsultStpOrderRequest, PutStpOrderRequest } from "@fiado/type-kit/bin/stpSpei/index.js";
2
+ /** Alias de compatibilidad: el request de consulta vive en @fiado/type-kit (≥ 3.464.0). */
3
+ export type StpConsultOrderRequest = ConsultStpOrderRequest;
2
4
  export interface IStpSpeiApi {
3
5
  putStpOrder(request: PutStpOrderRequest): Promise<any>;
4
6
  getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any>;
7
+ /**
8
+ * Consulta una orden enviada por claveRastreo (fiado-stp-lambda `postOrdersConsult`).
9
+ * Agregado para money-transfer-connector (F5', DEC-027/037).
10
+ */
11
+ consultOrder(request: StpConsultOrderRequest): Promise<any>;
5
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.91.0",
3
+ "version": "5.93.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.464.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -113,6 +113,8 @@ import STPBusinessApi from "./stp-business/api/STPBusinessApi.js";
113
113
  import { ISTPBusinessApi } from "./stp-business/index.js";
114
114
  import { IMulticommServicePaymentApi } from "./multicommServicePayment/index.js";
115
115
  import MulticommServicePaymentApi from "./multicommServicePayment/api/MulticommServicePaymentApi.js";
116
+ import { IMoneyTransferConnectorApi } from "./moneyTransferConnector/index.js";
117
+ import MoneyTransferConnectorApi from "./moneyTransferConnector/api/MoneyTransferConnectorApi.js";
116
118
  import { IProductPaymentApi } from "./product-payment/index.js";
117
119
  import ProductPaymentApi from "./product-payment/api/ProductPaymentApi.js";
118
120
  import { CommissionBusinessApi, ICommissionBusinessApi } from "./commission-business/index.js";
@@ -245,6 +247,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
245
247
  bind<IStpSpeiApi>("IStpSpeiApi").to(StpSpeiApi);
246
248
  bind<IStpServicePaymentApi>("IStpServicePaymentApi").to(StpServicePaymentApi);
247
249
  bind<IMulticommServicePaymentApi>("IMulticommServicePaymentApi").to(MulticommServicePaymentApi);
250
+ bind<IMoneyTransferConnectorApi>("IMoneyTransferConnectorApi").to(MoneyTransferConnectorApi);
248
251
  bind<IBBVARstApi>("IBBVARstApi").to(BBVARstApi);
249
252
  bind<IFraudPreventionEngineApi>("IFraudPreventionEngineApi").to(FraudPreventionEngineApi);
250
253
  bind<IGroupApi>("IGroupApi").to(GroupApi);
package/src/index.ts CHANGED
@@ -67,6 +67,7 @@ export * from "./people-business/index.js";
67
67
  export * from "./places-business/index.js";
68
68
  export * from "./stp-business/index.js";
69
69
  export * from "./multicommServicePayment/index.js";
70
+ export * from "./moneyTransferConnector/index.js";
70
71
  export * from "./product-payment/index.js";
71
72
  export * from "./credit-engine/index.js";
72
73
  export * from "./credit-payment/index.js";
@@ -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
  }
@@ -0,0 +1,49 @@
1
+ import {IMoneyTransferConnectorApi} from "./interfaces/IMoneyTransferConnectorApi.js";
2
+ import {inject, injectable} from "inversify";
3
+ import type {IHttpRequest} from "@fiado/http-client";
4
+ import {BenefitPaymentRequest, BenefitPaymentResponse, ConnectorCatalogResponse} from "@fiado/type-kit/bin/benefitCenter/index.js";
5
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
6
+
7
+ /**
8
+ * Cliente del money-transfer-connector (Centro de Beneficios — envíos de dinero / SPEI consolidado).
9
+ * Consumido por benefits-marketplace-business.
10
+ */
11
+ @injectable()
12
+ export default class MoneyTransferConnectorApi implements IMoneyTransferConnectorApi {
13
+ private readonly baseUrl = process.env.MONEY_TRANSFER_CONNECTOR_LAMBDA_URL || "";
14
+
15
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
16
+ }
17
+
18
+ async getStandardCatalog(params?: { benefitId?: string; includeDisabled?: boolean }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>> {
19
+ let url = `${this.baseUrl}/catalog/standard`;
20
+ if (params) {
21
+ const query = Object.keys(params)
22
+ .filter(key => params[key as keyof typeof params] !== undefined)
23
+ .map(key => `${key}=${encodeURIComponent(String(params[key as keyof typeof params]))}`)
24
+ .join('&');
25
+ if (query) url += `?${query}`;
26
+ }
27
+ return await this.httpRequest.get(url);
28
+ }
29
+
30
+ async payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>> {
31
+ const url = `${this.baseUrl}/pay/standard`;
32
+ return await this.httpRequest.post(url, request);
33
+ }
34
+
35
+ async consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>> {
36
+ const url = `${this.baseUrl}/pay/standard/transactions/${encodeURIComponent(transactionNumber)}`;
37
+ return await this.httpRequest.get(url);
38
+ }
39
+
40
+ async createService(payload: Record<string, unknown>): Promise<ApiGatewayResponse<any>> {
41
+ const url = `${this.baseUrl}/internal/services`;
42
+ return await this.httpRequest.post(url, payload);
43
+ }
44
+
45
+ async updateService(idServicio: number, patch: Record<string, unknown>): Promise<ApiGatewayResponse<any>> {
46
+ const url = `${this.baseUrl}/internal/services/${idServicio}`;
47
+ return await this.httpRequest.put(url, patch);
48
+ }
49
+ }
@@ -0,0 +1,24 @@
1
+ import {BenefitPaymentRequest, BenefitPaymentResponse, ConnectorCatalogResponse} from "@fiado/type-kit/bin/benefitCenter/index.js";
2
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
+
4
+ /**
5
+ * Contrato del money-transfer-connector (Centro de Beneficios — envíos de dinero / SPEI consolidado).
6
+ * Mismo shape que los métodos "standard" de IMulticommServicePaymentApi para que el
7
+ * PaymentRouter / CatalogTreeBuilder de benefits-marketplace-business lo consuman sin adaptar.
8
+ */
9
+ export interface IMoneyTransferConnectorApi {
10
+ // GET /catalog/standard — catálogo estandarizado del conector.
11
+ getStandardCatalog(params?: { benefitId?: string; includeDisabled?: boolean }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
12
+
13
+ // POST /pay/standard — pago con DTO estandarizado.
14
+ payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
15
+
16
+ // GET /pay/standard/transactions/{transactionNumber} — estado actual mapeado a BenefitPaymentResponse.
17
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
18
+
19
+ // POST /internal/services — alta manual de un servicio (admin-leaves).
20
+ createService(payload: Record<string, unknown>): Promise<ApiGatewayResponse<any>>;
21
+
22
+ // PUT /internal/services/{idServicio} — edición editorial in-place (admin-leaves).
23
+ updateService(idServicio: number, patch: Record<string, unknown>): Promise<ApiGatewayResponse<any>>;
24
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IMoneyTransferConnectorApi.js';
2
+ export * from './api/MoneyTransferConnectorApi.js';
@@ -1,6 +1,6 @@
1
- import {IStpSpeiApi} from "./interfaces/IStpSpeiApi.js";
1
+ import {IStpSpeiApi, StpConsultOrderRequest} from "./interfaces/IStpSpeiApi.js";
2
2
  import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
3
+ import type {IHttpRequest} from "@fiado/http-client";
4
4
  import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei/index.js";
5
5
 
6
6
  @injectable()
@@ -30,4 +30,13 @@ export class StpSpeiApi implements IStpSpeiApi {
30
30
  }
31
31
  return await this.httpRequest.post(url, request, headers);
32
32
  }
33
+
34
+ async consultOrder(request: StpConsultOrderRequest): Promise<any> {
35
+ const url = `${this.baseUrl}`;
36
+ const headers = {
37
+ 'Content-Type': 'application/json',
38
+ operationName: "postOrdersConsult"
39
+ }
40
+ return await this.httpRequest.post(url, request, headers);
41
+ }
33
42
  }
@@ -1,7 +1,16 @@
1
- import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei/index.js";
1
+ import {BusinessNameEnum, ConsultStpOrderRequest, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei/index.js";
2
+
3
+ /** Alias de compatibilidad: el request de consulta vive en @fiado/type-kit (≥ 3.464.0). */
4
+ export type StpConsultOrderRequest = ConsultStpOrderRequest;
2
5
 
3
6
  export interface IStpSpeiApi {
4
7
  putStpOrder(request: PutStpOrderRequest): Promise<any>;
5
8
 
6
9
  getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any>;
10
+
11
+ /**
12
+ * Consulta una orden enviada por claveRastreo (fiado-stp-lambda `postOrdersConsult`).
13
+ * Agregado para money-transfer-connector (F5', DEC-027/037).
14
+ */
15
+ consultOrder(request: StpConsultOrderRequest): Promise<any>;
7
16
  }