Files
parr_api/PARR.API/Contracts/V1/Responses/Statistics/StatWorkloadReportResponse.cs

95 lines
2.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using PARR.Domain.Enums.Workload;
namespace PARR.API.Contracts.V1.Responses.Statistics
{
/// <summary>
/// Response отчета о загруженности
/// </summary>
public record StatWorkloadReportResponse
{
/// <summary>
/// Тип отчета (все ЗО, все РГ, одна ЗО, одна РГ)
/// </summary>
public WorkloadReportType Type { get; init; }
/// <summary>
/// Название отчета (По всем ЗО, по одной ЗО)
/// </summary>
public required string DisplayName { get; init; }
/// <summary>
/// Подзаголовок, наименование конкретной ЗО/РГ
/// </summary>
public string? SubfilterName { get; init; }
/// <summary>
/// Дата формирования отчета
/// </summary>
public DateTimeOffset ReportCacheCreatedAt { get; init; }
/// <summary>
/// Дата формирования кэша ЗО и РГ
/// </summary>
public DateTimeOffset TemplateCacheCreatedAt { get; init; }
/// <summary>
/// Список дней
/// </summary>
public required List<WorkloadDayItemResponse> Days { get; init; }
/// <summary>
/// Нагруженность
/// </summary>
public required List<WorkloadStatisticItemResponse> Statistics { get; init; }
}
public record WorkloadSummaryResponse
{
public required WorkloadSummaryItemResponse Total { get; init; }
public required WorkloadSummaryItemResponse Activated { get; init; }
public required WorkloadSummaryItemResponse Deactivated { get; init; }
}
public record WorkloadSummaryItemResponse
{
public int Count { get; init; }
public double Average { get; init; }
public int Max { get; init; }
}
public record WorkloadDayItemResponse
{
public DateOnly Date { get; init; }
public bool IsWeekend { get; init; }
}
public record WorkloadStatisticItemResponse
{
public required string Title { get; init; }
public Guid? ObjId { get; init; }
public required WorkloadSummaryResponse Summary { get; init; }
public required List<WorkloadDailyItemResponse> DailyMetrics { get; init; }
}
public record WorkloadDailyItemResponse
{
public DateOnly Date { get; init; }
public bool IsWeekend { get; init; }
public int Total { get; init; }
public int Activated { get; init; }
public int Deactivated { get; init; }
}
}