using FluentValidation;
using PARR.API.Contracts.V1.Requests;
using PARR.Domain.Enums;

namespace PARR.API.Validators
{
    public class AgentHistoryRequestValidator : AbstractValidator<AgentHistoryRequest>
    {
        public AgentHistoryRequestValidator()
        {
            RuleFor(t => t.TemplateId).NotEmpty().NotNull();

            RuleFor(t => t.Level)
                .Must(t => t == AgentHistoryLevelEnum.Start || t == AgentHistoryLevelEnum.End)
                .WithMessage($"Допустимые значения: {(int)AgentHistoryLevelEnum.Start}, {(int)AgentHistoryLevelEnum.End}");
        }
    }
}
