Skip to content

feat: serialization audit and implementation - #22

Open
GallaGit wants to merge 6 commits into
mainfrom
feature/serialization-audit
Open

feat: serialization audit and implementation#22
GallaGit wants to merge 6 commits into
mainfrom
feature/serialization-audit

Conversation

@GallaGit

@GallaGit GallaGit commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Resumen

  • Auditoría y cierre del hito de serialización de la API HealthCore: los 31 endpoints quedan clasificados como Ya serializado en docs/audit/serialization-audit.md.
  • Cada ruta JSON declara un response_model Pydantic explícito; se separan esquemas de entrada y salida (p. ej. SupplierResponse vs SupplierCreate, RegisterResponse sin email).
  • Auth endurecida: login solo token; forgot/reset/change solo message; registro sin email; GET /auth/me puede devolver el email del llamante.
  • Listados más ligeros (IncidentListItem, InventoryOrderListItem) y evidencias de auditoría reubicadas en docs/audit/.

Objetivo y alcance

Cerrar contratos de respuesta indefinidos en FastAPI para que el backend no exponga ORM/dict crudos ni campos sensibles, alineado con el consumo del backoffice.

Archivos principales

  • Backend: services/app/models/*, routers/*, schemas.py, domain/supplier_service.py, domain/user_service.py
  • Docs: docs/audit/serialization-audit.md, docs/audit/README.md, services/README(.es).md, memory-bank/*, bitacora.md
  • Front (tipos): uis/backoffice/types/auth.ts, incidentManager.ts, inventory.ts, lib/services/authApi.ts

Validación

  • Smoke API post-docker compose up --build: register sin email, login token-only, /auth/me con email, suppliers, incidents lean, OpenAPI
  • Postman: POST /auth/login + GET /auth/me con Bearer
  • Checklist de auditoría 31/31 Ya serializado

Riesgos / seguimiento

  • Rebuild de Docker necesario tras merge para que contenedores viejos no sirvan schemas antiguos.
  • docs/telemetry/ no forma parte de esta PR (otro hito).
  • TODO opcional: unificar deletes en MessageResponse.message en lugar de DetailResponse.detail.

Plan de prueba

  • Levantar API (docker compose up --build o uvicorn local)
  • POST /users → body sin email
  • POST /auth/login → solo token; GET /auth/me → email del usuario
  • Revisar schemas en http://127.0.0.1:8000/docs
  • Smoke rápido: GET /suppliers, GET /api/incidents con Bearer

Made with Cursor

GallaGit and others added 6 commits August 29, 2026 12:20
Close undefined JSON contracts on auth, deletes, and incident analyze; slim list payloads and document every endpoint status.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep API serialization evidence with other audit artifacts and update cross-references.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Lighthouse and serialization audit evidence with project docs and refresh path references.

Co-authored-by: Cursor <cursoragent@cursor.com>
Split SupplierResponse from write models and stop echoing email on POST /users so every endpoint is fully serialized.

Co-authored-by: Cursor <cursoragent@cursor.com>
Record verification evidence and close the audit checklist at 31/31 serialized endpoints.

Co-authored-by: Cursor <cursoragent@cursor.com>
Point READMEs, tech context, and bitacora at the closed checklist and verification notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant