Tanstack Start
Fleet & trackingVehicles

Create and edit vehicles

Multi-step add vehicle wizard and edit dialog fields.

Add vehicle

Where: Vehicles list → Add vehicle (requires create_vehicle and list_vehicle_type, list_device, list_nationality).

API: Vehicles.create with a cleaned payload built from the form.

Wizard structure (4 steps)

  1. Basic information

    • Vehicle type (required; from vehicle types list).
    • Plate number (required; plate input).
    • Previous plate number (optional).
    • Secondary plate number (optional).
    • Make, Model.
    • Manufacturing year (select from generated year list).
    • Chassis number.
    • Motor engine number.
    • Color (color combobox).
    • Device (device picker).
    • Status (status combobox).
  2. Engine & dimension

    • Engine capacity (L), Engine power (KW), Engine torque (Nm).
    • Number of cylinders.
    • Max speed, Distance per liter, Liters per hour (numeric fields as shown in the form).
  3. Vehicle specification

    • Width, Height, Passenger capacity, Cargo capacity, Ground clearance, Fuel capacity, Oil capacity (numeric fields).
  4. Owner information

    • Owner full name, Phone (phone input), House number, Nationality (nationality combobox).

Use Next / Back to move between steps; validation runs per step via the schema. Submit on the final step creates the vehicle and closes the dialog on success.

Edit vehicle

Where: Vehicles table → row ActionsEdit vehicle (requires update_vehicle and the same list permissions as add: list_vehicle_type, list_device, list_nationality).

The edit dialog reuses the same four-step structure and schema as add, pre-filled from the selected vehicle. Saving calls the update mutation with a cleaned payload analogous to create.

Troubleshooting

  • Button not visible: Missing create_vehicle or one of the dependent list permissions; admin must update the role.
  • Comboboxes empty: Backend lists (vehicle types, devices, nationalities) returned no rows for your scope.
  • Validation errors: Complete required fields on the current step before Next; check plate and numeric formats.

On this page