import { ApiProperty } from "@nestjs/swagger";
import { IsEmail, IsOptional, IsString, MinLength } from "class-validator";

export class AdminLoginDto {
    @ApiProperty({ description: 'Email address' , default: 'broker@yopmail.com' })
    @IsEmail()
    email: string;

    @ApiProperty({ description: 'Password' , default: 'Admin@#123' })
    @IsString()
    @MinLength(6)
    password: string;
}

export class AdminForgotPasswordDto {
    @ApiProperty({ description: 'Email address' })
    @IsEmail()
    email: string;
}

export class AdminResetPasswordDto {
    @ApiProperty({ description: 'Reset token from the emailed link' })
    @IsString()
    token: string;

    @ApiProperty({ description: 'New password' })
    @IsString()
    @MinLength(6)
    password: string;
}

export class AdminAcceptInviteDto {
    @ApiProperty({ description: 'Invite token from the emailed link' })
    @IsString()
    token: string;

    @ApiProperty({ description: 'Password to set' })
    @IsString()
    @MinLength(6)
    password: string;
}

export class AdminChangePasswordDto {
    @ApiProperty({ description: 'Current password' })
    @IsString()
    @MinLength(6)
    old_password: string;

    @ApiProperty({ description: 'New password' })
    @IsString()
    @MinLength(6)
    new_password: string;
}

export class UpdateAdminProfileDto {
    @ApiProperty({ required: false })
    @IsString()
    @IsOptional()
    name: string;

    @ApiProperty({ required: false })
    @IsString()
    @IsOptional()
    profile_pic: string;

    @ApiProperty({ required: false })
    @IsEmail()
    @IsOptional()
    email: string;
}
