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

export class ChangePasswordDto {
  @ApiProperty({ minLength: 8, example: 'OldStrongPass123!' })
  @IsString()
  @Length(8, 64)
  currentPassword!: string;

  @ApiProperty({ minLength: 8, example: 'NewStrongPass123!' })
  @IsString()
  @Length(8, 64)
  @Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/, {
    message: 'newPassword must contain uppercase, lowercase, and number characters',
  })
  newPassword!: string;
}
