using FluentValidation;
using SportsDivision.Application.DTOs;

namespace SportsDivision.Application.Validators;

public class EventRegistrationValidator : AbstractValidator<EventRegistrationCreateDto>
{
    public EventRegistrationValidator()
    {
        RuleFor(x => x.TournamentEventLevelId).GreaterThan(0);
        RuleFor(x => x).Must(x => x.StudentId.HasValue || x.RelayTeamId.HasValue)
            .WithMessage("Either a student or relay team must be specified.");
    }
}
