initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Indotalent.Features.Profile.Password.Cqrs;
|
||||
|
||||
public class UpdatePasswordValidator : AbstractValidator<UpdatePasswordRequest>
|
||||
{
|
||||
public UpdatePasswordValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
|
||||
RuleFor(x => x.CurrentPassword)
|
||||
.NotEmpty().WithMessage("Current password is required");
|
||||
|
||||
RuleFor(x => x.NewPassword)
|
||||
.NotEmpty().WithMessage("New password is required")
|
||||
.MinimumLength(4).WithMessage("Password must be at least 4 characters");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user