import { IsOptional, IsString, Matches, MaxLength, MinLength } from 'class-validator'
import { Trim } from 'src/common/decorators/trim.decorator'

export class UpdateUsernameDto {
    @IsOptional()
    @IsString()
    @Trim()
    @MinLength(5)
    @MaxLength(20)
    @Matches(/^[a-zA-Z0-9_]+$/, { message: 'Username can only contain letters, numbers and underscores' })
    username: string | null
}
