feat(api,core,dal): Группы работ - управление автокнотролем

This commit is contained in:
Mikhail Trubnikov
2026-06-18 16:39:35 +10:00
parent 108eb05853
commit 8151ea89b9
18 changed files with 4326 additions and 186 deletions

View File

@@ -1,52 +1,14 @@
using PARR.Domain.Enums;
namespace PARR.API.Contracts.V1.Requests
namespace PARR.API.Contracts.V1.Requests
{
public class JobAutoControlRequest
/// <summary>
/// Часть реквеста по управлению авто контролем для Job, JobGroup
/// </summary>
public record JobAutoControlRequest
{
/// <summary>
/// Создавать новые РР (из настроке РР)
/// </summary>
public bool CreateNew { get; set; }
public bool IsEnable { get; init; }
/// <summary>
/// Деактивировать не актуальные согласно ЭК (обратные статусы ЭК)
/// </summary>
public bool Deactivate { get; set; }
public bool InitUsedTemplateState { get; init; }
/// <summary>
/// Активировать РР после смены ЭК (согласно настройкам статусов ЭК)
/// </summary>
public bool Activate { get; set; }
/// <summary>
/// Состояние для активированных РР, шаблоны
/// </summary>
public bool OnTemplateIsActive { get; set; }
/// <summary>
/// Состояние для активированных РР, расписания
/// </summary>
public bool OnScheduleIsActive { get; set; }
/// <summary>
/// Состояние для деактивированных РР, шаблоны
/// </summary>
public bool OffTemplateIsActive { get; set; }
/// <summary>
/// Состояние для деактивированных РР, расписания
/// </summary>
public bool OffScheduleIsActive { get; set; }
/// <summary>
/// Маски ЭК
/// </summary>
public required List<string> EkMasks { get; set; }
/// <summary>
/// Статусы ЭК для которых включена генерация РР и активация
/// </summary>
public required List<EkStatusEnum> EnabledEkStatuses { get; set; }
public bool InitUsedScheduleState { get; init; }
}
}

View File

@@ -1,47 +1,47 @@
namespace PARR.API.Contracts.V1.Requests
{
public class JobGroupRequest
public record JobGroupRequest
{
public required string Name { get; set; }
public required string Name { get; init; }
//public bool? IsUmbrella { get; set; }
public Guid GroupTypeId { get; set; }
public Guid GroupTypeId { get; init; }
/// <summary>
/// Поле по которому групиируем, если тип - ГРУППА
/// </summary>
public Guid? GroupingUnitFieldId { get; set; }
public Guid? GroupingUnitFieldId { get; init; }
public bool? IsGroupByResponsible { get; set; }
public bool? IsGroupByResponsible { get; init; }
public required string ShortDescription { get; set; }
public required string ShortDescription { get; init; }
public required string FullDescription { get; set; }
public required string FullDescription { get; init; }
public required string Solution { get; set; }
public required string Solution { get; init; }
public required string TemplateDuration { get; set; }
public required string TemplateDuration { get; init; }
public DateTimeOffset ReferenceDate { get; set; }
public DateTimeOffset ReferenceDate { get; init; }
public int? UserTimeZoneOffsetMinutes { get; set; }
public int? UserTimeZoneOffsetMinutes { get; init; }
/// <summary>
/// Использовать таймзону рабочей группы ответственного за ЭК шаблона
/// </summary>
public bool IsWorkGroupTimezone { get; set; }
public bool IsWorkGroupTimezone { get; init; }
public Guid ScheduleExcludeTypeId { get; set; }
public Guid ScheduleExcludeTypeId { get; init; }
public Guid? ScheduleExcludeTypeCalendarId { get; set; }
public Guid? ScheduleExcludeTypeCalendarId { get; init; }
public bool IsAutoDistributionEnabled { get; set; }
public bool IsAutoDistributionEnabled { get; init; }
/// <summary>
/// Настройки автораспределения
/// </summary>
public DistributionConfigRequest? DistributionConfig { get; set; }
public DistributionConfigRequest? DistributionConfig { get; init; }
//public bool IsAgent { get; set; }
@@ -51,28 +51,35 @@
//public string? AgentScript { get; set; }
public List<EsppSchValueRequest> Schedule { get; set; } = new List<EsppSchValueRequest>();
public List<EsppSchValueRequest> Schedule { get; init; } = new List<EsppSchValueRequest>();
/// <summary>
/// Настройки автоконтроля (возможны только в случае, если JobGroupType.IsJobGroupAutocontrol==true)
/// </summary>
public JobAutoControlRequest? AutoControl { get; init; }
}
public class EsppSchValueRequest
public record EsppSchValueRequest
{
public Guid TypeValueId { get; set; }
public Guid TypeValueId { get; init; }
public Guid TypeConfigId { get; set; }
public Guid TypeConfigId { get; init; }
}
public class DistributionConfigRequest
public record DistributionConfigRequest
{
public Guid DistributionPeriodId { get; set; }
public Guid DistributionPeriodId { get; init; }
/// <summary>
/// Исключать выходные и праздники
/// </summary>
public bool IsExcludeWeekends { get; set; }
public bool IsExcludeWeekends { get; init; }
/// <summary>
/// Группировать по рабочей группе
/// </summary>
public bool IsGroupingByWorkGroup { get; set; }
public bool IsGroupingByWorkGroup { get; init; }
}
}

View File

@@ -68,12 +68,23 @@
/// </summary>
public ScheduleExcludeTypeCalendarResponse? ScheduleExcludeTypeCalendar { get; set; }
public JobGroupAutoControlResponse? AutoControl { get; set; }
///// <summary>
///// Настройки автораспределения
///// </summary>
//public JobGroupDistributionConfigResponse? DistributionConfig { get; set; }
}
public class JobGroupAutoControlResponse
{
public bool IsEnable { get; set; }
public bool InitUsedTemplateState { get; set; }
public bool InitUsedScheduleState { get; set; }
}
public class JobGroupScheduleResponse
{
public string Timezone { get; set; } = string.Empty;

View File

@@ -2,14 +2,20 @@
namespace PARR.API.Contracts.V1.Responses
{
public class JobGroupTypeResponse
public record JobGroupTypeResponse
{
public Guid Id { get; set; }
public Guid Id { get; init; }
public required JobGroupTypesEnum Code { get; set; }
public required JobGroupTypesEnum Code { get; init; }
public required string Name { get; set; }
public required string Name { get; init; }
public required string Description { get; set; }
public required string Description { get; init; }
public bool IsAllowJobUnitFilter { get; init; }
public bool IsJobGroupAutoControl { get; init; }
public bool IsRelationshipsAllowed { get; init; }
}
}