export interface Instructor {
  id: string
  userId: string | null
  displayName: string
  bio: string | null
  instruments: string[] | null
  isActive: boolean
  createdAt: string
  updatedAt: string
}

export interface InstructorBlockedDate {
  id: string
  instructorId: string
  startDate: string
  endDate: string
  reason: string | null
  createdAt: string
}

export interface LessonType {
  id: string
  name: string
  instrument: string | null
  durationMinutes: number
  lessonFormat: 'private' | 'group'
  rateWeekly: string | null
  rateMonthly: string | null
  rateQuarterly: string | null
  isActive: boolean
  createdAt: string
  updatedAt: string
}

export interface ScheduleSlot {
  id: string
  instructorId: string
  lessonTypeId: string
  dayOfWeek: number
  startTime: string
  room: string | null
  maxStudents: number
  rateWeekly: string | null
  rateMonthly: string | null
  rateQuarterly: string | null
  isActive: boolean
  createdAt: string
  updatedAt: string
}

export interface Enrollment {
  id: string
  memberId: string
  accountId: string
  scheduleSlotId: string
  instructorId: string
  status: 'active' | 'paused' | 'cancelled' | 'completed'
  startDate: string
  endDate: string | null
  rate: string | null
  billingInterval: number | null
  billingUnit: 'day' | 'week' | 'month' | 'quarter' | 'year' | null
  makeupCredits: number
  notes: string | null
  createdAt: string
  updatedAt: string
}

export interface LessonSession {
  id: string
  enrollmentId: string
  scheduledDate: string
  scheduledTime: string
  actualStartTime: string | null
  actualEndTime: string | null
  status: 'scheduled' | 'attended' | 'missed' | 'makeup' | 'cancelled'
  instructorNotes: string | null
  memberNotes: string | null
  homeworkAssigned: string | null
  nextLessonGoals: string | null
  topicsCovered: string[] | null
  makeupForSessionId: string | null
  substituteInstructorId: string | null
  notesCompletedAt: string | null
  createdAt: string
  updatedAt: string
  // enriched fields from list endpoint
  memberName?: string
  instructorName?: string
  lessonTypeName?: string
}

export interface GradingScaleLevel {
  id: string
  gradingScaleId: string
  value: string
  label: string
  numericValue: number
  colorHex: string | null
  sortOrder: number
}

export interface GradingScale {
  id: string
  name: string
  description: string | null
  isDefault: boolean
  createdBy: string | null
  isActive: boolean
  createdAt: string
  updatedAt: string
  levels: GradingScaleLevel[]
}

export interface LessonPlanItem {
  id: string
  sectionId: string
  title: string
  description: string | null
  status: 'not_started' | 'in_progress' | 'mastered' | 'skipped'
  gradingScaleId: string | null
  currentGradeValue: string | null
  targetGradeValue: string | null
  startedDate: string | null
  masteredDate: string | null
  notes: string | null
  sortOrder: number
  createdAt: string
  updatedAt: string
}

export interface LessonPlanSection {
  id: string
  lessonPlanId: string
  title: string
  description: string | null
  sortOrder: number
  createdAt: string
  items: LessonPlanItem[]
}

export interface LessonPlan {
  id: string
  memberId: string
  enrollmentId: string
  createdBy: string | null
  title: string
  description: string | null
  isActive: boolean
  startedDate: string | null
  completedDate: string | null
  progress: number
  createdAt: string
  updatedAt: string
  sections: LessonPlanSection[]
}

export interface LessonPlanItemGradeHistory {
  id: string
  lessonPlanItemId: string
  gradingScaleId: string | null
  gradeValue: string
  gradedBy: string | null
  sessionId: string | null
  notes: string | null
  createdAt: string
}

export interface LessonPlanTemplateItem {
  id: string
  sectionId: string
  title: string
  description: string | null
  gradingScaleId: string | null
  targetGradeValue: string | null
  sortOrder: number
  createdAt: string
}

export interface LessonPlanTemplateSection {
  id: string
  templateId: string
  title: string
  description: string | null
  sortOrder: number
  createdAt: string
  items: LessonPlanTemplateItem[]
}

export interface LessonPlanTemplate {
  id: string
  name: string
  description: string | null
  instrument: string | null
  skillLevel: 'beginner' | 'intermediate' | 'advanced' | 'all_levels'
  createdBy: string | null
  isActive: boolean
  createdAt: string
  updatedAt: string
  sections: LessonPlanTemplateSection[]
}

export interface StoreClosure {
  id: string
  name: string
  startDate: string
  endDate: string
  createdAt: string
}

export interface SessionPlanItem {
  id: string
  sessionId: string
  lessonPlanItemId: string
  createdAt: string
}
