-- Örnek Veri Ekleme Scripti
-- Bu dosya test amaçlı örnek veriler ekler

-- 1. Örnek Şirket
INSERT INTO companies (name, subdomain, contact_email, contact_phone, subscription_start, subscription_end, is_active)
VALUES ('KERASUSAKADEMİ', 'admin', 'admin@kerasusakademi.com', '02121234567', '2026-01-01', '2026-12-31', 1);

SET @company_id = LAST_INSERT_ID();

-- 2. Örnek Kullanıcılar
-- Admin
INSERT INTO users (company_id, email, password, first_name, last_name, role, phone, is_active)
VALUES (@company_id, 'admin@kerasusakademi.com', '$2y$10$aLcibQsZtEctip8/NfH6auN3vnDp6i/lbprKZ5hvw4pJJr/pES4yS', 'Admin', 'Kullanıcı', 'admin', '05321234567', 1);
-- Şifre: KerasusAkademi1

-- Öğretmen
INSERT INTO users (company_id, email, password, first_name, last_name, role, phone, is_active)
VALUES (@company_id, 'ogretmen@ornekokul.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Ahmet', 'Yılmaz', 'teacher', '05321234568', 1);
-- Şifre: password

SET @teacher_id = LAST_INSERT_ID();

-- Öğrenci
INSERT INTO users (company_id, email, password, first_name, last_name, role, phone, is_active)
VALUES (@company_id, 'ogrenci@ornekokul.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Mehmet', 'Demir', 'student', '05321234569', 1);
-- Şifre: password

SET @student_id = LAST_INSERT_ID();

-- Veli
INSERT INTO users (company_id, email, password, first_name, last_name, role, phone, is_active)
VALUES (@company_id, 'veli@ornekokul.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Ali', 'Demir', 'parent', '05321234570', 1);
-- Şifre: password

SET @parent_id = LAST_INSERT_ID();

-- 3. Öğrenci-Veli İlişkisi
INSERT INTO student_parents (company_id, parent_id, student_id)
VALUES (@company_id, @parent_id, @student_id);

-- 4. Öğrenci Çalışma Programı
-- Pazartesi 18:00-20:00
INSERT INTO student_schedules (company_id, student_id, day_of_week, start_time, end_time)
VALUES (@company_id, @student_id, 1, '18:00:00', '20:00:00');

-- Çarşamba 18:00-20:00
INSERT INTO student_schedules (company_id, student_id, day_of_week, start_time, end_time)
VALUES (@company_id, @student_id, 3, '18:00:00', '20:00:00');

-- Cuma 19:00-21:00
INSERT INTO student_schedules (company_id, student_id, day_of_week, start_time, end_time)
VALUES (@company_id, @student_id, 5, '19:00:00', '21:00:00');

-- 5. Örnek Ödev
INSERT INTO assignments (company_id, created_by, student_id, title, description, subject, due_date, estimated_hours, priority, status)
VALUES (@company_id, @teacher_id, @student_id, 'Matematik Ödevi', 'Sayfa 45-50 arası problemler çözülecek', 'Matematik', DATE_ADD(CURDATE(), INTERVAL 10 DAY), 3.5, 'high', 'pending');

-- Not: Çalışma programı oluşturmak için API'yi kullanın:
-- POST /api/assignments/{assignment_id}/generate-plan
