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 Vehiculo → Avaluo 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
entidad | string(100) | Organisation or person requesting the appraisal |
fecha_evaluacion | date | Date the appraisal was initiated; cast to Carbon\Carbon |
ubicacion_actual | string(200) | Physical location of the vehicle at time of appraisal |
tipo_vehiculo | string(50) | Vehicle category (e.g. sedan, camioneta, moto) |
tipo_combustible | string(50) | Fuel type; nullable, defaults to "no tiene" |
id_marca | bigint (FK) | Foreign key → marca_vehiculo.id |
modelo | string(50) | Model name; defaults to "no tiene" |
año_fabricacion | integer | Year of manufacture; cast to integer |
placa | string(20) | License plate; nullable, defaults to "no tiene" |
serie_motor | string(50) | Engine serial number; nullable |
chasis | string(50) | Chassis number; nullable |
color | string(30) | Body colour; nullable |
procedencia | string(50) | Country / region of origin |
kilometraje | string(50) | Odometer reading (stored as string to allow range entries) |
precio_referencial | decimal(10,2) | Market reference price; cast to decimal:2 |
id_evaluador | bigint (FK) | Foreign key → users.id |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
marca() | BelongsTo | MarcaVehiculo via id_marca |
evaluador() | BelongsTo | User via id_evaluador |
avaluo() | HasOne | Avaluo via id_vehiculo |
condicionGeneral() | HasMany | CondicionGeneral via id_vehiculo |
sistemas() | HasMany | Sistema via id_vehiculo |
inspecciones() | HasMany | Inspeccion via id_vehiculo |
archivos() | HasMany | Archivo via id_vehiculo |
imagenes() | HasMany | VehiculoImagen via id_vehiculo |
accesorios() | HasMany | Accesorio 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
id_vehiculo | bigint (FK, UNIQUE) | Foreign key → vehiculos.id; unique constraint enforces 1-to-1 |
factor_reposicion | decimal(10,2) | Fixed replacement-cost markup factor (1.20); cast to decimal:2 |
final_estimacion | decimal(10,2) | Final calculated appraisal value in the selected currency; cast to decimal:2 |
moneda | string | Currency code ($us or Bs); defaults to $US |
depre_modelo | decimal(5,4) | Factor A — age-based depreciation (0–1 range); cast to decimal:4 |
depre_kilometraje | decimal(5,4) | Factor B — mileage-based depreciation (0–1 range); cast to decimal:4 |
depre_inspeccion | decimal(5,4) | Factor C — inspection-based depreciation (0–1 range); cast to decimal:4 |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculo() | BelongsTo | Vehiculo via id_vehiculo |
compartidos() | HasMany | AvaluoCompartido 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
nombre | string | Brand name (e.g. Toyota, Ford, Yamaha) |
tasa_k | decimal | Annual depreciation rate per year of age; cast to decimal:3 |
valor_residual | decimal | Minimum residual factor floor for the model depreciation (0–1); cast to decimal:3 |
user_id | bigint (FK) | Foreign key → users.id; owner of this brand entry |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculos() | HasMany | Vehiculo via id_marca |
user() | BelongsTo | User 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).
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
id_vehiculo | bigint (FK) | Foreign key → vehiculos.id |
titulo | string(50) | System section name (e.g. “Motor”, “Frenos”) |
componente | string(100) | Specific component being inspected |
estado | json (nullable) | JSON array of condition states; cast to array |
valoracion | decimal(8,4) (nullable) | Weighted value (0–1) for this component; cast to decimal:5 |
observaciones | text (nullable) | Free-text inspector notes |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculo() | BelongsTo | Vehiculo 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
id_vehiculo | bigint (FK) | Foreign key → vehiculos.id |
nombre | string | Fault category name |
caracteristica | string | Specific defect characteristic being evaluated |
tiene | boolean | true if the fault is present on this vehicle; cast to boolean |
valoracion | decimal(4,5) (nullable) | Severity weight (e.g. 0.025); cast to decimal:4 |
observaciones | string (nullable) | Inspector notes |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculo() | BelongsTo | Vehiculo 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
id_vehiculo | bigint (FK) | Foreign key → vehiculos.id |
estado_operativo | string | Operational status (e.g. “Funcional”, “No funcional”) |
estado_general | string | Overall cosmetic/mechanical condition rating |
observaciones | string | Free-text notes from the evaluator |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculo() | BelongsTo | Vehiculo 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
id_vehiculo | bigint (FK) | Foreign key → vehiculos.id |
lado | string | Camera angle or side (e.g. “Frontal”, “Lateral Izquierdo”) |
url | string | Storage path or public URL of the image file |
descripcion | string | Optional description of what the image shows |
fecha | date | Date the photograph was taken; cast to date |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculo() | BelongsTo | Vehiculo 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
id_vehiculo | bigint (FK) | Foreign key → vehiculos.id |
tipo_archivo | string | File type descriptor (e.g. “PDF”, “Informe”) |
url | string | Storage path or public URL of the file |
comentario | string | Optional comment about the document |
fecha | date | Date the file was generated or uploaded; cast to date |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculo() | BelongsTo | Vehiculo 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
avaluo_id | bigint (FK) | Foreign key → avaluo.id |
user_id | bigint (FK) | Foreign key → users.id; user who created the share |
token | string | Unique random token used in the public share URL |
fecha_inicio | datetime | Start of the valid access window; cast to datetime |
fecha_fin | datetime | End of the valid access window; cast to datetime |
estado | string | Share status (e.g. activo, expirado, revocado) |
fecha_compartido | datetime | Timestamp when the share was created; cast to datetime |
motivo | string | Reason / purpose for sharing the appraisal |
contador_vistas | integer | Number of times the shared link has been accessed; cast to integer |
observaciones | string | Additional notes from the sharing user |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
avaluo() | BelongsTo | Avaluo via avaluo_id |
user() | BelongsTo | User 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
id_vehiculo | bigint (FK) | Foreign key → vehiculos.id |
componente | string | Accessory name (e.g. “Aire Acondicionado”, “Winche”) |
aplica | boolean | Whether this accessory is relevant for this vehicle type; cast to boolean |
estado | string | Condition if present (e.g. “Bueno”, “Regular”, “Malo”) |
observacion | string | Free-text note |
deleted_at | timestamp | Soft-delete timestamp |
created_at / updated_at | timestamp | Laravel timestamps |
Relationships:
| Method | Type | Target |
|---|
vehiculo() | BelongsTo | Vehiculo 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
titulo | string | Fault section/category name |
componente | string | Specific fault item description |
valoracion | decimal | Default severity weight (0–1) for this fault; cast to decimal:4 |
created_at / updated_at | timestamp | Laravel 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.
| Field | Type | Description |
|---|
id | bigint (PK) | Auto-increment primary key |
titulo | string | Technical section name (e.g. “Motor”, “Sistema Eléctrico”) |
componente | string | Component name within the section |
valoracion | decimal | Default weighted value for this component |
opciones | json | Array of selectable condition states; cast to array |
created_at / updated_at | timestamp | Laravel timestamps |