Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alber1802/AvaluoVehicular/llms.txt

Use this file to discover all available pages before exploring further.

Vehicle brand depreciation rates are the central configuration that drives how an appraisal calculates a vehicle’s age-adjusted value. Every brand registered in the system carries its own annual depreciation rate (tasa_k) and a residual value floor (valor_residual). These two figures are applied during the appraisal computation to produce depre_modelo — the model depreciation factor stored on the Avaluo record. Getting these rates right is essential: they directly translate into the final monetary estimate presented to evaluators and clients.
Brand depreciation rates directly affect every appraisal that references that brand. Review and calibrate rates against market data regularly to keep appraisal results accurate.

The MarcaVehiculo Model

Brand configuration is stored in the marca_vehiculo table and managed through the App\Models\MarcaVehiculo model.
FieldDB TypeCastDescription
nombrestringCommercial brand name (e.g., Toyota, Ford, Chevrolet)
tasa_kdecimal(8,2)decimal:3Annual depreciation rate as a decimal fraction. 0.08 means the vehicle loses 8 % of its value each year.
valor_residualdecimal(8,2)decimal:3Minimum residual value floor as a decimal fraction. 0.10 means the vehicle will never appraise below 10 % of its reference price, no matter how old it is.
user_idforeignIdThe admin user who created the brand entry (cascades on user deletion)
Each brand also exposes a vehiculos relationship (hasMany(Vehiculo::class, 'id_marca')) so you can trace how many vehicles in the system are assigned to each brand.

Depreciation Formula

The model depreciation factor is calculated using the following formula:
depre_modelo = max(1 - (tasa_k × antigüedad), valor_residual)
Where:
  • tasa_k — the brand’s annual depreciation rate (e.g., 0.08)
  • antigüedad — vehicle age in whole years: current_year − año_fabricacion
  • valor_residual — the configured floor that prevents depre_modelo from dropping below a minimum (e.g., 0.10)
Example: A Toyota manufactured in 2015, evaluated in 2025 (antigüedad = 10), with tasa_k = 0.08 and valor_residual = 0.10:
depre_modelo = max(1 - (0.08 × 10), 0.10)
             = max(1 - 0.80, 0.10)
             = max(0.20, 0.10)
             = 0.20
The vehicle retains 20 % of its reference price as the model depreciation factor. The valor_residual floor kicks in only once 1 - (tasa_k × antigüedad) would fall below it — in this case a vehicle older than ~11 years would otherwise compute to less than 10 %, so it is clamped to 0.10.

Routes

All routes are grouped under the /depreciacion prefix and require the auth and verified middleware.

List All Brands

GET /depreciacion/consultar
Returns all brands ordered alphabetically by nombre and renders the Depreciacion/DepreMarcaVehiculo Inertia page. Any authenticated user can read this list.

Add a New Brand

POST /depreciacion/crear
Creates a new MarcaVehiculo record and associates it with the currently authenticated user. Required fields:
FieldRule
nombrerequired, string, max:255, unique in marca_vehiculo.nombre
tasa_krequired, numeric
valor_residualrequired, numeric

Update Brand Rates

POST /depreciacion/actualizar/{id}
Updates any combination of nombre, tasa_k, and valor_residual for an existing brand. Changes take effect immediately on all future appraisal calculations — existing Avaluo records are not retroactively recalculated.

Delete a Brand

DELETE /depreciacion/eliminar/{id}
Permanently removes the brand record from the database.
Deleting a brand does not remove vehicles already assigned to it. Those Vehiculo records retain their id_marca foreign key, which will become a dangling reference. Reassign or delete affected vehicles before removing a brand to avoid data integrity issues.

Sample Depreciation Rates

The table below shows representative rates based on typical vehicle market behaviour. These values are illustrative — set rates that reflect actual market data in your region.
Brandtasa_kvalor_residualNotes
Toyota0.080.10Strong resale value; moderate annual depreciation
Ford0.100.10Slightly faster depreciation on most models
Chevrolet0.100.10Similar profile to Ford for common segments
Hyundai0.090.10Mid-range depreciation; good residual retention
Kia0.090.10Closely mirrors Hyundai rates
Nissan0.090.10Moderate depreciation with a stable floor
Mercedes-Benz0.120.15Higher depreciation but a higher residual floor
BMW0.130.15Fastest depreciation in the premium segment

Cross-Reference

For a full technical breakdown of how depre_modelo, depre_kilometraje, and depre_inspeccion are combined to produce the final_estimacion, see Depreciation Formula Reference.

Build docs developers (and LLMs) love