using FluentValidation;
using Hotline.Share.Dtos.CallCenter;

namespace Hotline.Validators.CallCenter
{
    public class AddIvrDtoValidator : AbstractValidator<AddIvrDto>
    {
        public AddIvrDtoValidator()
        {
            RuleFor(d => d.IvrType).IsInEnum();
            RuleFor(d => d.No).NotEmpty();
            RuleFor(d => d.Voice).NotEmpty();
            RuleFor(d => d.Name).NotEmpty();
            RuleFor(d => d.IvrCategoryId).IsGuidStructureString();
            RuleFor(d => d.Exit).MaximumLength(1);
        }
    }

    public class UpdateIvrDtoValidator : AbstractValidator<UpdateIvrDto>
    {
        public UpdateIvrDtoValidator()
        {
            RuleFor(d => d.Id).IsGuidStructureString();
            Include(new AddIvrDtoValidator());
        }
    }

    public class StructureIvrDtoValidator : AbstractValidator<StructureIvrDto>
    {
        public StructureIvrDtoValidator()
        {
            RuleFor(d => d.Id).IsGuidStructureString();
            RuleFor(d => d.IvrStrategies).NotEmpty();
        }
    }
}
