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

export class CreateStudentDto {
  @IsString()
  username: string;

  @IsString()
  password: string;

  @IsString()
  nickname: string;

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

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

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

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

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

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

  @IsInt()
  @IsIn([1, 2])
  @IsOptional()
  gender?: number; // 1-男，2-女

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

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

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

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

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

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

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

  @IsInt()
  @IsOptional()
  validState?: number; // 有效状态：1-有效，0-无效
}
