using FluentValidation;
using SportsDivision.Application.DTOs;

namespace SportsDivision.Application.Validators;

public class TournamentCreateValidator : AbstractValidator<TournamentCreateDto>
{
    public TournamentCreateValidator()
    {
        RuleFor(x => x.Name).NotEmpty().MaximumLength(200);
        RuleFor(x => x.StartDate).NotEmpty();
        RuleFor(x => x.EndDate).NotEmpty()
            .GreaterThanOrEqualTo(x => x.StartDate).WithMessage("End date must be on or after start date.");
    }
}
