initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user