Based on the updated van pricing structure (basePrice150km, pricePerKmAfter150, pricePerAdditional24hr), the booking flow has been redesigned:
- Select Van
- Date & Time
- Your Details
- Payment
- Confirmation
- Route & Dates - User selects pickup location, destination, and travel dates
- Pricing Tier - User selects category: Budget-Friendly, Premium, or Executive
- Van Selection - User sees available vans filtered by selected tier with calculated prices
- Customer Details - User enters contact information
- Payment - User pays via Paystack
- Confirmation - Booking confirmed
- Users start by selecting pickup and destination locations
- System calculates distance automatically using coordinates
- Distance is used to calculate pricing for each van
- Three tiers: Budget-Friendly, Premium, Executive
- Maps to van.category field
- Filters available vans before showing selection
For each van, the price is calculated as:
total = van.basePrice150km
if (distanceKm > 150):
total += (distanceKm - 150) * van.pricePerKmAfter150
if (extraDays > 0):
total += extraDays * van.pricePerAdditional24hr
- Shows only vans matching selected pricing tier
- Displays calculated total price for user's specific trip
- Shows price breakdown (base + extra km + extra days)
src/types/booking.types.ts- Added distanceKm, durationHours, pricingTier fieldssrc/types/van.types.ts- Already updated with new pricing fields
src/pages/BookingFlow.tsx- Main booking flow component- Restructure steps
- Add pricing tier selection UI
- Add van filtering logic
- Update price calculation
- Pricing tier selection cards
- Van list with price calculations
- Distance calculator utility
- User-Centric: Users know their route before selecting a van
- Transparent Pricing: See exact price for their specific trip
- Better Filtering: Only see vans in their budget range
- Accurate Quotes: Pricing based on actual distance and duration
- Flexible: Supports the new per-km and per-day pricing model
- Update BookingFlow.tsx with new step structure
- Create pricing tier selection UI
- Implement van filtering by category
- Add distance calculation (Google Maps Distance Matrix API)
- Update price display to show breakdown
- Test complete flow end-to-end