Repository navigation
API: lecturas del panel (metricas, actividad, administradores) - #21
Merged
Merged
Conversation
Endpoints nuevos para el panel, detras del mismo portero de /api/admin:
- GET /api/admin/lugares/{id}/pois: todos los POI, tambien los inactivos.
- GET /api/admin/metricas: visitas, eventos por tipo, visitas por dia y
los 10 POI mas vistos, sobre la tabla eventos.
- GET /api/admin/actividad: cambios registrados en auditoria, paginados,
con el correo de quien los hizo.
- GET y PUT /api/admin/administradores: listar y cambiar el rol en
perfiles. No deja quitarse el rol a uno mismo ni quitar el ultimo admin,
y la auditoria registra quien hizo el cambio.
Endpoint publico POST /api/eventos para que la app registre el uso. Solo
acepta los cinco tipos acordados.
eventos, auditoria y auth.users entran a TourDbContext con
ExcludeFromMigrations: EF las lee pero no las crea. perfiles se lee con
SQL directo porque su rol es un enum de Postgres. No hay migracion nueva.
Se agrega scripts/datos/perfiles_eventos_auditoria.sql, que crea esas
tablas en Supabase, y se regeneran openapi.yaml y schema.d.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EB4pRoGeNrZBwz45Y4jvo5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Endpoints nuevos para el panel, detras del mismo portero de /api/admin:
Agrega los endpoints que el panel necesita para leer: lugares con inactivos, métricas sobre eventos, actividad sobre auditoría y la gestión del rol de administrador. Suma un endpoint público para que la app registre el uso. La API lee las tablas de Supabase sin migraciones nuevas. Probado en local contra Postgres y contra Supabase.