using Hotline.Application.StatisticalReport.CallReport;
using Hotline.Share.Dtos.CallCenter;
using Hotline.Share.Requests;
using Hotline.Share.Tools;
using Shouldly;
using SqlSugar.Extensions;

namespace Hotline.Tests.Application;
public class YiBinCallReportApplicationTest
{
    private readonly YiBinCallReportApplication _yiBinCallReportApplication;

    public YiBinCallReportApplicationTest(YiBinCallReportApplication yiBinCallReportApplication)
    {
        _yiBinCallReportApplication = yiBinCallReportApplication;
    }

    [Fact]
    public async Task QueryCallsDetailInTotal_Test()
    {
        var inDto = new BiQueryCallsDto
        {
            StartTime = "2024-04-11".ObjToDate(),
            EndTime = "2024-04-11 23:59:59".ObjToDate()
        };
        var (total, items) = await _yiBinCallReportApplication.QueryCallsDetailInTotalAsync(inDto, true);
        items.Any(m => m.OrderId.NotNullOrEmpty()).ShouldBe(true);
        items.Any(m => m.OrderNo.NotNullOrEmpty()).ShouldBe(true);
        items.Any(m => m.OrderTitle.NotNullOrEmpty()).ShouldBe(true);
    }

    [Fact]
    public async Task QuerySeatCall_Test()
    {
        var inDto = new ReportRequiredPagedRequest
        {
            StartTime = "2024-06-01".ObjToDate(),
            EndTime = "2024-06-30 23:59:59".ObjToDate()
        };

        var result = await _yiBinCallReportApplication.QuerySeatCallAsync(inDto, new CancellationToken());
        result.ShouldNotBeNull();
    }

}
