@fiado/api-invoker 4.52.0 → 4.54.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.
- package/bin/container.config.js +9 -0
- package/bin/equality-connector/api/EqualityConnectorApi.d.ts +2 -1
- package/bin/equality-connector/api/EqualityConnectorApi.js +4 -0
- package/bin/equality-connector/api/interfaces/IEqualityConnectorApi.d.ts +7 -1
- package/bin/index.d.ts +2 -0
- package/bin/index.js +2 -0
- package/bin/remittance-business/api/RemittanceBusinessApi.d.ts +10 -0
- package/bin/remittance-business/api/RemittanceBusinessApi.js +30 -0
- package/bin/remittance-business/api/interfaces/IRemittanceBusinessApi.d.ts +5 -0
- package/bin/remittance-business/api/interfaces/IRemittanceBusinessApi.js +1 -0
- package/bin/remittance-business/index.d.ts +2 -0
- package/bin/remittance-business/index.js +2 -0
- package/bin/uniteller-connector/api/UnitellerConnectorApi.d.ts +2 -1
- package/bin/uniteller-connector/api/UnitellerConnectorApi.js +4 -0
- package/bin/uniteller-connector/api/interfaces/IUnitellerConnectorApi.d.ts +3 -1
- package/bin/wallet-funding-rules/api/WalletFundingRulesApi.d.ts +12 -0
- package/bin/wallet-funding-rules/api/WalletFundingRulesApi.js +38 -0
- package/bin/wallet-funding-rules/api/interfaces/IWalletFundingRulesApi.d.ts +23 -0
- package/bin/wallet-funding-rules/api/interfaces/IWalletFundingRulesApi.js +1 -0
- package/bin/wallet-funding-rules/index.d.ts +2 -0
- package/bin/wallet-funding-rules/index.js +2 -0
- package/package.json +2 -2
- package/src/container.config.ts +11 -0
- package/src/equality-connector/api/EqualityConnectorApi.ts +9 -0
- package/src/equality-connector/api/interfaces/IEqualityConnectorApi.ts +11 -0
- package/src/index.ts +2 -0
- package/src/remittance-business/api/RemittanceBusinessApi.ts +17 -0
- package/src/remittance-business/api/interfaces/IRemittanceBusinessApi.ts +6 -0
- package/src/remittance-business/index.ts +2 -0
- package/src/uniteller-connector/api/UnitellerConnectorApi.ts +7 -0
- package/src/uniteller-connector/api/interfaces/IUnitellerConnectorApi.ts +4 -0
- package/src/wallet-funding-rules/api/WalletFundingRulesApi.ts +37 -0
- package/src/wallet-funding-rules/api/interfaces/IWalletFundingRulesApi.ts +36 -0
- package/src/wallet-funding-rules/index.ts +2 -0
package/bin/container.config.js
CHANGED
|
@@ -110,8 +110,12 @@ import { EqualityConnectorApi } from "./equality-connector/index.js";
|
|
|
110
110
|
import { ContactsBusinessApi } from "./contacts-business/index.js";
|
|
111
111
|
// Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
|
|
112
112
|
import { WalletFundingSettlementApi } from "./walletFundingSettlement/index.js";
|
|
113
|
+
// Wallet funding rules — validaciones de riesgo Cash In (cap agregado, exposición, breaker, LFPIORPI)
|
|
114
|
+
import { WalletFundingRulesApi } from "./wallet-funding-rules/index.js";
|
|
113
115
|
// SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
|
|
114
116
|
import { SnsSesConnectorApi } from "./sns-ses-connector/index.js";
|
|
117
|
+
// Remittance business — pricingResolve (Dashboard Ops Fase B, puente de resolución de precio en send-time)
|
|
118
|
+
import { RemittanceBusinessApi } from "./remittance-business/index.js";
|
|
115
119
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
116
120
|
// UTILS bindings
|
|
117
121
|
bind("InvokerUtils").to(InvokerUtils);
|
|
@@ -234,6 +238,11 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
234
238
|
// Wallet funding settlement — TransactWriteItems atómico del money path cash-in
|
|
235
239
|
// (consumido por equality-connector post processor.walletFundingValidate). Ver spec 15.
|
|
236
240
|
bind("IWalletFundingSettlementApi").to(WalletFundingSettlementApi);
|
|
241
|
+
// Wallet funding rules — cap agregado + exposición + circuit breaker + LFPIORPI (provider-agnostic).
|
|
242
|
+
// Lo consume transaction-processor en walletFundingValidate y db-conciliacion al liberar exposición.
|
|
243
|
+
bind("IWalletFundingRulesApi").to(WalletFundingRulesApi);
|
|
237
244
|
// SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
|
|
238
245
|
bind("ISnsSesConnectorApi").to(SnsSesConnectorApi);
|
|
246
|
+
// Remittance business — pricingResolve (Dashboard Ops Fase B, puente de resolución de precio en send-time)
|
|
247
|
+
bind("IRemittanceBusinessApi").to(RemittanceBusinessApi);
|
|
239
248
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
3
|
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
4
|
-
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
4
|
+
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse, ApplyWalletFundingRequest, ApplyWalletFundingResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
5
5
|
import { IEqualityConnectorApi } from "./interfaces/IEqualityConnectorApi.js";
|
|
6
6
|
export default class EqualityConnectorApi implements IEqualityConnectorApi {
|
|
7
7
|
private httpRequest;
|
|
@@ -13,4 +13,5 @@ export default class EqualityConnectorApi implements IEqualityConnectorApi {
|
|
|
13
13
|
benefitId: string;
|
|
14
14
|
includeDisabled?: boolean;
|
|
15
15
|
}): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
16
|
+
applyFunding(request: ApplyWalletFundingRequest): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
|
|
16
17
|
}
|
|
@@ -35,6 +35,10 @@ let EqualityConnectorApi = class EqualityConnectorApi {
|
|
|
35
35
|
const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
|
|
36
36
|
return await this.httpRequest.get(url);
|
|
37
37
|
}
|
|
38
|
+
async applyFunding(request) {
|
|
39
|
+
const url = `${this.baseUrl}/funding/apply`;
|
|
40
|
+
return await this.httpRequest.post(url, request);
|
|
41
|
+
}
|
|
38
42
|
};
|
|
39
43
|
EqualityConnectorApi = __decorate([
|
|
40
44
|
injectable(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
3
|
-
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
3
|
+
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse, ApplyWalletFundingRequest, ApplyWalletFundingResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Cliente del marketplace hacia equality-connector (privado, dentro de la VPC).
|
|
6
6
|
*
|
|
@@ -33,4 +33,10 @@ export interface IEqualityConnectorApi {
|
|
|
33
33
|
benefitId: string;
|
|
34
34
|
includeDisabled?: boolean;
|
|
35
35
|
}): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Dispara el acreditamiento diferido de un pago ya verificado (POST /funding/apply).
|
|
38
|
+
* Lo invoca `db-conciliacion` cuando la verificación autoritativa contra el portal
|
|
39
|
+
* resuelve: APPROVED → acredita (processor.credit → settle); REJECTED → revierte.
|
|
40
|
+
*/
|
|
41
|
+
applyFunding(request: ApplyWalletFundingRequest): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
|
|
36
42
|
}
|
package/bin/index.d.ts
CHANGED
|
@@ -82,4 +82,6 @@ export * from "./equality-connector/index.js";
|
|
|
82
82
|
export * from "./contacts-business/index.js";
|
|
83
83
|
export * from "./uniteller-connector/index.js";
|
|
84
84
|
export * from "./walletFundingSettlement/index.js";
|
|
85
|
+
export * from "./wallet-funding-rules/index.js";
|
|
85
86
|
export * from "./sns-ses-connector/index.js";
|
|
87
|
+
export * from "./remittance-business/index.js";
|
package/bin/index.js
CHANGED
|
@@ -82,4 +82,6 @@ export * from "./equality-connector/index.js";
|
|
|
82
82
|
export * from "./contacts-business/index.js";
|
|
83
83
|
export * from "./uniteller-connector/index.js";
|
|
84
84
|
export * from "./walletFundingSettlement/index.js";
|
|
85
|
+
export * from "./wallet-funding-rules/index.js";
|
|
85
86
|
export * from "./sns-ses-connector/index.js";
|
|
87
|
+
export * from "./remittance-business/index.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { PricingResolveRequest, PricingResolveResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
4
|
+
import { IRemittanceBusinessApi } from "./interfaces/IRemittanceBusinessApi.js";
|
|
5
|
+
export default class RemittanceBusinessApi implements IRemittanceBusinessApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
pricingResolve(request: PricingResolveRequest): Promise<ApiGatewayResponse<PricingResolveResponse>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
let RemittanceBusinessApi = class RemittanceBusinessApi {
|
|
15
|
+
httpRequest;
|
|
16
|
+
baseUrl = process.env.REMITTANCE_BUSINESS_LAMBDA_URL || "";
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
}
|
|
20
|
+
async pricingResolve(request) {
|
|
21
|
+
const url = `${this.baseUrl}/private/pricing/resolve`;
|
|
22
|
+
return await this.httpRequest.post(url, request);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
RemittanceBusinessApi = __decorate([
|
|
26
|
+
injectable(),
|
|
27
|
+
__param(0, inject("IHttpRequest")),
|
|
28
|
+
__metadata("design:paramtypes", [Object])
|
|
29
|
+
], RemittanceBusinessApi);
|
|
30
|
+
export default RemittanceBusinessApi;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { PricingResolveRequest, PricingResolveResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
3
|
+
export interface IRemittanceBusinessApi {
|
|
4
|
+
pricingResolve(request: PricingResolveRequest): Promise<ApiGatewayResponse<PricingResolveResponse>>;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
3
|
import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
4
|
-
import { CohortCountRequest, CohortCountResponse, PricingMetricsRequest, PricingMetricsResponse, PromotionReachRequest, PromotionReachResponse, SegmentMetricsRequest, SegmentMetricsResponse, WholesaleRateRequest, WholesaleRateResponse, KycUserDetail, KycUsersListResponse, RefreshUserProfileResponse, RemittanceAddBeneficiaryRequest, RemittanceBackofficeDashboardSummary, RemittanceBackofficeStats, RemittanceBackofficeStatsPeriod, RemittanceBackofficeTransaction, RemittanceBackofficeTxListResponse, RemittanceBackofficeUserDetail, RemittanceBackofficeUserListResponse, RemittanceBeneficiary, RemittanceCancelRequest, RemittanceCancelResponse, RemittanceHomeResponse, RemittanceListBeneficiariesResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittancePayRequest, RemittancePayResponse, RemittancePayerAdditionalFieldDto, RemittancePayerBranchDto, RemittancePayerDto, RemittanceQuoteRequest, RemittanceQuoteResponse, RemittanceSecurityQuestionsResponse, RemittanceSendPreviewRequest, RemittanceSendPreviewResponse, RemittanceSmsRequest, RemittanceStateDto, RemittanceTransactionDetail, RemittanceTransactionReceipt, RemittanceTransactionsListRequest, RemittanceTransactionsListResponse, RemittanceUpdateBeneficiaryRequest, RemittanceUserLimits, RemittanceUserLimitsBatchResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
4
|
+
import { CohortCountRequest, CohortCountResponse, CohortUserMatchRequest, CohortUserMatchResponse, PricingMetricsRequest, PricingMetricsResponse, PromotionReachRequest, PromotionReachResponse, SegmentMetricsRequest, SegmentMetricsResponse, WholesaleRateRequest, WholesaleRateResponse, KycUserDetail, KycUsersListResponse, RefreshUserProfileResponse, RemittanceAddBeneficiaryRequest, RemittanceBackofficeDashboardSummary, RemittanceBackofficeStats, RemittanceBackofficeStatsPeriod, RemittanceBackofficeTransaction, RemittanceBackofficeTxListResponse, RemittanceBackofficeUserDetail, RemittanceBackofficeUserListResponse, RemittanceBeneficiary, RemittanceCancelRequest, RemittanceCancelResponse, RemittanceHomeResponse, RemittanceListBeneficiariesResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittancePayRequest, RemittancePayResponse, RemittancePayerAdditionalFieldDto, RemittancePayerBranchDto, RemittancePayerDto, RemittanceQuoteRequest, RemittanceQuoteResponse, RemittanceSecurityQuestionsResponse, RemittanceSendPreviewRequest, RemittanceSendPreviewResponse, RemittanceSmsRequest, RemittanceStateDto, RemittanceTransactionDetail, RemittanceTransactionReceipt, RemittanceTransactionsListRequest, RemittanceTransactionsListResponse, RemittanceUpdateBeneficiaryRequest, RemittanceUserLimits, RemittanceUserLimitsBatchResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
5
5
|
import { IUnitellerConnectorApi } from "./interfaces/IUnitellerConnectorApi.js";
|
|
6
6
|
export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
7
7
|
private httpRequest;
|
|
@@ -76,6 +76,7 @@ export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
|
76
76
|
kycUserDetail(directoryId: string): Promise<ApiGatewayResponse<KycUserDetail>>;
|
|
77
77
|
kycRefreshUser(directoryId: string): Promise<ApiGatewayResponse<RefreshUserProfileResponse>>;
|
|
78
78
|
cohortCount(request: CohortCountRequest): Promise<ApiGatewayResponse<CohortCountResponse>>;
|
|
79
|
+
cohortUserMatch(request: CohortUserMatchRequest): Promise<ApiGatewayResponse<CohortUserMatchResponse>>;
|
|
79
80
|
segmentMetrics(request: SegmentMetricsRequest): Promise<ApiGatewayResponse<SegmentMetricsResponse>>;
|
|
80
81
|
wholesaleRate(request: WholesaleRateRequest): Promise<ApiGatewayResponse<WholesaleRateResponse>>;
|
|
81
82
|
pricingMetrics(request: PricingMetricsRequest): Promise<ApiGatewayResponse<PricingMetricsResponse>>;
|
|
@@ -165,6 +165,10 @@ let UnitellerConnectorApi = class UnitellerConnectorApi {
|
|
|
165
165
|
const url = `${this.baseUrl}/backoffice/config/cohorts/count`;
|
|
166
166
|
return await this.httpRequest.post(url, request);
|
|
167
167
|
}
|
|
168
|
+
async cohortUserMatch(request) {
|
|
169
|
+
const url = `${this.baseUrl}/backoffice/config/cohorts/user-match`;
|
|
170
|
+
return await this.httpRequest.post(url, request);
|
|
171
|
+
}
|
|
168
172
|
async segmentMetrics(request) {
|
|
169
173
|
const url = `${this.baseUrl}/backoffice/config/segments/metrics`;
|
|
170
174
|
return await this.httpRequest.post(url, request);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
3
|
-
import { CohortCountRequest, CohortCountResponse, PricingMetricsRequest, PricingMetricsResponse, PromotionReachRequest, PromotionReachResponse, SegmentMetricsRequest, SegmentMetricsResponse, WholesaleRateRequest, WholesaleRateResponse, KycUserDetail, KycUsersListResponse, RefreshUserProfileResponse, RemittanceAddBeneficiaryRequest, RemittanceBackofficeDashboardSummary, RemittanceBackofficeStats, RemittanceBackofficeStatsPeriod, RemittanceBackofficeTransaction, RemittanceBackofficeTxListResponse, RemittanceBackofficeUserDetail, RemittanceBackofficeUserListResponse, RemittanceBeneficiary, RemittanceCancelRequest, RemittanceCancelResponse, RemittanceHomeResponse, RemittanceListBeneficiariesResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittancePayRequest, RemittancePayResponse, RemittancePayerAdditionalFieldDto, RemittancePayerBranchDto, RemittancePayerDto, RemittanceQuoteRequest, RemittanceQuoteResponse, RemittanceSecurityQuestionsResponse, RemittanceSendPreviewRequest, RemittanceSendPreviewResponse, RemittanceSmsRequest, RemittanceStateDto, RemittanceTransactionDetail, RemittanceTransactionReceipt, RemittanceTransactionsListRequest, RemittanceTransactionsListResponse, RemittanceUpdateBeneficiaryRequest, RemittanceUserLimits, RemittanceUserLimitsBatchResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
3
|
+
import { CohortCountRequest, CohortCountResponse, CohortUserMatchRequest, CohortUserMatchResponse, PricingMetricsRequest, PricingMetricsResponse, PromotionReachRequest, PromotionReachResponse, SegmentMetricsRequest, SegmentMetricsResponse, WholesaleRateRequest, WholesaleRateResponse, KycUserDetail, KycUsersListResponse, RefreshUserProfileResponse, RemittanceAddBeneficiaryRequest, RemittanceBackofficeDashboardSummary, RemittanceBackofficeStats, RemittanceBackofficeStatsPeriod, RemittanceBackofficeTransaction, RemittanceBackofficeTxListResponse, RemittanceBackofficeUserDetail, RemittanceBackofficeUserListResponse, RemittanceBeneficiary, RemittanceCancelRequest, RemittanceCancelResponse, RemittanceHomeResponse, RemittanceListBeneficiariesResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittancePayRequest, RemittancePayResponse, RemittancePayerAdditionalFieldDto, RemittancePayerBranchDto, RemittancePayerDto, RemittanceQuoteRequest, RemittanceQuoteResponse, RemittanceSecurityQuestionsResponse, RemittanceSendPreviewRequest, RemittanceSendPreviewResponse, RemittanceSmsRequest, RemittanceStateDto, RemittanceTransactionDetail, RemittanceTransactionReceipt, RemittanceTransactionsListRequest, RemittanceTransactionsListResponse, RemittanceUpdateBeneficiaryRequest, RemittanceUserLimits, RemittanceUserLimitsBatchResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
4
4
|
export interface IUnitellerConnectorApi {
|
|
5
5
|
/** Estado del módulo remesas para un directoryId. */
|
|
6
6
|
getHome(directoryId: string): Promise<ApiGatewayResponse<RemittanceHomeResponse>>;
|
|
@@ -125,6 +125,8 @@ export interface IUnitellerConnectorApi {
|
|
|
125
125
|
kycRefreshUser(directoryId: string): Promise<ApiGatewayResponse<RefreshUserProfileResponse>>;
|
|
126
126
|
/** Cuenta usuarios que cumplen las condiciones (AND) + universo total. Lo consume remittance-business al recalcular un cohort. */
|
|
127
127
|
cohortCount(request: CohortCountRequest): Promise<ApiGatewayResponse<CohortCountResponse>>;
|
|
128
|
+
/** Determina si un usuario puntual matchea las condiciones (AND) de un cohort. Lo consume remittance-business. */
|
|
129
|
+
cohortUserMatch(request: CohortUserMatchRequest): Promise<ApiGatewayResponse<CohortUserMatchResponse>>;
|
|
128
130
|
/** {clientCount, volMonthUSD} para el subconjunto de RemittanceUsers del segmento (mes calendario, sin canceladas). */
|
|
129
131
|
segmentMetrics(request: SegmentMetricsRequest): Promise<ApiGatewayResponse<SegmentMetricsResponse>>;
|
|
130
132
|
/** Wholesale vivo (ExternalQuickQuotes) del corredor — Simulador de Precio Base. */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { ReserveExposureRequest, ReserveExposureResponse, ReleaseExposureRequest, ReleaseExposureResponse, GetExposureStateResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
4
|
+
import { IWalletFundingRulesApi } from "./interfaces/IWalletFundingRulesApi.js";
|
|
5
|
+
export default class WalletFundingRulesApi implements IWalletFundingRulesApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
reserveExposure(request: ReserveExposureRequest): Promise<ApiGatewayResponse<ReserveExposureResponse>>;
|
|
10
|
+
releaseExposure(request: ReleaseExposureRequest): Promise<ApiGatewayResponse<ReleaseExposureResponse>>;
|
|
11
|
+
getExposureState(): Promise<ApiGatewayResponse<GetExposureStateResponse>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
let WalletFundingRulesApi = class WalletFundingRulesApi {
|
|
15
|
+
httpRequest;
|
|
16
|
+
baseUrl = process.env.WALLET_FUNDING_RULES_LAMBDA_URL || "";
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
}
|
|
20
|
+
async reserveExposure(request) {
|
|
21
|
+
const url = `${this.baseUrl}/reserve`;
|
|
22
|
+
return await this.httpRequest.post(url, request);
|
|
23
|
+
}
|
|
24
|
+
async releaseExposure(request) {
|
|
25
|
+
const url = `${this.baseUrl}/release`;
|
|
26
|
+
return await this.httpRequest.post(url, request);
|
|
27
|
+
}
|
|
28
|
+
async getExposureState() {
|
|
29
|
+
const url = `${this.baseUrl}/state`;
|
|
30
|
+
return await this.httpRequest.get(url);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
WalletFundingRulesApi = __decorate([
|
|
34
|
+
injectable(),
|
|
35
|
+
__param(0, inject("IHttpRequest")),
|
|
36
|
+
__metadata("design:paramtypes", [Object])
|
|
37
|
+
], WalletFundingRulesApi);
|
|
38
|
+
export default WalletFundingRulesApi;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { ReserveExposureRequest, ReserveExposureResponse, ReleaseExposureRequest, ReleaseExposureResponse, GetExposureStateResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Cliente hacia `wallet-funding-rules-business` (lambda privado VPC).
|
|
5
|
+
*
|
|
6
|
+
* Dueño de las validaciones de riesgo del tipo Cash In: cap agregado FSA,
|
|
7
|
+
* exposición, circuit breaker y LFPIORPI. Provider-agnostic — lo consume el
|
|
8
|
+
* `transaction-processor` en `walletFundingValidate` (cap gate) y la
|
|
9
|
+
* conciliación (`db-conciliacion`) al liberar exposición.
|
|
10
|
+
*
|
|
11
|
+
* Endpoints backend en wallet-funding-rules:
|
|
12
|
+
* - POST /reserve (privado VPC) — reserva atómica single-region
|
|
13
|
+
* - POST /release (privado VPC)
|
|
14
|
+
* - GET /state (privado VPC)
|
|
15
|
+
*/
|
|
16
|
+
export interface IWalletFundingRulesApi {
|
|
17
|
+
/** Reserva monto contra la exposición agregada (cap gate). Atómico single-region. */
|
|
18
|
+
reserveExposure(request: ReserveExposureRequest): Promise<ApiGatewayResponse<ReserveExposureResponse>>;
|
|
19
|
+
/** Libera monto de la exposición agregada (liquidación / rechazo). Puede reactivar el servicio. */
|
|
20
|
+
releaseExposure(request: ReleaseExposureRequest): Promise<ApiGatewayResponse<ReleaseExposureResponse>>;
|
|
21
|
+
/** Devuelve el estado actual de la exposición agregada + circuit breaker. */
|
|
22
|
+
getExposureState(): Promise<ApiGatewayResponse<GetExposureStateResponse>>;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.54.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.
|
|
37
|
+
"@fiado/type-kit": "^3.163.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/container.config.ts
CHANGED
|
@@ -169,8 +169,12 @@ import { IEqualityConnectorApi, EqualityConnectorApi } from "./equality-connecto
|
|
|
169
169
|
import { IContactsBusinessApi, ContactsBusinessApi } from "./contacts-business/index.js";
|
|
170
170
|
// Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
|
|
171
171
|
import { IWalletFundingSettlementApi, WalletFundingSettlementApi } from "./walletFundingSettlement/index.js";
|
|
172
|
+
// Wallet funding rules — validaciones de riesgo Cash In (cap agregado, exposición, breaker, LFPIORPI)
|
|
173
|
+
import { IWalletFundingRulesApi, WalletFundingRulesApi } from "./wallet-funding-rules/index.js";
|
|
172
174
|
// SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
|
|
173
175
|
import { ISnsSesConnectorApi, SnsSesConnectorApi } from "./sns-ses-connector/index.js";
|
|
176
|
+
// Remittance business — pricingResolve (Dashboard Ops Fase B, puente de resolución de precio en send-time)
|
|
177
|
+
import { IRemittanceBusinessApi, RemittanceBusinessApi } from "./remittance-business/index.js";
|
|
174
178
|
|
|
175
179
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
176
180
|
// UTILS bindings
|
|
@@ -312,6 +316,13 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
312
316
|
// (consumido por equality-connector post processor.walletFundingValidate). Ver spec 15.
|
|
313
317
|
bind<IWalletFundingSettlementApi>("IWalletFundingSettlementApi").to(WalletFundingSettlementApi);
|
|
314
318
|
|
|
319
|
+
// Wallet funding rules — cap agregado + exposición + circuit breaker + LFPIORPI (provider-agnostic).
|
|
320
|
+
// Lo consume transaction-processor en walletFundingValidate y db-conciliacion al liberar exposición.
|
|
321
|
+
bind<IWalletFundingRulesApi>("IWalletFundingRulesApi").to(WalletFundingRulesApi);
|
|
322
|
+
|
|
315
323
|
// SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
|
|
316
324
|
bind<ISnsSesConnectorApi>("ISnsSesConnectorApi").to(SnsSesConnectorApi);
|
|
325
|
+
|
|
326
|
+
// Remittance business — pricingResolve (Dashboard Ops Fase B, puente de resolución de precio en send-time)
|
|
327
|
+
bind<IRemittanceBusinessApi>("IRemittanceBusinessApi").to(RemittanceBusinessApi);
|
|
317
328
|
});
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
CreateFundingReferenceRequest,
|
|
7
7
|
CreateFundingReferenceResponse,
|
|
8
8
|
ListFundingReferencesResponse,
|
|
9
|
+
ApplyWalletFundingRequest,
|
|
10
|
+
ApplyWalletFundingResponse,
|
|
9
11
|
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
10
12
|
import { IEqualityConnectorApi } from "./interfaces/IEqualityConnectorApi.js";
|
|
11
13
|
|
|
@@ -40,4 +42,11 @@ export default class EqualityConnectorApi implements IEqualityConnectorApi {
|
|
|
40
42
|
const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
|
|
41
43
|
return await this.httpRequest.get(url);
|
|
42
44
|
}
|
|
45
|
+
|
|
46
|
+
async applyFunding(
|
|
47
|
+
request: ApplyWalletFundingRequest,
|
|
48
|
+
): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>> {
|
|
49
|
+
const url = `${this.baseUrl}/funding/apply`;
|
|
50
|
+
return await this.httpRequest.post(url, request);
|
|
51
|
+
}
|
|
43
52
|
}
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
CreateFundingReferenceRequest,
|
|
5
5
|
CreateFundingReferenceResponse,
|
|
6
6
|
ListFundingReferencesResponse,
|
|
7
|
+
ApplyWalletFundingRequest,
|
|
8
|
+
ApplyWalletFundingResponse,
|
|
7
9
|
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -44,4 +46,13 @@ export interface IEqualityConnectorApi {
|
|
|
44
46
|
getStandardCatalog(
|
|
45
47
|
query: { benefitId: string; includeDisabled?: boolean },
|
|
46
48
|
): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Dispara el acreditamiento diferido de un pago ya verificado (POST /funding/apply).
|
|
52
|
+
* Lo invoca `db-conciliacion` cuando la verificación autoritativa contra el portal
|
|
53
|
+
* resuelve: APPROVED → acredita (processor.credit → settle); REJECTED → revierte.
|
|
54
|
+
*/
|
|
55
|
+
applyFunding(
|
|
56
|
+
request: ApplyWalletFundingRequest,
|
|
57
|
+
): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
|
|
47
58
|
}
|
package/src/index.ts
CHANGED
|
@@ -82,4 +82,6 @@ export * from "./equality-connector/index.js";
|
|
|
82
82
|
export * from "./contacts-business/index.js";
|
|
83
83
|
export * from "./uniteller-connector/index.js";
|
|
84
84
|
export * from "./walletFundingSettlement/index.js";
|
|
85
|
+
export * from "./wallet-funding-rules/index.js";
|
|
85
86
|
export * from "./sns-ses-connector/index.js";
|
|
87
|
+
export * from "./remittance-business/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import { PricingResolveRequest, PricingResolveResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
5
|
+
import { IRemittanceBusinessApi } from "./interfaces/IRemittanceBusinessApi.js";
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class RemittanceBusinessApi implements IRemittanceBusinessApi {
|
|
9
|
+
private readonly baseUrl = process.env.REMITTANCE_BUSINESS_LAMBDA_URL || "";
|
|
10
|
+
|
|
11
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
12
|
+
|
|
13
|
+
async pricingResolve(request: PricingResolveRequest): Promise<ApiGatewayResponse<PricingResolveResponse>> {
|
|
14
|
+
const url = `${this.baseUrl}/private/pricing/resolve`;
|
|
15
|
+
return await this.httpRequest.post(url, request);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { PricingResolveRequest, PricingResolveResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
3
|
+
|
|
4
|
+
export interface IRemittanceBusinessApi {
|
|
5
|
+
pricingResolve(request: PricingResolveRequest): Promise<ApiGatewayResponse<PricingResolveResponse>>;
|
|
6
|
+
}
|
|
@@ -5,6 +5,8 @@ import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter/index.js
|
|
|
5
5
|
import {
|
|
6
6
|
CohortCountRequest,
|
|
7
7
|
CohortCountResponse,
|
|
8
|
+
CohortUserMatchRequest,
|
|
9
|
+
CohortUserMatchResponse,
|
|
8
10
|
PricingMetricsRequest,
|
|
9
11
|
PricingMetricsResponse,
|
|
10
12
|
PromotionReachRequest,
|
|
@@ -245,6 +247,11 @@ export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
|
245
247
|
return await this.httpRequest.post(url, request);
|
|
246
248
|
}
|
|
247
249
|
|
|
250
|
+
async cohortUserMatch(request: CohortUserMatchRequest): Promise<ApiGatewayResponse<CohortUserMatchResponse>> {
|
|
251
|
+
const url = `${this.baseUrl}/backoffice/config/cohorts/user-match`;
|
|
252
|
+
return await this.httpRequest.post(url, request);
|
|
253
|
+
}
|
|
254
|
+
|
|
248
255
|
async segmentMetrics(request: SegmentMetricsRequest): Promise<ApiGatewayResponse<SegmentMetricsResponse>> {
|
|
249
256
|
const url = `${this.baseUrl}/backoffice/config/segments/metrics`;
|
|
250
257
|
return await this.httpRequest.post(url, request);
|
|
@@ -3,6 +3,8 @@ import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter/index.js
|
|
|
3
3
|
import {
|
|
4
4
|
CohortCountRequest,
|
|
5
5
|
CohortCountResponse,
|
|
6
|
+
CohortUserMatchRequest,
|
|
7
|
+
CohortUserMatchResponse,
|
|
6
8
|
PricingMetricsRequest,
|
|
7
9
|
PricingMetricsResponse,
|
|
8
10
|
PromotionReachRequest,
|
|
@@ -188,6 +190,8 @@ export interface IUnitellerConnectorApi {
|
|
|
188
190
|
// ─── Cohorts (Dashboard Ops · B2 — puente de recálculo Opción A) ────────────────
|
|
189
191
|
/** Cuenta usuarios que cumplen las condiciones (AND) + universo total. Lo consume remittance-business al recalcular un cohort. */
|
|
190
192
|
cohortCount(request: CohortCountRequest): Promise<ApiGatewayResponse<CohortCountResponse>>;
|
|
193
|
+
/** Determina si un usuario puntual matchea las condiciones (AND) de un cohort. Lo consume remittance-business. */
|
|
194
|
+
cohortUserMatch(request: CohortUserMatchRequest): Promise<ApiGatewayResponse<CohortUserMatchResponse>>;
|
|
191
195
|
|
|
192
196
|
// ─── Segmentos (Dashboard Ops — puente de métricas Opción A) ────────────────────
|
|
193
197
|
/** {clientCount, volMonthUSD} para el subconjunto de RemittanceUsers del segmento (mes calendario, sin canceladas). */
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import {
|
|
5
|
+
ReserveExposureRequest,
|
|
6
|
+
ReserveExposureResponse,
|
|
7
|
+
ReleaseExposureRequest,
|
|
8
|
+
ReleaseExposureResponse,
|
|
9
|
+
GetExposureStateResponse,
|
|
10
|
+
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
11
|
+
import { IWalletFundingRulesApi } from "./interfaces/IWalletFundingRulesApi.js";
|
|
12
|
+
|
|
13
|
+
@injectable()
|
|
14
|
+
export default class WalletFundingRulesApi implements IWalletFundingRulesApi {
|
|
15
|
+
private readonly baseUrl = process.env.WALLET_FUNDING_RULES_LAMBDA_URL || "";
|
|
16
|
+
|
|
17
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
18
|
+
|
|
19
|
+
async reserveExposure(
|
|
20
|
+
request: ReserveExposureRequest,
|
|
21
|
+
): Promise<ApiGatewayResponse<ReserveExposureResponse>> {
|
|
22
|
+
const url = `${this.baseUrl}/reserve`;
|
|
23
|
+
return await this.httpRequest.post(url, request);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async releaseExposure(
|
|
27
|
+
request: ReleaseExposureRequest,
|
|
28
|
+
): Promise<ApiGatewayResponse<ReleaseExposureResponse>> {
|
|
29
|
+
const url = `${this.baseUrl}/release`;
|
|
30
|
+
return await this.httpRequest.post(url, request);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async getExposureState(): Promise<ApiGatewayResponse<GetExposureStateResponse>> {
|
|
34
|
+
const url = `${this.baseUrl}/state`;
|
|
35
|
+
return await this.httpRequest.get(url);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import {
|
|
3
|
+
ReserveExposureRequest,
|
|
4
|
+
ReserveExposureResponse,
|
|
5
|
+
ReleaseExposureRequest,
|
|
6
|
+
ReleaseExposureResponse,
|
|
7
|
+
GetExposureStateResponse,
|
|
8
|
+
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Cliente hacia `wallet-funding-rules-business` (lambda privado VPC).
|
|
12
|
+
*
|
|
13
|
+
* Dueño de las validaciones de riesgo del tipo Cash In: cap agregado FSA,
|
|
14
|
+
* exposición, circuit breaker y LFPIORPI. Provider-agnostic — lo consume el
|
|
15
|
+
* `transaction-processor` en `walletFundingValidate` (cap gate) y la
|
|
16
|
+
* conciliación (`db-conciliacion`) al liberar exposición.
|
|
17
|
+
*
|
|
18
|
+
* Endpoints backend en wallet-funding-rules:
|
|
19
|
+
* - POST /reserve (privado VPC) — reserva atómica single-region
|
|
20
|
+
* - POST /release (privado VPC)
|
|
21
|
+
* - GET /state (privado VPC)
|
|
22
|
+
*/
|
|
23
|
+
export interface IWalletFundingRulesApi {
|
|
24
|
+
/** Reserva monto contra la exposición agregada (cap gate). Atómico single-region. */
|
|
25
|
+
reserveExposure(
|
|
26
|
+
request: ReserveExposureRequest,
|
|
27
|
+
): Promise<ApiGatewayResponse<ReserveExposureResponse>>;
|
|
28
|
+
|
|
29
|
+
/** Libera monto de la exposición agregada (liquidación / rechazo). Puede reactivar el servicio. */
|
|
30
|
+
releaseExposure(
|
|
31
|
+
request: ReleaseExposureRequest,
|
|
32
|
+
): Promise<ApiGatewayResponse<ReleaseExposureResponse>>;
|
|
33
|
+
|
|
34
|
+
/** Devuelve el estado actual de la exposición agregada + circuit breaker. */
|
|
35
|
+
getExposureState(): Promise<ApiGatewayResponse<GetExposureStateResponse>>;
|
|
36
|
+
}
|