INSERT INTO plans (code, price, currency, features) VALUES
('free', 0.00, 'USD', JSON_OBJECT('ads', true, 'payAtVisit', true)),
('pro', 14.00, 'USD', JSON_OBJECT('ads', false, 'multiClinic', true, 'directions', true, 'notifications', true, 'analytics', true)),
('premium', 29.00, 'USD', JSON_OBJECT('ads', false, 'multiClinic', true, 'directions', true, 'notifications', true, 'advancedAnalytics', true, 'staff', true, 'customDomain', true, 'prioritySupport', true));

INSERT INTO users (role, email, phone, password_hash) VALUES
('admin', 'admin@bookme.doctor', '+911234567890', '$2a$10$wHcK1v/jrJdQYw0v1nZK8OZC2Q2Ot6wq2QXr7v0xK9vTq8pJr7h3a');

INSERT INTO users (role, email, phone, password_hash) VALUES
('doctor', 'aisha@bookme.doctor', '+919876543210', NULL);

INSERT INTO doctors (user_id, slug, name, specialty, education, phone, phone_visible, plan_id, logo_url, brand_color, reviews_sync_place_id)
SELECT u.id, 'aisha-khan', 'Dr. Aisha Khan', 'Dermatology', 'MBBS, MD (Dermatology)', '+919876543210', 1, p.id, '/app/assets/logo.svg', '#0F62FE', NULL
FROM users u, plans p
WHERE u.email='aisha@bookme.doctor' AND p.code='free'
LIMIT 1;

INSERT INTO clinics (doctor_id, name, address, lat, lng)
SELECT d.id, 'City Care Clinic', '12 MG Road, Bengaluru, KA 560001', 12.9716000, 77.5946000
FROM doctors d WHERE d.slug='aisha-khan' LIMIT 1;

INSERT INTO clinic_rules (clinic_id, part, start_time, end_time, slot_minutes)
SELECT c.id, 'morning', '09:00:00', '12:00:00', 30 FROM clinics c, doctors d WHERE c.doctor_id=d.id AND d.slug='aisha-khan';
INSERT INTO clinic_rules (clinic_id, part, start_time, end_time, slot_minutes)
SELECT c.id, 'afternoon', '14:00:00', '17:00:00', 30 FROM clinics c, doctors d WHERE c.doctor_id=d.id AND d.slug='aisha-khan';
INSERT INTO clinic_rules (clinic_id, part, start_time, end_time, slot_minutes)
SELECT c.id, 'evening', '18:00:00', '20:00:00', 30 FROM clinics c, doctors d WHERE c.doctor_id=d.id AND d.slug='aisha-khan';

INSERT INTO legal_pages (slug, title, html) VALUES
('terms', 'Terms & Conditions', '<h1>Terms & Conditions</h1><p>By using BookMe.doctor you agree to these terms.</p>'),
('privacy', 'Privacy Policy', '<h1>Privacy Policy</h1><p>We respect your privacy. No prescriptions or PHI stored.</p>'),
('refund', 'Refund & Cancellation', '<h1>Refund & Cancellation</h1><p>Subscriptions are billed monthly. Cancel anytime.</p>'),
('cookie', 'Cookie Policy', '<h1>Cookie Policy</h1><p>We use essential cookies for authentication and preferences.</p>'),
('disclaimer', 'Disclaimer', '<h1>Disclaimer</h1><p>This site is not medical advice. Always consult your doctor.</p>');