Clone
Contents
Driver Management
CRM Integration
Drivers are linked to MokoSuiteCRM contacts via the contact_id foreign key. This means:
- No duplicate user tables -- driver profiles reference existing CRM records
- Contact details (name, phone, email, address) are managed in CRM
- Driver-specific fields (license, commission, rating) are in the taxi drivers table
- Layer dependency: MokoSuiteTaxi (Layer 2) requires MokoSuiteCRM (Layer 1)
Driver Status
| Status | Description |
|---|---|
active |
Approved and available for dispatch |
inactive |
Account exists but not taking rides |
suspended |
Administratively suspended |
pending |
Awaiting approval (if auto_approve_drivers is off) |
License Tracking
Each driver record stores:
license_number-- driving license IDlicense_expiry-- expiry date for proactive alerts
Commission
commission_rate-- per-driver override (nullable)- Falls back to
default_commissionplugin parameter when null - Commission is a percentage of the total fare
Rating System
Ratings are bidirectional:
- Rider rates driver after ride completion (1-5 stars)
- Driver rates rider after ride completion (1-5 stars)
Stored in #__mokosuitetaxi_ratings with:
ride_id,rater_type(rider/driver),ratee_type(rider/driver)rating(1-5),comment,tags(JSON array of feedback tags)
The driver rating column is an aggregate average, updated automatically when new ratings are submitted.
Shift Management
Driver shifts are tracked in #__mokosuitetaxi_shifts:
driver_id,start_time,end_timestart_latitude,start_longitude-- where the shift startedend_latitude,end_longitude-- where the shift endedtotal_rides,total_earnings-- aggregated during the shiftstatus-- active, completed, cancelled
Automatic Stats
Driver records maintain running totals:
total_rides-- lifetime completed ridestotal_earnings-- lifetime earningsrating-- rolling average rating
These are updated by RideHelper::completeRide() after each completed ride.