using CalledIt.Domain.Dtos;
using FluentValidation;

namespace CalledIt.Domain.Validators;

public class CreateCompetitionDtoValidator : AbstractValidator<CreateCompetitionDto>
{
    public CreateCompetitionDtoValidator()
    {
        RuleFor(x => x.Name).NotEmpty();
        RuleFor(x => x.EndDate)
            .GreaterThan(x => x.StartDate)
            .WithMessage("Start date must be before end date.");
    }
}
