CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

Add comprehensive admin panel with bookings, live pricing, and email management #4511

Merged⚡ AI-generatedXSccantynz wants to mergeclaude/add-live-pricing-u9RN0mainopened Mar 6, 2026
ccantynzcommented Mar 6, 2026

Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/BookarideV2/pull/6


Summary

This PR introduces a complete admin panel for BookARide with tools for managing bookings, calculating live pricing quotes, and managing email communications. The admin interface includes authentication, booking status management with confirmation dialogs, and email delivery verification.

Key Changes

Frontend Components

  • AdminLayout - Main admin shell with sidebar navigation, authentication check, and logout functionality
  • AdminLogin - Secure login page for admin staff with username/password authentication
  • AdminDashboard - Overview dashboard showing booking statistics and system health
  • AdminBookings - Full booking management interface with:
    • Search and filter by status (pending, confirmed, completed, cancelled)
    • Expandable booking details with customer info, pricing breakdown, and flight numbers
    • Confirm, cancel, and delete actions with confirmation dialogs
    • Resend confirmation email functionality
    • Payment status tracking
  • AdminLivePricing - Price calculator tool for admin staff to:
    • Generate quick price quotes without creating bookings
    • Support multiple pickup locations
    • Include optional add-ons (VIP, oversized luggage, return trips)
    • Pre-fill public booking form with calculated details
  • AdminEmail - Email management interface with:
    • Test email delivery functionality
    • Email send logs with status tracking
    • Configuration status display

Backend Routes & Services

  • Admin routes (/admin/*) - New endpoints for:

    • Live pricing calculation (POST /admin/live-pricing)
    • Pricing enquiry history (GET /admin/pricing-enquiries)
    • Booking confirmation (POST /admin/bookings/{id}/confirm)
    • Booking cancellation (POST /admin/bookings/{id}/cancel)
    • Test email sending (POST /admin/email/test)
    • Confirmation email resend (POST /admin/email/send-confirmation/{id})
    • Email logs retrieval (GET /admin/email/logs)
    • System health check (GET /admin/system-health)
  • Email service (app/services/email.py) - New service for:

    • Mailgun API integration for email delivery
    • Booking confirmation email templates with HTML formatting
    • Admin notification emails
    • Email logging and tracking
    • Test email functionality

Database Schema

  • New pricing_enquiries table to track admin live pricing tool usage
  • New email_logs table to track all email send attempts with status and details

Security & UX

  • Admin authentication with JWT tokens stored in localStorage
  • Confirmation dialogs for all destructive actions (cancel, delete bookings)
  • Protected routes that redirect to login if not authenticated
  • Lock notice informing admins that bookings are protected
  • Status badges with color coding for booking states
  • Responsive design with mobile-friendly sidebar navigation

Notable Implementation Details

  • Live pricing tool calculates quotes without creating database records, only logging enquiries
  • Booking confirmation emails include full details (reference, addresses, date/time, pricing breakdown)
  • Admin can resend confirmation emails to customers at any time
  • Email delivery uses Mailgun API with async/await pattern
  • All admin actions are logged for audit purposes
  • Confirmation dialogs prevent accidental destructive actions

https://claude.ai/code/session_018Lk1bRwfbtxc5eo6zXuG94

ccantynzcommented Mar 6, 2026

Originally written by @vercel[bot] on GitHub.


The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bookaride-v2 Ready Ready Preview, Comment Mar 6, 2026 9:47pm

Request Review

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts