Módulos de dominio — Proptech
Detalle funcional por módulo del backlog PropTech Platform y encaje en Cortex HIVE.
Core (v0.1.0)
Autenticación (#1)
| Requisito Proptech | Cortex HIVE |
| JWT + refresh | Middleware JWT (CORTEX_AUTH_MODE), sesión panel |
| OAuth2 / OIDC (Google, Microsoft, GitHub) | ADR 005 — parcial |
| RBAC, scopes por panel | PanelAuthPolicy, scopes en manifests |
| Audit log auth | Planificado en framework IO |
Multi-tenancy (#2)
| Requisito Proptech | Cortex HIVE |
| Identificación tenant (subdominio / header) | Diseño: middleware + CORTEX_* settings |
| Aislamiento datos (schema-per-tenant) | PostgreSQL 16, migraciones por plugin (ADR 007) |
| Provisioning tenant | API control / futuro endpoint admin |
API Documentation (#3)
| Requisito Proptech | Cortex HIVE |
| Portal interactivo | FastAPI OpenAPI en /api/docs |
| Versionado API | Prefijo /api/v1 |
| Try-it-out | Swagger UI integrado |
Lease (v0.2.0)
Modelo de dominio (#4)
Entidades propuestas para plugin lease:
| Entidad | Descripción | Relación Cortex |
Lease | Agregado raíz: términos, estado, fechas | Nuevo dominio |
Tenant | Inquilino del contrato | Referencia clients vía client_ref |
Unit | Unidad dentro de propiedad | Extensión o tipo en resources |
LeaseTerms | Canon, depósito, fees, calendario pagos | Value object |
LeaseDocument | Contrato, anexos | Upload S3 (ADR 020b) |
Estados: draft → active → expired | terminated.
API REST (#5)
Namespace propuesto: /api/v1/lease
| Método | Ruta | Notas |
POST | /leases | Crear borrador |
GET | /leases | Lista paginada + filtros |
GET | /leases/{id} | Detalle |
PUT | /leases/{id} | Actualizar |
PATCH | /leases/{id}/activate | Activar contrato |
PATCH | /leases/{id}/terminate | Terminar |
Integración: POST /api/v1/payments/payments para cobros; GET /api/v1/clients/clients/{id} para inquilino.
Invest (v0.2.0)
Motor ROI (#6)
Plugin propuesto invest, namespace /api/v1/invest:
| Capacidad | Descripción |
| Proyección cash flow | Multi-año, ingresos/gastos |
| Cap rate | Ingreso neto / valor propiedad |
| IRR / NPV | Newton-Raphson, tasas descuento configurables |
| Sensibilidad | Variables clave (vacancia, rent growth) |
| Comparativa | Escenarios lado a lado |
Entrada: referencia a resource_id (propiedad en resources). Sin duplicar catálogo inmobiliario.
DevOps e infraestructura
Matriz resumen
| Módulo Proptech | Plugin Cortex | Estado |
| Core Auth | framework + ADR 005 | Parcial |
| Multi-tenant | plataforma | Diseño |
| Lease | lease (nuevo) | Diseño |
| Invest | invest (nuevo) | Diseño |
| Tenants | clients | Existe |
| Properties / units | resources | Existe (+ extensión tipos) |
| Rent pricing | pricing | Existe |
| Collections | payments | Existe |
| Invoicing | billing | Existe |
| GL / reports | accounting | Existe |