The Multas module lets operators record traffic and administrative fines against fleet vehicles. In practice, transport companies rarely receive fine notifications in real time — infraction notices typically arrive days or even weeks later by post or municipal communication. The module therefore treatsDocumentation 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.
fecha (the date of the infraction) as fully independent from creado_en (the timestamp the record was entered into the system), allowing dispatchers to log a fine with the accurate infraction date regardless of when the paperwork landed. Each record can optionally be linked to the driver at the wheel and the active trip, giving management a complete picture of where and when penalties occurred.
Data Models
Multa
The read model returned by the API for every registered fine.
Unique identifier for the fine record.
ID of the truck to which the fine was issued.
ID of the driver who was operating the vehicle at the time.
null when the driver is not recorded or not known.ID of the trip the truck was running when the infraction occurred.
null when not linked to a specific trip.Free-text description of the infraction (e.g. “Exceso de velocidad”, “Estacionamiento indebido”).
Monetary value of the fine.
null when the amount has not yet been confirmed at the time of logging.Date of the infraction in ISO 8601 format (
YYYY-MM-DD). This is the official date on the notice, not the date the record was created.ID of the user who created the record. Set by the backend.
UTC timestamp of when the record was inserted into the database.
MultaCreate
The write model sent to the API when registering a new fine.
ID of the truck the fine was issued against. Must match an existing truck in the fleet.
Description of the infraction. Cannot be blank — the component trims and validates this field before submitting.
Optional. ID of the driver at the wheel. When the driver is unknown or not relevant, omit this field.
Optional. Links the fine to a specific trip. Useful for attributing the penalty to a particular route or customer job.
Optional. Fine amount in local currency. Can be added later once the official notice confirms the value. See the note below.
Optional. ISO 8601 date string (
YYYY-MM-DD) representing the actual infraction date. When omitted, the backend defaults to the current date. Supply the date from the official notice to keep records accurate.monto is intentionally optional. Municipal fine notices often arrive before the payment amount is officially set or before the company has reviewed the infraction. Log the fine immediately with motivo and fecha to preserve the accurate infraction date, then update the amount once it is confirmed.MultasService
MultasService is a root-level Angular injectable that wraps all fines-related API calls.
listar()
Fetches a paginated list of all fines, ordered by the backend default (most recent first).
RespuestaPaginada<T> envelope:
crear()
Posts a new fine record to the API.
TypeScript example — creating a fine
camion_id and motivo are present before calling crear():
The fecha Field and Retroactive Entry
fecha and creado_en represent two distinct moments in time:
| Field | Meaning | Set by |
|---|---|---|
fecha | Date the infraction occurred (from the official notice) | Operator, at registration |
creado_en | UTC timestamp the record was inserted into the database | Backend, automatically |
fecha must be entered manually from the document. If omitted, it defaults to today — which is almost never the correct infraction date. Always enter the date printed on the official notice.
How the List Component Works
Load reference data on init
ngOnInit triggers cargarDatosRelacionados(), which first fetches all trucks via CamionesService (up to 1 000 records), building a camion_id → patente lookup map.Load drivers
Once trucks are loaded,
cargarChoferesYMultas() fetches all drivers via ChoferesService, building a chofer_id → nombre_completo map. Both lookups complete before the fines list is fetched.Fetch fines
cargarMultas() calls listar() with the current page and page size. The paginated result is stored in the multas signal.Resolve labels
The template uses
nombrePatente() and nombreChofer() helpers to display human-readable labels instead of raw UUIDs. If a chofer ID is null, the cell renders '-'.Paginate
The
<app-paginacion> component handles page navigation. Changing pages re-calls cargarMultas() with the updated page number.