The Combustible module is the primary cost-tracking tool in Aibar SRL App. Every time a truck is refuelled, operators log the litres dispensed, the amount paid, the odometer reading, and — optionally — the trip the vehicle was running at the time. Because fuel is typically the largest variable operating expense in a transport fleet, this data feeds directly into per-vehicle cost analysis via 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.
gastoTotalPorCamion summary endpoint. The list view defaults to the last 30 days so dispatchers see recent activity at a glance, with a single toggle to expand to the full historical record.
Data Models
CargaCombustible
The read model returned by the API for every fuel load record.
Unique identifier for the fuel load record.
ID of the truck that was refuelled.
Trip the truck was assigned to at the time of the load.
null when the load was not linked to any trip.Volume of fuel dispensed, in litres.
Total cost of the fuel load in the local currency.
Date of the fuel load in ISO 8601 format (
YYYY-MM-DD). Defaults to today when not supplied at creation.Odometer reading recorded at the time of refuelling.
null if not captured.ID of the user who created the record. Set by the backend.
UTC timestamp of when the record was inserted into the database.
CargaCombustibleCreate
The write model sent to the API when registering a new fuel load.
ID of the truck being refuelled. Must match an existing truck in the fleet.
Litres of fuel loaded. Must be greater than zero — the component validates this before submitting.
Total cost of the load. Must be greater than zero.
Optional. Links this fuel load to a specific trip. When provided, the load can be attributed to a route’s operating cost.
Optional. ISO 8601 date string (
YYYY-MM-DD). When omitted, the backend defaults to the current date.Optional. Odometer value at the time of refuelling. Useful for calculating fuel consumption per kilometre over time.
CombustibleService
CombustibleService is a root-level Angular injectable that wraps all fuel-related API calls.
listar()
Fetches a paginated list of fuel loads. By default, only loads from the last 30 days are returned.
camion_id query parameter is appended only when camionId is provided. The response is wrapped in the standard RespuestaPaginada<T> envelope:
30-Day Filter
soloUltimos30Dias defaults to true, which means the API only returns fuel loads with a fecha within the past 30 calendar days. This keeps the default list relevant and fast.
To retrieve the complete historical record for a truck, pass false:
ListaCombustible component, this is controlled by the verTodoElHistorico signal and wired to a checkbox in the UI:
crear()
Posts a new fuel load record to the API.
camion_id is set and that both litros and monto are greater than zero before calling this method:
gastoTotalPorCamion()
Returns an aggregate cost summary for a single truck — across all loads ever recorded, regardless of date range.
The truck ID the summary belongs to.
Total litres of fuel loaded across all records for this truck.
Total amount spent on fuel for this truck.
Number of individual fuel load records for this truck.
Usage example
The component callsgastoTotalPorCamion() whenever a truck filter is active, and stores the result in the gastoTotal signal for display:
Linking a Fuel Load to a Trip
Theviaje_id field is optional on CargaCombustibleCreate. When a truck is refuelled mid-route or at the start of a trip, supply the trip’s ID to associate the cost directly with that journey:
viaje_id entirely. The stored record will have viaje_id: null.
How the List Component Works
Load trucks on init
ngOnInit fetches all trucks via CamionesService (up to 1 000 records) and builds a Record<string, string> map of camion_id → patente for fast label resolution.Fetch fuel loads
cargarCargas() calls listar() with the current page, page size, truck filter, and the verTodoElHistorico flag. The paginated result is stored in the cargas signal.Show per-truck summary
If a truck filter is active,
gastoTotalPorCamion() is also called and the result is shown in the summary banner above the table.Paginate
The
<app-paginacion> component handles page navigation. Changing pages re-calls cargarCargas() with the new page number.The table displays the truck’s licence plate (
patente) rather than its raw UUID. The nombrePatente() helper resolves camion_id against the pre-loaded camionesPorId map. If a truck ID cannot be resolved, it falls back to 'Desconocido'.