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.

An appraisal in Avalúo Vehicular is a structured, multi-step process managed by the Registro controller family. A new appraisal begins when an evaluator registers a vehicle and records its baseline data; it progresses through one of two evaluation paths (mechanical or visual inspection); and it concludes with photo uploads and automatic generation of the final estimated value. Every step is persisted independently, so work-in-progress appraisals can be paused and resumed at any time.

Vehicle Data Fields

The Vehiculo model (table vehiculos) stores the following fillable fields, all captured in the registration form at /registro/crear:
FieldTypeDescription
entidadstringName of the requesting entity or client
fecha_evaluaciondateDate of evaluation — set automatically to now() on creation
ubicacion_actualstringCurrent physical location of the vehicle
tipo_vehiculostringVehicle category (car, truck, motorcycle, etc.)
tipo_combustiblestringFuel type (gasoline, diesel, electric, etc.)
id_marcaintegerForeign key → marca_vehiculos; loaded from MarcaVehiculo::all()
modelostringModel name
año_fabricacionintegerManufacturing year
placastring|nullLicense plate — automatically uppercased and trimmed on save
serie_motorstringEngine serial number
chasisstringChassis / VIN number
colorstringVehicle color
procedenciastringCountry or region of origin
kilometrajeintegerOdometer reading; if 0 is submitted the system stores 500000 to represent an unknown high mileage
precio_referencialdecimal(8,2)Reference market price used as the base for the appraisal calculation
id_evaluadorintegerAutomatically set to Auth::user()->id on creation
The CondicionGeneral record is created alongside the vehicle and captures estado_operativo (comma-separated operational states), estado_general, and observaciones. The Vehiculo model also uses SoftDeletes — records are never hard-deleted from the database; they are moved to the recycle bin and can be restored via /reciclaje/listado.

Step-by-Step Appraisal Creation

1

Open the registration form

Navigate to GET /registro/crear. The page renders the Registro/create/registro Inertia component, which receives the full marcas catalog for the brand selector.
2

Fill in vehicle data and submit

Complete all required fields in the registration form and submit via POST /registro/avaluo. The CreateRequest form request validates the payload. On success, a Vehiculo and a linked CondicionGeneral record are created, and the user is redirected to the evaluation selector for the new vehicle ID.
3

Choose an evaluation method

The route GET /registro/seleccionar/{id} renders the SelecccionarMetodo page. Two paths are available:
  • Mecánica — scores each mechanical system component
  • Inspección — records visible faults found during physical examination
If an appraisal already exists for the vehicle, the user is redirected back to the dashboard immediately.
4

Complete the chosen evaluation

Depending on the selection in the previous step, the evaluator is routed to either:
  • GET /registro/evaluacion/mecanica/{id} — mechanical evaluation form
  • GET /registro/evaluacion/inspeccion/{id} — visual inspection form
Each form is pre-populated from its respective catalog (SeccionTecnica or SeccionFalla). Submitting a form a second time for the same vehicle is blocked — the controller checks for existing records and redirects to the resultados.avaluo.continuar route instead.
5

Upload vehicle images

After saving the evaluation, the user is redirected to GET /registro/imagenes/vehiculo/{id} to upload photos. Images are stored in the vehiculo_imagen table and are displayed in the final appraisal report.
6

View the appraisal result

The route GET /registro/resultado/avaluo/{id} triggers AvaluoController@index, which computes and persists the final estimated value using the three depreciation factors (model, mileage, inspection). The result page displays the full breakdown of all factors alongside vehicle data, images, and evaluator information.

Continuing an In-Progress Appraisal

Use the Continuar button on any vehicle card in the dashboard to pick up exactly where you left off. The system automatically detects which step is missing and sends you directly there — you never need to remember where you stopped.
The route GET /registro/continuar/avaluo/{id} is handled by ContinuarController@continuar. It inspects the completion state of every step and issues a redirect to the appropriate next screen. The internal “continuar” route used during step-to-step navigation is GET /registro/resultados/avaluo/continuar/{id} (named resultados.avaluo.continuar), handled by CreateRegistroController@show. Its branching logic is:
// CreateRegistroController::show()

// 1. Both avaluo and images are done → go to results
if (Avaluo::where('id_vehiculo', $vehiculo->id)->exists() && $hasImagenes) {
    return redirect()->route('resultados.avaluo', $vehiculo->id);
}

// 2. Neither evaluation step done → choose method
if (! $hasInspeccion && ! $hasSistema) {
    return Inertia::render('Registro/create/SelecccionarMetodo', ['id' => $vehiculo->id]);
}

// 3. No mechanical systems saved → go to mechanical evaluation
elseif (! $hasSistema) {
    return redirect()->route('evaluacion.mecanica', $vehiculo->id);
}

// 4. No inspection saved → go to visual inspection
elseif (! $hasInspeccion) {
    return redirect()->route('evaluacion.inspeccion', $vehiculo->id);
}

// 5. Both evaluations done but no images yet → go to images
else {
    return redirect()->route('imagenes.vehiculo', $vehiculo->id);
}

Editing an Existing Appraisal

Once a vehicle is registered, each section can be edited independently. The edit selection screen at GET /registro/resultados/avaluo/edit/{id} lists all editable sections. Authorization is enforced by a VehiculoPolicy on every edit and update route.
SectionView routeUpdate route
Vehicle dataGET /registro/avaluo/editDatosVehiculo/{id}POST /registro/avaluo/editDatosVehiculo/update/{id}
Mechanical evaluationGET /registro/evaluacion/mecanica/edit/{id}POST /registro/evaluacion/mecanica/update/{id}
Visual inspectionGET /registro/evaluacion/inspeccion/edit/{id}POST /registro/evaluacion/inspeccion/update/{id}
ImagesGET /registro/imagenes/vehiculo/edit/{id}POST /registro/imagenes/vehiculo/update/{id}
Mechanical and inspection updates use updateOrCreate keyed on (id_vehiculo, titulo, componente) and (id_vehiculo, nombre, caracteristica) respectively, so re-submitting the form is always safe.

Soft Delete and Recycle Bin

The Vehiculo model uses SoftDeletes:
class Vehiculo extends Model
{
    use HasFactory, SoftDeletes;
    // ...
}
Deleted vehicles are hidden from all normal queries but remain in the database with a deleted_at timestamp. They can be viewed, restored, or permanently deleted through the recycle bin at GET /reciclaje/listado.

Route Reference

MethodURINameDescription
GET/registro/crearregistro.indexVehicle registration form
POST/registro/avaluoregistro.storeSave new vehicle + condition
GET/registro/seleccionar/{id}registro.seleccionarChoose evaluation method
GET/registro/resultado/avaluo/{id}resultados.avaluoView final appraisal result
GET/registro/continuar/avaluo/{id}continuar.avaluoResume in-progress appraisal (dashboard button)
GET/registro/resultados/avaluo/continuar/{id}resultados.avaluo.continuarInternal step-to-step navigation
GET/registro/resultados/avaluo/edit/{id}resultados.avaluo.seleccionarEditarEdit section selector
GET/registro/avaluo/editDatosVehiculo/{id}avaluo.editDatosVehiculoEdit vehicle data form
POST/registro/avaluo/editDatosVehiculo/update/{id}avaluo.editDatosVehiculo.updateSave vehicle data changes

Build docs developers (and LLMs) love