Skip to main content

Trip Lifecycle

Understand the complete journey of a trip request in Viax, from the moment a user requests a ride to trip completion and payment.

Lifecycle Overview


Phase 1: Trip Request

User Actions

1

Select Pickup Location

User taps on map or uses current GPS location to set pickup point.Data Captured:
2

Select Destination

User taps on map or searches for address to set dropoff point.Data Captured:
3

Choose Service Type

User selects between:
  • Viaje (Ride): Personal transportation
  • Paquete (Package): Delivery service
4

Select Vehicle Type

User chooses from available options:
  • 🏍️ Moto (Motorcycle)
  • 🚗 Carro (Car)
  • 🏍️ Moto Carga (Cargo Motorcycle)
  • 🚙 Carro Carga (Cargo Car)
5

View Estimate

System calculates and displays:
  • Route distance (km)
  • Estimated duration (minutes)
  • Price estimate (COP)
Calculation:
6

Confirm Request

User taps “Solicitar viaje” button to submit request.

Backend Processing


Automatic Driver Discovery

The system automatically searches for available drivers within a 5km radius of the pickup location.
Search Query:
Parameters:
  • ? placeholders: latitud_origen, longitud_origen (3 times for Haversine formula)
  • tipo_vehiculo: Matches requested vehicle type
  • Radius: 5 kilometers
  • Limit: Top 10 closest drivers

Driver Matching Criteria

Location

  • Within 5km of pickup point
  • GPS coordinates updated < 5 min ago
  • Calculated using Haversine formula

Availability

  • disponibilidad = 1 (online)
  • Not currently on another trip
  • Active in the system

Verification

  • estado_verificacion = ‘aprobado’
  • Documents validated
  • Background check passed

Vehicle Match

  • tipo_vehiculo matches request
  • Vehicle registered and insured
  • Passed vehicle inspection

Notification to Drivers

Push Notification (Future):
Current Implementation:
  • Drivers poll server every 5 seconds for new requests
  • Requests appear in driver’s “Pending Requests” screen

Phase 3: Driver Acceptance

Driver Views Request

Driver sees:

Driver Actions

1

Review Request

Driver evaluates:
  • Distance to pickup
  • Route complexity
  • Estimated earnings
  • Current traffic conditions
2

Accept or Decline

If Accept:
If Decline:
  • Request remains in pending state
  • Shown to other nearby drivers
3

Navigate to Pickup

Driver receives:
  • Pickup address
  • GPS coordinates
  • Navigation link (Google Maps/Waze)
  • User contact number (for coordination)

User Notification

User sees:

Phase 4: En Route to Pickup

Driver Status Updates

Driver’s location updated every 10 seconds:
User sees driver approaching on map in real-time.

Communication

In-App Features (Future):
  • Chat between user and driver
  • Quick messages (“I’m here”, “5 minutes away”)
  • Voice call button
Current:
  • Phone call via displayed number

Phase 5: Trip in Progress

Pickup Confirmation

1

Driver Arrives

Driver taps “He llegado” button
2

User Enters Vehicle

Driver confirms: “Pasajero a bordo”
3

Start Trip

Driver taps “Iniciar viaje”

During Trip

Driver View

  • Route to destination
  • Current traffic
  • Updated ETA
  • Trip timer
  • Distance counter

User View

  • Real-time driver location
  • Route visualization
  • ETA to destination
  • Trip details
  • Share trip with contacts
Location Tracking:

Phase 6: Trip Completion

Arrival at Destination

1

Driver Marks Arrival

2

Calculate Final Fare

3

Complete Trip

Payment Processing

  • Driver confirms cash payment received
  • Or payment marked as pending for later processing
  • Receipt generated

Trip Summary

User Receives:
Driver Receives:

Phase 7: Post-Trip

Rating & Review

Stored in database:

Trip History

Stored for:
  • User’s trip history
  • Driver’s trip log
  • Platform analytics
  • Financial records
  • Dispute resolution
  • Tax reporting

Cancellation Flows

User Cancellation

No penalty for user.
User charged ₡2,000 cancellation fee.
User cannot cancel once trip has started. Must complete trip or contact support.

Driver Cancellation

Trip returned to pending state, shown to other drivers.
Driver must contact support. Emergency cancellation only for valid reasons (safety, emergency).

State Transitions Summary

Valid State Flow:
Cancellation Paths:
Database Enum:
The trip lifecycle in Viax is designed for reliability, transparency, and user satisfaction with clear state transitions and comprehensive tracking.