export type UserRole = 'student' | 'teacher' | 'admin'

export interface User {
  id: number
  name: string
  email: string
  roles: UserRole[]
  activeRole: UserRole
  avatar?: string
  institute?: string
  department?: string
  year?: number
  direction?: string
  coins: number
  level: number
  xp?: number
  currentLevelXp?: number
  nextLevelXp?: number | null
  lecturesAttended?: number
  hoursLearned?: number
  achievements?: string[]
  activeEnrollments?: number
  enrollmentSlotLimit?: number
  enrollmentSlotRules?: EnrollmentSlotRule[]
}

export interface EnrollmentSlotRule {
  level: number
  slots: number
}

export interface Lecture {
  id: string
  teacherId?: number | null
  title: string
  description: string
  teacher: string
  teacherTitle?: string
  department?: string
  institute: string
  date: string
  time: string
  duration: number
  building: string
  room?: string
  format: 'online' | 'offline'
  totalSeats: number
  enrolledSeats: number
  freeSeats: number
  registrationClosed?: boolean
  tags: string[]
  rating: number
  reviewCount: number
  status?: 'upcoming' | 'ongoing' | 'completed'
  registered?: boolean
}

export interface Review {
  id: string
  lectureId: string
  userId: string
  userName: string
  text: string
  sentiment: 'positive' | 'neutral' | 'negative'
  coins?: number
  createdAt: string
  status: 'pending' | 'analyzing' | 'done' | 'rejected'
  quality?: number
}

export interface Achievement {
  id: string
  title: string
  description: string
  icon: string
  unlocked: boolean
  unlockedAt?: string
  coins?: number
}

export interface Notification {
  id: string
  type: 'reminder' | 'schedule-change' | 'achievement' | 'coins' | 'recommendation'
  title: string
  body: string
  read: boolean
  createdAt: string
}

export interface CoinTransaction {
  id: string
  date: string
  description: string
  amount: number
  type: 'earned' | 'spent'
}
