import { IsEmail, IsString, MinLength, MaxLength, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class ResetPasswordEmailDto {
  @ApiProperty({ description: '邮箱地址', example: 'user@example.com' })
  @IsEmail({}, { message: '邮箱格式无效' })
  email: string;

  @ApiProperty({ description: '6位邮箱验证码', example: '123456' })
  @IsString()
  @Length(6, 6, { message: '验证码必须为6位数字' })
  emailCode: string;

  @ApiProperty({ description: '新密码 (8-128位)', example: 'NewPassword123!' })
  @IsString()
  @MinLength(8)
  @MaxLength(128)
  newPassword: string;
}
