import { IsNotEmpty, MinLength, MaxLength, Matches  } from 'class-validator';
import { validationMessages } from '../../../messages/validation-messages';
import { MatchPasswordValidator } from '../../../validators/match-password.validator';
import { ApiProperty } from '@nestjs/swagger';

export class ResetPasswordDto
{
    @ApiProperty({ example: 'user@yopmail.com', required : true, type : 'string' })
    @IsNotEmpty({ message: validationMessages.user.email_required  })
    email: string;

    @ApiProperty({ example: 'xxxxxxx', required : true, type : 'string' })
    @MinLength(8)
    @MaxLength(20)
    @IsNotEmpty({ message: validationMessages.user.password_required  })
    password: string;

    @ApiProperty({ example: 'xxxxxxx', required : true, type : 'string' })
    @MatchPasswordValidator({ message: validationMessages.user.password_not_match })
    @MinLength(8)
    @MaxLength(20)
    @IsNotEmpty({ message: validationMessages.user.confirm_password_required  })
    confirm_password: string;

    @ApiProperty({ example: 'en', required: false, type: 'string' })
    language: string;
}
