Every significant action performed by an admin or referee is recorded in the audit log. Use the logs to trace who changed what, when, and in what context — useful for debugging, accountability, and compliance.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526_Consulta/llms.txt
Use this file to discover all available pages before exploring further.
What gets logged
The following actions produce an audit log entry: Match managementCreación de partido— A new fixture was createdEliminación lógica de partido— A fixture was moved to trashRestauración de partido— A fixture was restored from trashEliminación permanente de partido— A fixture was permanently deletedActualización de equipos— Team assignments on a fixture were updatedAñadir evento— A match event (goal, card, penalty) was recordedFinalización de partido— A match was finished; standings and porra scores updated
Creación de temporada— A new season was createdActualización de temporada— A season was editedEliminación de temporada— A season was deletedImportación de estructura de temporada— A season’s structure was imported from another season
Actualización de usuario— A user’s role was changedDesactivación de usuario (Admin)— A user account was deactivated and anonymised by an admin
- Image uploads via the admin upload endpoint
Log record fields
Each entry in theaudit_logs table contains:
| Field | Type | Description |
|---|---|---|
user_id | integer | ID of the admin or referee who performed the action |
username | string | Username of the actor (joined from users) |
action | string | Human-readable action name (see list above) |
entity_type | string | Type of entity affected: match, season, user, team, player, group, field |
entity_id | integer | ID of the affected entity |
details | JSONB | Structured context for the action (e.g. score at finish, role change, event type) |
created_at | timestamp | When the action was recorded |
Accessing logs
Retrieve the full audit log withGET /admin/logs. This endpoint is restricted to admins.
Filtering
You can narrow results using any combination of the following query parameters:| Parameter | Description |
|---|---|
season_id | Return only entries related to a specific season (matched against details.season_id) |
username | Partial, case-insensitive match on the actor’s username |
date | Exact date filter in YYYY-MM-DD format |
Pagination
Usepage and limit query parameters to paginate results. The default page size is 20 entries per page.
total field in the response to calculate the number of available pages: Math.ceil(total / limit).
Dashboard preview
The admin dashboard (GET /admin/summary) includes a recentActivity field containing the last 5 audit log entries. This provides a quick overview of recent activity without needing to open the full log view. If a season_id is passed to the summary endpoint, the preview is filtered to that season’s entries.