using Hotline.Share.Requests.Exam;

namespace Hotline.Share.Exams.Extensions
{
    public static class ReportPagedRequestExtensions
    {
        public static void ResolveEndTime<T>(this T analysisReportRequest)where T :AnalysisReportRequest
        {
            if (analysisReportRequest.StartTime == null) return;

            switch (analysisReportRequest.AnlysisType)
            {
                case Share.Enums.Exams.EAnlysisType.Day:
                    analysisReportRequest.EndTime = analysisReportRequest.StartTime.Value.AddDays(1);
                    break;
                case Share.Enums.Exams.EAnlysisType.Week:
                    analysisReportRequest.EndTime = analysisReportRequest.StartTime.Value.AddDays(7);
                    break;
                case Share.Enums.Exams.EAnlysisType.Moon:
                    analysisReportRequest.EndTime = analysisReportRequest.StartTime.Value.AddMonths(1);
                    break;
                case Share.Enums.Exams.EAnlysisType.Time:

                    break;
                default:
                    analysisReportRequest.EndTime = analysisReportRequest.StartTime.Value.AddDays(1);
                    break;
            }
        }
    }
}
