using FluentValidation;
using OnlineAssessment.Domain.ViewModels;

namespace OnlineAssessment.Validators
{
    public class SubCategoryAddModelValidator : AbstractValidator<SubCategoryAddModel>
    {
        public SubCategoryAddModelValidator()
        {

            RuleFor(c => c.Name)
               .NotEmpty()
               .NotNull()
               .MaximumLength(500);

            RuleFor(c => c.Description).Length(0, 1500);

        }
    }

    public class SubCategoryEditModelValidator : AbstractValidator<SubCategoryEditModel>
    {
        public SubCategoryEditModelValidator()
        {
            RuleFor(c => c.Id)
               .NotEmpty()
               .NotNull()
               .GreaterThan(0);

            RuleFor(c => c.Name)
               .NotEmpty()
               .NotNull()
               .MaximumLength(500);

            RuleFor(c => c.Description).Length(0, 1500);

        }
    }
}
