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

53 lines
1.9 KiB
C#
Raw 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.

namespace PARR.API.Contracts.V1.Responses.Statistics
{
public class StatTemplateDistributorResponse
{
public required JobGroupWithDistributionConfigResponse JobGroup { get; set; }
/// <summary>
/// Всего шаблонов
/// </summary>
public int AllCount => ItemsList?.Sum(t => t.AllCount) ?? 0;
/// <summary>
/// Всего шаблонов с активированными шаблонами и расписаниями
/// </summary>
public int IsActivatedAllCount => ItemsList?.Sum(t => t.IsActivatedCount) ?? 0;
/// <summary>
/// Всего шаблонов с деактивированными шаблонами и/или расписаниями
/// </summary>
public int IsDeactivatedAllCount => ItemsList?.Sum(t => t.IsDeactivatedCount) ?? 0;
public List<StatDistributorItemResponse>? ItemsList { get; set; }
}
public class StatDistributorItemResponse
{
public string? WorkGroupName { get; set; }
public int AllCount => Statistics?.Sum(t => t.AllCount) ?? 0;
public int IsActivatedCount => Statistics?.Sum(t => t.IsActivatedCount) ?? 0;
public int IsDeactivatedCount => Statistics?.Sum(t => t.IsDeactivatedCount) ?? 0;
public List<StatTemplateDistributorDateStat>? Statistics { get; set; }
}
public class StatTemplateDistributorDateStat
{
public DateOnly Date { get; set; }
public int AllCount { get; set; }
public int IsActivatedCount { get; set; }
public int IsDeactivatedCount { get; set; }
public List<StatTempleteDistribItem>? Templates { get; set; }
}
public class StatTempleteDistribItem
{
public required string Name { get; set; }
public DateTimeOffset NextRun { get; set; }
public bool IsActiveTemplate { get; set; }
public bool IsActiveSchedular { get; set; }
}
}