import type { StudentDashboardGradeProps, StudentHomeworkAssignmentListItem } from "@/modules/homework/types"
import type { TeacherClass, ClassScheduleItem } from "@/modules/classes/types"
import type { HomeworkAssignmentListItem, HomeworkSubmissionListItem, TeacherGradeTrendItem } from "@/modules/homework/types"

export type AdminDashboardUserRoleCount = {
  role: string
  count: number
}

export type AdminDashboardRecentUser = {
  id: string
  name: string | null
  email: string
  role: string | null
  createdAt: string
}

export type AdminDashboardData = {
  activeSessionsCount: number
  userCount: number
  userRoleCounts: AdminDashboardUserRoleCount[]
  classCount: number
  textbookCount: number
  chapterCount: number
  questionCount: number
  examCount: number
  homeworkAssignmentCount: number
  homeworkAssignmentPublishedCount: number
  homeworkSubmissionCount: number
  homeworkSubmissionToGradeCount: number
  recentUsers: AdminDashboardRecentUser[]
  userGrowth: Array<{ date: string; count: number }>
  homeworkTrend: Array<{ date: string; count: number }>
}

export type StudentTodayScheduleItem = {
  id: string
  classId: string
  className: string
  course: string
  startTime: string
  endTime: string
  location: string | null
}

export type StudentDashboardProps = {
  studentName: string
  enrolledClassCount: number
  dueSoonCount: number
  overdueCount: number
  gradedCount: number
  todayScheduleItems: StudentTodayScheduleItem[]
  upcomingAssignments: StudentHomeworkAssignmentListItem[]
  grades: StudentDashboardGradeProps
}

export type TeacherTodayScheduleItem = {
  id: string
  classId: string
  className: string
  course: string
  startTime: string
  endTime: string
  location: string | null
}

export type TeacherDashboardData = {
  classes: TeacherClass[]
  schedule: ClassScheduleItem[]
  assignments: HomeworkAssignmentListItem[]
  submissions: HomeworkSubmissionListItem[]
  teacherName: string
  gradeTrends: TeacherGradeTrendItem[]
}
