Files
blazor-crm/Features/Setting/SystemUser/Cqrs/ChangePasswordValidator.cs
T
2026-07-21 13:59:38 +07:00

16 lines
562 B
C#

using FluentValidation;
namespace Indotalent.Features.Setting.SystemUser.Cqrs;
public class ChangePasswordValidator : AbstractValidator<ChangePasswordRequest>
{
public ChangePasswordValidator()
{
RuleFor(x => x.UserId).NotEmpty();
RuleFor(x => x.NewPassword)
.NotEmpty().WithMessage("New password is required")
.MinimumLength(6).WithMessage("Password must be at least 6 characters");
RuleFor(x => x.ConfirmPassword)
.Equal(x => x.NewPassword).WithMessage("Passwords do not match");
}
}