import {
  IsString,
  IsInt,
  IsOptional,
  IsEmail,
  IsDateString,
  IsIn,
  IsArray,
} from 'class-validator';

export class UpdateStudentDto {
  @IsString()
  @IsOptional()
  nickname?: string;

  @IsEmail()
  @IsOptional()
  email?: string;

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

  @IsInt()
  @IsOptional()
  classId?: number; // 行政班级ID

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

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

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

  @IsInt()
  @IsIn([1, 2])
  @IsOptional()
  gender?: number;

  @IsDateString()
  @IsOptional()
  birthDate?: string;

  @IsDateString()
  @IsOptional()
  enrollmentDate?: string;

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

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

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

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

  @IsInt()
  @IsIn([1, 2])
  @IsOptional()
  validState?: number; // 1-有效，2-失效

  @IsArray()
  @IsInt({ each: true })
  @IsOptional()
  interestClassIds?: number[]; // 兴趣班ID数组
}

