using FluentValidation;
using Mizuki.Dtos;
namespace Mizuki.Validators;
///
/// The data validator for the PasswordChangeDto.
///
public class PasswordChangeValidator : AbstractValidator
{
///
/// Constructs the ruleset for the PasswordChangeValidator.
///
public PasswordChangeValidator()
{
RuleFor(x => x.OldPassword)
.NotEmpty();
RuleFor(x => x.OldPassword)
.MinimumLength(8);
RuleFor(x => x.NewPassword)
.NotEmpty();
RuleFor(x => x.NewPassword)
.MinimumLength(8);
RuleFor(x => x.NewPassword)
.Matches(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$%^&*!])[A-Za-z\d@#$%^&*!]{8,}$");
}
}