namespace Application.Enrollments.Commands;

using Application.Common;
using FluentValidation;

/// <summary>
/// Validator for <see cref="EnrollStudentCommand"/>.
/// Validates that student and subject IDs are valid.
/// </summary>
public class EnrollStudentValidator : AbstractValidator<EnrollStudentCommand>
{
    public EnrollStudentValidator()
    {
        RuleFor(x => x.StudentId)
            .GreaterThan(0).WithMessage(ValidationPatterns.InvalidIdMessage);

        RuleFor(x => x.SubjectId)
            .GreaterThan(0).WithMessage(ValidationPatterns.InvalidIdMessage);
    }
}

/// <summary>
/// Validator for <see cref="UnenrollStudentCommand"/>.
/// Validates that enrollment ID is valid.
/// </summary>
public class UnenrollStudentValidator : AbstractValidator<UnenrollStudentCommand>
{
    public UnenrollStudentValidator()
    {
        RuleFor(x => x.EnrollmentId)
            .GreaterThan(0).WithMessage(ValidationPatterns.InvalidIdMessage);
    }
}
