using FluentValidation;

using Monitoring.Interfaces;

namespace Monitoring.Common.Validators;

public class TableStateValidator : AbstractValidator<ITableState>
{
	public TableStateValidator()
	{
		_ = RuleFor(x => x.Take)
			.GreaterThan(0).When(x => x.Take.HasValue)
			.LessThanOrEqualTo(100).When(x => x.Take.HasValue);

		_ = RuleFor(x => x.Skip)
			.GreaterThanOrEqualTo(0).When(x => x.Skip.HasValue);
	}
}
