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