24 lines
749 B
C#
24 lines
749 B
C#
using FluentValidation;
|
|
using Indotalent.Shared.Consts;
|
|
|
|
namespace Indotalent.Features.Setting.Company.Cqrs;
|
|
|
|
public class CreateCompanyValidator : AbstractValidator<CreateCompanyRequest>
|
|
{
|
|
public CreateCompanyValidator()
|
|
{
|
|
RuleFor(x => x.Name)
|
|
.NotEmpty().WithMessage("Company Name is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
|
|
RuleFor(x => x.CurrencyId)
|
|
.NotEmpty().WithMessage("Default Currency is required");
|
|
|
|
RuleFor(x => x.Email)
|
|
.NotEmpty().WithMessage("Email is required")
|
|
.EmailAddress().WithMessage("Invalid email format");
|
|
|
|
RuleFor(x => x.Phone)
|
|
.NotEmpty().WithMessage("Phone number is required");
|
|
}
|
|
} |