export type UserRole =
  | "super_admin"
  | "admin"
  | "kepala_sekolah"
  | "guru"
  | "wali_kelas"
  | "siswa"
  | "orang_tua"
  | "staf_tu"
  | "kesiswaan";

export interface UserProfile {
  id: string;
  email: string;
  fullName: string;
  role: UserRole;
  avatarUrl?: string;
  phone?: string;
  createdAt: string;
}

export interface AcademicYear {
  id: string;
  yearName: string; // e.g. "2026/2027"
  semester: "Ganjil" | "Genap";
  isActive: boolean;
  startDate: string;
  endDate: string;
}

export interface Teacher {
  id: string;
  nip?: string;
  fullName: string;
  title?: string;
  gender: "L" | "P";
  email: string;
  phone?: string;
  subjectsTaught: string[];
  isHomeroomTeacher: boolean;
  homeroomClass?: string;
  isActive: boolean;
}

export interface Student {
  id: string;
  nisn: string;
  nis: string;
  fullName: string;
  gender: "L" | "P";
  gradeLevel: "X" | "XI" | "XII";
  className: string;
  classId: string;
  email?: string;
  parentName?: string;
  parentPhone?: string;
  status: "aktif" | "lulus" | "mutasi" | "non_aktif";
}

export interface SchoolClass {
  id: string;
  name: string; // e.g. "X-1", "XI-MIPA-1"
  gradeLevel: "X" | "XI" | "XII";
  academicYearId: string;
  homeroomTeacherId?: string;
  homeroomTeacherName?: string;
  totalStudents: number;
  roomName?: string;
}

export interface Subject {
  id: string;
  code: string;
  name: string;
  category: "umum" | "peminatan" | "muatan_lokal" | "pilihan";
  gradeLevel: "X" | "XI" | "XII" | "Semua";
  totalHoursPerWeek: number;
}

export interface AttendanceRecord {
  id: string;
  studentId: string;
  classId: string;
  date: string;
  status: "hadir" | "sakit" | "izin" | "alpa";
  notes?: string;
}

export interface GradeRecord {
  id: string;
  studentId: string;
  subjectId: string;
  classId: string;
  academicYearId: string;
  type: "formatif" | "sumatif" | "pts" | "pas";
  score: number;
  letterGrade?: string;
}
