using FastEndpoints;
using FluentValidation;
using Knots.DTO.Group;

namespace Knots.Validators.Group;

public class CreateGroupDtoValidator : Validator<CreateGroupDto>
{
    public CreateGroupDtoValidator()
    {
        RuleFor(x => x.Nom)
            .NotEmpty()
            .WithMessage("You must enter a name for the group")
            .MaximumLength(50)
            .WithMessage("Maximum 50 character are required");

        RuleFor(x => x.NombreMembres)
            .NotEmpty()
            .WithMessage("Members cannot be empty");
    }
}