Phase,Task,Subtasks,Priority,Status,Description,Ocarz Module,Ocarz Source
Phase 0 — Setup & Infra,Environment & Deployment,"Define cross-environment sync strategy, Set up CI/CD pipeline, Configure production environment variables, Set up database backup strategy",Critical,PLANNING,"Define the full deployment strategy: staging (Lovable Cloud) to production (client servers). Includes Git sync, CI/CD pipelines, env vars management, and automated daily backups with retention policy.",Infrastructure,Documentation — Architecture
Phase 0 — Setup & Infra,Team Onboarding,"Create developer setup guide, Provision team access & roles, Code conventions & PR workflow",High,PLANNING,"Prepare developer documentation (clone/install/run), access provisioning (Lovable, Git, DB), and coding standards (component structure, hook patterns, TanStack Query, RLS conventions, PR review process).",Infrastructure,Documentation — Installation
Phase 0 — Setup & Infra,Vehicle Referential Data Strategy,"Evaluate external car data APIs, Define extended data model, Plan chatbot data sync",High,PLANNING,"Finalize the long-term vehicle data source: external API (car-api.com, back4app) vs curated local dataset. Current temp solution uses vehicle_brands/vehicle_models (~16 brands, ~60 models). Includes extended model design and chatbot sync planning.",Vehicles,Documentation — Vehicles Module
Phase 1 — Core Ops,Leads — Chatbot Data Sync,"Implement chatbot-to-lead data sync (22 fields), Validate scoring algorithm, Validate temperature auto-calculation, Implement SLA breach notification trigger, Add lead type auto-detection",Critical,TO DO,"Finalize the Leads module: build the edge function webhook that receives FlowXo data and upserts leads with all 22 mapped fields. Validate priority_score (0-100+), temperature classification (hot/warm/cold), lead_type detection (buyer/seller/both), and SLA breach trigger for client_push leads (15min window).",Leads,Documentation — Leads Module
Phase 1 — Core Ops,Campaign Matching Engine,"Validate retroactive matching trigger, Test multi-campaign simultaneous matching, Validate exclusivity rules",High,TO DO,"Matching engine (match_lead_to_campaigns) is functional. Validate production behavior: retroactive matching on new campaign_product insert, multi-campaign matching for single leads, and exclusivity rules (exclusive=1 sale, standard=max_resales). Test Drive products always exclusive.",Matching,Documentation — Matching Module
Phase 1 — Core Ops,Bookings — WhatsApp Automation,"Implement booking confirmation WhatsApp message, Implement 24h reminder WhatsApp message, Validate mission wizard photo persistence",High,TO DO,"Booking scheduling and calendar are functional. Wire WhatsApp automation: send booking_confirmation template on creation via 360dialog, send booking_reminder_24h via scheduled function, and validate inspection photo persistence on real devices.",Bookings,Documentation — Bookings Module
Phase 1 — Core Ops,Surveys — Results Delivery,"Implement AI report generation, Validate unique lead count across audiences",Medium,TO DO,"Survey creation, execution, and audience system are functional. Build automated PDF/PPT report generation with AI summaries. Validate audience deduplication logic (Set-based) for unique lead counts.",Surveys,Documentation — Surveys Module
Phase 1 — Core Ops,Buyer-Seller Matching Notifications,Implement match approval WhatsApp notifications,Medium,TO DO,"When dispatcher approves a buyer-seller match, send WhatsApp notifications to both buyer and seller with vehicle details and contact info. Update whatsapp_sent_at timestamp.",Matching,Documentation — Matching Module
Phase 1 — Core Ops,Expert Mobile Optimization,Optimize expert mobile experience (PWA),Medium,TO DO,"Improve Agenda and Mission Wizard pages for mobile/tablet. Consider PWA capabilities for offline photo capture and mission data persistence by field experts.",Experts,Documentation — Experts Module
Phase 1 — Core Ops,Client Portal — Promo Vehicles,Add promotional vehicle data to portal,Low,TO DO,"Display promotional vehicle details (photos, specs, description) within the campaign view so clients see marketing assets alongside performance metrics.",Client Portal,Documentation — Client Portal
Phase 1 — Core Ops,Dispatcher Round-Robin Validation,Validate round-robin with real dispatchers,High,TO DO,"Test round-robin lead assignment with multiple active dispatchers. Verify redistribution triggers correctly when a dispatcher marks themselves unavailable (redistribute_pending_leads function).",Dispatcher,Documentation — Roles
Phase 1 — Core Ops,Notifications — Email & WhatsApp Wiring,"Wire email notifications to Mailgun, Implement all 27 notification triggers",High,TO DO,"27 notification types defined, web channel working via Realtime. Wire Mailgun for email channel with HTML templates. Ensure every business action triggers sendMatrixNotification with correct type and recipient resolution by role.",Notifications,Documentation — Notifications
Phase 1 — Core Ops,Admin Dashboard — Cost Analytics,Validate cost analytics with real data,Medium,TO DO,"Test calculate_cost_per_acquisition function and media_budgets tracking with actual campaign spend. Verify cost per lead and cost per test drive calculations.",Admin Dashboard,Documentation — Business Model
Phase 2 — Chatbot,WhatsApp Chatbot Development,"Configure FlowXo chatbot engine, Implement AI vehicle estimation (Gemini), Build NLU entity extraction layer, Implement qualification-first flow, Build dual record creation (Lead+Booking), Implement clarification & fallback logic, Map all 22 database fields, Sync vehicle referential with chatbot",Critical,TO DO,"Build the complete WhatsApp chatbot: FlowXo setup with 5-phase flow (Onboarding→Valuation→Qualification→Product Push→Booking). AI vehicle estimation via Gemini, NLU for French/Darija, qualification-first strategy, dual record creation on appointment, and full 22-field database mapping.",Chatbot,Documentation — Chatbot Module
Phase 2 — Chatbot,Chatbot-to-Database Webhook,"Create lead-sync edge function, Handle progressive funnel updates, Generate bot_summary with AI",Critical,TO DO,"Build POST /functions/v1/chatbot-lead-sync endpoint: accept FlowXo webhook, upsert lead by customer_phone, handle progressive funnel_stage updates (never downgrade), and generate AI bot_summary at conversation milestones.",Chatbot,Documentation — Chatbot Module
Phase 3 — Integrations,WhatsApp Business API (360dialog),"Create send-whatsapp-template edge function, Create whatsapp-webhook edge function, Create whatsapp_message_logs table, Create whatsapp_campaigns table, Configure 360dialog secrets, Replace mock templates with real ones",Critical,TO DO,"Connect to 360dialog API for template messages. Build send and webhook edge functions, create message_logs and campaigns tables, configure API secrets, and replace placeholder templates with approved ones from 360dialog dashboard.",Integrations,Documentation — Integrations
Phase 3 — Integrations,Email Integration (Mailgun),"Configure Mailgun API credentials, Create HTML email templates",High,TO DO,"Configure Mailgun: add API keys (MAILGUN_API_KEY, MAILGUN_DOMAIN, MAILGUN_FROM_EMAIL), verify DNS records (SPF, DKIM), and design responsive HTML email templates for each notification type with Ocarz branding.",Integrations,Documentation — Integrations
Phase 3 — Integrations,Media Budget Tracking (Ads APIs),"Build Meta Ads API connector, Build Google Ads API connector",High,TO DO,"Connect to Meta Marketing API and Google Ads API for automated ad spend tracking per campaign. Map to media_budgets table with source identification. Handle OAuth, pagination, and rate limiting.",Integrations,Documentation — Business Model
Phase 3 — Integrations,VoIP / Call Center,"Select VoIP provider, Implement Phase 1 — click-to-call + data sync, Plan Phase 2 — embedded softphone",High,PLANNING,"Select VoIP provider (Aircall, Ringover, CloudTalk, JustCall) based on API capabilities, WebRTC SDK, Moroccan number support. Phase 1: click-to-call + call log sync. Phase 2: embedded softphone widget.",Integrations,Documentation — Integrations
Phase 3 — Integrations,CRM Connectors,"Design universal CRM push interface, Build Salesforce connector, Build HubSpot connector",Medium,TO DO,"Build connectors to push delivered leads to client CRMs. Design standard API contract with field mapping per client, then implement Salesforce (OAuth + Lead/Contact objects) and HubSpot (contacts + deals) connectors.",Integrations,Documentation — Integrations
Phase 4 — Intelligence & Growth,AI Web Assistant,"Build role-aware AI assistant, Implement contextual help triggers",High,TO DO,"In-app AI chatbot that understands user's role (dispatcher, expert, client, admin) and answers platform questions using documentation as knowledge base. Add contextual help buttons on complex pages.",AI & Analytics,Roadmap — Évolutions futures
Phase 4 — Intelligence & Growth,Self-Service Campaign Builder,"Design client self-signup flow, Build campaign creation wizard for clients, Implement admin approval workflow",Medium,TO DO,"Allow automotive clients to self-register, create campaigns (select product type, target zones, upload promo vehicles, set quotas), and submit for admin approval. Campaigns enter 'pending_approval' until Admin Ops validates.",Campaigns,Roadmap — Évolutions futures
Phase 4 — Intelligence & Growth,Advanced Analytics,"Build custom date range analytics, Add conversion funnel visualization",Low,TO DO,"Enhanced dashboards with flexible date ranges (daily/weekly/monthly), YoY comparison, and interactive funnel charts showing lead progression with drop-off rates between stages.",AI & Analytics,Roadmap — Évolutions futures
Phase 4 — Intelligence & Growth,Landing Page ocarz.ma,"Design and build landing page, Define growth marketing strategy",Low,TO DO,"Public-facing marketing website with value proposition, product showcase, client testimonials, pricing, and contact form. Growth strategy: LinkedIn B2B ads, automotive events, SEO, referral program.",Marketing,Roadmap — Évolutions futures
Phase 5 — Deployment,Testing,"Write unit tests for scoring & matching, Write integration tests for edge functions, E2E test critical user flows, User acceptance testing (UAT)",Critical,TO DO,"Comprehensive testing: unit tests for scoring/matching functions (edge cases, boundary conditions), integration tests for edge functions (mock external APIs), E2E browser tests for each role's workflow, and UAT sessions with real users.",Testing & QA,Documentation — Security & Access
Phase 5 — Deployment,Security Audit,"Audit all RLS policies, Review edge function authentication, Validate data isolation per client, Check for SQL injection & XSS",Critical,TO DO,"Full security review: RLS policies per role (can_access_client, dispatcher assignments, expert bookings), edge function JWT validation, client data isolation, and input sanitization for SQL injection and XSS.",Security,Documentation — Security & Access
Phase 5 — Deployment,Data Migration,"Design data migration scripts, Seed production reference data",High,TO DO,"Plan and execute data migration: import existing clients/campaigns/leads/experts with ID mapping and referential integrity. Seed reference data (moroccan_cities, vehicle_brands, vehicle_models, fuel_types, products).",Infrastructure,Documentation — Installation
Phase 5 — Deployment,Go-Live Checklist,"Verify all secrets are configured, Validate production database schema, Configure production monitoring, Create admin seed accounts",Critical,TO DO,"Final pre-launch: confirm all API keys in production, run full migration suite, set up error tracking (Sentry) and uptime monitoring, create initial admin_ops and lead_dispatcher accounts, and remove demo data.",Infrastructure,Documentation — Architecture
Phase 6 — Scale & Maintenance,Performance Monitoring,"Set up APM and error tracking, Monitor database query performance, Monitor edge function cold starts",High,TO DO,"Ongoing APM: track page loads, API response times, edge function latency. Monitor slow queries (>500ms), connection pool usage, table sizes. Optimize with indexes (leads.customer_phone, bookings.scheduled_date).",Infrastructure,Documentation — Architecture
Phase 6 — Scale & Maintenance,SLA & Uptime,"Define uptime SLA targets, Set up uptime monitoring & alerts",High,TO DO,"Define SLA targets: 99.9% uptime, <200ms API response, <5s page load. Set up external monitoring (Pingdom/UptimeRobot) and on-call alerts (PagerDuty) during business hours.",Infrastructure,Documentation — Architecture
Phase 6 — Scale & Maintenance,Database Optimization,"Implement data archival strategy, Optimize matching engine for scale",Medium,TO DO,"Archive old data (leads >1yr, completed bookings, processed notifications) to keep tables performant. Profile and optimize matching functions with proper indexes and query plans for scale.",Infrastructure,Documentation — Architecture
Phase 6 — Scale & Maintenance,Dark Mode & UI Polish,Audit all components for dark mode,Low,TO DO,"Review every component for proper semantic color tokens (bg-background, text-foreground). Fix hardcoded colors and low-contrast elements in dark mode.",UI/UX,Internal
Phase 6 — Scale & Maintenance,Feature Maintenance,"Establish bug triage process, Plan quarterly feature reviews",Medium,TO DO,"Define bug severity levels (P0-P3) with response time targets. Schedule quarterly reviews of feature usage analytics, user feedback, and roadmap alignment.",Operations,Internal
