2024-08-20 09:33:13 +10:00
|
|
|
|
namespace PARR.API.Contracts.V1.Responses.Statistics
|
|
|
|
|
|
{
|
|
|
|
|
|
public class StatWorkLoadDataBaseResponse
|
|
|
|
|
|
{
|
|
|
|
|
|
public List<StatWorkLoadDataResponse> WorkLoad { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int WorksCount => WorkLoad?.Sum(t => t.TemplateCount) ?? 0;
|
|
|
|
|
|
|
2024-09-16 12:03:08 +10:00
|
|
|
|
public double AverageWorksCount
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
int divider = WorkLoad.Where(t => t.TemplateCount > 0).Count();
|
|
|
|
|
|
if (divider > 0)
|
|
|
|
|
|
return Math.Round((double)WorksCount / divider, 2);
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}//=> Math.Round((double)WorksCount / WorkLoad.Where(t => t.TemplateCount > 0).Count(), 2);
|
2024-08-20 09:33:13 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class StatWorkLoadDataResponse
|
|
|
|
|
|
{
|
2024-08-30 16:40:06 +10:00
|
|
|
|
//public DateTimeOffset Date { get; set; }
|
|
|
|
|
|
public DateOnly Date { get; set; }
|
2024-08-20 09:33:13 +10:00
|
|
|
|
public int TemplateCount { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|