using FluentValidation;

using Monitoring.Core.Domain.Primitives;

namespace Monitoring.Features.Zones.CreateZone;

public class CreateZoneValidator : AbstractValidator<CreateZoneRequest>
{
	public CreateZoneValidator()
	{
		_ = RuleFor(x => x.AreaId)
			.NotEmpty();

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

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

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