using FluentValidation;

using Monitoring.Core.Domain.Primitives;

namespace Monitoring.Features.Areas.CreateArea;

public class CreateAreaValidator : AbstractValidator<CreateAreaRequest>
{
	public CreateAreaValidator()
	{
		_ = RuleFor(x => x.AssetId)
			.NotEmpty();

		_ = RuleFor(x => x.Index)
			.GreaterThanOrEqualTo(0).LessThanOrEqualTo(99);

		_ = RuleFor(x => x.Name)
			.NotEmpty()
			.MinimumLength(AreaName.MinLength)
			.MaximumLength(AreaName.MaxLength);

		_ = RuleFor(x => x.Description)
			.NotEmpty()
			.MinimumLength(AreaDescription.MinLength)
			.MaximumLength(AreaDescription.MaxLength);
	}
}
