@fiado/api-invoker 4.60.0 → 4.62.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 +4 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +2 -0
- package/bin/retailOrg/api/RetailOrgBusinessApi.d.ts +27 -0
- package/bin/retailOrg/api/RetailOrgBusinessApi.js +56 -0
- package/bin/retailOrg/api/interfaces/IRetailOrgBusinessApi.d.ts +78 -0
- package/bin/retailOrg/api/interfaces/IRetailOrgBusinessApi.js +1 -0
- package/bin/retailOrg/index.d.ts +2 -0
- package/bin/retailOrg/index.js +2 -0
- package/bin/synergypay-connector/api/SynergyPayConnectorApi.d.ts +17 -0
- package/bin/synergypay-connector/api/SynergyPayConnectorApi.js +48 -0
- package/bin/synergypay-connector/api/interfaces/ISynergyPayConnectorApi.d.ts +45 -0
- package/bin/synergypay-connector/api/interfaces/ISynergyPayConnectorApi.js +1 -0
- package/bin/synergypay-connector/index.d.ts +2 -0
- package/bin/synergypay-connector/index.js +2 -0
- package/package.json +2 -2
- package/src/container.config.ts +4 -0
- package/src/index.ts +2 -0
- package/src/retailOrg/api/RetailOrgBusinessApi.ts +64 -0
- package/src/retailOrg/api/interfaces/IRetailOrgBusinessApi.ts +100 -0
- package/src/retailOrg/index.ts +2 -0
- package/src/synergypay-connector/api/SynergyPayConnectorApi.ts +52 -0
- package/src/synergypay-connector/api/interfaces/ISynergyPayConnectorApi.ts +61 -0
- package/src/synergypay-connector/index.ts +2 -0
package/bin/container.config.js
CHANGED
|
@@ -106,6 +106,8 @@ import MessagesBusinessPublisher from "./messages-business/queue/MessagesBusines
|
|
|
106
106
|
import { TotpSecurityApi } from "./totp-security/index.js";
|
|
107
107
|
// Equality connector — wallet-funding HTTP client (benefits-marketplace → equality-connector)
|
|
108
108
|
import { EqualityConnectorApi } from "./equality-connector/index.js";
|
|
109
|
+
// SynergyPay connector — wallet-funding HTTP client (benefits-marketplace → synergypay-connector)
|
|
110
|
+
import { SynergyPayConnectorApi } from "./synergypay-connector/index.js";
|
|
109
111
|
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
110
112
|
import { ContactsBusinessApi } from "./contacts-business/index.js";
|
|
111
113
|
// Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
|
|
@@ -233,6 +235,8 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
233
235
|
bind("ITotpSecurityApi").to(TotpSecurityApi);
|
|
234
236
|
// Equality connector — wallet-funding (benefits-marketplace → equality-connector)
|
|
235
237
|
bind("IEqualityConnectorApi").to(EqualityConnectorApi);
|
|
238
|
+
// SynergyPay connector — wallet-funding (benefits-marketplace → synergypay-connector)
|
|
239
|
+
bind("ISynergyPayConnectorApi").to(SynergyPayConnectorApi);
|
|
236
240
|
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
237
241
|
bind("IContactsBusinessApi").to(ContactsBusinessApi);
|
|
238
242
|
// Wallet funding settlement — TransactWriteItems atómico del money path cash-in
|
package/bin/index.d.ts
CHANGED
|
@@ -76,9 +76,11 @@ export * from "./benefits-marketplace/index.js";
|
|
|
76
76
|
export * from "./milestone-business/index.js";
|
|
77
77
|
export * from "./cognitoBackofficeConnector/index.js";
|
|
78
78
|
export * from "./platformRbac/index.js";
|
|
79
|
+
export * from "./retailOrg/index.js";
|
|
79
80
|
export * from "./messages-business/index.js";
|
|
80
81
|
export * from "./totp-security/index.js";
|
|
81
82
|
export * from "./equality-connector/index.js";
|
|
83
|
+
export * from "./synergypay-connector/index.js";
|
|
82
84
|
export * from "./contacts-business/index.js";
|
|
83
85
|
export * from "./uniteller-connector/index.js";
|
|
84
86
|
export * from "./walletFundingSettlement/index.js";
|
package/bin/index.js
CHANGED
|
@@ -76,9 +76,11 @@ export * from "./benefits-marketplace/index.js";
|
|
|
76
76
|
export * from "./milestone-business/index.js";
|
|
77
77
|
export * from "./cognitoBackofficeConnector/index.js";
|
|
78
78
|
export * from "./platformRbac/index.js";
|
|
79
|
+
export * from "./retailOrg/index.js";
|
|
79
80
|
export * from "./messages-business/index.js";
|
|
80
81
|
export * from "./totp-security/index.js";
|
|
81
82
|
export * from "./equality-connector/index.js";
|
|
83
|
+
export * from "./synergypay-connector/index.js";
|
|
82
84
|
export * from "./contacts-business/index.js";
|
|
83
85
|
export * from "./uniteller-connector/index.js";
|
|
84
86
|
export * from "./walletFundingSettlement/index.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { RetailerValidationDto, StoreValidationDto, RetailUserValidationDto } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
4
|
+
import { IRetailOrgBusinessApi } from "./interfaces/IRetailOrgBusinessApi.js";
|
|
5
|
+
/**
|
|
6
|
+
* Publisher HTTP del lambda `retail-org-business` (componente 04 SureKeep Fase 1) para sus 4
|
|
7
|
+
* endpoints privados de validación. Contrato y semántica completos → `IRetailOrgBusinessApi`.
|
|
8
|
+
*
|
|
9
|
+
* Los 4 paths y el `?tenantId=` fueron verificados contra dev (200 + negativos 400/404) el
|
|
10
|
+
* 2026-07-16 y matchean `openapi/private.yaml` del lambda destino.
|
|
11
|
+
*
|
|
12
|
+
* Env var requerida en el consumer: `RETAIL_ORG_BUSINESS_URL`.
|
|
13
|
+
* El template.yml del consumer la setea con:
|
|
14
|
+
*
|
|
15
|
+
* RETAIL_ORG_BUSINESS_URL: '{{resolve:ssm:retail-org-business}}'
|
|
16
|
+
*
|
|
17
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
18
|
+
*/
|
|
19
|
+
export default class RetailOrgBusinessApi implements IRetailOrgBusinessApi {
|
|
20
|
+
private httpRequest;
|
|
21
|
+
private readonly baseUrl;
|
|
22
|
+
constructor(httpRequest: IHttpRequest);
|
|
23
|
+
getRetailer(retailerId: string, tenantId: string): Promise<StandardResponse<RetailerValidationDto>>;
|
|
24
|
+
getStore(retailerId: string, storeId: string, tenantId: string): Promise<StandardResponse<StoreValidationDto>>;
|
|
25
|
+
getStoreUsers(retailerId: string, storeId: string, tenantId: string): Promise<StandardResponse<RetailUserValidationDto[]>>;
|
|
26
|
+
getUserByCognitoSub(cognitoSub: string, tenantId: string): Promise<StandardResponse<RetailUserValidationDto>>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
* Publisher HTTP del lambda `retail-org-business` (componente 04 SureKeep Fase 1) para sus 4
|
|
16
|
+
* endpoints privados de validación. Contrato y semántica completos → `IRetailOrgBusinessApi`.
|
|
17
|
+
*
|
|
18
|
+
* Los 4 paths y el `?tenantId=` fueron verificados contra dev (200 + negativos 400/404) el
|
|
19
|
+
* 2026-07-16 y matchean `openapi/private.yaml` del lambda destino.
|
|
20
|
+
*
|
|
21
|
+
* Env var requerida en el consumer: `RETAIL_ORG_BUSINESS_URL`.
|
|
22
|
+
* El template.yml del consumer la setea con:
|
|
23
|
+
*
|
|
24
|
+
* RETAIL_ORG_BUSINESS_URL: '{{resolve:ssm:retail-org-business}}'
|
|
25
|
+
*
|
|
26
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
27
|
+
*/
|
|
28
|
+
let RetailOrgBusinessApi = class RetailOrgBusinessApi {
|
|
29
|
+
httpRequest;
|
|
30
|
+
baseUrl = process.env.RETAIL_ORG_BUSINESS_URL || "";
|
|
31
|
+
constructor(httpRequest) {
|
|
32
|
+
this.httpRequest = httpRequest;
|
|
33
|
+
}
|
|
34
|
+
async getRetailer(retailerId, tenantId) {
|
|
35
|
+
const url = `${this.baseUrl}/private/retailers/${encodeURIComponent(retailerId)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
36
|
+
return await this.httpRequest.get(url);
|
|
37
|
+
}
|
|
38
|
+
async getStore(retailerId, storeId, tenantId) {
|
|
39
|
+
const url = `${this.baseUrl}/private/retailers/${encodeURIComponent(retailerId)}/stores/${encodeURIComponent(storeId)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
40
|
+
return await this.httpRequest.get(url);
|
|
41
|
+
}
|
|
42
|
+
async getStoreUsers(retailerId, storeId, tenantId) {
|
|
43
|
+
const url = `${this.baseUrl}/private/retailers/${encodeURIComponent(retailerId)}/users/by-store/${encodeURIComponent(storeId)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
44
|
+
return await this.httpRequest.get(url);
|
|
45
|
+
}
|
|
46
|
+
async getUserByCognitoSub(cognitoSub, tenantId) {
|
|
47
|
+
const url = `${this.baseUrl}/private/users/by-cognito-sub/${encodeURIComponent(cognitoSub)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
48
|
+
return await this.httpRequest.get(url);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
RetailOrgBusinessApi = __decorate([
|
|
52
|
+
injectable(),
|
|
53
|
+
__param(0, inject("IHttpRequest")),
|
|
54
|
+
__metadata("design:paramtypes", [Object])
|
|
55
|
+
], RetailOrgBusinessApi);
|
|
56
|
+
export default RetailOrgBusinessApi;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { RetailerValidationDto, StoreValidationDto, RetailUserValidationDto } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Contrato del publisher HTTP del lambda `retail-org-business` (componente 04 SureKeep Fase 1)
|
|
5
|
+
* para sus 4 endpoints privados de VALIDACIÓN (service-to-service, VPC-only).
|
|
6
|
+
*
|
|
7
|
+
* Consumidores previstos (regla R5 — cruces entre lambdas son SOLO lecturas de validación;
|
|
8
|
+
* ningún lambda escribe en tabla ajena):
|
|
9
|
+
* - `retail-catalog-business` → valida `storeId` al registrar IMEIs
|
|
10
|
+
* - `retail-cards-business` → valida `storeId` de un lote de tarjetas PCF
|
|
11
|
+
* - `loan-*` → valida retailer / store / usuarios retail
|
|
12
|
+
*
|
|
13
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
* `tenantId` es OBLIGATORIO en los 4 métodos — no es un detalle de firma.
|
|
15
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
16
|
+
* Los privados NO llevan token de usuario (`Feature.ANONIMUS`; la protección es la red VPC),
|
|
17
|
+
* así que el lambda destino no tiene `AuthContext.issuer` y NO puede inferir el silo. El caller
|
|
18
|
+
* declara el tenant explícito por query y `@fiado/tenant-context` asume el rol de ESE silo.
|
|
19
|
+
* Sin `tenantId` → `400 UNKNOWN_TENANT` (fail-closed, verificado en dev). Nunca hay default:
|
|
20
|
+
* caer a un tenant por default sería fail-OPEN y podría devolver datos de otra SOFOM.
|
|
21
|
+
*
|
|
22
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
23
|
+
* ⚠️ Patrón de retorno: `StandardResponse<T>` — el consumer accede `result.data`, NO `result.body`.
|
|
24
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
25
|
+
* Los publishers viejos tipan `ApiGatewayResponse<T>` (`{ statusCode, body }`) y documentan
|
|
26
|
+
* `result.body.data`. Eso es FICCIÓN del tipo: `@fiado/http-client` hace `return response.data`
|
|
27
|
+
* (ver `AxiosHttpRequest`), o sea entrega el BODY PELADO — `.statusCode`/`.body` no existen en
|
|
28
|
+
* runtime y leerlos da `undefined`. Verificado en dev el 2026-07-16: costó un `500` (TypeError sobre
|
|
29
|
+
* `body.roleAssignments`) en `retail-org-business` al confiar en el tipo. `StandardResponse<T>`
|
|
30
|
+
* (`{ code, date, data, description?, msg? }`, ya exportado por `@fiado/gateway-adapter`) SÍ describe
|
|
31
|
+
* lo que llega. No se toca el tipo de los publishers viejos acá para no romperlos, pero los nuevos
|
|
32
|
+
* dicen la verdad.
|
|
33
|
+
*
|
|
34
|
+
* Errores: el lambda destino lanza `DomainError` tipado → el publisher RECHAZA (no devuelve null).
|
|
35
|
+
* Cada consumer mapea a su propio error de dominio (ver `fiado-api-invoker § 6`):
|
|
36
|
+
* `404 RETAILER_NOT_FOUND` / `404 STORE_NOT_FOUND` / `404 RETAIL_USER_NOT_FOUND`
|
|
37
|
+
* `400 UNKNOWN_TENANT` (tenantId ausente o desconocido)
|
|
38
|
+
*
|
|
39
|
+
* Env var requerida en el consumer: `RETAIL_ORG_BUSINESS_URL`.
|
|
40
|
+
* El template.yml del consumer la setea con:
|
|
41
|
+
*
|
|
42
|
+
* RETAIL_ORG_BUSINESS_URL: '{{resolve:ssm:retail-org-business}}'
|
|
43
|
+
*
|
|
44
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
45
|
+
*/
|
|
46
|
+
export interface IRetailOrgBusinessApi {
|
|
47
|
+
/**
|
|
48
|
+
* GET /private/retailers/{retailerId} — valida que el retailer exista y devuelve su shape mínimo
|
|
49
|
+
* (id, name, type, status, parentId). `status` ya viene con la cascada aplicada (estado efectivo).
|
|
50
|
+
*
|
|
51
|
+
* @throws si el retailer no existe (`404 RETAILER_NOT_FOUND`).
|
|
52
|
+
*/
|
|
53
|
+
getRetailer(retailerId: string, tenantId: string): Promise<StandardResponse<RetailerValidationDto>>;
|
|
54
|
+
/**
|
|
55
|
+
* GET /private/retailers/{retailerId}/stores/{storeId} — valida que la tienda exista Y pertenezca
|
|
56
|
+
* a ese retailer. El path es ANIDADO (no `/private/stores/{storeId}`): la tabla es
|
|
57
|
+
* pk `RETAILER#<id>` / sk `STORE#<storeId>`, así que el lookup anidado es un `get(pk, sk)` directo
|
|
58
|
+
* sobre la tabla base — cero GSI. Un path aplanado obligaría a un índice que el spec no define.
|
|
59
|
+
*
|
|
60
|
+
* `status` viene con la cascada del retailer padre ya aplicada.
|
|
61
|
+
*
|
|
62
|
+
* @throws si la tienda no existe o es de OTRO retailer (`404 STORE_NOT_FOUND` — verificado en dev).
|
|
63
|
+
*/
|
|
64
|
+
getStore(retailerId: string, storeId: string, tenantId: string): Promise<StandardResponse<StoreValidationDto>>;
|
|
65
|
+
/**
|
|
66
|
+
* GET /private/retailers/{retailerId}/users/by-store/{storeId} — usuarios retail cuya tienda base
|
|
67
|
+
* (`homeStoreId`) es esa. Devuelve `[]` (no 404) si la tienda no tiene usuarios asignados.
|
|
68
|
+
*/
|
|
69
|
+
getStoreUsers(retailerId: string, storeId: string, tenantId: string): Promise<StandardResponse<RetailUserValidationDto[]>>;
|
|
70
|
+
/**
|
|
71
|
+
* GET /private/users/by-cognito-sub/{cognitoSub} — resuelve el usuario retail por su identidad
|
|
72
|
+
* Cognito. Es el match de la frontera RBAC (F0, identidad) ↔ retail-org (F1, estructura):
|
|
73
|
+
* el `cognitoSub` es la llave entre ambos mundos (ver `DEC-SKF1-005`).
|
|
74
|
+
*
|
|
75
|
+
* @throws si no hay usuario retail para ese sub (`404 RETAIL_USER_NOT_FOUND`).
|
|
76
|
+
*/
|
|
77
|
+
getUserByCognitoSub(cognitoSub: string, tenantId: string): Promise<StandardResponse<RetailUserValidationDto>>;
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
4
|
+
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse, ApplyWalletFundingRequest, ApplyWalletFundingResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
5
|
+
import { ISynergyPayConnectorApi } from "./interfaces/ISynergyPayConnectorApi.js";
|
|
6
|
+
export default class SynergyPayConnectorApi implements ISynergyPayConnectorApi {
|
|
7
|
+
private httpRequest;
|
|
8
|
+
private readonly baseUrl;
|
|
9
|
+
constructor(httpRequest: IHttpRequest);
|
|
10
|
+
createFundingReference(request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
|
|
11
|
+
listFundingReferences(directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
|
|
12
|
+
getStandardCatalog(query: {
|
|
13
|
+
benefitId: string;
|
|
14
|
+
includeDisabled?: boolean;
|
|
15
|
+
}): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
16
|
+
applyFunding(request: ApplyWalletFundingRequest): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 SynergyPayConnectorApi = class SynergyPayConnectorApi {
|
|
15
|
+
httpRequest;
|
|
16
|
+
baseUrl = process.env.SYNERGYPAY_CONNECTOR_LAMBDA_URL || "";
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
}
|
|
20
|
+
async createFundingReference(request) {
|
|
21
|
+
const url = `${this.baseUrl}/funding`;
|
|
22
|
+
return await this.httpRequest.post(url, request);
|
|
23
|
+
}
|
|
24
|
+
async listFundingReferences(directoryId, status) {
|
|
25
|
+
const params = new URLSearchParams({ directoryId });
|
|
26
|
+
if (status)
|
|
27
|
+
params.set("status", status);
|
|
28
|
+
const url = `${this.baseUrl}/funding/references?${params.toString()}`;
|
|
29
|
+
return await this.httpRequest.get(url);
|
|
30
|
+
}
|
|
31
|
+
async getStandardCatalog(query) {
|
|
32
|
+
const params = new URLSearchParams({ benefitId: query.benefitId });
|
|
33
|
+
if (query.includeDisabled)
|
|
34
|
+
params.set("includeDisabled", "true");
|
|
35
|
+
const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
|
|
36
|
+
return await this.httpRequest.get(url);
|
|
37
|
+
}
|
|
38
|
+
async applyFunding(request) {
|
|
39
|
+
const url = `${this.baseUrl}/funding/apply`;
|
|
40
|
+
return await this.httpRequest.post(url, request);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
SynergyPayConnectorApi = __decorate([
|
|
44
|
+
injectable(),
|
|
45
|
+
__param(0, inject("IHttpRequest")),
|
|
46
|
+
__metadata("design:paramtypes", [Object])
|
|
47
|
+
], SynergyPayConnectorApi);
|
|
48
|
+
export default SynergyPayConnectorApi;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
3
|
+
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse, ApplyWalletFundingRequest, ApplyWalletFundingResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Cliente del marketplace hacia synergypay-connector (privado, dentro de la VPC).
|
|
6
|
+
*
|
|
7
|
+
* Segundo proveedor de Cash In (SinergyPay). Lo consume `SynergyPayFundingPublisher`
|
|
8
|
+
* + `SynergyPayCatalogPublisher` del benefits-marketplace-business. Mismo contrato
|
|
9
|
+
* provider-agnostic que `IEqualityConnectorApi` — el marketplace no sabe con qué
|
|
10
|
+
* proveedor habla.
|
|
11
|
+
*
|
|
12
|
+
* Endpoints backend en synergypay-connector (privado VPC):
|
|
13
|
+
* - POST /funding
|
|
14
|
+
* - GET /funding/references?directoryId=&status=
|
|
15
|
+
* - GET /catalog/standard?benefitId=&includeDisabled=
|
|
16
|
+
* - POST /funding/apply
|
|
17
|
+
*
|
|
18
|
+
* NOTA: los endpoints `/passport/*` del BackOffice (SPEC 1.3) NO están incluidos —
|
|
19
|
+
* el synergypay-connector aún no los expone (F6.1 construyó solo el money-path).
|
|
20
|
+
* Se agregan en F6.4 junto con `SynergyPayPassportBackofficePublisher`.
|
|
21
|
+
*/
|
|
22
|
+
export interface ISynergyPayConnectorApi {
|
|
23
|
+
/** Genera una referencia de fondeo en SinergyPay via el connector. */
|
|
24
|
+
createFundingReference(request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
|
|
25
|
+
/**
|
|
26
|
+
* Lista las referencias del usuario, opcionalmente filtradas por status.
|
|
27
|
+
* Status default (cuando no se pasa) lo decide el connector.
|
|
28
|
+
*/
|
|
29
|
+
listFundingReferences(directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
|
|
30
|
+
/**
|
|
31
|
+
* Devuelve el catalogo standard de productos de wallet-funding del connector.
|
|
32
|
+
* Patron canonico del Centro de Beneficios — el marketplace lo consume via
|
|
33
|
+
* `IConnectorCatalogPublisher.getStandardCatalog` (mismo flow que Equality).
|
|
34
|
+
*/
|
|
35
|
+
getStandardCatalog(query: {
|
|
36
|
+
benefitId: string;
|
|
37
|
+
includeDisabled?: boolean;
|
|
38
|
+
}): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
39
|
+
/**
|
|
40
|
+
* Aplica el resultado de la conciliación de un pago (POST /funding/apply).
|
|
41
|
+
* En SinergyPay el crédito se hace inline en el webhook firmado; este endpoint
|
|
42
|
+
* queda para el cierre SETTLED (conciliación bancaria) — mismo contrato canónico.
|
|
43
|
+
*/
|
|
44
|
+
applyFunding(request: ApplyWalletFundingRequest): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
|
|
45
|
+
}
|
|
@@ -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.62.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.189.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/container.config.ts
CHANGED
|
@@ -165,6 +165,8 @@ import { IMessagesBusinessPublisher } from "./messages-business/queue/interfaces
|
|
|
165
165
|
import { ITotpSecurityApi, TotpSecurityApi } from "./totp-security/index.js";
|
|
166
166
|
// Equality connector — wallet-funding HTTP client (benefits-marketplace → equality-connector)
|
|
167
167
|
import { IEqualityConnectorApi, EqualityConnectorApi } from "./equality-connector/index.js";
|
|
168
|
+
// SynergyPay connector — wallet-funding HTTP client (benefits-marketplace → synergypay-connector)
|
|
169
|
+
import { ISynergyPayConnectorApi, SynergyPayConnectorApi } from "./synergypay-connector/index.js";
|
|
168
170
|
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
169
171
|
import { IContactsBusinessApi, ContactsBusinessApi } from "./contacts-business/index.js";
|
|
170
172
|
// Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
|
|
@@ -308,6 +310,8 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
308
310
|
|
|
309
311
|
// Equality connector — wallet-funding (benefits-marketplace → equality-connector)
|
|
310
312
|
bind<IEqualityConnectorApi>("IEqualityConnectorApi").to(EqualityConnectorApi);
|
|
313
|
+
// SynergyPay connector — wallet-funding (benefits-marketplace → synergypay-connector)
|
|
314
|
+
bind<ISynergyPayConnectorApi>("ISynergyPayConnectorApi").to(SynergyPayConnectorApi);
|
|
311
315
|
|
|
312
316
|
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
313
317
|
bind<IContactsBusinessApi>("IContactsBusinessApi").to(ContactsBusinessApi);
|
package/src/index.ts
CHANGED
|
@@ -76,9 +76,11 @@ export * from "./benefits-marketplace/index.js";
|
|
|
76
76
|
export * from "./milestone-business/index.js";
|
|
77
77
|
export * from "./cognitoBackofficeConnector/index.js";
|
|
78
78
|
export * from "./platformRbac/index.js";
|
|
79
|
+
export * from "./retailOrg/index.js";
|
|
79
80
|
export * from "./messages-business/index.js";
|
|
80
81
|
export * from "./totp-security/index.js";
|
|
81
82
|
export * from "./equality-connector/index.js";
|
|
83
|
+
export * from "./synergypay-connector/index.js";
|
|
82
84
|
export * from "./contacts-business/index.js";
|
|
83
85
|
export * from "./uniteller-connector/index.js";
|
|
84
86
|
export * from "./walletFundingSettlement/index.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import {
|
|
5
|
+
RetailerValidationDto,
|
|
6
|
+
StoreValidationDto,
|
|
7
|
+
RetailUserValidationDto,
|
|
8
|
+
} from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
9
|
+
import { IRetailOrgBusinessApi } from "./interfaces/IRetailOrgBusinessApi.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Publisher HTTP del lambda `retail-org-business` (componente 04 SureKeep Fase 1) para sus 4
|
|
13
|
+
* endpoints privados de validación. Contrato y semántica completos → `IRetailOrgBusinessApi`.
|
|
14
|
+
*
|
|
15
|
+
* Los 4 paths y el `?tenantId=` fueron verificados contra dev (200 + negativos 400/404) el
|
|
16
|
+
* 2026-07-16 y matchean `openapi/private.yaml` del lambda destino.
|
|
17
|
+
*
|
|
18
|
+
* Env var requerida en el consumer: `RETAIL_ORG_BUSINESS_URL`.
|
|
19
|
+
* El template.yml del consumer la setea con:
|
|
20
|
+
*
|
|
21
|
+
* RETAIL_ORG_BUSINESS_URL: '{{resolve:ssm:retail-org-business}}'
|
|
22
|
+
*
|
|
23
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
24
|
+
*/
|
|
25
|
+
@injectable()
|
|
26
|
+
export default class RetailOrgBusinessApi implements IRetailOrgBusinessApi {
|
|
27
|
+
private readonly baseUrl = process.env.RETAIL_ORG_BUSINESS_URL || "";
|
|
28
|
+
|
|
29
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
30
|
+
|
|
31
|
+
async getRetailer(
|
|
32
|
+
retailerId: string,
|
|
33
|
+
tenantId: string,
|
|
34
|
+
): Promise<StandardResponse<RetailerValidationDto>> {
|
|
35
|
+
const url = `${this.baseUrl}/private/retailers/${encodeURIComponent(retailerId)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
36
|
+
return await this.httpRequest.get(url);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getStore(
|
|
40
|
+
retailerId: string,
|
|
41
|
+
storeId: string,
|
|
42
|
+
tenantId: string,
|
|
43
|
+
): Promise<StandardResponse<StoreValidationDto>> {
|
|
44
|
+
const url = `${this.baseUrl}/private/retailers/${encodeURIComponent(retailerId)}/stores/${encodeURIComponent(storeId)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
45
|
+
return await this.httpRequest.get(url);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async getStoreUsers(
|
|
49
|
+
retailerId: string,
|
|
50
|
+
storeId: string,
|
|
51
|
+
tenantId: string,
|
|
52
|
+
): Promise<StandardResponse<RetailUserValidationDto[]>> {
|
|
53
|
+
const url = `${this.baseUrl}/private/retailers/${encodeURIComponent(retailerId)}/users/by-store/${encodeURIComponent(storeId)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
54
|
+
return await this.httpRequest.get(url);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async getUserByCognitoSub(
|
|
58
|
+
cognitoSub: string,
|
|
59
|
+
tenantId: string,
|
|
60
|
+
): Promise<StandardResponse<RetailUserValidationDto>> {
|
|
61
|
+
const url = `${this.baseUrl}/private/users/by-cognito-sub/${encodeURIComponent(cognitoSub)}?tenantId=${encodeURIComponent(tenantId)}`;
|
|
62
|
+
return await this.httpRequest.get(url);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import {
|
|
3
|
+
RetailerValidationDto,
|
|
4
|
+
StoreValidationDto,
|
|
5
|
+
RetailUserValidationDto,
|
|
6
|
+
} from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Contrato del publisher HTTP del lambda `retail-org-business` (componente 04 SureKeep Fase 1)
|
|
10
|
+
* para sus 4 endpoints privados de VALIDACIÓN (service-to-service, VPC-only).
|
|
11
|
+
*
|
|
12
|
+
* Consumidores previstos (regla R5 — cruces entre lambdas son SOLO lecturas de validación;
|
|
13
|
+
* ningún lambda escribe en tabla ajena):
|
|
14
|
+
* - `retail-catalog-business` → valida `storeId` al registrar IMEIs
|
|
15
|
+
* - `retail-cards-business` → valida `storeId` de un lote de tarjetas PCF
|
|
16
|
+
* - `loan-*` → valida retailer / store / usuarios retail
|
|
17
|
+
*
|
|
18
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
* `tenantId` es OBLIGATORIO en los 4 métodos — no es un detalle de firma.
|
|
20
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
21
|
+
* Los privados NO llevan token de usuario (`Feature.ANONIMUS`; la protección es la red VPC),
|
|
22
|
+
* así que el lambda destino no tiene `AuthContext.issuer` y NO puede inferir el silo. El caller
|
|
23
|
+
* declara el tenant explícito por query y `@fiado/tenant-context` asume el rol de ESE silo.
|
|
24
|
+
* Sin `tenantId` → `400 UNKNOWN_TENANT` (fail-closed, verificado en dev). Nunca hay default:
|
|
25
|
+
* caer a un tenant por default sería fail-OPEN y podría devolver datos de otra SOFOM.
|
|
26
|
+
*
|
|
27
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
28
|
+
* ⚠️ Patrón de retorno: `StandardResponse<T>` — el consumer accede `result.data`, NO `result.body`.
|
|
29
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
30
|
+
* Los publishers viejos tipan `ApiGatewayResponse<T>` (`{ statusCode, body }`) y documentan
|
|
31
|
+
* `result.body.data`. Eso es FICCIÓN del tipo: `@fiado/http-client` hace `return response.data`
|
|
32
|
+
* (ver `AxiosHttpRequest`), o sea entrega el BODY PELADO — `.statusCode`/`.body` no existen en
|
|
33
|
+
* runtime y leerlos da `undefined`. Verificado en dev el 2026-07-16: costó un `500` (TypeError sobre
|
|
34
|
+
* `body.roleAssignments`) en `retail-org-business` al confiar en el tipo. `StandardResponse<T>`
|
|
35
|
+
* (`{ code, date, data, description?, msg? }`, ya exportado por `@fiado/gateway-adapter`) SÍ describe
|
|
36
|
+
* lo que llega. No se toca el tipo de los publishers viejos acá para no romperlos, pero los nuevos
|
|
37
|
+
* dicen la verdad.
|
|
38
|
+
*
|
|
39
|
+
* Errores: el lambda destino lanza `DomainError` tipado → el publisher RECHAZA (no devuelve null).
|
|
40
|
+
* Cada consumer mapea a su propio error de dominio (ver `fiado-api-invoker § 6`):
|
|
41
|
+
* `404 RETAILER_NOT_FOUND` / `404 STORE_NOT_FOUND` / `404 RETAIL_USER_NOT_FOUND`
|
|
42
|
+
* `400 UNKNOWN_TENANT` (tenantId ausente o desconocido)
|
|
43
|
+
*
|
|
44
|
+
* Env var requerida en el consumer: `RETAIL_ORG_BUSINESS_URL`.
|
|
45
|
+
* El template.yml del consumer la setea con:
|
|
46
|
+
*
|
|
47
|
+
* RETAIL_ORG_BUSINESS_URL: '{{resolve:ssm:retail-org-business}}'
|
|
48
|
+
*
|
|
49
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
50
|
+
*/
|
|
51
|
+
export interface IRetailOrgBusinessApi {
|
|
52
|
+
/**
|
|
53
|
+
* GET /private/retailers/{retailerId} — valida que el retailer exista y devuelve su shape mínimo
|
|
54
|
+
* (id, name, type, status, parentId). `status` ya viene con la cascada aplicada (estado efectivo).
|
|
55
|
+
*
|
|
56
|
+
* @throws si el retailer no existe (`404 RETAILER_NOT_FOUND`).
|
|
57
|
+
*/
|
|
58
|
+
getRetailer(
|
|
59
|
+
retailerId: string,
|
|
60
|
+
tenantId: string,
|
|
61
|
+
): Promise<StandardResponse<RetailerValidationDto>>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* GET /private/retailers/{retailerId}/stores/{storeId} — valida que la tienda exista Y pertenezca
|
|
65
|
+
* a ese retailer. El path es ANIDADO (no `/private/stores/{storeId}`): la tabla es
|
|
66
|
+
* pk `RETAILER#<id>` / sk `STORE#<storeId>`, así que el lookup anidado es un `get(pk, sk)` directo
|
|
67
|
+
* sobre la tabla base — cero GSI. Un path aplanado obligaría a un índice que el spec no define.
|
|
68
|
+
*
|
|
69
|
+
* `status` viene con la cascada del retailer padre ya aplicada.
|
|
70
|
+
*
|
|
71
|
+
* @throws si la tienda no existe o es de OTRO retailer (`404 STORE_NOT_FOUND` — verificado en dev).
|
|
72
|
+
*/
|
|
73
|
+
getStore(
|
|
74
|
+
retailerId: string,
|
|
75
|
+
storeId: string,
|
|
76
|
+
tenantId: string,
|
|
77
|
+
): Promise<StandardResponse<StoreValidationDto>>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* GET /private/retailers/{retailerId}/users/by-store/{storeId} — usuarios retail cuya tienda base
|
|
81
|
+
* (`homeStoreId`) es esa. Devuelve `[]` (no 404) si la tienda no tiene usuarios asignados.
|
|
82
|
+
*/
|
|
83
|
+
getStoreUsers(
|
|
84
|
+
retailerId: string,
|
|
85
|
+
storeId: string,
|
|
86
|
+
tenantId: string,
|
|
87
|
+
): Promise<StandardResponse<RetailUserValidationDto[]>>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* GET /private/users/by-cognito-sub/{cognitoSub} — resuelve el usuario retail por su identidad
|
|
91
|
+
* Cognito. Es el match de la frontera RBAC (F0, identidad) ↔ retail-org (F1, estructura):
|
|
92
|
+
* el `cognitoSub` es la llave entre ambos mundos (ver `DEC-SKF1-005`).
|
|
93
|
+
*
|
|
94
|
+
* @throws si no hay usuario retail para ese sub (`404 RETAIL_USER_NOT_FOUND`).
|
|
95
|
+
*/
|
|
96
|
+
getUserByCognitoSub(
|
|
97
|
+
cognitoSub: string,
|
|
98
|
+
tenantId: string,
|
|
99
|
+
): Promise<StandardResponse<RetailUserValidationDto>>;
|
|
100
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
5
|
+
import {
|
|
6
|
+
CreateFundingReferenceRequest,
|
|
7
|
+
CreateFundingReferenceResponse,
|
|
8
|
+
ListFundingReferencesResponse,
|
|
9
|
+
ApplyWalletFundingRequest,
|
|
10
|
+
ApplyWalletFundingResponse,
|
|
11
|
+
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
12
|
+
import { ISynergyPayConnectorApi } from "./interfaces/ISynergyPayConnectorApi.js";
|
|
13
|
+
|
|
14
|
+
@injectable()
|
|
15
|
+
export default class SynergyPayConnectorApi implements ISynergyPayConnectorApi {
|
|
16
|
+
private readonly baseUrl = process.env.SYNERGYPAY_CONNECTOR_LAMBDA_URL || "";
|
|
17
|
+
|
|
18
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
19
|
+
|
|
20
|
+
async createFundingReference(
|
|
21
|
+
request: CreateFundingReferenceRequest,
|
|
22
|
+
): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>> {
|
|
23
|
+
const url = `${this.baseUrl}/funding`;
|
|
24
|
+
return await this.httpRequest.post(url, request);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async listFundingReferences(
|
|
28
|
+
directoryId: string,
|
|
29
|
+
status?: string,
|
|
30
|
+
): Promise<ApiGatewayResponse<ListFundingReferencesResponse>> {
|
|
31
|
+
const params = new URLSearchParams({ directoryId });
|
|
32
|
+
if (status) params.set("status", status);
|
|
33
|
+
const url = `${this.baseUrl}/funding/references?${params.toString()}`;
|
|
34
|
+
return await this.httpRequest.get(url);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async getStandardCatalog(
|
|
38
|
+
query: { benefitId: string; includeDisabled?: boolean },
|
|
39
|
+
): Promise<ApiGatewayResponse<ConnectorCatalogResponse>> {
|
|
40
|
+
const params = new URLSearchParams({ benefitId: query.benefitId });
|
|
41
|
+
if (query.includeDisabled) params.set("includeDisabled", "true");
|
|
42
|
+
const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
|
|
43
|
+
return await this.httpRequest.get(url);
|
|
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
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
3
|
+
import {
|
|
4
|
+
CreateFundingReferenceRequest,
|
|
5
|
+
CreateFundingReferenceResponse,
|
|
6
|
+
ListFundingReferencesResponse,
|
|
7
|
+
ApplyWalletFundingRequest,
|
|
8
|
+
ApplyWalletFundingResponse,
|
|
9
|
+
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Cliente del marketplace hacia synergypay-connector (privado, dentro de la VPC).
|
|
13
|
+
*
|
|
14
|
+
* Segundo proveedor de Cash In (SinergyPay). Lo consume `SynergyPayFundingPublisher`
|
|
15
|
+
* + `SynergyPayCatalogPublisher` del benefits-marketplace-business. Mismo contrato
|
|
16
|
+
* provider-agnostic que `IEqualityConnectorApi` — el marketplace no sabe con qué
|
|
17
|
+
* proveedor habla.
|
|
18
|
+
*
|
|
19
|
+
* Endpoints backend en synergypay-connector (privado VPC):
|
|
20
|
+
* - POST /funding
|
|
21
|
+
* - GET /funding/references?directoryId=&status=
|
|
22
|
+
* - GET /catalog/standard?benefitId=&includeDisabled=
|
|
23
|
+
* - POST /funding/apply
|
|
24
|
+
*
|
|
25
|
+
* NOTA: los endpoints `/passport/*` del BackOffice (SPEC 1.3) NO están incluidos —
|
|
26
|
+
* el synergypay-connector aún no los expone (F6.1 construyó solo el money-path).
|
|
27
|
+
* Se agregan en F6.4 junto con `SynergyPayPassportBackofficePublisher`.
|
|
28
|
+
*/
|
|
29
|
+
export interface ISynergyPayConnectorApi {
|
|
30
|
+
/** Genera una referencia de fondeo en SinergyPay via el connector. */
|
|
31
|
+
createFundingReference(
|
|
32
|
+
request: CreateFundingReferenceRequest,
|
|
33
|
+
): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Lista las referencias del usuario, opcionalmente filtradas por status.
|
|
37
|
+
* Status default (cuando no se pasa) lo decide el connector.
|
|
38
|
+
*/
|
|
39
|
+
listFundingReferences(
|
|
40
|
+
directoryId: string,
|
|
41
|
+
status?: string,
|
|
42
|
+
): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Devuelve el catalogo standard de productos de wallet-funding del connector.
|
|
46
|
+
* Patron canonico del Centro de Beneficios — el marketplace lo consume via
|
|
47
|
+
* `IConnectorCatalogPublisher.getStandardCatalog` (mismo flow que Equality).
|
|
48
|
+
*/
|
|
49
|
+
getStandardCatalog(
|
|
50
|
+
query: { benefitId: string; includeDisabled?: boolean },
|
|
51
|
+
): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Aplica el resultado de la conciliación de un pago (POST /funding/apply).
|
|
55
|
+
* En SinergyPay el crédito se hace inline en el webhook firmado; este endpoint
|
|
56
|
+
* queda para el cierre SETTLED (conciliación bancaria) — mismo contrato canónico.
|
|
57
|
+
*/
|
|
58
|
+
applyFunding(
|
|
59
|
+
request: ApplyWalletFundingRequest,
|
|
60
|
+
): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
|
|
61
|
+
}
|