> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Braian551/viax/llms.txt
> Use this file to discover all available pages before exploring further.

# Vehicle Types

> Manage vehicle categories, requirements, and configurations

## Overview

Viax supports multiple vehicle types to serve different transportation needs. Each vehicle type has specific requirements, pricing, and operational characteristics.

## Supported Vehicle Types

<CardGroup cols={2}>
  <Card title="Motorcycle" icon="motorcycle" color="#667eea">
    **Code:** `moto`

    **Purpose:** Personal transport for 1 passenger

    **License Required:** A2 or higher

    **Base Fare:** \$4,000 COP
  </Card>

  <Card title="Car" icon="car" color="#11998e">
    **Code:** `carro`

    **Purpose:** Personal transport for up to 4 passengers

    **License Required:** C1 or higher

    **Base Fare:** \$6,000 COP
  </Card>

  <Card title="Cargo Motorcycle" icon="truck-fast" color="#ffa726">
    **Code:** `moto_carga`

    **Purpose:** Small package delivery

    **License Required:** C1 or higher

    **Base Fare:** \$5,000 COP
  </Card>

  <Card title="Cargo Van" icon="truck" color="#f5576c">
    **Code:** `carro_carga`

    **Purpose:** Large package and furniture delivery

    **License Required:** C2 or higher

    **Base Fare:** \$8,000 COP
  </Card>
</CardGroup>

## Vehicle Type Entity

```dart theme={null}
enum VehicleType {
  moto('moto', 'Moto', Icons.two_wheeler),
  carro('carro', 'Carro', Icons.directions_car),
  motoCarga('moto_carga', 'Moto Carga', Icons.delivery_dining),
  carroCarga('carro_carga', 'Carro Carga', Icons.local_shipping);

  final String code;
  final String displayName;
  final IconData icon;
  
  const VehicleType(this.code, this.displayName, this.icon);
  
  static VehicleType fromCode(String code) {
    return VehicleType.values.firstWhere(
      (type) => type.code == code,
      orElse: () => VehicleType.carro,
    );
  }
}
```

## License Requirements

### Colombia License Categories

<Tabs>
  <Tab title="Category A2">
    **Vehicles:** Motorcycles

    **Engine Size:** Up to 200cc

    **Viax Vehicle Types:** `moto`

    **Age Requirement:** 16+ years
  </Tab>

  <Tab title="Category C1">
    **Vehicles:** Passenger cars, light trucks

    **Weight:** Up to 3,500 kg

    **Viax Vehicle Types:** `carro`, `moto_carga`

    **Age Requirement:** 18+ years
  </Tab>

  <Tab title="Category C2">
    **Vehicles:** Medium trucks, vans

    **Weight:** 3,500 kg - 10,500 kg

    **Viax Vehicle Types:** `carro_carga`

    **Age Requirement:** 18+ years
  </Tab>
</Tabs>

### License Validation

```dart theme={null}
bool isLicenseValidForVehicleType(String licenseCategory, String vehicleType) {
  final validCombinations = {
    'moto': ['A1', 'A2', 'B1', 'B2', 'C1', 'C2'],
    'carro': ['C1', 'C2'],
    'moto_carga': ['C1', 'C2'],
    'carro_carga': ['C2'],
  };
  
  return validCombinations[vehicleType]?.contains(licenseCategory) ?? false;
}
```

## Vehicle Information Fields

### Required Fields

```dart admin/domain/entities/vehicle.dart theme={null}
class Vehicle {
  final String tipo;          // 'moto', 'carro', 'moto_carga', 'carro_carga'
  final String placa;         // License plate (e.g., 'ABC123')
  final String marca;         // Brand (e.g., 'Toyota', 'Yamaha')
  final String modelo;        // Model (e.g., 'Corolla', 'FZ')
  final int anio;            // Year (e.g., 2020)
  final String color;         // Color (e.g., 'Blanco', 'Negro')
  
  // Validation
  bool get isValid {
    return placa.isNotEmpty &&
           marca.isNotEmpty &&
           modelo.isNotEmpty &&
           anio >= 2000 && anio <= DateTime.now().year + 1;
  }
}
```

### Optional Fields

```dart theme={null}
class VehicleDetails extends Vehicle {
  final String? numeroMotor;
  final String? numeroChasis;
  final int? kilometraje;
  final String? transmision;  // 'Manual', 'Automática'
  final String? combustible;  // 'Gasolina', 'Eléctrico', 'Híbrido'
  final int? capacidadPasajeros;
  final double? capacidadCarga; // kg
}
```

## Vehicle Database Schema

```sql theme={null}
CREATE TABLE vehiculos (
  id INT AUTO_INCREMENT PRIMARY KEY,
  conductor_id INT NOT NULL,
  tipo ENUM('moto', 'carro', 'moto_carga', 'carro_carga') NOT NULL,
  placa VARCHAR(10) NOT NULL UNIQUE,
  marca VARCHAR(50) NOT NULL,
  modelo VARCHAR(50) NOT NULL,
  anio INT NOT NULL,
  color VARCHAR(30) NOT NULL,
  numero_motor VARCHAR(50),
  numero_chasis VARCHAR(50),
  kilometraje INT,
  transmision ENUM('Manual', 'Automática'),
  combustible ENUM('Gasolina', 'Diésel', 'Eléctrico', 'Híbrido'),
  capacidad_pasajeros INT,
  capacidad_carga DECIMAL(8, 2),
  activo BOOLEAN DEFAULT TRUE,
  verificado BOOLEAN DEFAULT FALSE,
  fecha_verificacion DATETIME,
  creado_en TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  actualizado_en TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  FOREIGN KEY (conductor_id) REFERENCES usuarios(id)
);
```

## Vehicle Type Configuration

Each vehicle type has specific configuration in the pricing table:

```sql theme={null}
SELECT 
  tipo_vehiculo,
  tarifa_base,
  costo_por_km,
  costo_por_minuto,
  tarifa_minima
FROM configuracion_precios
WHERE activo = TRUE;
```

### Configuration by Type

| Type             | Base    | Per KM  | Per Min | Minimum  |
| ---------------- | ------- | ------- | ------- | -------- |
| **moto**         | \$4,000 | \$2,000 | \$250   | \$6,000  |
| **carro**        | \$6,000 | \$3,000 | \$400   | \$9,000  |
| **moto\_carga**  | \$5,000 | \$2,500 | \$300   | \$7,500  |
| **carro\_carga** | \$8,000 | \$3,500 | \$450   | \$12,000 |

## Vehicle Selection UI

### User Selection Screen

```dart user/presentation/screens/select_destination_screen.dart theme={null}
Widget _buildVehicleTypeSelector() {
  return Row(
    children: [
      _buildVehicleTypeCard(
        type: 'moto',
        icon: Icons.two_wheeler,
        label: 'Moto',
        price: '± $6,000',
      ),
      _buildVehicleTypeCard(
        type: 'carro',
        icon: Icons.directions_car,
        label: 'Carro',
        price: '± $9,000',
      ),
      _buildVehicleTypeCard(
        type: 'moto_carga',
        icon: Icons.delivery_dining,
        label: 'Moto Carga',
        price: '± $7,500',
      ),
      _buildVehicleTypeCard(
        type: 'carro_carga',
        icon: Icons.local_shipping,
        label: 'Carro Carga',
        price: '± $12,000',
      ),
    ],
  );
}
```

## Vehicle Verification Process

<Steps>
  <Step title="Driver Registration">
    Driver enters vehicle information during onboarding
  </Step>

  <Step title="Document Upload">
    Driver uploads:

    * Vehicle registration (Tarjeta de Propiedad)
    * SOAT (mandatory insurance)
    * Technomechanical inspection certificate
    * Photos of the vehicle
  </Step>

  <Step title="Admin Review">
    Admin verifies:

    * License plate matches registration
    * Driver's license category is valid for vehicle type
    * All documents are valid and not expired
  </Step>

  <Step title="Approval">
    Vehicle is marked as `verificado = TRUE` and driver can start accepting trips
  </Step>
</Steps>

## Vehicle Age Restrictions

Implement vehicle age limits:

```dart theme={null}
class VehicleAgePolicy {
  static const maxAgeYears = {
    'moto': 15,
    'carro': 15,
    'moto_carga': 12,
    'carro_carga': 12,
  };
  
  static bool isVehicleAgeValid(String vehicleType, int year) {
    final currentYear = DateTime.now().year;
    final vehicleAge = currentYear - year;
    final maxAge = maxAgeYears[vehicleType] ?? 15;
    
    return vehicleAge <= maxAge;
  }
  
  static String getAgeRejectionMessage(String vehicleType, int year) {
    final currentYear = DateTime.now().year;
    final vehicleAge = currentYear - year;
    final maxAge = maxAgeYears[vehicleType] ?? 15;
    
    return 'Vehículo muy antiguo ($vehicleAge años). '
           'Máximo permitido: $maxAge años para $vehicleType.';
  }
}
```

## Vehicle Capacity

Define passenger and cargo limits:

```dart theme={null}
class VehicleCapacity {
  static const passengerCapacity = {
    'moto': 1,           // Driver + 1 passenger
    'carro': 4,          // Driver + 4 passengers
    'moto_carga': 0,     // No passengers, cargo only
    'carro_carga': 1,    // Driver + 1 helper
  };
  
  static const cargoCapacityKg = {
    'moto': 0.0,         // No cargo
    'carro': 50.0,       // Small luggage
    'moto_carga': 150.0, // Medium packages
    'carro_carga': 1000.0, // Large cargo
  };
}
```

## Vehicle Icons and Colors

Consistent UI representation:

```dart theme={null}
class VehicleTypeTheme {
  static const colors = {
    'moto': Color(0xFF667eea),
    'carro': Color(0xFF11998e),
    'moto_carga': Color(0xFFffa726),
    'carro_carga': Color(0xFFf5576c),
  };
  
  static const icons = {
    'moto': Icons.two_wheeler,
    'carro': Icons.directions_car,
    'moto_carga': Icons.delivery_dining,
    'carro_carga': Icons.local_shipping,
  };
  
  static Color getColor(String vehicleType) {
    return colors[vehicleType] ?? Colors.grey;
  }
  
  static IconData getIcon(String vehicleType) {
    return icons[vehicleType] ?? Icons.help_outline;
  }
}
```

## Adding New Vehicle Types

<Warning>
  Adding new vehicle types requires updates to multiple system components.
</Warning>

<Steps>
  <Step title="Update Database">
    ```sql theme={null}
    ALTER TABLE vehiculos 
    MODIFY tipo ENUM('moto', 'carro', 'moto_carga', 'carro_carga', 'new_type');
    ```
  </Step>

  <Step title="Add Pricing Configuration">
    ```sql theme={null}
    INSERT INTO configuracion_precios (
      tipo_vehiculo, tarifa_base, costo_por_km, costo_por_minuto, tarifa_minima
    ) VALUES ('new_type', 10000, 4000, 500, 15000);
    ```
  </Step>

  <Step title="Update Flutter Enums">
    Add new type to `VehicleType` enum and related constants
  </Step>

  <Step title="Update UI Components">
    Add icon, color, and labels for new vehicle type
  </Step>

  <Step title="Test Thoroughly">
    Verify pricing, validation, and UI for new type
  </Step>
</Steps>

## Vehicle Type Statistics

Track usage by vehicle type:

```dart theme={null}
class VehicleTypeStats {
  final String tipo;
  final int totalVehicles;
  final int activeVehicles;
  final int totalTrips;
  final double averageRating;
  final double totalEarnings;
  
  double get utilizationRate {
    return totalVehicles > 0 
        ? (activeVehicles / totalVehicles) * 100 
        : 0;
  }
}
```

## Popular Vehicle Brands

### Motorcycles

* Yamaha (FZ, MT-03)
* Honda (CB, CBR)
* Suzuki (GN, GSX)
* Bajaj (Pulsar, Dominar)

### Cars

* Chevrolet (Spark, Sail)
* Renault (Logan, Sandero)
* Mazda (2, 3)
* Toyota (Corolla, Yaris)

### Cargo Vehicles

* Chevrolet (N300, N200)
* Renault (Master, Kangoo)
* Fiat (Ducato)
* Ford (Transit)

## Best Practices

<Accordion title="Verify Documents Carefully">
  Always cross-check license plate, registration, and SOAT to prevent fraud.
</Accordion>

<Accordion title="Monitor Vehicle Age">
  Enforce age restrictions to maintain service quality and safety.
</Accordion>

<Accordion title="Track Popular Types">
  Monitor which vehicle types are most in demand to guide driver recruitment.
</Accordion>

<Accordion title="Update Pricing Regularly">
  Adjust pricing for each vehicle type based on operating costs and demand.
</Accordion>

<Accordion title="Ensure Adequate Coverage">
  Maintain balanced availability of all vehicle types to serve diverse customer needs.
</Accordion>

## Related Features

<CardGroup cols={3}>
  <Card title="Pricing Configuration" icon="dollar-sign" href="/admin/pricing-configuration">
    Set pricing by vehicle type
  </Card>

  <Card title="Driver Management" icon="id-card" href="/admin/driver-management">
    Verify driver vehicle documents
  </Card>

  <Card title="Trip Monitoring" icon="route" href="/admin/trip-monitoring">
    Track trips by vehicle type
  </Card>
</CardGroup>
