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

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

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

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

  @IsInt()
  @IsOptional()
  departmentId?: number;

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

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

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

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

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

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

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

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

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

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

