> ## 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.

# Driver Onboarding

> Complete guide to registering as a Viax driver and getting approved

## Registration Process

Becoming a Viax driver is simple and straightforward. Follow these steps to get started.

<Steps>
  <Step title="Create Account">
    Register with your email, phone number, and basic personal information
  </Step>

  <Step title="Complete Driver Profile">
    Fill in your full name, phone, and address details
  </Step>

  <Step title="Upload License">
    Provide driver's license information and photos
  </Step>

  <Step title="Register Vehicle">
    Add vehicle details and required documents
  </Step>

  <Step title="Submit for Approval">
    Submit your profile for admin review
  </Step>

  <Step title="Get Approved">
    Wait 24-48 hours for document verification
  </Step>
</Steps>

## Account Creation

### Initial Registration

When you first register, the system creates a basic conductor profile:

```dart Conductor Profile Entity theme={null}
class ConductorProfile {
  final int id;
  final int conductorId;
  final String? nombreCompleto;
  final String? telefono;
  final String? direccion;
  final DriverLicense? license;
  final Vehicle? vehicle;
  final bool aprobado;              // Approval status
  final String? motivoRechazo;      // Rejection reason if denied
  final DateTime? fechaAprobacion;  // Approval date
  final DateTime? fechaCreacion;    // Creation date
  
  // Check if profile is complete
  bool get isProfileComplete {
    return nombreCompleto != null &&
        telefono != null &&
        direccion != null &&
        license != null &&
        license!.isComplete &&
        vehicle != null &&
        vehicle!.isComplete;
  }
  
  // Calculate completion percentage
  int get completionPercentage {
    int completed = 0;
    const int total = 5;
    
    if (nombreCompleto != null && nombreCompleto!.isNotEmpty) completed++;
    if (telefono != null && telefono!.isNotEmpty) completed++;
    if (direccion != null && direccion!.isNotEmpty) completed++;
    if (license != null && license!.isComplete) completed++;
    if (vehicle != null && vehicle!.isComplete) completed++;
    
    return ((completed / total) * 100).round();
  }
}
```

<Info>
  Your profile completion percentage is visible on your dashboard. Complete all sections to reach 100% and get approved faster!
</Info>

## Personal Information

### Required Fields

<ParamField path="nombreCompleto" type="string" required>
  Full legal name as it appears on your driver's license
</ParamField>

<ParamField path="telefono" type="string" required>
  Active phone number for contact and trip coordination
</ParamField>

<ParamField path="direccion" type="string" required>
  Current residential address for verification purposes
</ParamField>

### Update Profile Use Case

The system uses Clean Architecture with dedicated use cases:

```dart Update Profile Use Case theme={null}
import 'package:viax/src/core/error/result.dart';
import '../repositories/conductor_repository.dart';

class UpdateConductorProfile {
  final ConductorRepository repository;
  
  UpdateConductorProfile(this.repository);
  
  Future<Result<void>> call({
    required int conductorId,
    String? nombreCompleto,
    String? telefono,
    String? direccion,
  }) async {
    if (conductorId <= 0) {
      return Error(ValidationFailure('Invalid conductor ID'));
    }
    
    return await repository.updateProfile(
      conductorId: conductorId,
      nombreCompleto: nombreCompleto,
      telefono: telefono,
      direccion: direccion,
    );
  }
}
```

## Driver License Information

### License Categories

In Colombia, drivers must have specific license categories for public service:

<Tabs>
  <Tab title="Category C1">
    **C1 - Automobiles, Camperos (Public Service)**

    Valid for:

    * Cars
    * SUVs
    * Mototaxis
    * Four-wheelers for public transport

    <Info>Most common category for Viax drivers</Info>
  </Tab>

  <Tab title="Category C2">
    **C2 - Vans, Microbuses (Public Service)**

    Valid for:

    * Vans
    * Minibuses
    * Larger passenger vehicles
  </Tab>

  <Tab title="Category C3">
    **C3 - Trucks, Buses (Public Service)**

    Valid for:

    * Large trucks
    * Buses
    * Heavy commercial vehicles
  </Tab>
</Tabs>

### License Model

```dart Driver License Entity theme={null}
enum LicenseCategory {
  ninguna('ninguna', 'None', ''),
  a1('A1', 'A1', 'Motorcycles up to 125cc'),
  a2('A2', 'A2', 'Motorcycles over 125cc'),
  b1('B1', 'B1', 'Cars, mototaxis, four-wheelers, SUVs'),
  b2('B2', 'B2', 'Vans and microbuses'),
  b3('B3', 'B3', 'Rigid trucks, buses'),
  c1('C1', 'C1', 'Cars, SUVs (Public Service)'),
  c2('C2', 'C2', 'Vans, microbuses (Public Service)'),
  c3('C3', 'C3', 'Trucks, buses (Public Service)');
  
  final String value;
  final String label;
  final String description;
}

class DriverLicense {
  final String numero;
  final DateTime fechaExpedicion;
  final DateTime fechaVencimiento;
  final LicenseCategory categoria;
  final String? foto;              // Front photo URL
  final String? fotoReverso;       // Back photo URL
  final bool isVerified;
  
  // Validation methods
  bool get isValid => fechaVencimiento.isAfter(DateTime.now());
  bool get isExpiringSoon => daysUntilExpiry <= 30 && daysUntilExpiry > 0;
  int get daysUntilExpiry => fechaVencimiento.difference(DateTime.now()).inDays;
  bool get isComplete => numero.isNotEmpty && 
                         categoria != LicenseCategory.ninguna && 
                         isValid;
}
```

<Warning>
  Your license must be valid for at least 30 days. The system will alert you when it's expiring soon.
</Warning>

## Approval Process

### Verification Workflow

<Steps>
  <Step title="Profile Submission">
    Submit your complete profile with all required documents

    ```dart Submit for Approval theme={null}
    final result = await SubmitProfileForApproval(
      conductorId: conductorId,
    );
    ```
  </Step>

  <Step title="Document Review">
    Admin team reviews your documents for authenticity and validity

    * License photos checked
    * Vehicle documents verified
    * SOAT and Tecnomecánica dates validated
  </Step>

  <Step title="Approval Decision">
    Within 24-48 hours, you'll receive one of these outcomes:

    <Tabs>
      <Tab title="Approved">
        **Profile Approved** ✅

        * `aprobado = true`
        * `fechaAprobacion` set to current timestamp
        * You can now go online and start accepting rides
      </Tab>

      <Tab title="Rejected">
        **Profile Rejected** ❌

        * `aprobado = false`
        * `motivoRechazo` contains reason for rejection
        * Fix issues and resubmit for approval
      </Tab>
    </Tabs>
  </Step>

  <Step title="Notification">
    Receive notification about approval status

    ```dart Approval Notification theme={null}
    await ApprovalNotificationService.notify(
      conductorId: conductorId,
      aprobado: true,
      message: 'Your profile has been approved!'
    );
    ```
  </Step>
</Steps>

### Common Rejection Reasons

<AccordionGroup>
  <Accordion title="Invalid License" icon="id-card">
    * Expired license
    * Wrong category (not C1, C2, or C3)
    * Blurry or incomplete photos
    * Name mismatch with registration
  </Accordion>

  <Accordion title="Vehicle Document Issues" icon="file-circle-xmark">
    * Expired SOAT or Tecnomecánica
    * Missing vehicle photos
    * Plate number doesn't match documents
    * Documents not legible
  </Accordion>

  <Accordion title="Incomplete Information" icon="triangle-exclamation">
    * Missing phone number or address
    * Profile fields left empty
    * Vehicle details incomplete
  </Accordion>
</AccordionGroup>

<Tip>
  **Pro Tip:** Take clear, well-lit photos of all documents. Make sure all text is readable and dates are visible.
</Tip>

## Profile Completion Tracking

The app provides real-time feedback on your profile status:

```dart Profile Completion Check theme={null}
// Load profile
final provider = Provider.of<ConductorProfileProvider>(context);
await provider.loadProfile(conductorId);

final profile = provider.profile;

if (profile != null) {
  print('Completion: ${profile.completionPercentage}%');
  print('Is Complete: ${profile.isProfileComplete}');
  print('Can Go Online: ${profile.canBeAvailable}');
  
  if (!profile.isProfileComplete) {
    final pendingTasks = profile.pendingTasks;
    print('Pending: $pendingTasks');
    // Show alert to complete profile
  }
}
```

### Profile Completion Card

The driver app displays a completion status card:

* **0-25%** - Basic info only (Red indicator)
* **26-50%** - License added (Orange indicator)
* **51-75%** - Vehicle partially complete (Yellow indicator)
* **76-99%** - Almost done (Light green indicator)
* **100%** - Ready for approval (Green indicator)

## Next Steps After Registration

Once registered, proceed with these tasks:

<CardGroup cols={2}>
  <Card title="Upload Documents" icon="cloud-arrow-up" href="/drivers/document-verification">
    Upload license and vehicle documents for verification
  </Card>

  <Card title="Vehicle Setup" icon="car" href="/drivers/vehicle-management">
    Complete vehicle registration with all required details
  </Card>

  <Card title="Profile Management" icon="user-gear" href="/drivers/profile-management">
    Update your settings and preferences
  </Card>

  <Card title="Availability" icon="toggle-on" href="/drivers/availability-status">
    Learn how to go online after approval
  </Card>
</CardGroup>

<Warning>
  **Important:** You cannot go online to accept trips until your profile is approved by the admin team.
</Warning>
