==================================================
 STORYGEN AI — STORY EXPORT
==================================================
Story ID:           1
Title:              Taxi Booking
Owner:              Demo Admin <demo@storygen.local>
App Type:           Conventional App
Input Type:         text
Status:             features_generated
Created:            2026-04-21 12:11:52 UTC
Updated:            2026-04-26 10:10:36 UTC
Features Generated: 2026-04-26 10:10:36 UTC
Total Clusters:     9
Total Features:     18

--- ORIGINAL INPUT ---
1. Passenger (Rider) User Stories
Passengers focus on convenience, speed, and safety. 

	•	Location Access: As a passenger, I want to authorize my location so that the driver knows exactly where to pick me up.
	•	Fare Estimation: As a passenger, I want to see the estimated fare before booking so that I can decide if it fits my budget.
	•	Real-Time Tracking: As a passenger, I want to track my driver on a map in real-time so that I know when they will arrive.
	•	Safety Sharing: As a passenger, I want to share my live ride status with a friend so they can track my location for safety.
	•	Cashless Payment: As a passenger, I want to pay for my ride through the app so that I don't have to carry cash.
	•	Rating System: As a passenger, I want to rate my driver after the trip so that I can provide feedback on my experience. 

2. Driver User Stories
Drivers prioritize efficiency, income management, and ease of use. 

	•	Accept/Reject Rides: As a driver, I want to view ride requests so that I can accept or reject them based on my preference.
	•	Navigation: As a driver, I want to use GPS navigation for the pickup and drop-off points so that I can find the best route without hassle.
	•	Availability Toggle: As a driver, I want to go offline or online so that I can control my working hours.
	•	Earnings History: As a driver, I want to see my daily earnings and ride history so that I can track my financial goals. 

3. Admin User Stories
Admins need tools for oversight and business optimization. 

	•	Fleet Monitoring: As an admin, I want to monitor all ongoing trips in real-time so that I can manage platform activities and address issues.
	•	Reporting: As an admin, I want to generate reports on total sales and ride volume so that I can make data-driven business decisions.
	•	Driver Management: As an admin, I want to verify and manage driver profiles to ensure all drivers meet safety and insurance standards.
	•	Complaint Resolution: As an admin, I want to access passenger feedback and complaints so that I can resolve grievances and maintain service quality.

--- USER STORY ---
# Ride-Hailing Platform with Passenger, Driver, and Admin Experiences

## Overview
Urban commuters need a fast, safe, and cashless way to book rides, while drivers need flexible tools to manage their availability and earnings, and operators need oversight of the entire fleet. This solution is a multi-sided ride-hailing platform that connects passengers with nearby drivers in real time, processes payments digitally, and provides administrators with monitoring and reporting capabilities to ensure service quality and business performance.

## Actors
- Passenger (Rider): Books rides, tracks drivers, pays for trips, and rates the experience.
- Driver: Receives ride requests, navigates to pickup/drop-off points, manages availability, and tracks earnings.
- Admin: Oversees platform operations, manages drivers, monitors live trips, resolves complaints, and generates business reports.

## Goals
- Enable passengers to book, track, and pay for rides safely and conveniently through a single app.
- Empower drivers to manage their working hours, navigate efficiently, and monitor their income.
- Give administrators operational visibility and control to maintain service quality and drive data-informed decisions.
- Ensure safety, trust, and transparency across all three user groups through ratings, live tracking, and driver verification.

## User Story
As a passenger, driver, or admin using the ride-hailing platform, I want role-specific tools for booking, fulfilling, and overseeing rides, so that trips are completed safely, efficiently, and profitably for all parties involved.

## Detailed Workflow

**Passenger Flow**
1. Passenger opens the app and authorizes location access so the system can detect the pickup point.
2. Passenger enters a destination and reviews the estimated fare before confirming the booking.
3. Upon booking, the system dispatches the request to nearby available drivers.
4. Once a driver accepts, the passenger sees the driver's details and tracks their arrival on a real-time map.
5. Passenger optionally shares live ride status with a trusted contact for safety.
6. At the end of the ride, payment is processed cashlessly through the app.
7. Passenger rates the driver and optionally leaves feedback.

**Driver Flow**
1. Driver logs in and toggles availability to "online" to start receiving ride requests.
2. Driver receives an incoming ride request with pickup location and fare details, and chooses to accept or reject.
3. Upon acceptance, the driver uses in-app GPS navigation to reach the pickup point and then the drop-off destination.
4. At trip completion, the fare is confirmed and added to the driver's earnings.
5. Driver can toggle "offline" at any time and view daily earnings and ride history from their dashboard.

**Admin Flow**
1. Admin logs into the admin console and views a live map of all ongoing trips.
2. Admin reviews new driver applications, verifies documentation (licenses, insurance, safety standards), and approves or rejects profiles.
3. Admin monitors passenger complaints and feedback, investigates issues, and resolves grievances.
4. Admin generates reports on total sales, ride volume, and operational KPIs to support business decisions.

## Acceptance Criteria

**Passenger**
- The app requests and uses device location permissions to auto-populate the pickup point.
- Estimated fare is displayed before the passenger confirms the booking.
- Passenger can view the driver's live location and ETA on a map after a ride is accepted.
- Passenger can share a live trip link with an external contact for safety.
- Passenger can complete payment through the app using a stored payment method without cash.
- Passenger can submit a star rating (and optional comment) after trip completion.

**Driver**
- Driver receives ride requests with visible pickup details and can accept or reject within a defined time window.
- Accepting a ride launches in-app GPS navigation to pickup and then to drop-off.
- Driver can toggle between online and offline status at any time.
- Driver dashboard displays daily earnings, trip count, and a chronological ride history.

**Admin**
- Admin console displays all active trips on a real-time map with status indicators.
- Admin can view, verify, approve, suspend, or reject driver profiles.
- Admin can view passenger-submitted complaints and take resolution actions.
- Admin can generate and export reports filtered by date range, covering total revenue and ride volume.

## Assumptions & Constraints
- Users have smartphones with GPS and internet connectivity.
- Passengers will grant location permissions; fallback manual entry should be considered.
- A secure payment gateway is integrated to handle cashless transactions.
- Driver verification processes must comply with local transportation regulations and insurance requirements.
- Real-time tracking depends on stable GPS/network signals; degraded accuracy in low-connectivity areas is expected.
- Ratings and complaints data are retained to inform driver performance reviews and admin action.

--- FEATURE LIST SUMMARY ---
This solution enables a multi-sided ride-hailing marketplace that connects passengers, drivers, and administrators on a single digital platform. The primary actors are Passengers who book and pay for rides, Drivers who fulfill trips, and Admins who oversee operations. The core flow runs from passenger booking and driver dispatch through live tracking, payment, and rating, with admin verification and reporting wrapping the lifecycle. The Master Data Configuration cluster holds users, roles, vehicle types, fare rules, payment methods, and reference catalogs reused across every module. The list contains 18 rows and delivers cashless ride booking, real-time fleet visibility, and driver onboarding with verification.

Feature Clusters & Features:
• Master Data Configuration
  - 1. User and Role Management — Central registry of passenger, driver, and admin accounts with role-based access control across the platform.
  - 2. Vehicle and Fare Configuration — Catalog of vehicle categories, base fares, per-km rates, and surge rules used to price every ride.
  - 3. Payment Method Registry — Stores supported payment instruments and tokenized cards that passengers reuse for cashless checkout.
  - 4. Reference Lookups — Shared catalogs for cities, zones, complaint categories, and trip statuses referenced across workflows.
• Driver Onboarding
  - 5. Driver Application and Document Upload — Lets aspiring drivers register and submit licenses, insurance, and vehicle documents for review.
  - 6. Admin Driver Verification and Approval — Allows admins to review documents and approve, suspend, or reject driver profiles.
• Driver Availability
  - 7. Driver Online/Offline Toggle — Enables verified drivers to mark themselves available so the dispatch engine can route requests to them.
• Ride Booking
  - 8. Pickup Location Detection — Uses device GPS or manual entry to auto-populate the passenger's pickup point.
  - 9. Fare Estimation and Booking Confirmation — Shows estimated fare and ETA before the passenger confirms the ride request.
• Ride Dispatch
  - 10. Nearby Driver Dispatch — Broadcasts the booking to nearby online drivers and assigns the first to accept.
  - 11. Driver Accept/Reject Decision — Lets drivers accept or reject incoming requests within a defined response window.
• Ride Execution
  - 12. In-App GPS Navigation — Provides turn-by-turn navigation to the pickup point and then to the drop-off destination.
  - 13. Real-Time Trip Tracking — Shows the passenger live driver location and ETA on a map throughout the ride.
  - 14. Live Trip Sharing — Lets passengers share a trip link with a trusted contact for added safety.
• Payment and Rating
  - 15. Cashless Payment Processing — Charges the stored payment method automatically when the trip ends.
  - 16. Trip Rating and Feedback — Lets passengers submit a star rating and optional comments after trip completion.
• Driver Earnings
  - 17. Driver Earnings Dashboard — Shows daily earnings, trip count, and chronological ride history for each driver.
• Admin Operations and Reporting
  - 18. Live Fleet Monitoring, Complaint Handling, and Business Reports — Gives admins a real-time map of active trips, complaint resolution tools, and exportable revenue and ride-volume reports.

--- FEATURE LIST (18 features across 9 clusters) ---

#1 | Cluster: Master Data Configuration | Feature: User and Role Management
  Description: Central registry that manages all user accounts, profiles, and role-based permissions. Acts as the identity backbone referenced by every other module.
  Workflow:
    1. Admin defines roles (passenger, driver, admin) and permissions.
    2. Users register or are created with a role assignment.
    3. System enforces RBAC on every API call.
    4. Admin can deactivate or modify user accounts.
  Table:       users
  Columns:     id (bigint, pk), full_name (varchar 150), email (varchar 150, unique), phone (varchar 20), role (varchar 20), password_hash (varchar 255), status (varchar 20), created_at (timestamp)
  Actor:       Admin
  AI Agent:    None
  ----
#2 | Cluster: Master Data Configuration | Feature: Vehicle and Fare Configuration
  Description: Maintains vehicle types and the pricing rules that drive fare calculation. Ensures consistent, configurable pricing across the platform.
  Workflow:
    1. Admin defines vehicle categories (mini, sedan, SUV).
    2. Admin sets base fare, per-km rate, per-minute rate, and surge factors per category and city.
    3. System uses configuration during fare estimation.
    4. Admin updates rates as needed.
  Table:       vehicle_fare_config
  Columns:     id (bigint, pk), vehicle_type (varchar 50), city_id (bigint, fk), base_fare (decimal), per_km_rate (decimal), per_min_rate (decimal), surge_multiplier (decimal), effective_from (timestamp)
  Actor:       Admin
  AI Agent:    None
  ----
#3 | Cluster: Master Data Configuration | Feature: Payment Method Registry
  Description: Stores tokenized payment instruments linked to passengers for cashless checkout. Integrates with the payment gateway for secure storage.
  Workflow:
    1. Passenger adds a card or wallet through the secure gateway.
    2. System tokenizes and stores the reference.
    3. Passenger can mark a default method.
    4. Passenger can remove or update methods.
  Table:       payment_methods
  Columns:     id (bigint, pk), user_id (bigint, fk), method_type (varchar 30), gateway_token (varchar 255), last4 (varchar 4), is_default (boolean), created_at (timestamp)
  Actor:       Passenger
  AI Agent:    None
  ----
#4 | Cluster: Master Data Configuration | Feature: Reference Lookups
  Description: Shared lookup catalog for cities, zones, trip statuses, and complaint categories. Keeps enumerated values consistent across modules.
  Workflow:
    1. Admin seeds cities, service zones, and complaint categories.
    2. Admin defines trip status enums and document types.
    3. Modules consume the lookups via APIs.
    4. Admin updates entries as policies evolve.
  Table:       reference_lookups
  Columns:     id (bigint, pk), category (varchar 50), code (varchar 50), label (varchar 150), parent_id (bigint), is_active (boolean)
  Actor:       Admin
  AI Agent:    None
  ----
#5 | Cluster: Driver Onboarding | Feature: Driver Application and Document Upload
  Description: Allows aspiring drivers to register and submit required documentation. Initiates the verification workflow.
  Workflow:
    1. Aspiring driver signs up and creates a profile.
    2. Driver enters vehicle and license details.
    3. Driver uploads license, insurance, and registration documents.
    4. System marks application as pending review.
  Table:       driver_applications
  Columns:     id (bigint, pk), user_id (bigint, fk), license_number (varchar 50), vehicle_plate (varchar 20), vehicle_type (varchar 50), document_urls (json), status (varchar 20), submitted_at (timestamp)
  Actor:       Driver
  AI Agent:    None
  ----
#6 | Cluster: Driver Onboarding | Feature: Admin Driver Verification and Approval
  Description: Enables admins to verify driver documents and control access to the platform. Ensures regulatory and safety compliance.
  Workflow:
    1. Admin opens pending applications queue.
    2. Admin reviews documents and validates compliance.
    3. Admin approves, requests resubmission, or rejects.
    4. Approved driver profile is activated and notified.
    5. Admin can later suspend a driver if violations occur.
  Table:       driver_verification
  Columns:     id (bigint, pk), application_id (bigint, fk), reviewer_id (bigint, fk), decision (varchar 20), notes (text), reviewed_at (timestamp)
  Actor:       Admin
  AI Agent:    None
  ----
#7 | Cluster: Driver Availability | Feature: Driver Online/Offline Toggle
  Description: Lets drivers control when they are available to receive ride requests. Drives the live pool of dispatchable drivers.
  Workflow:
    1. Approved driver logs into the app.
    2. Driver toggles availability to online.
    3. System updates driver status and starts location streaming.
    4. Driver toggles offline to stop receiving requests.
  Table:       driver_status
  Columns:     id (bigint, pk), driver_id (bigint, fk), is_online (boolean), current_lat (decimal), current_lng (decimal), updated_at (timestamp)
  Actor:       Driver
  AI Agent:    None
  ----
#8 | Cluster: Ride Booking | Feature: Pickup Location Detection
  Description: Auto-populates the passenger's pickup location using device GPS. Provides manual fallback when permissions are denied.
  Workflow:
    1. Passenger opens the app and grants location permission.
    2. System auto-detects coordinates via GPS.
    3. Pickup is pre-filled on the booking screen.
    4. Passenger can manually adjust the pickup pin if needed.
  Table:       booking_pickups
  Columns:     id (bigint, pk), passenger_id (bigint, fk), pickup_lat (decimal), pickup_lng (decimal), pickup_address (varchar 255), source (varchar 20), captured_at (timestamp)
  Actor:       Passenger
  AI Agent:    None
  ----
#9 | Cluster: Ride Booking | Feature: Fare Estimation and Booking Confirmation
  Description: Computes the estimated fare and ETA before booking confirmation. Records the new ride request for dispatch.
  Workflow:
    1. Passenger enters destination address.
    2. System calculates distance, ETA, and estimated fare using fare config.
    3. Estimated fare is displayed for confirmation.
    4. Passenger confirms booking; system creates a ride request record.
  Table:       ride_requests
  Columns:     id (bigint, pk), passenger_id (bigint, fk), pickup_lat (decimal), pickup_lng (decimal), drop_lat (decimal), drop_lng (decimal), estimated_fare (decimal), vehicle_type (varchar 50), status (varchar 20), created_at (timestamp)
  Actor:       Passenger
  AI Agent:    None
  ----
#10 | Cluster: Ride Dispatch | Feature: Nearby Driver Dispatch
  Description: Routes new ride requests to the closest available drivers. Ensures fast matching and efficient dispatch.
  Workflow:
    1. System receives a confirmed ride request.
    2. System queries online drivers within radius matching the vehicle type.
    3. Request is broadcast in proximity order.
    4. First accepting driver is assigned to the trip.
  Table:       dispatch_log
  Columns:     id (bigint, pk), ride_request_id (bigint, fk), driver_id (bigint, fk), broadcast_at (timestamp), distance_km (decimal), outcome (varchar 20)
  Actor:       System
  AI Agent:    None
  ----
#11 | Cluster: Ride Dispatch | Feature: Driver Accept/Reject Decision
  Description: Lets drivers review and respond to incoming ride requests. Enforces a response time window to keep dispatch flowing.
  Workflow:
    1. Driver receives the request with pickup, drop-off, and fare details.
    2. Driver accepts or rejects within the response window.
    3. On accept, ride is assigned and passenger is notified.
    4. On reject or timeout, request is reissued to the next driver.
  Table:       ride_assignments
  Columns:     id (bigint, pk), ride_request_id (bigint, fk), driver_id (bigint, fk), response (varchar 20), responded_at (timestamp), response_time_seconds (int)
  Actor:       Driver
  AI Agent:    None
  ----
#12 | Cluster: Ride Execution | Feature: In-App GPS Navigation
  Description: Provides turn-by-turn navigation embedded in the driver app. Guides drivers from pickup to drop-off seamlessly.
  Workflow:
    1. Driver accepts and navigation launches to pickup.
    2. Driver picks up the passenger and starts the trip.
    3. Navigation re-routes to the drop-off destination.
    4. Trip is marked complete on arrival.
  Table:       trips
  Columns:     id (bigint, pk), ride_request_id (bigint, fk), driver_id (bigint, fk), started_at (timestamp), ended_at (timestamp), distance_km (decimal), final_fare (decimal), status (varchar 20)
  Actor:       Driver
  AI Agent:    None
  ----
#13 | Cluster: Ride Execution | Feature: Real-Time Trip Tracking
  Description: Shows passengers a live map of the driver's location and ETA. Drives transparency and trust during the ride.
  Workflow:
    1. Driver location stream updates every few seconds.
    2. Passenger app displays driver position and ETA on map.
    3. ETA recalculates as the trip progresses.
    4. Tracking ends when the trip completes.
  Table:       trip_locations
  Columns:     id (bigint, pk), trip_id (bigint, fk), lat (decimal), lng (decimal), heading (decimal), recorded_at (timestamp)
  Actor:       Passenger
  AI Agent:    None
  ----
#14 | Cluster: Ride Execution | Feature: Live Trip Sharing
  Description: Generates a secure link that lets a trusted contact follow the ride in real time. Enhances passenger safety.
  Workflow:
    1. Passenger taps share-trip during the ride.
    2. System generates a secure shareable link.
    3. Passenger sends link via SMS or messaging app.
    4. Recipient views live ride progress until trip ends.
  Table:       trip_shares
  Columns:     id (bigint, pk), trip_id (bigint, fk), share_token (varchar 100, unique), expires_at (timestamp), created_at (timestamp)
  Actor:       Passenger
  AI Agent:    None
  ----
#15 | Cluster: Payment and Rating | Feature: Cashless Payment Processing
  Description: Charges the passenger automatically using a stored payment method. Provides secure, cashless settlement at trip end.
  Workflow:
    1. Trip ends and final fare is computed.
    2. System charges the passenger's default payment method via gateway.
    3. Receipt is generated and emailed.
    4. Driver earnings ledger is updated.
  Table:       payments
  Columns:     id (bigint, pk), trip_id (bigint, fk), passenger_id (bigint, fk), payment_method_id (bigint, fk), amount (decimal), gateway_txn_id (varchar 100), status (varchar 20), processed_at (timestamp)
  Actor:       System
  AI Agent:    None
  ----
#16 | Cluster: Payment and Rating | Feature: Trip Rating and Feedback
  Description: Captures passenger ratings and feedback after each trip. Feeds driver performance reviews and quality controls.
  Workflow:
    1. After payment, passenger is prompted to rate.
    2. Passenger submits 1-5 star rating and optional comment.
    3. System stores rating against the trip and driver.
    4. Driver's average rating is updated.
  Table:       trip_ratings
  Columns:     id (bigint, pk), trip_id (bigint, fk), passenger_id (bigint, fk), driver_id (bigint, fk), stars (int), comment (text), created_at (timestamp)
  Actor:       Passenger
  AI Agent:    None
  ----
#17 | Cluster: Driver Earnings | Feature: Driver Earnings Dashboard
  Description: Shows drivers their daily earnings, trip count, and complete ride history. Helps drivers track income and performance.
  Workflow:
    1. Driver opens the earnings dashboard.
    2. System aggregates today's trips, fares, and tips.
    3. Dashboard displays daily totals, trip count, and history.
    4. Driver can drill into a specific trip's details.
  Table:       driver_earnings
  Columns:     id (bigint, pk), driver_id (bigint, fk), trip_id (bigint, fk), gross_amount (decimal), commission (decimal), net_amount (decimal), earned_on (date)
  Actor:       Driver
  AI Agent:    None
  ----
#18 | Cluster: Admin Operations and Reporting | Feature: Live Fleet Monitoring, Complaint Handling, and Business Reports
  Description: Gives admins real-time fleet visibility, complaint resolution tools, and exportable business reports. Supports operational oversight and data-driven decisions.
  Workflow:
    1. Admin opens the operations console with a live map of active trips.
    2. Admin reviews passenger complaints and investigates issues.
    3. Admin records resolution actions or escalations.
    4. Admin selects a date range and generates revenue, ride volume, and KPI reports.
    5. Admin exports reports in CSV or PDF.
  Table:       admin_operations
  Columns:     id (bigint, pk), record_type (varchar 30), reference_id (bigint), admin_id (bigint, fk), action (varchar 50), notes (text), report_period_start (date), report_period_end (date), created_at (timestamp)
  Actor:       Admin
  AI Agent:    None
  ----

==================================================
 END OF STORY EXPORT
==================================================
