Initial JARED implementation - Predefined flows manager for CORP

- Flask API with full CRUD for flows
- Execute flow with OK->FELDMAN / incidencia->MASON routing
- PostgreSQL integration with host DB
- Docker deployment on port 5052
- S-CONTRACT v2.1 compliant
This commit is contained in:
ARCHITECT
2025-12-24 10:25:10 +00:00
commit b4bb286396
7 changed files with 488 additions and 0 deletions

57
README.md Normal file
View File

@@ -0,0 +1,57 @@
# JARED - Predefined Flows Manager (CORP)
Microservicio para gestionar flujos de trabajo predefinidos en el servidor CORP del ecosistema TZZR.
## Descripcion
JARED maneja la creacion, listado y ejecucion de flujos predefinidos. Cada ejecucion se enruta a:
- **FELDMAN** si el flujo termina OK
- **MASON** si hay incidencia
## Endpoints
| Endpoint | Metodo | Auth | Descripcion |
|----------|--------|------|-------------|
| `/health` | GET | No | Health check |
| `/s-contract` | GET | No | Contrato del servicio |
| `/flujos` | GET | Si | Listar flujos |
| `/flujos` | POST | Si | Crear flujo |
| `/flujos/<id>` | GET | Si | Obtener flujo |
| `/flujos/<id>` | PUT | Si | Actualizar flujo |
| `/flujos/<id>` | DELETE | Si | Eliminar flujo |
| `/ejecutar/<id>` | POST | Si | Ejecutar flujo |
| `/ejecuciones` | GET | Si | Listar ejecuciones |
| `/stats` | GET | Si | Estadisticas |
## Autenticacion
Header `X-Auth-Key` con el h_instancia de CORP.
## Despliegue
```bash
cd /opt/jared
docker compose up -d --build
```
## Configuracion (.env)
```
H_INSTANCIA=<h_instancia_corp>
DB_HOST=172.17.0.1
DB_PORT=5432
DB_NAME=corp
DB_USER=corp
DB_PASSWORD=<password>
PORT=5052
```
## Base de Datos
Tablas en PostgreSQL (corp):
- `flujos_predefinidos` - Definiciones de flujos
- `flujo_ejecuciones` - Historial de ejecuciones
## Puerto
5052