-- Seed Users (password is 'password123')
INSERT OR REPLACE INTO users (id, name, email, phone, role, status, password, created_at, updated_at) VALUES
(1, 'Eng. Tariq Al Nuaimi', 'superadmin@abudhabiautocare.ae', '+971 50 123 4567', 'super_admin', 'active', '$2y$10$QDmkrN9PvNJazhHH3b/1XOCbGgS4DdMbqm8vPPV6cDT4rIGYiVjuy', datetime('now'), datetime('now')),
(2, 'Rashid Mansoor', 'admin@abudhabiautocare.ae', '+971 54 514 3060', 'admin', 'active', '$2y$10$QDmkrN9PvNJazhHH3b/1XOCbGgS4DdMbqm8vPPV6cDT4rIGYiVjuy', datetime('now'), datetime('now')),
(3, 'Master Painter Hamza', 'technician@abudhabiautocare.ae', '+971 52 987 6543', 'technician', 'active', '$2y$10$QDmkrN9PvNJazhHH3b/1XOCbGgS4DdMbqm8vPPV6cDT4rIGYiVjuy', datetime('now'), datetime('now')),
(4, 'Mohammed Al Hashemi', 'client@abudhabiautocare.ae', '+971 55 432 1098', 'client', 'active', '$2y$10$QDmkrN9PvNJazhHH3b/1XOCbGgS4DdMbqm8vPPV6cDT4rIGYiVjuy', datetime('now'), datetime('now'));

-- Seed Settings
INSERT OR REPLACE INTO settings (module, key, value, type, label, description, created_at, updated_at) VALUES
('general', 'business_name', 'Abu Dhabi Auto Care', 'text', 'Business Name', '', datetime('now'), datetime('now')),
('general', 'tagline', 'Driven by Excellence', 'text', 'Tagline', '', datetime('now'), datetime('now')),
('general', 'supporting_line', 'Professional Car Painting, Repair & Auto Care in Abu Dhabi', 'text', 'Supporting Slogan', '', datetime('now'), datetime('now')),
('general', 'phone', '+971 54 514 3060', 'text', 'Official Phone', '', datetime('now'), datetime('now')),
('general', 'whatsapp', '+971 54 514 3060', 'text', 'WhatsApp Number', '', datetime('now'), datetime('now')),
('general', 'location_summary', 'Mussafah M11, Abu Dhabi, United Arab Emirates', 'text', 'Workshop Location Note', '', datetime('now'), datetime('now')),
('general', 'email', 'info@abudhabiautocare.ae', 'text', 'Contact Email', '', datetime('now'), datetime('now')),
('general', 'working_hours', 'Saturday – Thursday: 8:00 AM – 8:00 PM (Friday Closed / Emergency on request)', 'text', 'Working Hours', '', datetime('now'), datetime('now')),
('general', 'currency', 'AED', 'text', 'Currency', '', datetime('now'), datetime('now')),
('general', 'primary_offer', 'Full Car Paint Starting from AED 1,299', 'text', 'Primary Offer Headline', '', datetime('now'), datetime('now')),
('general', 'site_logo', '', 'text', 'Main Site Logo', '', datetime('now'), datetime('now')),
('general', 'footer_tagline', 'Care in every detail. Your certified automotive refinishing & car painting workshop in Abu Dhabi.', 'textarea', 'Footer Tagline', '', datetime('now'), datetime('now')),
('general', 'footer_cta_title', 'Book Workshop Visit Now', 'text', 'Footer CTA Text', '', datetime('now'), datetime('now')),
('general', 'footer_cta_url', '/book-service', 'text', 'Footer CTA URL', '', datetime('now'), datetime('now')),
('general', 'footer_copyright', 'Abu Dhabi Auto Care. All rights reserved.', 'text', 'Footer Copyright', '', datetime('now'), datetime('now')),
('general', 'default_theme', 'dark', 'text', 'Default Theme', '', datetime('now'), datetime('now')),
('services_video', 'paint_quality', 'Premium German Paint', 'text', 'Paint Formulation', '', datetime('now'), datetime('now')),
('services_video', 'warranty_duration', 'Up to 3-Year Warranty on qualifying painting work', 'text', 'Warranty Coverage', '', datetime('now'), datetime('now')),
('services_video', 'service_video_url', 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4', 'text', 'Showcase Video URL', '', datetime('now'), datetime('now')),
('services_video', 'service_video_ratio', '16/9', 'text', 'Video Aspect Ratio', '', datetime('now'), datetime('now')),
('services_video', 'service_video_speed', '1.0', 'text', 'Default Playback Speed', '', datetime('now'), datetime('now')),
('services_video', 'service_video_muted', '1', 'boolean', 'Default Mute', '', datetime('now'), datetime('now')),
('services_video', 'service_video_autoplay', '1', 'boolean', 'Autoplay Video', '', datetime('now'), datetime('now')),
('services_video', 'service_video_poster', 'https://images.unsplash.com/photo-1617814076367-b759c7d7e738?auto=format&fit=crop&w=1200&q=80', 'text', 'Poster URL', '', datetime('now'), datetime('now')),
('services_video', 'service_video_title', 'Inside Our Mussafah M11 Spray Booth & Detailing Bay', 'text', 'Showcase Video Title', '', datetime('now'), datetime('now')),
('services_video', 'service_video_desc', 'Watch our certified master painters apply German thermal cured coatings and multi-stage mirror clear coats.', 'textarea', 'Showcase Video Description', '', datetime('now'), datetime('now')),
('orders', 'free_pickup_enabled', '1', 'boolean', 'Free Car Pickup & Drop Across Abu Dhabi', '', datetime('now'), datetime('now')),
('orders', 'pickup_area', 'All Abu Dhabi Metropolitan & Mussafah Areas', 'text', 'Eligible Pickup Areas', '', datetime('now'), datetime('now')),
('orders', 'auto_whatsapp_dispatch', '1', 'boolean', 'Enable WhatsApp Instant Link', '', datetime('now'), datetime('now')),
('orders', 'order_prefix', 'AD-', 'text', 'Order Prefix', '', datetime('now'), datetime('now')),
('orders', 'default_deposit_percent', '25', 'number', 'Required Deposit %', '', datetime('now'), datetime('now')),
('orders', 'total_workshop_bays', '10', 'number', 'Total Workshop Bays', '', datetime('now'), datetime('now')),
('seo', 'meta_title_default', 'Car Painting & Auto Repair Abu Dhabi | Abu Dhabi Auto Care', 'text', 'Default SEO Title', '', datetime('now'), datetime('now')),
('seo', 'meta_description_default', 'Professional car painting, body repair, mechanical repair, AC service, detailing and free car pickup in Abu Dhabi. WhatsApp +971 54 514 3060.', 'textarea', 'Default SEO Description', '', datetime('now'), datetime('now')),
('seo', 'google_rating_value', '4.9', 'text', 'Google Rating Value', '', datetime('now'), datetime('now')),
('seo', 'google_review_count', '184', 'number', 'Google Review Count', '', datetime('now'), datetime('now')),
('notifications', 'notify_whatsapp_on_status_change', '1', 'boolean', 'Show WhatsApp Client Alert', '', datetime('now'), datetime('now')),
('working_hours', 'work_days', 'Saturday – Thursday', 'text', 'Working Days', '', datetime('now'), datetime('now')),
('working_hours', 'opening_time', '08:00 AM', 'text', 'Opening Time', '', datetime('now'), datetime('now')),
('working_hours', 'closing_time', '08:00 PM', 'text', 'Closing Time', '', datetime('now'), datetime('now')),
('pricing', 'vat_percent', '5', 'number', 'UAE VAT Rate %', '', datetime('now'), datetime('now'));

-- Seed Services
INSERT OR REPLACE INTO services (id, category, name, name_ar, slug, short_description, short_description_ar, starting_price, icon, badge, features, is_active, sort_order, created_at, updated_at) VALUES
(1, 'painting', 'Car Painting & Automotive Refinishing', 'دهان السيارات وتجديد الطلاء الاحترافي', 'car-painting-and-refinishing', 'Full-body car painting, same-colour repainting, and complete colour-change using premium German paint with up to 3-year warranty.', 'دهان كامل لجسم السيارة، وإعادة الطلاء بنفس اللون وتغيير اللون بالكامل باستخدام دهانات ألمانية ممتازة مع ضمان حتى 3 سنوات.', 1299.00, 'spray-can', 'Most Popular', '["Full-body same-colour repainting from AED 1,299","Complete colour-change painting from AED 1,650","Climate-controlled spray booths & infrared baking","Premium German paint formulation","Scratch, panel & bumper painting","Up to 3-Year warranty coverage","Free pickup & drop across Abu Dhabi"]', 1, 1, datetime('now'), datetime('now')),
(2, 'body_repair', 'Body Repair & Dent Restoration', 'إصلاح الهيكل وإزالة الصدمات وتعديل الشاسيه', 'body-repair-and-restoration', 'Precision dent removal, panel alignment, rust treatment, bumper repairs, and complete accident damage restoration.', 'إزالة الصدمات والطعجات بدقة، وضبط الفواصل، ومعالجة الصدأ، وإصلاح الصدامات وترميم أضرار الحوادث.', 250.00, 'hammer', 'Certified Technicians', '["Paintless Dent Removal (PDR) & structural pulling","Accident-damage reconstruction","Panel and bumper alignment","Rust removal and treatment","Surface sanding, priming, and pre-paint prep"]', 1, 2, datetime('now'), datetime('now')),
(3, 'mechanical', 'Mechanical Repair & Engine Diagnostics', 'خدمات الميكانيكا وفحص المحرك الشامل', 'mechanical-services', 'Comprehensive computer diagnostics, engine tuning, brake repairs, suspension overhaul, and preventive maintenance.', 'فحص كمبيوتر شامل، وصيانة المحركات، والفرامل، والمساعدين ونظام التعليق، والصيانة الدورية.', 199.00, 'wrench', 'Full Diagnostics', '["Full vehicle OBD-II computer diagnostics","Engine & transmission checks","Brake pads & disc rotor resurfacing","Suspension, shock absorbers & bushings","Fluid flushes, oil service & filter replacement"]', 1, 3, datetime('now'), datetime('now')),
(4, 'ac', 'Auto Air-Conditioning & Climate Care', 'صيانة تكييف السيارات وفحص كفاءة التبريد', 'air-conditioning-services', 'Keep cool in the UAE climate with precision AC gas refill, leak detection, compressor testing, and climate performance optimization.', 'صيانة مكيفات متكاملة في أجواء الإمارات الحارة، شحن غاز الفريون، كشف التسريبات، وصيانة الكمبروسر.', 150.00, 'fan', 'UAE Summer Ready', '["AC gas recovery, vacuum & genuine refrigerant refill","UV dye leak detection test","Compressor, condenser & evaporator inspection","Cabin air filter replacement and antibacterial treatment","Cooling performance temperature calibration"]', 1, 4, datetime('now'), datetime('now')),
(5, 'detailing', 'Machine Polishing & Auto Detailing', 'التلميع الاحترافي بالماكينة وعناية الديتيلنج', 'detailing-and-polishing', 'Multi-stage paint correction, swirl mark removal, deep gloss enhancement, and interior sanitization.', 'معالجة الخدوش السطحية ودوائر الغسيل، وتلميع متعدد المراحل لاستعادة اللمعة الأصلية وتنظيف المقصورة.', 299.00, 'sparkles', 'High Gloss', '["Machine Polish — Sedan starting from AED 299","Machine Polish — SUV starting from AED 350","Paint swirl & oxidation correction","Hydrophobic protective sealant","Interior deep steam extraction & leather conditioning"]', 1, 5, datetime('now'), datetime('now')),
(6, 'rims_calipers', 'Rim & Brake Caliper Custom Painting', 'صبغ وتجديد الجنوط وكليبرات الفرامل الرياضية', 'rims-and-brake-calipers', 'Transform your vehicle stance with custom high-temperature rim and caliper paint in gloss black, bronze, red, yellow or gold.', 'تغيير وتجديد مظهر الجنوط وكليبرات الفرامل بدهان مقاوم للحرارة العالية بمختلف الألوان الرياضية.', 399.00, 'disc', 'Custom Colors', '["Rim Painting (set of 4) starting from AED 399","Combined Rims & Brake Calipers from AED 450","High-temperature heat resistant ceramic coats","Custom gloss, matte, satin or metallic finishes","Curb rash smoothing and surface preparation"]', 1, 6, datetime('now'), datetime('now')),
(7, 'upholstery', 'Upholstery & Vehicle Styling Modifications', 'تنجيد المقاعد وتعديل المظهر الداخلي والخارجي', 'upholstery-and-modification', 'Custom seat leather upholstery, headliner restoration, interior colour changes, and exterior styling enhancements.', 'تنجيد المقاعد بالجلد الفاخر، وتجديد سقف السيارة، وتعديل ألوان الديكور الداخلي والمظهر الخارجي.', 450.00, 'armchair', 'Bespoke Craft', '["Custom leather & Alcantara upholstery","Starry roof lights / Starlight headliners","Interior trim wrapping and hydro-dipping","Body kits, spoilers & grille installation","Steering wheel restoration & custom stitching"]', 1, 7, datetime('now'), datetime('now')),
(8, 'specialty', 'Sandblasting & Underbody Protective Coating', 'صنفرة بالرمال (ساند بلاست) وحماية الشاسيه وأسفل السيارة', 'sandblasting-and-undercoating', 'Industrial-grade surface stripping and heavy-duty underbody rubberized coatings to protect against UAE coastal humidity, salt, and rust.', 'إزالة الصدأ والدهانات القديمة بالساند بلاست، ورش عازل الشاسيه المقاوم للرطوبة وصدأ السواحل.', 499.00, 'shield', 'Rust Defense', '["Undercoating from AED 499","Industrial sandblasting from AED 499","Complete chassis degreasing and rust treatment","Durable anti-corrosion barrier protection","Sound-deadening and stone chip prevention"]', 1, 8, datetime('now'), datetime('now'));

-- Seed Service Prices
INSERT OR REPLACE INTO service_prices (service_id, package_name, vehicle_category, price, notes, created_at, updated_at) VALUES
(1, 'Same-Colour Painting', 'Sedan', 1299.00, 'Original factory shade restore', datetime('now'), datetime('now')),
(1, 'Same-Colour Painting', 'Luxury / New Vehicle', 1499.00, 'High gloss ceramic clear coat', datetime('now'), datetime('now')),
(1, 'Same-Colour Painting', 'SUV / 7-Seater', 1599.00, 'Full exterior coverage', datetime('now'), datetime('now')),
(1, 'Same-Colour Painting', 'Sports Car', 1999.00, 'Multi-layer pearl / metallic finish', datetime('now'), datetime('now')),
(1, 'Same-Colour Painting', 'Muscle Car', 1499.00, 'Deep gloss performance coat', datetime('now'), datetime('now')),
(1, 'Colour-Change Painting', 'Sedan', 1650.00, 'Complete exterior & door jambs', datetime('now'), datetime('now')),
(1, 'Colour-Change Painting', 'Luxury / New Vehicle', 1999.00, 'Custom luxury colour transition', datetime('now'), datetime('now')),
(1, 'Colour-Change Painting', 'SUV / 7-Seater', 2250.00, 'Full body colour conversion', datetime('now'), datetime('now')),
(1, 'Colour-Change Painting', 'Sports Car', 2499.00, 'Show-room mirror finish', datetime('now'), datetime('now')),
(1, 'Colour-Change Painting', 'Muscle Car', 1999.00, 'Custom aggressive shade', datetime('now'), datetime('now')),
(2, 'Panel Dent Repair', 'All Vehicles', 250.00, 'Per panel starting price', datetime('now'), datetime('now')),
(2, 'Accident Restoration Assessment', 'All Vehicles', 0.00, 'Free inspection & quotation', datetime('now'), datetime('now')),
(3, 'General Inspection & Diagnostics', 'All Vehicles', 199.00, 'Digital diagnostic report', datetime('now'), datetime('now')),
(3, 'Brake Pad Replacement & Inspection', 'All Vehicles', 249.00, 'Front or rear axle', datetime('now'), datetime('now')),
(4, 'AC Performance Check & Gas Top-up', 'All Vehicles', 150.00, 'Includes pressure test', datetime('now'), datetime('now')),
(5, 'Machine Polish', 'Sedan', 299.00, 'Multi-stage paint correction', datetime('now'), datetime('now')),
(5, 'Machine Polish', 'SUV / 7-Seater', 350.00, 'Full exterior gloss treatment', datetime('now'), datetime('now')),
(6, 'Rim Painting (Set of 4)', 'All Vehicles', 399.00, 'Choice of gloss black, gunmetal, silver, gold', datetime('now'), datetime('now')),
(6, 'Rims & Brake Calipers Combo', 'All Vehicles', 450.00, 'High-heat resistant caliper finish', datetime('now'), datetime('now')),
(7, 'Interior Trim & Upholstery Customization', 'All Vehicles', 450.00, 'Starting price per project scope', datetime('now'), datetime('now')),
(8, 'Sandblasting', 'All Vehicles', 499.00, 'Heavy rust and old paint stripping', datetime('now'), datetime('now')),
(8, 'Chassis Undercoating', 'All Vehicles', 499.00, 'Rubberized anti-corrosion layer', datetime('now'), datetime('now'));

-- Seed Clients
INSERT OR REPLACE INTO clients (id, user_id, name, phone, whatsapp, email, address, city, notes, created_at, updated_at) VALUES
(1, 4, 'Mohammed Al Hashemi', '+971 55 432 1098', '+971 55 432 1098', 'client@abudhabiautocare.ae', 'Al Bateen, Villa 14', 'Abu Dhabi', 'Prefers communication via WhatsApp. Regular customer.', datetime('now'), datetime('now')),
(2, NULL, 'Saeed Al Dhaheri', '+971 50 882 1199', '+971 50 882 1199', 'saeed.dhaheri@gmail.com', 'Khalifa City Sector 12', 'Abu Dhabi', 'Requested free car pickup from Khalifa City.', datetime('now'), datetime('now')),
(3, NULL, 'Alexander Novak', '+971 52 334 7788', '+971 52 334 7788', 'a.novak@dubaiholding.ae', 'Saadiyat Island, Residences 3', 'Abu Dhabi', 'Sports car enthusiast. Demands high-gloss mirror finish.', datetime('now'), datetime('now')),
(4, NULL, 'Fatima Al Mansoori', '+971 56 712 9900', '+971 56 712 9900', 'fatima.m@adnoc.ae', 'Al Reem Island, Marina Square', 'Abu Dhabi', 'Full car repainting and brake caliper color change.', datetime('now'), datetime('now'));

-- Seed Realistic Orders
INSERT OR REPLACE INTO orders (id, order_number, client_id, service_id, service_title, vehicle_make, vehicle_model, vehicle_year, vehicle_plate, vehicle_category, current_color, target_color, package_type, pickup_required, pickup_location, preferred_date, status, estimated_cost, final_cost, payment_status, customer_notes, internal_notes, assigned_technician_id, created_at, updated_at) VALUES
(1, 'AD-8401', 1, 1, 'Full Car Paint (Same-Colour) & Rims Painting', 'Nissan', 'Patrol Titanium V8', '2022', 'Abu Dhabi 4 - 88124', 'SUV / 7-Seater', 'Pearl White', 'Pearl White (Refreshed Factory Coat)', 'Same-Colour Painting', 1, 'Al Bateen, Abu Dhabi', date('now', '-2 days'), 'in_paint_booth', 1998.00, 1998.00, 'partial', 'Bumper scratches from parking. Please repaint front & rear bumpers and rims in gloss black.', 'Primer baked. Base coat sprayed. Clear coat scheduled in booth 2 this afternoon.', 3, datetime('now', '-2 days'), datetime('now', '-1 hours')),
(2, 'AD-8402', 2, 1, 'Colour-Change Full Body Painting', 'Toyota', 'Land Cruiser LC300', '2023', 'Abu Dhabi 2 - 11090', 'SUV / 7-Seater', 'Silver Metallic', 'Nardo Grey (High Gloss)', 'Colour-Change Painting', 1, 'Khalifa City, Abu Dhabi', date('now', '-4 days'), 'preparation_sanding', 2250.00, 2250.00, 'pending', 'Changing colour from silver to Nardo grey with black accents on roof & mirrors.', 'Panels disassembled. Sanding completed, applying epoxy primer today.', 3, datetime('now', '-4 days'), datetime('now', '-3 hours')),
(3, 'AD-8403', 3, 1, 'Sports Car Custom Refinishing & Calipers', 'Porsche', '911 Carrera 4S', '2021', 'Dubai R - 77291', 'Sports Car', 'Agate Grey', 'Guards Red with Ceramic Gloss', 'Colour-Change Painting', 1, 'Saadiyat Island, Abu Dhabi', date('now', '-6 days'), 'ready_for_delivery', 2949.00, 2949.00, 'paid', 'Include bright yellow brake caliper painting.', '3-stage polishing completed. Final QC passed with 0 imperfections. Ready for customer pickup.', 3, datetime('now', '-6 days'), datetime('now', '-30 minutes')),
(4, 'AD-8404', 4, 1, 'Same-Colour Full Paint — Sedan Offer', 'Honda', 'Accord 2.0T', '2020', 'Abu Dhabi 5 - 43810', 'Sedan', 'Modern Steel Metallic', 'Modern Steel Metallic', 'Same-Colour Painting', 0, 'Dropped off at Mussafah M11', date('now', '-1 days'), 'vehicle_picked_up', 1299.00, 1299.00, 'pending', 'Selected AED 1,299 promo. Sun damage on hood and roof.', 'Intake inspection logged. Sun-damaged lacquer will be thoroughly stripped to metal.', 3, datetime('now', '-1 days'), datetime('now', '-5 hours')),
(5, 'AD-8405', 1, 5, 'Machine Polish & Ceramic Gloss Treatment', 'Lexus', 'LX600', '2023', 'Abu Dhabi 1 - 22440', 'Luxury / New Vehicle', 'Sonic Titanium', 'Sonic Titanium', 'Standard', 1, 'Al Bateen, Abu Dhabi', date('now', '-10 days'), 'completed', 350.00, 350.00, 'paid', 'Machine polish to remove dust swirls.', 'Delivered on time. Customer rated 5-stars.', 3, datetime('now', '-10 days'), datetime('now', '-2 days')),
(6, 'AD-8406', 2, 8, 'Chassis Undercoating & Sandblasting', 'Ford', 'F-150 Raptor', '2022', 'Abu Dhabi 3 - 90211', 'SUV / 7-Seater', 'Oxford White', 'Oxford White', 'Standard', 0, 'Customer bring-in', date('now'), 'pending_review', 998.00, NULL, 'pending', 'Desert offroading rust defense and sandblasting on suspension arms.', 'Quotation dispatched on WhatsApp, awaiting customer approval.', NULL, datetime('now'), datetime('now'));

-- Seed Order Status Logs
INSERT OR REPLACE INTO order_status_logs (order_id, from_status, to_status, note, updated_by, created_at, updated_at) VALUES
(1, NULL, 'pending_review', 'Order received via online booking.', 1, datetime('now', '-2 days'), datetime('now', '-2 days')),
(1, 'pending_review', 'in_paint_booth', 'Primer baked. Base coat sprayed. Curing in booth 2.', 3, datetime('now', '-1 hours'), datetime('now', '-1 hours')),
(2, NULL, 'preparation_sanding', 'Panels disassembled. Sanding with 800-grit.', 3, datetime('now', '-4 days'), datetime('now', '-3 hours')),
(3, NULL, 'ready_for_delivery', '3-stage polishing completed. QC passed with 0 defects.', 3, datetime('now', '-30 minutes'), datetime('now', '-30 minutes')),
(4, NULL, 'vehicle_picked_up', 'Vehicle received at Mussafah workshop.', 3, datetime('now', '-5 hours'), datetime('now', '-5 hours')),
(5, NULL, 'completed', 'Completed and handover finalized with 3-year warranty.', 3, datetime('now', '-2 days'), datetime('now', '-2 days')),
(6, NULL, 'pending_review', 'Quotation request submitted.', 1, datetime('now'), datetime('now'));
