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

namespace Hotline.Validators.CallCenter;


public class StartEndTimeDtoValidator : AbstractValidator<StartEndTimeDto>
{
    public StartEndTimeDtoValidator()
    {
        RuleFor(d => d.StartTime).Must(m => m != default(DateTime)).WithMessage("请选择开始时间");
        RuleFor(d => d.EndTime).Must(m => m != default(DateTime)).WithMessage("请选择结束时间");
    }
}

public class QueryOrderVisitQuantityValidator : AbstractValidator<QueryOrderVisitQuantity>
{
    public QueryOrderVisitQuantityValidator()
    {
        Include(new StartEndTimeDtoValidator());
    }
}

public class ReportRequiredPagedRequestValidator : AbstractValidator<ReportRequiredPagedRequest>
{
    public ReportRequiredPagedRequestValidator()
    {
        RuleFor(d => d.StartTime).NotEmpty();
        RuleFor(d => d.EndTime).NotEmpty();
    }
}

public class QueryCallListDtoValidator : AbstractValidator<QueryCallListDto>
{
    public QueryCallListDtoValidator()
    {
        RuleFor(d => d.StartTime).Must(m => m != default(DateTime)).WithMessage("请选择开始时间");
        RuleFor(d => d.EndTime).Must(m => m != default(DateTime)).WithMessage("请选择结束时间"); ;
    }
}

public class PagedStartEndTimeDtoValidator : AbstractValidator<PagedStartEndTimeDto>
{
    public PagedStartEndTimeDtoValidator()
    {
        RuleFor(d => d.StartTime).NotEmpty();
        RuleFor(d => d.EndTime).NotEmpty();
    }
}
