Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/trustride/llms.txt

Use this file to discover all available pages before exploring further.

TrustRide’s admin panel includes a dedicated reports section that gives operators a real-time view of platform health. You can review summary statistics for the last 30 days, download raw CSV exports of bookings and revenue data, investigate driver safety reports, and inspect a full chronological audit log of every admin action.

Reports Overview

GET /control/reports/ is the reports landing page. It computes the following statistics for the last 30 days and displays them as summary cards:
MetricQuery
Revenue (30d)Sum of price for all confirmed and completed bookings in the period
Bookings (30d)Total booking records created in the period
New Users (30d)Users whose date_joined falls within the period
Trips (30d)Trips whose created_at falls within the period
This page is the starting point for weekly operational reviews. Use it to spot drops in booking volume, revenue anomalies, or unusual spikes in new user registrations.

CSV Exports

TrustRide provides three CSV export endpoints. Each returns a downloadable file that can be opened in Excel, Google Sheets, or imported into accounting or analytics tools.
Schedule a recurring reminder to export CSVs at the end of each month and store them in a shared drive or accounting system. These exports serve as your off-platform record of platform activity and are essential for tax reporting, driver payment reconciliation, and dispute resolution.

Booking Export

GET /control/reports/export/bookings/ Downloads trustride_bookings.csv. This export covers all bookings regardless of status or date range. Each row corresponds to one Booking record. Columns:
ColumnSource field
IDbooking.id (UUID)
Riderbooking.rider.get_full_name()
Emailbooking.rider.email
Tripstr(booking.trip) — origin, destination, date, time
Seatbooking.seat_id
Pricebooking.price (₦)
Statusbooking.status
Booked Atbooking.booking_date formatted as YYYY-MM-DD HH:MM
Example rows:
ID,Rider,Email,Trip,Seat,Price,Status,Booked At
a3f1...,Fatima Bello,fatima@email.com,Lagos to Abuja on 2025-03-10 at 06:00,A1,7500,confirmed,2025-03-08 14:22
b7c2...,Emeka Okafor,emeka@email.com,Kano to Jos on 2025-03-11 at 07:30,B3,4200,cancelled,2025-03-09 09:05
Use this export to:
  • Reconcile which bookings have been paid versus cancelled.
  • Identify riders who have a high cancellation rate.
  • Cross-reference confirmed bookings against driver payout records.

Revenue Export

GET /control/reports/export/revenue/ Downloads trustride_revenue.csv. This export covers only confirmed and completed bookings, ordered by booking_date descending. It is purpose-built for financial reconciliation. Columns:
ColumnSource field
Datebooking.booking_date formatted as YYYY-MM-DD
Riderbooking.rider.get_full_name()
Driverbooking.trip.driver.get_full_name()
Tripstr(booking.trip)
Amountbooking.price (₦)
Statusbooking.status
The revenue export intentionally omits commission calculations at the row level, as commission rates are set per driver and applied at payout time rather than at booking time. To see commission breakdowns per trip, use /control/revenue/trips/ alongside this export.

User Export

GET /control/reports/export/users/ Downloads trustride_users.csv. Contains one row per registered user, ordered by date_joined descending. Columns:
ColumnSource field
IDuser.id
Nameuser.get_full_name()
Emailuser.email
Phoneuser.phone
Roleuser.role
Verifieduser.is_driver_verified (True/False)
Suspendeduser.is_suspended (True/False)
Joineduser.date_joined formatted as YYYY-MM-DD

Driver Reports

Riders can submit reports about driver behaviour through the platform. These reports are reviewed and actioned through the admin panel.

Report List

GET /control/reports/driver/ Lists all DriverReport records, ordered by created_at descending. Results can be filtered by status using the status query parameter. The page header shows aggregate counts for:
  • Pending — awaiting admin review
  • Reviewed — admin has read the report but not resolved it
  • Resolved — issue addressed and closed
  • Dismissed — report found to be invalid or outside scope
Reports are submitted with one of the following reasons:
ReasonDisplay label
inappropriate_behaviorInappropriate behavior
safety_concernSafety concern
trip_cancelledTrip cancelled without reason
vehicle_issueVehicle issue
otherOther

Report Detail

GET /control/reports/driver/<uuid>/ Shows the full content of a single DriverReport, including:
  • The reporter (rider who submitted the report)
  • The driver who was reported
  • The specific trip the report is tied to
  • The reason category and free-text details field
  • Current status and any admin_notes

Updating Report Status

POST /control/reports/driver/<uuid>/update-status/ Changes the status of a driver report. Accepted values are pending, reviewed, resolved, and dismissed. The new status and any admin_notes from the POST body are saved, and the action is written to the audit log under update_report_status.
POST /control/reports/driver/c4d8.../update-status/
Content-Type: application/x-www-form-urlencoded

status=resolved&admin_notes=Driver+warned+via+WhatsApp.+No+further+incidents+recorded.

Using Driver Reports for Safety Operations

1

Triage pending reports daily

Open /control/reports/driver/?status=pending each morning. Any report with reason = safety_concern should be prioritised and reviewed before any others.
2

Review the associated trip

From the report detail page, navigate to the linked trip. Check whether the trip completed normally, whether there are other reports on the same trip, and whether the driver has prior reports.
3

Contact the driver if needed

For serious reports (safety concerns, inappropriate behaviour), contact the driver via the admin WhatsApp or email set in platform settings. Document the contact attempt in admin_notes.
4

Escalate to suspension if warranted

If a driver accumulates multiple unresolved reports or a confirmed safety violation, proceed to /control/users/<id>/suspend/. See the Verification guide for the full suspension process.
5

Close the report

Set the status to resolved (action taken) or dismissed (report not substantiated). Add a brief note explaining the outcome.

Audit Log

GET /control/audit/ The audit log provides a complete, chronological record of every significant admin action taken on the platform. Records are stored in the AuditLog model (apps/admin_panel/models.py) and ordered by timestamp descending. The log paginates at 30 entries per page.

Filtering the Audit Log

The log supports two filters via query parameters:
ParameterEffect
qSearch across target_label, admin first_name, and notes
actionFilter to a specific action type
Tracked action types:
ActionTriggered by
suspend_userSuspending any user account
reinstate_userReinstating a suspended account
verify_driverVerifying a driver’s account
unverify_driverRevoking driver verification
cancel_tripAdmin cancelling a trip
cancel_bookingAdmin cancelling a booking
approve_refundApproving a refund request
reject_refundRejecting a refund request
update_settingsSaving platform settings
change_roleChanging a user’s role
force_complete_tripForce-completing a trip

Audit Log Record Fields

Each log entry contains:
FieldDescription
adminThe staff user who performed the action
actionThe action type from the list above
target_typeObject type ("user", "trip", "booking", "refund")
target_idUUID or integer ID of the affected record
target_labelHuman-readable description (e.g., "Aminu Garba (driver)")
notesReason, role transition, or other context
timestampWhen the action occurred
ip_addressThe admin’s IP address at the time
The audit log is append-only from the platform’s perspective. Entries are never deleted automatically. If you need to comply with a data retention policy, entries can be archived via database export. The log table is admin_audit_logs in the database.

Using Reports for Operations

Reconciling Payments with Booking Exports

After each pay cycle, export the booking CSV and filter the Status column to confirmed. Group by Driver (using the Trip column) and sum the Price column to get gross revenue per driver. Compare this total against any existing payout records for those drivers to identify unpaid balances.

Processing Payouts from Revenue Reports

Use the revenue export (/control/reports/export/revenue/) as the input for each payout batch. Filter by driver name, sum the Amount column to get the driver’s gross earnings for the period, then apply the driver’s commission rate to derive the net_amount. See the Payouts guide for the full payout creation workflow.

Identifying Safety Issues with Driver Reports

Cross-reference the driver reports list with the revenue export. A driver generating high revenue but accumulating unresolved safety reports may need account review before their next payout is processed. Holding a payout pending investigation is a standard operational control — use the pending status on the payout record and add a note explaining the hold.

Build docs developers (and LLMs) love