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

namespace PARR.API.Validators
{
    public class TemplateRobotStatusRequestValidator : AbstractValidator<TemplateRobotStatusRequest>
    {
        public TemplateRobotStatusRequestValidator()
        {
            var statuses = new List<int> { (int)RobotStatusEnum.Wait, (int)RobotStatusEnum.InProgress, (int)RobotStatusEnum.Error, (int)RobotStatusEnum.Complete };
            RuleFor(t => t.Code).Must(t => statuses.Contains(t)).WithMessage($"Допустимые значения: {string.Join(", ", statuses)}");
        }
    }
}
