The Drivers module is the backbone of fleet personnel management in Aibar SRL App. Every trip must be assigned to a driver, making accurate driver data — name, contact details, availability status, and home-truck assignment — critical for day-to-day operations. TheDocumentation 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.
ListaChoferes component provides a paginated directory with inline actions to create, edit, and deactivate drivers, while ChoferesService handles all backend communication.
Driver States
Each driver carries anestado field that reflects their current availability:
disponible
The driver is on duty and free to be assigned to a new trip. Only drivers in this state appear in the new-trip dropdown.
viajando
The driver is currently on an active (
en_curso) trip. They cannot be assigned to another trip until the current one is finalised or cancelled.inactivo
The driver has been taken out of rotation, either temporarily or permanently. They will not appear in the available-driver list but their historical trip data is preserved.
Data Models
Chofer Interface
The full read model returned by the API for every driver record:
ChoferCreate Interface
The payload used when registering a new driver. Only nombre_completo is required:
ChoferCreate Fields
Full legal name of the driver. Used throughout the UI wherever a human-readable driver label is needed (e.g., the trip list shows
nombreChofer(viaje.chofer_id) which resolves to this value).National identity document number. Optional but recommended for compliance and driver verification.
Contact phone number for the driver. Optional — stored as a string to accommodate country codes and formatting variations.
UUID of the driver’s “home” truck — the vehicle habitually assigned to this driver. This is a default or preference field only. The actual truck used on any given trip is recorded directly on the
Viaje object and may differ from camion_id.ChoferesService
ChoferesService is an Angular Injectable provided at the root level. It encapsulates all REST calls to the /choferes resource.
listar()
Returns a paginated list of drivers. By default, only active drivers (activo: true) are included.
obtenerPorId()
Retrieves a single driver by their UUID.
Chofer object for the given id.
crear()
Registers a new driver. The driver is created with estado: 'disponible' and activo: true by default.
ChoferCreate object serialised as JSON.
Returns the newly created Chofer. The component validates that nombre_completo is non-empty before calling this method.
cambiarEstado()
Updates the driver’s availability state directly, without modifying any other fields.
Chofer. The backend also calls this endpoint internally when a trip is started (sets viajando) or completed/cancelled (resets to disponible).
actualizar()
Performs a partial update on a driver record. Accepts any subset of ChoferCreate fields.
Chofer. The edit modal pre-populates nombre_completo, dni, and telefono from the selected driver before sending only the changed values.
darDeBaja()
Soft-deletes a driver by setting activo: false on the backend. The driver record and all associated trip history are preserved.
Chofer with activo: false. Deactivated drivers are hidden from the default listing (activos_only=true) but remain visible when queried with activos_only=false.
Driver Lifecycle
Register a new driver
Open the registration modal via + Nuevo chofer. Provide at least the driver’s full name. DNI, phone, and a home truck are optional at registration time.
Assign to a trip
When creating a trip, only drivers with
estado === 'disponible' are shown in the dropdown. Selecting the driver and saving the trip transitions them to the correct state automatically.Edit contact details
Use the Editar action on any driver row to update
nombre_completo, dni, or telefono via a PATCH /choferes/{id} call.Home Truck Assignment (camion_id)
The camion_id on a Chofer record represents an optional default truck preference — the vehicle that is habitually driven by that person. It is purely informational at the driver level.
The truck that actually carries a given shipment is recorded on the
Viaje object (Viaje.camion_id), not derived from the driver’s home truck. A driver can be dispatched with any truck regardless of what Chofer.camion_id contains.Pagination
The driver list uses the sameRespuestaPaginada<Chofer> wrapper as all other modules. Pagination state is managed with Angular signals:
<app-paginacion> component emits a (cambioPagina) event which calls cambiarPagina(nueva), updating the signal and re-fetching the current page.