The Audit Log (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lucavallini/aibar-frontend/llms.txt
Use this file to discover all available pages before exploring further.
/auditoria) is a read-only chronological record of every significant action performed anywhere in the Aibar SRL App. Every time a user creates a trip, edits a driver, cancels a fuel entry, or deactivates an account, the backend writes a new audit event capturing who did it, what entity was affected, and a detail payload describing the change. The log is visible to administrators only and is the primary tool for accountability, tracing errors, and understanding the full history of any record across all modules.
Data Model
Auditoria
Each row in the audit log is represented by the following interface:
RespuestaPaginada<Auditoria>
All list responses are wrapped in the shared pagination envelope:
Response Fields
Unique UUID of this audit log entry. Never reused or modified.
The
id of the Usuario who triggered this event. Cross-reference with the Users module to identify the responsible operator or administrator.The category of action that was recorded. One of
alta, edicion, cancelacion, or baja. See Action Types below.The module or entity type that was affected. Matches one of the values used in the entity filter:
viaje, chofer, camion, multa, combustible, usuario.The UUID of the specific record within
entidad that was created, edited, cancelled, or deactivated.A free-text or JSON-serialised blob describing the specifics of the change — for example, which fields were modified and what their old and new values were. Can be
null for actions where no additional detail is relevant. The UI renders this as plain text; null values are displayed as -.ISO 8601 timestamp of when the action occurred (e.g.
"2025-06-15T14:32:07.000Z"). The UI formats this as dd/MM/yyyy HH:mm using Angular’s DatePipe.Action Types
Every audit event carries atipo_accion value that describes the kind of operation performed. The frontend applies a CSS badge class matching the action name.
alta
A new record was created. Triggered when a trip is registered, a driver is added, a truck is onboarded, etc.
edicion
An existing record was edited. Triggered when any field on an existing entity is updated through the Edit modal.
cancelacion
A record was cancelled. Typically used for trips or fines that are voided without being permanently removed.
baja
A record was soft-deactivated or deleted. Sets
activo: false on the affected entity rather than removing it from the database.Entity Filter
The audit log can be narrowed to a single module using theentidad query parameter. The component exposes a <select> populated from the entidades array defined in ListaAuditoria:
cambiarFiltroEntidad(valor), which resets the page to 1 and refetches with the new filter. Selecting Todos los eventos sends no entidad parameter, returning the full cross-module history.
| Filter value | Module |
|---|---|
viaje | Trips |
chofer | Drivers |
camion | Trucks |
multa | Fines |
combustible | Fuel |
usuario | User accounts |
AuditoriaService API
The service is registered application-wide via providedIn: 'root' and exposes a single method.
listar(entidad?, pagina, tamanoPagina)
Fetches a paginated page of audit events, optionally filtered to a single entity type.
| Parameter | Type | Default | Description |
|---|---|---|---|
entidad | string | undefined | When provided, only events for this entity type are returned. Omit or pass undefined for all entities. |
pagina | number | 1 | Page number to retrieve |
tamanoPagina | number | 50 | Records per page — larger than other modules to reduce navigation through high-volume audit data |
The default page size for the audit log is 50 records, compared to 20 in most other modules. This is intentional: audit events are dense and read-only, so larger pages reduce the number of clicks needed to review a period of activity.
Observable<RespuestaPaginada<Auditoria>>
Usage Example
The following TypeScript snippet shows howListaAuditoria loads events and reacts to filter changes, taken directly from the component source:
Audit Table Columns
The/auditoria view renders one row per event with the following four columns:
| Column | Source field | Notes |
|---|---|---|
| Fecha y hora | fecha_hora | Formatted as dd/MM/yyyy HH:mm via Angular DatePipe |
| Acción | tipo_accion | Displayed as a coloured badge; CSS class matches the action name |
| Entidad | entidad | Plain text module name |
| Detalle | detalle | Raw detail string; renders - when null |
Audit records are read-only. There are no edit or delete controls anywhere in the frontend. The table and its pagination component are the only UI elements on the page, intentionally keeping the view simple and tamper-proof.
Workflow
Navigate to Auditoría
Click Auditoría in the sidebar. The page loads the most recent 50 events across all modules, sorted by
fecha_hora descending.Filter by entity (optional)
Use the Filtrar por tipo dropdown to narrow the log to a specific module such as
viaje or usuario. The page resets to 1 and the table refreshes immediately.Paginate through history
Use the pagination controls at the bottom of the table to move through older events. Each page loads 50 records from the API.