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.

The Avalúo Vehicular data model is structured around a central Vehiculo → Avaluo relationship. Every vehicle record (vehiculos) acts as the root entity: once all inspection and technical data is entered, a single appraisal record (avaluo) is computed and persisted for that vehicle. Branching off the vehicle are supporting entities for mechanical systems, visual fault inspections, general condition notes, uploaded images, generated PDF files, and accessories. Two configurable catalog tables (seccion_tecnicas, seccion_fallas) hold the master templates from which per-vehicle inspection rows are generated.
The VehiculoAvaluo relationship is strictly one-to-one (hasOne / belongsTo). The id_vehiculo column on the avaluo table carries a UNIQUE constraint, enforcing this at the database level. Every call to AvaluoController::index() uses updateOrCreate so the appraisal record is recalculated in place whenever the vehicle data changes.

Vehiculo

Table: vehiculos | SoftDeletes: The primary entity in the system. Represents a physical vehicle submitted for appraisal, including its identity information, technical specifications, and the reference market price used as the base of all depreciation calculations.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
entidadstring(100)Organisation or person requesting the appraisal
fecha_evaluaciondateDate the appraisal was initiated; cast to Carbon\Carbon
ubicacion_actualstring(200)Physical location of the vehicle at time of appraisal
tipo_vehiculostring(50)Vehicle category (e.g. sedan, camioneta, moto)
tipo_combustiblestring(50)Fuel type; nullable, defaults to "no tiene"
id_marcabigint (FK)Foreign key → marca_vehiculo.id
modelostring(50)Model name; defaults to "no tiene"
año_fabricacionintegerYear of manufacture; cast to integer
placastring(20)License plate; nullable, defaults to "no tiene"
serie_motorstring(50)Engine serial number; nullable
chasisstring(50)Chassis number; nullable
colorstring(30)Body colour; nullable
procedenciastring(50)Country / region of origin
kilometrajestring(50)Odometer reading (stored as string to allow range entries)
precio_referencialdecimal(10,2)Market reference price; cast to decimal:2
id_evaluadorbigint (FK)Foreign key → users.id
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
marca()BelongsToMarcaVehiculo via id_marca
evaluador()BelongsToUser via id_evaluador
avaluo()HasOneAvaluo via id_vehiculo
condicionGeneral()HasManyCondicionGeneral via id_vehiculo
sistemas()HasManySistema via id_vehiculo
inspecciones()HasManyInspeccion via id_vehiculo
archivos()HasManyArchivo via id_vehiculo
imagenes()HasManyVehiculoImagen via id_vehiculo
accesorios()HasManyAccesorio via id_vehiculo

Avaluo

Table: avaluo | SoftDeletes: Stores the computed appraisal result for a vehicle. This record is created or updated by AvaluoController::index() every time the appraisal page is visited. All three depreciation factors (A, B, C) are stored alongside the final estimated value so the calculation is auditable without re-running it.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
id_vehiculobigint (FK, UNIQUE)Foreign key → vehiculos.id; unique constraint enforces 1-to-1
factor_reposiciondecimal(10,2)Fixed replacement-cost markup factor (1.20); cast to decimal:2
final_estimaciondecimal(10,2)Final calculated appraisal value in the selected currency; cast to decimal:2
monedastringCurrency code ($us or Bs); defaults to $US
depre_modelodecimal(5,4)Factor A — age-based depreciation (0–1 range); cast to decimal:4
depre_kilometrajedecimal(5,4)Factor B — mileage-based depreciation (0–1 range); cast to decimal:4
depre_inspecciondecimal(5,4)Factor C — inspection-based depreciation (0–1 range); cast to decimal:4
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculo()BelongsToVehiculo via id_vehiculo
compartidos()HasManyAvaluoCompartido via avaluo_id

MarcaVehiculo

Table: marca_vehiculo | SoftDeletes: Brand/make catalog with brand-specific depreciation parameters. The tasa_k and valor_residual fields feed directly into Factor A (age depreciation). Each brand is owned by a user, allowing evaluators to maintain their own rate tables.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
nombrestringBrand name (e.g. Toyota, Ford, Yamaha)
tasa_kdecimalAnnual depreciation rate per year of age; cast to decimal:3
valor_residualdecimalMinimum residual factor floor for the model depreciation (0–1); cast to decimal:3
user_idbigint (FK)Foreign key → users.id; owner of this brand entry
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculos()HasManyVehiculo via id_marca
user()BelongsToUser via user_id

Sistema

Table: sistemas | SoftDeletes: Records a technical inspection item for a specific mechanical or structural system on the vehicle (e.g. engine, brakes, suspension). The estado field is a JSON array holding multiple inspection sub-states for the component, and valoracion is the weighted contribution of this system to Factor C (Tecnica).
FieldTypeDescription
idbigint (PK)Auto-increment primary key
id_vehiculobigint (FK)Foreign key → vehiculos.id
titulostring(50)System section name (e.g. “Motor”, “Frenos”)
componentestring(100)Specific component being inspected
estadojson (nullable)JSON array of condition states; cast to array
valoraciondecimal(8,4) (nullable)Weighted value (0–1) for this component; cast to decimal:5
observacionestext (nullable)Free-text inspector notes
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculo()BelongsToVehiculo via id_vehiculo

Inspeccion

Table: inspeccion | SoftDeletes: Records a visual fault or defect found on the vehicle during inspection. Each row represents one inspectable characteristic (e.g. a dent, a cracked windshield, worn tyres). The tiene flag marks whether the fault was found present, and valoracion is the severity weight subtracted from the faults sub-score in Factor C.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
id_vehiculobigint (FK)Foreign key → vehiculos.id
nombrestringFault category name
caracteristicastringSpecific defect characteristic being evaluated
tienebooleantrue if the fault is present on this vehicle; cast to boolean
valoraciondecimal(4,5) (nullable)Severity weight (e.g. 0.025); cast to decimal:4
observacionesstring (nullable)Inspector notes
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculo()BelongsToVehiculo via id_vehiculo

CondicionGeneral

Table: condicion_general | SoftDeletes: A free-text summary of the vehicle’s overall operational and cosmetic condition, authored by the evaluator after completing all detailed inspections.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
id_vehiculobigint (FK)Foreign key → vehiculos.id
estado_operativostringOperational status (e.g. “Funcional”, “No funcional”)
estado_generalstringOverall cosmetic/mechanical condition rating
observacionesstringFree-text notes from the evaluator
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculo()BelongsToVehiculo via id_vehiculo

VehiculoImagen

Table: vehiculo_imagen | SoftDeletes: Stores references to photographs taken of the vehicle during the appraisal inspection. Multiple images can be attached to a vehicle, each tagged with the angle/side it depicts.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
id_vehiculobigint (FK)Foreign key → vehiculos.id
ladostringCamera angle or side (e.g. “Frontal”, “Lateral Izquierdo”)
urlstringStorage path or public URL of the image file
descripcionstringOptional description of what the image shows
fechadateDate the photograph was taken; cast to date
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculo()BelongsToVehiculo via id_vehiculo

Archivo

Table: archivos | SoftDeletes: Tracks generated or uploaded documents associated with a vehicle — primarily the PDF appraisal report produced via barryvdh/laravel-dompdf or carlos-meneses/laravel-mpdf.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
id_vehiculobigint (FK)Foreign key → vehiculos.id
tipo_archivostringFile type descriptor (e.g. “PDF”, “Informe”)
urlstringStorage path or public URL of the file
comentariostringOptional comment about the document
fechadateDate the file was generated or uploaded; cast to date
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculo()BelongsToVehiculo via id_vehiculo

AvaluoCompartido

Table: avaluo_compartido | SoftDeletes: Manages time-limited, tokenized sharing of an appraisal result with an external viewer. Each record represents one sharing event, tracking the access window, access count, and the reason the appraisal was shared.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
avaluo_idbigint (FK)Foreign key → avaluo.id
user_idbigint (FK)Foreign key → users.id; user who created the share
tokenstringUnique random token used in the public share URL
fecha_iniciodatetimeStart of the valid access window; cast to datetime
fecha_findatetimeEnd of the valid access window; cast to datetime
estadostringShare status (e.g. activo, expirado, revocado)
fecha_compartidodatetimeTimestamp when the share was created; cast to datetime
motivostringReason / purpose for sharing the appraisal
contador_vistasintegerNumber of times the shared link has been accessed; cast to integer
observacionesstringAdditional notes from the sharing user
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
avaluo()BelongsToAvaluo via avaluo_id
user()BelongsToUser via user_id

Accesorio

Table: accesorios | SoftDeletes: Records whether a given optional accessory or equipment item is present on the vehicle and, if so, its condition. Used to provide a complete accessories inventory in the final appraisal report.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
id_vehiculobigint (FK)Foreign key → vehiculos.id
componentestringAccessory name (e.g. “Aire Acondicionado”, “Winche”)
aplicabooleanWhether this accessory is relevant for this vehicle type; cast to boolean
estadostringCondition if present (e.g. “Bueno”, “Regular”, “Malo”)
observacionstringFree-text note
deleted_attimestampSoft-delete timestamp
created_at / updated_attimestampLaravel timestamps
Relationships:
MethodTypeTarget
vehiculo()BelongsToVehiculo via id_vehiculo

SeccionFalla

Table: seccion_fallas | SoftDeletes: Master catalog of fault inspection items used to pre-populate the inspeccion rows when a new vehicle is registered. Each row defines one inspectable defect characteristic and its severity weight. Administrators manage this catalog to customise which faults are evaluated.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
titulostringFault section/category name
componentestringSpecific fault item description
valoraciondecimalDefault severity weight (0–1) for this fault; cast to decimal:4
created_at / updated_attimestampLaravel timestamps

SeccionTecnica

Table: seccion_tecnicas | SoftDeletes: Master catalog of technical inspection sections used to pre-populate sistemas rows. The opciones JSON field holds the set of possible inspection states (condition options) that the evaluator can select for each component.
FieldTypeDescription
idbigint (PK)Auto-increment primary key
titulostringTechnical section name (e.g. “Motor”, “Sistema Eléctrico”)
componentestringComponent name within the section
valoraciondecimalDefault weighted value for this component
opcionesjsonArray of selectable condition states; cast to array
created_at / updated_attimestampLaravel timestamps

Build docs developers (and LLMs) love