Test Drives Advanced 3 min read

Implementation Status

Current implementation status and pending features for the test drive system

Test Drive Implementation Status

This document tracks the implementation progress of the Test Drive Queue System.

Completed Features

Core Infrastructure

  • Database migrations for test_drives table
  • TestDriveStatus enum (waiting, called, in_progress, returning, completed, no_show, cancelled)
  • TestDriveQueueType enum (scheduled, walk_in)
  • TestDriveVehicleStatus enum (available, on_test_drive, reserved, returning, maintenance)
  • TestDrive model with relationships and scopes
  • Vehicle model extensions for test drive tracking

Business Logic

  • TestDriveService with full queue management
  • Add to queue with priority ordering
  • Call customer from queue
  • Start, complete, and cancel test drives
  • Mark as no-show functionality
  • Queue position recalculation
  • Vehicle availability checks (blocks, bookings, status)

Staff Dashboard

  • Dashboard view with queue list and vehicle grid
  • Queue management showing position, type, wait time
  • Active drives table with time remaining/overdue indicators
  • Walk-in registration modal
  • Start test drive modal with vehicle and staff selection
  • Remove confirmation modal
  • No-show confirmation modal
  • HTMX auto-refresh (15s interval)
  • Toggle between list and grid views for vehicles

Public Interface

  • Multi-step walk-in wizard (details, license, vehicle, review)
  • License step conditionally shown based on company settings
  • Vehicle preference selection (any or specific)
  • Public queue display for TV/kiosk with QR codes
  • Customer tracking page with timeline and grace period countdown
  • Cancel queue confirmation modal
  • Company brand colors throughout

Integration & Polish

  • Booking flow integration - Auto-queue when scheduled customer checks in
  • QR code generation on confirmation page and queue display
  • Grace period timer with countdown for CALLED status
  • Overdue alert detection scheduled job (every 5 minutes)
  • Settings page with all configuration options
  • History/reports view with filtering and pagination
  • Staff assignment workflow when starting test drives
  • SMS notifications when customers are called

Analytics Dashboard

  • Daily test drive trends chart
  • Day of week distribution analysis
  • Queue type breakdown (scheduled vs walk-in)
  • Outcomes breakdown (completed, no-show, cancelled)
  • Top vehicles by test drive count
  • Staff performance metrics
  • Period selector (7, 30, 90 days)

Pending Features

Future Enhancements

Feature Priority Notes
Event broadcasting Low WebSocket real-time updates (requires Reverb/Pusher)
License photo capture Low Camera integration for mobile devices
Email notifications Low Optional email when called
Customer feedback Low Post-drive satisfaction survey
Vehicle comparison Low Compare multiple vehicles

Technical Notes

Queue Priority Algorithm

Scheduled bookings always come before walk-ins. Within each type, customers are ordered by join time (FIFO).

ORDER BY
  CASE queue_type WHEN 'scheduled' THEN 1 ELSE 2 END,
  joined_queue_at ASC

Vehicle Availability

A vehicle is considered available for test drive when:

  1. allow_test_drives = true
  2. test_drive_status = 'available'
  3. Not blocked for current date/time
  4. No active booking happening now

Auto-Refresh Intervals

  • Staff dashboard: 15 seconds (HTMX)
  • Public queue display: 15 seconds (HTMX) + 30 seconds (meta refresh)
  • Customer tracking: 15 seconds (HTMX)

Grace Period & Overdue Detection

  • When a customer is CALLED, a grace period countdown begins (configurable via no_show_grace_minutes, default 5 min)
  • Grace period timer is visible on both staff dashboard and customer tracking page
  • Overdue detection scheduled command runs every 5 minutes
  • Logs warnings for overdue test drives and expired grace periods
  • Configurable alert threshold via overdue_alert_minutes setting (default 10 min)

SMS Notifications

  • Sent automatically when a customer is called
  • Uses Semaphore SMS gateway (Philippine provider)
  • Includes company name, customer name, grace period, and tracking URL
  • Can be enabled/disabled per company in settings
  • Respects company SMS quota from subscription plan

QR Code Integration

  • Confirmation page includes QR code linking to tracking URL
  • Public queue display includes QR code linking to walk-in registration wizard
  • Uses milon/barcode library (DNS2D::getBarcodePNG)

Related Documentation