import { IsInt, IsNumber, IsString, IsOptional, IsDateString, Min, Max } from 'class-validator';

export class CreateGradeDto {
  @IsInt()
  studentId: number;

  @IsInt()
  timetableEntryId: number;

  @IsInt()
  @Min(1)
  @Max(53)
  weekNumber: number;

  @IsInt()
  year: number;

  @IsNumber()
  @Min(1.0)
  @Max(6.0)
  grade: number;

  @IsString()
  gradeType: string; // z.B. "Klausur", "Mitarbeit", "Hausaufgabe", "Mündlich"

  @IsOptional()
  @IsNumber()
  weight?: number;

  @IsOptional()
  @IsString()
  title?: string;

  @IsOptional()
  @IsString()
  description?: string;

  @IsOptional()
  @IsNumber()
  maxPoints?: number;

  @IsOptional()
  @IsNumber()
  achievedPoints?: number;

  @IsDateString()
  date: string;

  @IsInt()
  teacherId: number; // Foreign Key zu User (Lehrer)
}
