TAXITUR.NO — Full Application Flow & Post-Implementation Report

Project: TAXITUR / DVBS (CodeIgniter) · Local: http://localhost/txn · Live: www.taxitur.no
Report date: 12 August 2026 (updated) · All roles, marketplace flow, RBAC, GDPR, payments, and completed fixes

Current platform status: Online booking (name plate, special requests, multi-stop, day trip/sightseeing, km+minute+hour pricing) is live. Stripe return, live tracking, owner document pack, admin minute/hour rates, and booking detail fields are implemented. Role-based access control (RBAC) and GDPR isolation are now enforced: only Admin has full access; Car Owner, Corporate, Driver, and Customer each see and manage only their own records.

1. Implementation summary

AreaChangeStatus
Online bookingTrip type, name plate, special requests, 4 stops + wait hours, km+minute+hour pricing, category UIDONE
Stripe returnValid is_conformed=confirm; booking saved on successDONE
Live trackingusers/track/{ref} + driver update_locationDONE
Car owner docsProfile & document pack + bank fields at /carowners/profileDONE
Admin pricingprice_per_minute + price_per_hour on vehicle categoriesDONE
RBAC Admin-only full accessAdmin panel blocked for car owners; settings/reports admin-onlyDONE
RBAC Car owner scopeOwn vehicles (added_by), own drivers (created_by + vehicle assignment), own fleet bookings & paymentsDONE
RBAC Corporate scopeCorporate portal corporate-only; bookings/branches/invoices scoped by corporate_idDONE
GDPR Driver isolationCalendar, details, cancel, extra charges, customer view — own driver_id only; nearby jobs redactedDONE
Owner accepted bookingscarowners/get_bookings?filter=accepted for confirm/accept/on_the_way/trip_started/completedDONE
Atomic dispatch + category matchFirst-wins accept race-safe filterPARTIAL
Public car-owner self-registrationStill admin-createdPARTIAL
Admin payout/settlement UIBank data collected; payout workflow nextPARTIAL

2. Access control model (who sees what)

Rule: Admin = all records. Every other role = own records only (GDPR / data minimisation).
RoleGroupPortalData scopeCan manage
Administratoradmin (1)/admin All bookings, users, vehicles, settings, reports, finances Full CRUD on every module
Car Ownercompany (5)/carowners Vehicles where added_by = owner; drivers where created_by = owner or assigned to owner vehicles; bookings where driver_id ∈ owner fleet Cars, drivers, accepted/assigned bookings, payments, salaries, documents
Corporatecorporate (7)/corporate/* Bookings where corporate_id = company; own branches & invoices Company profile, branches, book trips, view/export own bookings
Driverdriver (4)/driver Bookings where driver_id = self; nearby unassigned jobs (PII redacted until accept) Accept job, start/stop/complete own trips, GPS, own profile
Executiveexecutives (3)/executive Operational bookings (verify/confirm workflow) Dashboard, pending verification — not admin settings
Customermembers (2) / guest/users/* + public booking Bookings where user_id = self (or guest email match) Book, pay, track own trip, view own history

Demo login (local): admin@admin.com / admin123 · Login: http://localhost/txn/en/auth/login

3. End-to-end marketplace flow

A. Customer books online
  1. Home → pickup & drop-off (airport/local toggles).
  2. Trip type: Transfer / Day trip / Sightseeing.
  3. Transfer: name plate (airport/hotel/cruise/train).
  4. Up to 4 stops + waiting hours; return journey optional.
  5. Special needs free text.
  6. Maps → distance + journey minutes → fare = start + km + minutes + stop wait + day-trip hours + night.
  7. Passenger details → Payment (cash / Stripe / PayPal / PayU).
  8. Booking created pending or confirm (after payment).
B. Dispatch to drivers (GDPR-safe)
  1. Drivers with GPS see nearby unassigned jobs within dispatch_radius (default 100 km).
  2. Phone/email hidden on nearby list until driver accepts (GDPR).
  3. Accept → driver_id set; status: accept → on_the_way → trip_started → completed.
  4. Driver update_location pushes GPS to active booking for customer live map.
  5. Car owners see nearby unassigned jobs (redacted) + all bookings assigned to their drivers.
C. Customer live tracking
  1. Booking details → “Open live map” → users/track/{ref}.
  2. Polls users/track_location/{ref} every 10s.
  3. Map: pickup, drop-off, moving driver marker (own booking only).
D. Role portals (scoped access)
  1. Admin — all modules, manual bookings, settings, global reports.
  2. Car owner — fleet vehicles, own drivers, assigned/accepted bookings, payments, document pack, driver salaries.
  3. Corporate — register/login, branches, book & view company trips, CSV invoice export (own company only).
  4. Driver — nearby jobs, own calendar/history, accept & complete own trips only.

4. Role-by-role workflow & access (detailed)

4.1 Customer

ActionRoute / moduleAccess rule
Book & pay onlineHome → Welcome/BookingsystemPublic / logged-in member
View booking history/users/*user_id = logged-in user
Live track trip/users/track/{ref}Own booking ref only
View booking details/users/booking_detailsOwn booking only

4.2 Driver GDPR ISOLATED

ActionRouteAccess rule
Dashboard stats/driverAggregates for own driver_id only
Booking history AJAX/driver/ajax_get_bookingsWHERE driver_id = me
Calendar/driver/bookingCalendarDataOwn trips only (was all trips — fixed)
Booking details/driver/bookingDetails/{id}Own driver_id only
Nearby jobs/driver/get_nearby_bookingsUnassigned + redacted phone/email
Accept / update status/driver/update_booking_statusOwn booking or unassigned claim
Complete ride / extra charges/driver/complete_ride, update_extra_chargesOwn driver_id required
View customer/driver/userDetails/{id}Only if customer linked to own assigned booking
Profile edit/driver/profileOwn user ID only
GPS push/driver/update_locationUpdates own user + own active bookings

4.3 Car Owner FLEET SCOPED

ActionRouteAccess rule
Manage vehicles/vehicles, /vehicle_settingsadded_by = owner; edit/delete guarded
Manage drivers/carowners/drivers_index, /driverscreated_by or vehicle assignment
Add driver/carowners/add_driverSets created_by on new driver user
View bookings/bookings (car template)Bookings for owner fleet drivers only
Accepted bookings API/carowners/get_bookings?filter=acceptedconfirm/accept/on_the_way/trip_started/completed
Payments/carowners/paymentsOwner fleet bookings only
Nearby dispatch view/carowners/get_nearby_bookingsUnassigned (redacted) + own fleet assigned
Documents & bank/carowners/profileOwn profile only
Driver salaries/carowners/driver_salariesowner_id scoped
Admin panel/adminBlocked — redirected to /carowners

4.4 Corporate COMPANY SCOPED

ActionRouteAccess rule
Register / login/corporate/register, /auth/loginCorporate group
Dashboard/corporate/dashboardOwn corporate profile
Branches CRUD/corporate/branchescorporate_id match on branch
Book trip/corporate/new_bookingSaves corporate_id on booking
View bookings/corporate/bookingscorporate_id or fallback user_id
Booking details/corporate/booking_details/{id}Own company booking only
Invoice CSV export/corporate/invoices_exportDate range + own company only
Admin panel/adminCorporate users use /corporate/* only

4.5 Admin & Executive

RoleScopeNotes
AdminFull platformAll CRUD, settings, reports, car owner list, global payments
ExecutiveOperationsDashboard, verify bookings; reports module; not full settings

5. RBAC helper functions (central enforcement)

Implemented in application/helpers/global_helper.php — used across controllers:

FunctionPurpose
require_admin_access()Admin-only routes; redirects car owners to /carowners
check_access('car_owner')Car owner routes (alias for company group)
get_owner_driver_ids()Drivers owned via created_by + vehicle assignment
get_owner_vehicle_ids()Vehicles where added_by = owner
append_role_booking_scope()Filters booking lists by role (owner/corporate/customer)
user_can_access_booking()Single booking access check for view/edit/delete
user_can_access_driver()Owner can only edit/delete own drivers
user_can_access_vehicle()Owner can only edit/delete own vehicles
get_corporate_account_id()Resolve corporate profile from logged-in user
redact_booking_customer_pii()Hide phone/email on unassigned jobs (GDPR)
driver_can_view_booking()Driver: own assigned or redacted unassigned

6. GDPR & security controls

ControlImplementationStatus
Driver cannot see other drivers' tripsAll driver queries filter driver_idENFORCED
Driver calendar was leaking all bookingsCalendar SQL scoped to own driverFIXED
Driver could open any booking by ref/IDbookingDetails, booking_details require own driverFIXED
Driver could view any customer profileuserDetails only if customer on own bookingFIXED
Nearby jobs expose PII before acceptphone/email redacted until assignedENFORCED
Owner payments showed all platform bookingsFiltered by owner fleet driver_idFIXED
Owner saw all drivers in systemScoped by created_by + assignmentFIXED
Owner accessed admin financial dashboardAdmin constructor blocks car ownersFIXED
Corporate cross-company booking accesscorporate_id on bookings + query filterENFORCED
Customer tracking other users' tripsTrack/history scoped to own user/bookingENFORCED

7. Pricing formula

Fare = start_fee + (km × price_per_km OR day_rate) + (journey_minutes × price_per_minute) + (stop_wait × price_per_minute) + (duration_hours × price_per_hour) + night segments

8. Database schema (marketplace + RBAC)

TableColumns / purpose
vbs_bookingstrip_type, pickup_name_plate, special_requests, duration_hours, journey_minutes, waypoints_json, stop_waiting_cost, driver_lat/lng, corporate_id, corporate_branch_id
vbs_vehicle_categoriesprice_per_minute, price_per_hour
vbs_vehicleadded_by (car owner link)
vbs_userscreated_by (driver → owner link), owner doc/bank fields
vbs_assign_cars_drivervehicle_id + driver_id (fleet assignment)
vbs_site_settingsdispatch_radius (default 100 km)

Migrations: sql/booking_enhancements.sql, sql/rbac_owner_scope.sql, sql/rbac_corporate_bookings.sql

9. Key URLs (local)

URLRolePurpose
http://localhost/txn/PublicOnline booking home
http://localhost/txn/en/auth/loginAllLogin
http://localhost/txn/adminAdminFull admin dashboard
http://localhost/txn/carownersCar ownerFleet portal (scoped)
http://localhost/txn/carowners/profileCar ownerDocuments & bank
http://localhost/txn/driverDriverDriver portal (own data)
http://localhost/txn/corporate/dashboardCorporateCompany portal
http://localhost/txn/users/track/{ref}CustomerLive trip map
http://localhost/txn/vehicle_categories/addeditAdminMinute/hour rates

10. Module CRUD matrix (admin full access)

ModuleCRUDNon-admin scope
BookingsYYYYOwner/Corp/Driver/Customer: own only
VehiclesYYYYOwner: added_by
Drivers (users)YYYYOwner: created_by
Vehicle categoriesYYYYAdmin (+ owner read per existing rules)
Settings / ReportsYYYYAdmin only (exec: reports)
Corporate branches————Corporate: own company

11. Acceptance checklist (incl. RBAC / GDPR)

#TestPass?
1Customer: book transfer with name plate + multi-stop + pay☐
2Customer: live map shows driver for own booking only☐
3Driver: calendar/history shows only own trips☐
4Driver: cannot open another driver's booking by changing URL ID☐
5Driver: nearby list hides phone/email until accept☐
6Car owner: sees only own vehicles and drivers☐
7Car owner: payments/bookings limited to own fleet☐
8Car owner: /admin redirects away (no global data)☐
9Corporate: sees only own company bookings & branches☐
10Admin: full access to all modules and reports☐

12. Files touched (latest cycle)

13. Remaining enhancements (optional)

ItemPriority
Atomic first-wins accept + vehicle category match on dispatchP1
Backfill created_by / added_by for legacy drivers & vehiclesP1
Public car-owner self-registrationP2
Admin payout/settlement workflowP2
Corporate contact-person field + priced CSV columnsP2