16 lines
562 B
C#
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");
|
|
}
|
|
} |