initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using FluentValidation;
|
||||
using Indotalent.Shared.Consts;
|
||||
|
||||
namespace Indotalent.Features.Profile.PersonalInformation.Cqrs;
|
||||
|
||||
public class UpdateProfileValidator : AbstractValidator<UpdateProfileRequest>
|
||||
{
|
||||
public UpdateProfileValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
|
||||
RuleFor(x => x.FirstName)
|
||||
.NotEmpty().WithMessage("First name is required")
|
||||
.MaximumLength(GlobalConsts.StringLengthShort).WithMessage($"First name cannot exceed {GlobalConsts.StringLengthShort} characters");
|
||||
|
||||
RuleFor(x => x.LastName)
|
||||
.NotEmpty().WithMessage("Last name is required")
|
||||
.MaximumLength(GlobalConsts.StringLengthShort).WithMessage($"Last name cannot exceed {GlobalConsts.StringLengthShort} characters");
|
||||
|
||||
RuleFor(x => x.PhoneNumber)
|
||||
.MaximumLength(GlobalConsts.StringLengthShort).WithMessage($"Phone cannot exceed {GlobalConsts.StringLengthShort} characters");
|
||||
|
||||
RuleFor(x => x.ShortBio)
|
||||
.MaximumLength(GlobalConsts.StringLengthShort).WithMessage($"Bio cannot exceed {GlobalConsts.StringLengthShort} characters");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user