diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index 256dd62a..ab342b67 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -65,7 +65,7 @@ namespace PARR.DAL.Context public DbSet Orders { get; set; } public DbSet OrderStatuses { get; set; } - public DbSet Users { get; set; } + public DbSet Users { get; set; } public DbSet Roles { get; set; } public DbSet UsersInRoles { get; set; } @@ -135,6 +135,11 @@ namespace PARR.DAL.Context var dateCreated = new DateTimeOffset(2023, 05, 01, 0, 0, 0, new TimeSpan(0)); + //Задать значение по умолчанию + //modelBuilder.Entity() + // .Property(t => t.UnitFieldValueId) + // .HasDefaultValue(new Guid("d6485475-d4c5-47f0-a48f-b364a6321cc4")); + #region Unit //Добавляем ограничение по имени ЭК. нельзя писать прописными!!! modelBuilder.Entity(f => @@ -148,7 +153,8 @@ namespace PARR.DAL.Context #region UnitsInTemplate modelBuilder.Entity() - .HasKey(t => new { t.TemplateId, t.UnitId }); + .HasKey(t => new { t.TemplateId, t.UnitId, t.UnitFieldValueId }); + #endregion #region JobGroupType @@ -569,9 +575,9 @@ namespace PARR.DAL.Context #region TaskType - modelBuilder.Entity(f => + modelBuilder.Entity(f => { - f.HasData(new TaskType[] + f.HasData(new Domain.Entities.TaskEntities.TaskType[] { new() { Code = TaskTypeEnum.Workload, Name = TaskTypeEnum.Workload.ToString(), Description = "Формирование данных для отчетности - Загруженность", MaxRetries = 2, IsSingleton=true, MaxExecutionTimeMinutes=60, RetentionDays=90 } } diff --git a/PARR.DAL/Migrations/20260512062119_tblUnitsInTemplateAddUnitFieldValueId.Designer.cs b/PARR.DAL/Migrations/20260512062119_tblUnitsInTemplateAddUnitFieldValueId.Designer.cs new file mode 100644 index 00000000..6fba0fda --- /dev/null +++ b/PARR.DAL/Migrations/20260512062119_tblUnitsInTemplateAddUnitFieldValueId.Designer.cs @@ -0,0 +1,3810 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using PARR.DAL.Context; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20260512062119_tblUnitsInTemplateAddUnitFieldValueId")] + partial class tblUnitsInTemplateAddUnitFieldValueId + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.20") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("HistoryLevelId") + .HasColumnType("integer"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevelId"); + + b.HasIndex("OrderId"); + + b.HasIndex("TemplateId"); + + b.ToTable("AgentHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistoryLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AgentHistoryLevels"); + + b.HasData( + new + { + Id = 1, + Description = "Агент начал выполнять задание", + Name = "Start" + }, + new + { + Id = 5, + Description = "Агент завершил выполнение задания", + Name = "End" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Duration") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Type"); + + b.ToTable("DistributionPeriods", "schedule"); + + b.HasData( + new + { + Id = new Guid("9bd0bfa8-c316-480b-a001-e09ffe8c9340"), + Duration = "7", + Name = "Еженедельно", + Type = "Day" + }, + new + { + Id = new Guid("3a7341a8-085c-461c-babc-6b78dd5d2c67"), + Duration = "30", + Name = "Ежемесячно", + Type = "Day" + }, + new + { + Id = new Guid("0ad2dfdb-3833-46d9-979a-c408b7eadc6c"), + Duration = "90", + Name = "Каждые 90 дней", + Type = "Day" + }, + new + { + Id = new Guid("31dd3947-8471-4f09-852c-a4f075f1ba7f"), + Duration = "182", + Name = "Каждые пол года", + Type = "Day" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriodType", b => + { + b.Property("Type") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Type"); + + b.ToTable("DistributionPeriodTypes", "schedule"); + + b.HasData( + new + { + Type = "Day", + Description = "День" + }, + new + { + Type = "Month", + Description = "Месяц" + }, + new + { + Type = "Year", + Description = "Год" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("IsParentRelationships") + .HasColumnType("boolean"); + + b.Property("MaxValueRelationships") + .HasColumnType("integer"); + + b.Property("MinValueRelationships") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResponseAreaMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateNameMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("TnkId") + .HasColumnType("uuid"); + + b.Property("WorkGroupMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("TnkId"); + + b.ToTable("Jobs", "job", t => + { + t.HasComment("Таблица видов работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b => + { + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("InitUsedScheduleState") + .HasColumnType("boolean"); + + b.Property("InitUsedTemplateState") + .HasColumnType("boolean"); + + b.Property("IsEnable") + .HasColumnType("boolean"); + + b.HasKey("JobId"); + + b.ToTable("AutoControls", "job", t => + { + t.HasComment("Таблица управления автоконтролем для работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("IsInverse") + .HasColumnType("boolean"); + + b.Property("UnitFilterId") + .HasColumnType("uuid"); + + b.Property("ValueMask") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FieldId"); + + b.HasIndex("UnitFilterId"); + + b.ToTable("FieldFilters", "job", t => + { + t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AgentName") + .HasColumnType("text"); + + b.Property("AgentScript") + .HasColumnType("text"); + + b.Property("AgentTimeOutSec") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FullDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupName") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupTypeId") + .HasColumnType("uuid"); + + b.Property("GroupingUnitFieldId") + .HasColumnType("uuid"); + + b.Property("IsAgent") + .HasColumnType("boolean"); + + b.Property("IsAutoDistributionEnabled") + .HasColumnType("boolean"); + + b.Property("IsGroupByResponsible") + .HasColumnType("boolean"); + + b.Property("IsResponseAreaTimezone") + .HasColumnType("boolean"); + + b.Property("ReferenceDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ScheduleExcludeTypeCalendarId") + .HasColumnType("uuid"); + + b.Property("ScheduleExcludeTypeId") + .HasColumnType("uuid"); + + b.Property("ShortDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("Solution") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateDuration") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserTimeZoneOffsetMinutes") + .HasColumnType("integer") + .HasComment("Смещение часового пояса пользователя в минутах относительно UTC на момент ReferenceDate"); + + b.HasKey("Id"); + + b.HasIndex("GroupTypeId"); + + b.HasIndex("GroupingUnitFieldId"); + + b.HasIndex("ScheduleExcludeTypeCalendarId"); + + b.HasIndex("ScheduleExcludeTypeId"); + + b.ToTable("Groups", "job", t => + { + t.HasComment("Таблица описания групп работ, для реализации зонтиков"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupDistributionConfig", b => + { + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("DistributionPeriodId") + .HasColumnType("uuid"); + + b.Property("IsExcludeWeekends") + .HasColumnType("boolean"); + + b.Property("IsGroupingByWorkGroup") + .HasColumnType("boolean"); + + b.HasKey("GroupId"); + + b.HasIndex("DistributionPeriodId"); + + b.ToTable("GroupDistributionConfigs", "job", t => + { + t.HasComment("Настройки автораспределения для группы работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Code") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("GroupTypes", "job", t => + { + t.HasComment("Таблица типов групп работ"); + }); + + b.HasData( + new + { + Id = new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"), + Code = 0, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Обычный", + Name = "Simple" + }, + new + { + Id = new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"), + Code = 1, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зонтик", + Name = "Umbrella" + }, + new + { + Id = new Guid("318625e5-f833-436a-99df-2a382a1e71c7"), + Code = 2, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Сгруппированный", + Name = "Group" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b => + { + b.Property("UnitFilterId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("IsFullMatch") + .HasColumnType("boolean"); + + b.Property("IsInverse") + .HasColumnType("boolean"); + + b.Property("IsParent") + .HasColumnType("boolean"); + + b.Property("ValueMask") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UnitFilterId", "FieldId"); + + b.HasIndex("FieldId"); + + b.ToTable("RelationshipFilters", "job", t => + { + t.HasComment("Таблица фильтров связей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("UnitFilter") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.ToTable("UnitFilters", "job", t => + { + t.HasComment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b => + { + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("UnitFieldValueId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasDefaultValue(new Guid("d6485475-d4c5-47f0-a48f-b364a6321cc4")); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("TemplateId", "UnitId", "UnitFieldValueId"); + + b.HasIndex("UnitFieldValueId"); + + b.HasIndex("UnitId"); + + b.ToTable("UnitsInTemplates", "job", t => + { + t.HasComment("Таблица связи ЭК в шаблонах"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("GenerateDate") + .HasColumnType("timestamp with time zone"); + + b.Property("NextStatusCode") + .HasColumnType("integer"); + + b.Property("Number") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("NextStatusCode"); + + b.HasIndex("Number") + .IsUnique(); + + b.HasIndex("StatusCode"); + + b.HasIndex("TemplateId"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.OrderStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("OrderStatuses"); + + b.HasData( + new + { + Code = 1, + Description = "1-Направлен в группу", + Name = "New" + }, + new + { + Code = 2, + Description = "2-В работе", + Name = "InWork" + }, + new + { + Code = 3, + Description = "3-Приостановлен", + Name = "Stop" + }, + new + { + Code = 4, + Description = "4-Выполнен", + Name = "Complete" + }, + new + { + Code = 5, + Description = "5-Закрыт", + Name = "Closed" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.ParrComponent", b => + { + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ParrComponents"); + + b.HasData( + new + { + Id = 0, + Description = "API", + Name = "Api" + }, + new + { + Id = 1, + Description = "Загрузчик из АИХИТ", + Name = "AihitLoader" + }, + new + { + Id = 2, + Description = "Синхронизатор АИХИТ", + Name = "AihitSyncer" + }, + new + { + Id = 3, + Description = "Загрузчик нарядов из ЕСПП", + Name = "EsppOrderLoader" + }, + new + { + Id = 4, + Description = "Управление нарядами ЕСПП", + Name = "EsppOrderManager" + }, + new + { + Id = 5, + Description = "Синхронизатор расписаний", + Name = "EsppScheduleSync" + }, + new + { + Id = 6, + Description = "Синхронизатор шаблонов", + Name = "EsppTemplateSync" + }, + new + { + Id = 7, + Description = "Генератор шаблонов", + Name = "GeneratorTemplates" + }, + new + { + Id = 8, + Description = "Авто-контроль РР", + Name = "JobAutoControl" + }, + new + { + Id = 9, + Description = "Связывание нарядов ЕСПП с ПАРР (шаблонами, агентами)", + Name = "Master" + }, + new + { + Id = 10, + Description = "Рассчет даты следующего срабатывания", + Name = "NextRun" + }, + new + { + Id = 11, + Description = "Активатор шаблонов / расписаний", + Name = "TemplateActivator" + }, + new + { + Id = 12, + Description = "Автораспределение РР", + Name = "TemplateDistributor" + }, + new + { + Id = 13, + Description = "Генератор шаблонов", + Name = "TemplateTaskGenerator" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Process", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("EsppId") + .IsUnique(); + + b.ToTable("Processes"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Robot", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Robots"); + + b.HasData( + new + { + Code = 1, + Description = "Робот по созданию/изменению шаблона наряда ЕСПП", + Name = "TemplateOrder" + }, + new + { + Code = 2, + Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП", + Name = "ScheduleOrder" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptsNumber") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastRobotStatusUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("RobotCode") + .HasColumnType("integer"); + + b.Property("RobotStatusCode") + .HasColumnType("integer"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RobotCode"); + + b.HasIndex("RobotStatusCode"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("TemplateId", "RobotCode") + .IsUnique(); + + b.HasIndex("TemplateId", "RobotStatusCode"); + + b.HasIndex("TemplateId", "TaskStatusCode"); + + b.ToTable("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppMessage") + .HasColumnType("text"); + + b.Property("HistoryLevel") + .HasColumnType("integer"); + + b.Property("RobotConfigurationId") + .HasColumnType("uuid"); + + b.Property("RobotIp") + .HasColumnType("text"); + + b.Property("RobotMessage") + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("DateCreated"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("HistoryLevel", "DateCreated") + .IsDescending(false, true); + + b.HasIndex("RobotConfigurationId", "DateCreated"); + + b.ToTable("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b => + { + b.Property("Level") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Level")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Level"); + + b.ToTable("RobotHistoryLevels"); + + b.HasData( + new + { + Level = 1, + Description = "Робот начал работу ", + Name = "Start" + }, + new + { + Level = 5, + Description = "Информация", + Name = "Information" + }, + new + { + Level = 10, + Description = "Ошибка", + Name = "Error" + }, + new + { + Level = 15, + Description = "Успешно завершил работу", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("RobotStatuses"); + + b.HasData( + new + { + Code = 11, + Description = "Ожидание, ждет пока робот возьмет в работу.", + Name = "Wait" + }, + new + { + Code = 22, + Description = "Робот взял в работу.", + Name = "InProgress" + }, + new + { + Code = 33, + Description = "Ошибка отработки роботом. Требует ручного вмешательства.", + Name = "Error" + }, + new + { + Code = 44, + Description = "Робот успешно отработал.", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + + b.HasData( + new + { + Id = new Guid("c8f2f144-e6c2-45d7-ba66-5e9bbd376376"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Администратор", + Name = "administrator" + }, + new + { + Id = new Guid("13bca225-7fa4-42fa-9d80-d2d46de261fe"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Робот ЕСПП", + Name = "espp-robot" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypes", "schedule"); + + b.HasData( + new + { + Id = 1, + Description = "Через интервал", + Name = "Interval" + }, + new + { + Id = 2, + Description = "День недели: пнд, вт...", + Name = "DayOfWeek" + }, + new + { + Id = 3, + Description = "Число месяца: 1,2,3,4", + Name = "DayOfMonth" + }, + new + { + Id = 4, + Description = "Каждый: первый, второй, третий, четвертый, последний", + Name = "Order" + }, + new + { + Id = 5, + Description = "Месяц: январь, февраль...", + Name = "Month" + }, + new + { + Id = 6, + Description = "Месяц (родительный падеж): января, февраля...", + Name = "MonthGenitive" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("TypeScheduleId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.HasIndex("TypeScheduleId", "TypeId") + .IsUnique(); + + b.ToTable("EsppSchTypeConfigs", "schedule"); + + b.HasData( + new + { + Id = new Guid("d2693562-b3eb-41e9-97db-c6b5d2ef1bea"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 1, + TypeScheduleId = 1 + }, + new + { + Id = new Guid("06b2e7aa-6927-4fbf-99fb-67c92a4fce8a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 2, + TypeScheduleId = 2 + }, + new + { + Id = new Guid("78079071-ff80-417e-9bb0-d928cec853e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 3, + TypeScheduleId = 3 + }, + new + { + Id = new Guid("accb1d46-e1c1-4396-9182-4c0766155921"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("162ffe73-2428-4abe-8f83-235c2593664c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("8470d1ef-165d-42fc-ab05-8203e4d263cf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 5, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("006900b5-f65c-413e-bc67-09e6dae60b7c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 3, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("85635bc8-f17a-46b8-9c15-8615761be3d9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("439460c2-deca-4b54-80e7-2f20806696ec"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("5c63ad8c-e9b4-43fd-9d24-5c2eed80dadd"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 2, + TypeId = 6, + TypeScheduleId = 6 + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypeSchedules", "schedule"); + + b.HasData( + new + { + Id = 1, + Description = "Регулярно", + Name = "Regularly" + }, + new + { + Id = 2, + Description = "Еженедельно", + Name = "Weekly" + }, + new + { + Id = 3, + Description = "Ежемесячно", + Name = "Monthly" + }, + new + { + Id = 4, + Description = "Ежемесячно-2", + Name = "Monthly2" + }, + new + { + Id = 5, + Description = "Ежегодно", + Name = "Annually" + }, + new + { + Id = 6, + Description = "Ежегодно-2", + Name = "Annually2" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppExportValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.ToTable("EsppSchTypeValues", "schedule"); + + b.HasData( + new + { + Id = new Guid("6e3b5dd2-b2f7-40bc-bace-15bfa6bbd4ff"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "01:00:00", + Order = 0, + TypeId = 1, + Value = "Каждый час" + }, + new + { + Id = new Guid("4df04834-f14f-43d9-8984-334f080f4107"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "02:00:00", + Order = 1, + TypeId = 1, + Value = "Каждые 2 часа" + }, + new + { + Id = new Guid("dab6e3f9-2385-4966-b77c-133ad233c592"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "03:00:00", + Order = 2, + TypeId = 1, + Value = "Каждые 3 часа" + }, + new + { + Id = new Guid("035f485d-8451-47df-bfaa-ba4dd36cf146"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "04:00:00", + Order = 3, + TypeId = 1, + Value = "Каждые 4 часа" + }, + new + { + Id = new Guid("d627daa7-3eed-4571-acae-ffbb3c5bedb9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "06:00:00", + Order = 4, + TypeId = 1, + Value = "Каждые 6 часов" + }, + new + { + Id = new Guid("ae0a0015-0f1e-4496-b71e-6244f7e321e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12:00:00", + Order = 5, + TypeId = 1, + Value = "Каждые 12 часов" + }, + new + { + Id = new Guid("8df097aa-9860-4a62-9675-a8eecd3f2ce7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1 00:00:00", + Order = 6, + TypeId = 1, + Value = "Ежедневно" + }, + new + { + Id = new Guid("dee32e60-c1a1-4206-98bc-aa03deabfdf6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3 00:00:00", + Order = 7, + TypeId = 1, + Value = "Каждые 72 часа" + }, + new + { + Id = new Guid("e0465fbf-e3a5-4486-9f53-5bb85c6feeca"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4 00:00:00", + Order = 8, + TypeId = 1, + Value = "Каждые 96 часов" + }, + new + { + Id = new Guid("4e3f73d1-a0f3-4dd1-bca9-68ada0dd5ce2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14 00:00:00", + Order = 9, + TypeId = 1, + Value = "Каждые 2 недели" + }, + new + { + Id = new Guid("55833417-6a24-42f6-bcc2-5d032f883202"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "60 00:00:00", + Order = 10, + TypeId = 1, + Value = "Каждые 60 дней" + }, + new + { + Id = new Guid("7fefa052-29db-4ce5-9c57-2fd9ff855f21"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "80 00:00:00", + Order = 11, + TypeId = 1, + Value = "Каждые 80 дней" + }, + new + { + Id = new Guid("b0ca99f9-5ee0-45b3-bb80-948f82b1fcb1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "90 00:00:00", + Order = 12, + TypeId = 1, + Value = "Каждые 90 дней" + }, + new + { + Id = new Guid("086f7a37-9848-423a-a3cc-36dbb5ad43e3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "182 00:00:00", + Order = 13, + TypeId = 1, + Value = "Каждые полгода" + }, + new + { + Id = new Guid("f2da9e02-d619-4517-a598-374880a8c8e8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "540 00:00:00", + Order = 14, + TypeId = 1, + Value = "Каждые 1,5 года" + }, + new + { + Id = new Guid("f38d7d30-8923-4ea0-aa7c-5b251e19ab61"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1095 00:00:00", + Order = 15, + TypeId = 1, + Value = "Каждые 3 года" + }, + new + { + Id = new Guid("b7303461-9a30-43fa-8e55-305aa13f186f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 2, + Value = "Понедельник" + }, + new + { + Id = new Guid("e951135e-71f2-4262-9342-df4d5315ab6c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 2, + Value = "Вторник" + }, + new + { + Id = new Guid("c34d5375-70e7-4632-b3af-30e279a0621a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 2, + Value = "Среда" + }, + new + { + Id = new Guid("ec9540df-c2de-4bda-a063-34d02d4b6e03"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 2, + Value = "Четверг" + }, + new + { + Id = new Guid("2ed85534-4684-4eb2-9ccb-e264d212c945"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 2, + Value = "Пятница" + }, + new + { + Id = new Guid("a6804315-96ef-484e-82ee-c5795694468b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 2, + Value = "Суббота" + }, + new + { + Id = new Guid("eb71e699-937f-4894-9688-f7a7f95e5e58"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 2, + Value = "Воскресенье" + }, + new + { + Id = new Guid("e86adbfb-3345-4e0c-aa3b-b4418f9cfe88"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 3, + Value = "1" + }, + new + { + Id = new Guid("5b4d7ca6-31e7-475b-b7c8-13c6680c3dc3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 3, + Value = "2" + }, + new + { + Id = new Guid("0da03db0-9404-425d-bea1-5da0c9b60b59"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 3, + Value = "3" + }, + new + { + Id = new Guid("199474c8-0a77-47e5-aab8-ba33c216cc9e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 3, + Value = "4" + }, + new + { + Id = new Guid("e6619da1-f7e8-45b9-bbd3-9c17bec2ccd3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 3, + Value = "5" + }, + new + { + Id = new Guid("a8708763-c838-49a5-95fe-bf4f73518d71"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 3, + Value = "6" + }, + new + { + Id = new Guid("7ec056aa-820c-4900-96cb-4564d2ea6398"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 3, + Value = "7" + }, + new + { + Id = new Guid("554d7d0c-91b1-4b81-b94d-1ee864192962"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + Order = 7, + TypeId = 3, + Value = "8" + }, + new + { + Id = new Guid("8b7847a4-23de-4199-8aad-3b5c0323b5a2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + Order = 8, + TypeId = 3, + Value = "9" + }, + new + { + Id = new Guid("fb7f41ca-950b-4dc1-a0a6-bd9a221ab2ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + Order = 9, + TypeId = 3, + Value = "10" + }, + new + { + Id = new Guid("a28b530f-ea38-4a2c-a16b-0b7fa3770d3c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + Order = 10, + TypeId = 3, + Value = "11" + }, + new + { + Id = new Guid("7a004a11-32e1-40ae-ab35-0d3dc3a69785"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + Order = 11, + TypeId = 3, + Value = "12" + }, + new + { + Id = new Guid("e0f2f4d1-4a5e-4997-8336-83c3c35f38df"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "13", + Order = 12, + TypeId = 3, + Value = "13" + }, + new + { + Id = new Guid("9c5aaf48-88ec-4c67-b936-2be45550f8bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14", + Order = 13, + TypeId = 3, + Value = "14" + }, + new + { + Id = new Guid("8dbd680c-ce49-4d2e-8a1a-05619685e240"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "15", + Order = 14, + TypeId = 3, + Value = "15" + }, + new + { + Id = new Guid("2f476f70-b1ef-419d-aad5-3911f1e3231f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "16", + Order = 15, + TypeId = 3, + Value = "16" + }, + new + { + Id = new Guid("2c635ce2-fc18-47be-b3e9-98c211abf312"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "17", + Order = 16, + TypeId = 3, + Value = "17" + }, + new + { + Id = new Guid("f9d5b03b-624a-4f9f-8da3-1490ea5d2914"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "18", + Order = 17, + TypeId = 3, + Value = "18" + }, + new + { + Id = new Guid("4f4b249c-db60-4582-86ed-75cfee4edd0c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "19", + Order = 18, + TypeId = 3, + Value = "19" + }, + new + { + Id = new Guid("220a1464-4d39-416c-b4b2-3093eb007298"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "20", + Order = 19, + TypeId = 3, + Value = "20" + }, + new + { + Id = new Guid("c887ca60-b05d-4d3c-ad1f-223c879b1a6d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "21", + Order = 20, + TypeId = 3, + Value = "21" + }, + new + { + Id = new Guid("2905765d-63fb-41fe-a111-ee2f1d03d62e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "22", + Order = 21, + TypeId = 3, + Value = "22" + }, + new + { + Id = new Guid("dbbe704a-8d6d-40e7-bd30-6974035b1fab"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "23", + Order = 22, + TypeId = 3, + Value = "23" + }, + new + { + Id = new Guid("cf7b9645-52ed-43a2-8267-267e0aed19b1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "24", + Order = 23, + TypeId = 3, + Value = "24" + }, + new + { + Id = new Guid("454788d6-d0ad-4c07-878c-da3fd3cd05e1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "25", + Order = 24, + TypeId = 3, + Value = "25" + }, + new + { + Id = new Guid("40d70d73-8582-4be6-a9e6-503b96ae3d49"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "26", + Order = 25, + TypeId = 3, + Value = "26" + }, + new + { + Id = new Guid("8f6610dc-ef46-4842-a57e-18d7aaa75931"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "27", + Order = 26, + TypeId = 3, + Value = "27" + }, + new + { + Id = new Guid("03858472-d4ce-47fd-9497-8051728766e4"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "28", + Order = 27, + TypeId = 3, + Value = "28" + }, + new + { + Id = new Guid("b1018e07-e90e-42ee-b399-19f3d0c14dd6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "29", + Order = 28, + TypeId = 3, + Value = "29" + }, + new + { + Id = new Guid("a1669207-aa31-40fe-98d0-d941008d1655"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "30", + Order = 29, + TypeId = 3, + Value = "30" + }, + new + { + Id = new Guid("0936aa99-73e0-43de-b6df-334c1228a226"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "31", + Order = 30, + TypeId = 3, + Value = "31" + }, + new + { + Id = new Guid("626ca076-f09e-4a7a-8610-b7de6337b24a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 4, + Value = "Первый" + }, + new + { + Id = new Guid("032fbd02-67d0-4b8c-bed0-42629ab7113b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 4, + Value = "Второй" + }, + new + { + Id = new Guid("fa8a8f60-e41e-495e-ac86-35174d9976bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 4, + Value = "Третий" + }, + new + { + Id = new Guid("d2f90168-2b49-42f2-820b-79db2c522adf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 4, + Value = "Четвертый" + }, + new + { + Id = new Guid("12bb8db2-cf7f-4113-baff-6883770f1ba5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 4, + Value = "Последний" + }, + new + { + Id = new Guid("18260e91-3fbe-4401-9edc-78dbc419370e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 5, + Value = "Январь" + }, + new + { + Id = new Guid("361526aa-3e1c-452e-bb44-0ade8521830d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 5, + Value = "Февраль" + }, + new + { + Id = new Guid("fad4bdb0-6c51-4810-a30b-6d031a0d4c46"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 5, + Value = "Март" + }, + new + { + Id = new Guid("06ab835d-3d3e-4057-8422-a553b6b40995"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 5, + Value = "Апрель" + }, + new + { + Id = new Guid("83f56b5d-b16b-4aa5-89d7-a253fee4e4ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 5, + Value = "Май" + }, + new + { + Id = new Guid("e679ec84-a9ee-4bed-a051-2b14edddcb18"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 5, + Value = "Июнь" + }, + new + { + Id = new Guid("d439808a-6a10-409b-8809-a755b7cca60b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 5, + Value = "Июль" + }, + new + { + Id = new Guid("6e9972c4-6bf7-4fe4-b4ea-bbb333fb69c8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + Order = 7, + TypeId = 5, + Value = "Август" + }, + new + { + Id = new Guid("0883aac2-9d5b-4098-b672-c684d2a3a0c9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + Order = 8, + TypeId = 5, + Value = "Сентябрь" + }, + new + { + Id = new Guid("5e6592bc-acb2-45a4-979b-fdecf8457453"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + Order = 9, + TypeId = 5, + Value = "Октябрь" + }, + new + { + Id = new Guid("edd7cb49-d6a0-4969-b2d6-1967da69b336"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + Order = 10, + TypeId = 5, + Value = "Ноябрь" + }, + new + { + Id = new Guid("dd695fb2-4ad0-4cda-a4df-e15059c56b24"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + Order = 11, + TypeId = 5, + Value = "Декабрь" + }, + new + { + Id = new Guid("2f473624-4eb3-49b4-a4b9-cc7fc08a50f5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 6, + Value = "Января" + }, + new + { + Id = new Guid("f0003490-a249-44bd-814f-4566999915d8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 6, + Value = "Февраля" + }, + new + { + Id = new Guid("f4c3fe38-aeaa-42f7-a9ba-190ea2dfe339"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 6, + Value = "Марта" + }, + new + { + Id = new Guid("06a8bd2f-68e1-42f5-961c-ac3b98a2181e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 6, + Value = "Апреля" + }, + new + { + Id = new Guid("963b9c41-d607-444a-9fe0-fe429590e326"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 6, + Value = "Мая" + }, + new + { + Id = new Guid("ec8554c8-dee4-49a1-b1b7-474ad8ec1473"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 6, + Value = "Июня" + }, + new + { + Id = new Guid("e15c7c63-e29f-41a3-9c82-f70eb6c24fde"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 6, + Value = "Июля" + }, + new + { + Id = new Guid("0b1f3cea-301a-4d74-9ce1-2cd93b41897d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + Order = 7, + TypeId = 6, + Value = "Августа" + }, + new + { + Id = new Guid("e2fa3769-f66f-4753-a161-35adad7717a5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + Order = 8, + TypeId = 6, + Value = "Сентября" + }, + new + { + Id = new Guid("c1de4aca-9f49-48ae-9279-cf9ec4092112"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + Order = 9, + TypeId = 6, + Value = "Октября" + }, + new + { + Id = new Guid("a74b9ebd-bcd8-4537-b371-194de2fe0a4d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + Order = 10, + TypeId = 6, + Value = "Ноября" + }, + new + { + Id = new Guid("852a5ebd-4545-494b-bc69-c27409a41adc"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + Order = 11, + TypeId = 6, + Value = "Декабря" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchValue", b => + { + b.Property("JobGroupId") + .HasColumnType("uuid"); + + b.Property("TypeValueId") + .HasColumnType("uuid"); + + b.Property("TypeConfigId") + .HasColumnType("uuid"); + + b.HasKey("JobGroupId", "TypeValueId", "TypeConfigId"); + + b.HasIndex("TypeConfigId"); + + b.HasIndex("TypeValueId"); + + b.ToTable("EsppSchValues", "schedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppName") + .IsRequired() + .HasColumnType("text"); + + b.Property("EsppValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ExcludeTypes", "schedule", t => + { + t.HasComment("Расписание регламентной работы - Тип исключения"); + }); + + b.HasData( + new + { + Id = new Guid("0595b8e0-f322-4661-b5e3-064af8fbe7cd"), + Code = "None", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "Нет исключений", + EsppValue = "NONE", + Title = "Нет исключений" + }, + new + { + Id = new Guid("2b7a4356-9aaf-4e00-b444-42f0b5010e25"), + Code = "Only", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "Выполнить ТОЛЬКО В указанном календаре", + EsppValue = "ONLY", + Title = "Выполнить ТОЛЬКО В указанном календаре" + }, + new + { + Id = new Guid("38cd9e64-27c1-4672-a805-2211952a48bd"), + Code = "Except", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "Выполнить везде, КРОМЕ указанного календаря", + EsppValue = "EXCEPT", + Title = "Выполнить везде, КРОМЕ указанного календаря" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppName") + .IsRequired() + .HasColumnType("text"); + + b.Property("EsppValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ExcludeTypeCalendars", "schedule", t => + { + t.HasComment("Расписание регламентной работы, исключение - Календарь"); + }); + + b.HasData( + new + { + Id = new Guid("a26edb88-0267-4fbf-b7ec-d172b0a86c9c"), + Code = "24x5", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "24x5", + EsppValue = "24x5", + Title = "24x5" + }, + new + { + Id = new Guid("6834f1d5-ac51-43d5-974e-4c759d7bbf9f"), + Code = "24x7", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "24x7", + EsppValue = "24x7", + Title = "24x7" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleResponseAreaTimeOffset", b => + { + b.Property("ResponseArea") + .HasColumnType("text"); + + b.Property("EsppValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("UtcTimeOffset") + .HasColumnType("interval"); + + b.HasKey("ResponseArea"); + + b.ToTable("ResponseAreaTimeOffsets", "schedule", t => + { + t.HasComment("Расписание в ЕСПП. Смещение часового пояса относительно МСК для зоны ответственности рабочей группы"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Setting", b => + { + b.Property("Name") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Name"); + + b.ToTable("Settings"); + + b.HasData( + new + { + Name = "Initiator", + Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "ОВЧАРЕНКО АЛЕКСЕЙ ВИТАЛЬЕВИЧ (OVCHARENKOAV@GVC.OAO.RZD)" + }, + new + { + Name = "ClosingCode", + Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "выполнен" + }, + new + { + Name = "Category", + Description = "Категория создаваемого объекта в ЕСПП", + Value = "регламентная работа" + }, + new + { + Name = "TemplatePrefixName", + Description = "Префикс имени шаблона в ЕСПП", + Value = "%PREFIX%-ЭИТИ-ПТК-ПАРР" + }, + new + { + Name = "RobotAttemptsNumber", + Description = "Количество попыток выполнения задания роботом", + Value = "3" + }, + new + { + Name = "RobotWaitTime", + Description = "Время ожидания выполнения роботом задания", + Value = "00:15:00" + }, + new + { + Name = "EsppScheduleTimezone", + Description = "Расписание регламентной работы - В каком часовом поясе", + Value = "MSK" + }, + new + { + Name = "ScheduleRepeatRange", + Description = "Расписание регламентной работы - Диапазн повторов", + Value = "Отсутствует дата завершения" + }, + new + { + Name = "OrderSearchDeltaDate", + Description = "Промежуток времени для поиска нарядов в ЕСПП", + Value = "01:30:00" + }, + new + { + Name = "EsppRobotAccountTimeZoneHour", + Description = "Таймзона УЗ роботов в ЕСПП, в часах (может быть положительная и отрицательная)", + Value = "3" + }, + new + { + Name = "WeekendCacheTtl", + Description = "Время хранения в кэше данных о выходных и рабочих днях", + Value = "01:00:00" + }, + new + { + Name = "TemplateNameConstantParts", + Description = "Список неизменных частей имени шаблона", + Value = "[{\"Name\":\"П-1\",\"Value\":\"ЭИТИ-ПАРР\"}]" + }, + new + { + Name = "EsppUnitTag", + Description = "Префикс тега в поле ЭК \"Дополнительная информация\"", + Value = "ПАРР_" + }, + new + { + Name = "JobIdForUnusedTemplates", + Description = "Job в который перемещаем ниспользованные шаблоны", + Value = "8f85a91c-a223-4686-bb69-1f0ee73624f2" + }, + new + { + Name = "DefaultResponseAreaToTimeOffset", + Description = "Зона ответственности для получения тайм зоны по умолчанию для расписаний", + Value = "17-МСК" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProcessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("EsppId") + .IsUnique(); + + b.HasIndex("ProcessId"); + + b.ToTable("Subprocesses"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptNumber") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("ErrorMessage") + .IsRequired() + .HasColumnType("text"); + + b.Property("StackTrace") + .HasColumnType("text"); + + b.Property("TaskId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TaskId"); + + b.ToTable("Errors", "task", t => + { + t.HasComment("Таблица ошибок заданий"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("ProcessedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("RetryCount") + .HasColumnType("integer"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.Property("TypeCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("StatusCode"); + + b.HasIndex("TypeCode"); + + b.ToTable("Tasks", "task", t => + { + t.HasComment("Таблица заданий"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskStatus", b => + { + b.Property("Code") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("Statuses", "task", t => + { + t.HasComment("Таблица статусов заданий"); + }); + + b.HasData( + new + { + Code = 0, + Description = "Ожидание", + Name = "Pending" + }, + new + { + Code = 1, + Description = "В работе", + Name = "Processing" + }, + new + { + Code = 2, + Description = "Выполнено успешно", + Name = "Success" + }, + new + { + Code = 3, + Description = "Ошибка", + Name = "Failed" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskType", b => + { + b.Property("Code") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsSingleton") + .HasColumnType("boolean"); + + b.Property("MaxExecutionTimeMinutes") + .HasColumnType("integer"); + + b.Property("MaxRetries") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RetentionDays") + .HasColumnType("integer"); + + b.HasKey("Code"); + + b.ToTable("Types", "task", t => + { + t.HasComment("Таблица типов заданий"); + }); + + b.HasData( + new + { + Code = 0, + Description = "Формирование данных для отчетности - Загруженность", + IsSingleton = true, + MaxExecutionTimeMinutes = 60, + MaxRetries = 2, + Name = "Workload", + RetentionDays = 90 + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("TaskStatuses"); + + b.HasData( + new + { + Code = 10, + Description = "Требуется создание объекта в ЕСПП", + Name = "Creating" + }, + new + { + Code = 20, + Description = "Требуется обновление объекта в ЕСПП", + Name = "Updating" + }, + new + { + Code = 30, + Description = "Нормальное состояние объекта в ЕСПП и ПАРР. Объект в ПАРР соответствует объекту в ЕСПП", + Name = "Ok" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.Property("StatusTypeId") + .HasColumnType("integer"); + + b.Property("UnitId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.HasIndex("StatusTypeId"); + + b.HasIndex("UnitId"); + + b.HasIndex("Name", "Index") + .IsUnique(); + + b.ToTable("Templates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateAddedToHistory") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.Property("StatusTypeId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("TemplateHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateStatusType", b => + { + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TemplateStatusTypes", t => + { + t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); + }); + + b.HasData( + new + { + Id = 0, + Description = "В работе", + Name = "Used" + }, + new + { + Id = 1, + Description = "Не используется", + Name = "Unused" + }, + new + { + Id = 2, + Description = "Обновляется", + Name = "Updating" + }, + new + { + Id = 3, + Description = "Ошибка", + Name = "Error" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .HasColumnType("text"); + + b.Property("SubprocessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SubprocessId"); + + b.ToTable("Tnks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.Unit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastLogon") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Units", "unit", t => + { + t.HasComment("Таблица с ЭК"); + + t.HasCheckConstraint("CK_Units_Name_Upper", "\"Name\" = UPPER(\"Name\") AND \"Name\" IS NOT NULL AND LENGTH(\"Name\")>0"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AihitName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("EsppName") + .HasColumnType("text"); + + b.Property("IsMultipleValue") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AihitName"); + + b.HasIndex("EsppName"); + + b.ToTable("Fields", "unit", t => + { + t.HasComment("Справочник полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldInUnitFieldValue", b => + { + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("FieldValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("FieldId", "FieldValueId"); + + b.HasIndex("FieldValueId"); + + b.ToTable("FieldInFieldValues", "unit", t => + { + t.HasComment("Значения полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Value") + .IsUnique(); + + b.ToTable("FieldValues", "unit", t => + { + t.HasComment("Значения полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UnitId", "FieldId"); + + b.HasIndex("FieldId"); + + b.ToTable("UnitInFields", "unit", t => + { + t.HasComment("Справочник полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b => + { + b.Property("ParentUnitId") + .HasColumnType("uuid"); + + b.Property("ChildUnitId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateSynced") + .HasColumnType("timestamp with time zone"); + + b.HasKey("ParentUnitId", "ChildUnitId"); + + b.HasIndex("ChildUnitId"); + + b.ToTable("UnitInUnits", "unit", t => + { + t.HasComment("Таблица связей иерархии между ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInValue", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("ValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UnitId", "FieldId", "ValueId"); + + b.HasIndex("ValueId"); + + b.HasIndex("FieldId", "UnitId"); + + b.HasIndex("FieldId", "ValueId"); + + b.HasIndex("UnitId", "FieldId"); + + b.ToTable("UnitInValues", "unit", t => + { + t.HasComment("Таблица связи ЭК с полями и со значениями"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitKiiUnit", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.HasKey("UnitId"); + + b.ToTable("KiiUnits", "unit", t => + { + t.HasComment("Таблица - Список ЭК КИИ, которые учавствуют в групповых работах. Создавалась как временная"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", b => + { + b.Property("FieldValueId") + .HasColumnType("uuid"); + + b.HasKey("FieldValueId"); + + b.ToTable("RegionalEkPtkGroups", "unit", t => + { + t.HasComment("Таблица - региональные группы ПТК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Ip") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastLogon") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Ip") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.UsersInRole", b => + { + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("RoleId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UsersInRoles"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.WeekendDay", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Date") + .HasColumnType("date"); + + b.HasKey("Id"); + + b.HasIndex("Date") + .IsUnique(); + + b.ToTable("WeekendDays", "schedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistory", b => + { + b.HasOne("PARR.Domain.Entities.AgentHistoryLevel", "AgentHistoryLevel") + .WithMany("AgentHistories") + .HasForeignKey("HistoryLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Order", "Order") + .WithMany("AgentHistories") + .HasForeignKey("OrderId"); + + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("AgentHistories") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AgentHistoryLevel"); + + b.Navigation("Order"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => + { + b.HasOne("PARR.Domain.Entities.DistributionPeriodType", "DistributionPeriodType") + .WithMany("Periods") + .HasForeignKey("Type") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DistributionPeriodType"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => + { + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "Group") + .WithMany("Jobs") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Tnk", "Tnk") + .WithMany("Jobs") + .HasForeignKey("TnkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Tnk"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b => + { + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") + .WithOne("AutoControl") + .HasForeignKey("PARR.Domain.Entities.Job.JobAutoControl", "JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") + .WithMany() + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter") + .WithMany("FieldFilters") + .HasForeignKey("UnitFilterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UnitField"); + + b.Navigation("UnitFilter"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => + { + b.HasOne("PARR.Domain.Entities.Job.JobGroupType", "GroupType") + .WithMany("JobGroups") + .HasForeignKey("GroupTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "GroupingUnitField") + .WithMany("JobGroupWithGrouping") + .HasForeignKey("GroupingUnitFieldId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", "ScheduleExcludeTypeCalendar") + .WithMany("JobGroups") + .HasForeignKey("ScheduleExcludeTypeCalendarId"); + + b.HasOne("PARR.Domain.Entities.Schedule.ScheduleExcludeType", "ScheduleExcludeType") + .WithMany("JobGroups") + .HasForeignKey("ScheduleExcludeTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("GroupType"); + + b.Navigation("GroupingUnitField"); + + b.Navigation("ScheduleExcludeType"); + + b.Navigation("ScheduleExcludeTypeCalendar"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupDistributionConfig", b => + { + b.HasOne("PARR.Domain.Entities.DistributionPeriod", "DistributionPeriod") + .WithMany("GroupDistributionConfig") + .HasForeignKey("DistributionPeriodId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "Group") + .WithOne("DistributionConfig") + .HasForeignKey("PARR.Domain.Entities.Job.JobGroupDistributionConfig", "GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DistributionPeriod"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") + .WithMany("RelationshipFilters") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter") + .WithMany("RelationshipFilters") + .HasForeignKey("UnitFilterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UnitField"); + + b.Navigation("UnitFilter"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => + { + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") + .WithMany("UnitFilters") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b => + { + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("UnitsInTemplate") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "UnitFieldValue") + .WithMany("UnitsInTemplates") + .HasForeignKey("UnitFieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("TemplatesInUnit") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + + b.Navigation("Unit"); + + b.Navigation("UnitFieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.HasOne("PARR.Domain.Entities.OrderStatus", "NextStatus") + .WithMany("OrdersNext") + .HasForeignKey("NextStatusCode"); + + b.HasOne("PARR.Domain.Entities.OrderStatus", "OrderStatus") + .WithMany("Orders") + .HasForeignKey("StatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("Orders") + .HasForeignKey("TemplateId"); + + b.Navigation("NextStatus"); + + b.Navigation("OrderStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => + { + b.HasOne("PARR.Domain.Entities.Robot", "Robot") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.RobotStatus", "RobotStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TaskStatus", "TaskStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("RobotConfigurations") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Robot"); + + b.Navigation("RobotStatus"); + + b.Navigation("TaskStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b => + { + b.HasOne("PARR.Domain.Entities.RobotHistoryLevel", "RobotHistoryLevel") + .WithMany("RobotHistories") + .HasForeignKey("HistoryLevel") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.RobotConfiguration", "RobotConfiguration") + .WithMany("RobotHistories") + .HasForeignKey("RobotConfigurationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TaskStatus", "StatusTask") + .WithMany("RobotHistories") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RobotConfiguration"); + + b.Navigation("RobotHistoryLevel"); + + b.Navigation("StatusTask"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => + { + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", "EsppSchTypeSchedule") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + + b.Navigation("EsppSchTypeSchedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeValues") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchValue", b => + { + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "JobGroup") + .WithMany("EsppSchValues") + .HasForeignKey("JobGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", "EsppSchTypeConfig") + .WithMany("EsppSchValues") + .HasForeignKey("TypeConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeValue", "EsppSchTypeValue") + .WithMany("EsppSchValues") + .HasForeignKey("TypeValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchTypeConfig"); + + b.Navigation("EsppSchTypeValue"); + + b.Navigation("JobGroup"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => + { + b.HasOne("PARR.Domain.Entities.Process", "Process") + .WithMany("Subprocesses") + .HasForeignKey("ProcessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Process"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskError", b => + { + b.HasOne("PARR.Domain.Entities.TaskEntities.TaskItem", "TaskItem") + .WithMany("TaskErrors") + .HasForeignKey("TaskId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TaskItem"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskItem", b => + { + b.HasOne("PARR.Domain.Entities.TaskEntities.TaskStatus", "TaskStatus") + .WithMany("Tasks") + .HasForeignKey("StatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TaskEntities.TaskType", "TaskType") + .WithMany("Tasks") + .HasForeignKey("TypeCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TaskStatus"); + + b.Navigation("TaskType"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") + .WithMany("Templates") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TemplateStatusType", "StatusType") + .WithMany("Templates") + .HasForeignKey("StatusTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("Templates") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + + b.Navigation("StatusType"); + + b.Navigation("Unit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b => + { + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("TemplateHistories") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.HasOne("PARR.Domain.Entities.Subprocess", "Subprocess") + .WithMany("Tnks") + .HasForeignKey("SubprocessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subprocess"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldInUnitFieldValue", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "Field") + .WithMany("UnitFieldValues") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "FieldValue") + .WithMany("FieldValues") + .HasForeignKey("FieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Field"); + + b.Navigation("FieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") + .WithMany("Units") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("UnitFields") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Unit"); + + b.Navigation("UnitField"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b => + { + b.HasOne("PARR.Domain.Entities.Unit.Unit", "ChildUnit") + .WithMany("ParentUnits") + .HasForeignKey("ChildUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "ParentUnit") + .WithMany("ChildUnits") + .HasForeignKey("ParentUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChildUnit"); + + b.Navigation("ParentUnit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInValue", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "Field") + .WithMany("UnitInValues") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("UnitValues") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "Value") + .WithMany("UnitInValues") + .HasForeignKey("ValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Field"); + + b.Navigation("Unit"); + + b.Navigation("Value"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitKiiUnit", b => + { + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithOne("UnitKii") + .HasForeignKey("PARR.Domain.Entities.Unit.UnitKiiUnit", "UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Unit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "FieldValue") + .WithOne("RegionalEkPtkGroup") + .HasForeignKey("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", "FieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.UsersInRole", b => + { + b.HasOne("PARR.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistoryLevel", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => + { + b.Navigation("GroupDistributionConfig"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriodType", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => + { + b.Navigation("AutoControl"); + + b.Navigation("Templates"); + + b.Navigation("UnitFilters"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => + { + b.Navigation("DistributionConfig"); + + b.Navigation("EsppSchValues"); + + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupType", b => + { + b.Navigation("JobGroups"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => + { + b.Navigation("FieldFilters"); + + b.Navigation("RelationshipFilters"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.OrderStatus", b => + { + b.Navigation("Orders"); + + b.Navigation("OrdersNext"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Process", b => + { + b.Navigation("Subprocesses"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Robot", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Role", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchType", b => + { + b.Navigation("EsppSchTypeConfigs"); + + b.Navigation("EsppSchTypeValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", b => + { + b.Navigation("EsppSchTypeConfigs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeType", b => + { + b.Navigation("JobGroups"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", b => + { + b.Navigation("JobGroups"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => + { + b.Navigation("Tnks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskItem", b => + { + b.Navigation("TaskErrors"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskStatus", b => + { + b.Navigation("Tasks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskType", b => + { + b.Navigation("Tasks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b => + { + b.Navigation("RobotConfigurations"); + + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.Navigation("AgentHistories"); + + b.Navigation("Orders"); + + b.Navigation("RobotConfigurations"); + + b.Navigation("TemplateHistories"); + + b.Navigation("UnitsInTemplate"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateStatusType", b => + { + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.Unit", b => + { + b.Navigation("ChildUnits"); + + b.Navigation("ParentUnits"); + + b.Navigation("Templates"); + + b.Navigation("TemplatesInUnit"); + + b.Navigation("UnitFields"); + + b.Navigation("UnitKii"); + + b.Navigation("UnitValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitField", b => + { + b.Navigation("JobGroupWithGrouping"); + + b.Navigation("RelationshipFilters"); + + b.Navigation("UnitFieldValues"); + + b.Navigation("UnitInValues"); + + b.Navigation("Units"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b => + { + b.Navigation("FieldValues"); + + b.Navigation("RegionalEkPtkGroup"); + + b.Navigation("UnitInValues"); + + b.Navigation("UnitsInTemplates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.User", b => + { + b.Navigation("Roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PARR.DAL/Migrations/20260512062119_tblUnitsInTemplateAddUnitFieldValueId.cs b/PARR.DAL/Migrations/20260512062119_tblUnitsInTemplateAddUnitFieldValueId.cs new file mode 100644 index 00000000..b9d114d4 --- /dev/null +++ b/PARR.DAL/Migrations/20260512062119_tblUnitsInTemplateAddUnitFieldValueId.cs @@ -0,0 +1,96 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + /// + public partial class tblUnitsInTemplateAddUnitFieldValueId : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_UnitsInTemplates", + schema: "job", + table: "UnitsInTemplates"); + + migrationBuilder.AddColumn( + name: "UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates", + type: "uuid", + nullable: false, + defaultValue: new Guid("d6485475-d4c5-47f0-a48f-b364a6321cc4")); + + migrationBuilder.AddPrimaryKey( + name: "PK_UnitsInTemplates", + schema: "job", + table: "UnitsInTemplates", + columns: new[] { "TemplateId", "UnitId", "UnitFieldValueId" }); + + migrationBuilder.UpdateData( + schema: "task", + table: "Types", + keyColumn: "Code", + keyValue: 0, + column: "MaxExecutionTimeMinutes", + value: 60); + + migrationBuilder.CreateIndex( + name: "IX_UnitsInTemplates_UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates", + column: "UnitFieldValueId"); + + migrationBuilder.AddForeignKey( + name: "FK_UnitsInTemplates_FieldValues_UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates", + column: "UnitFieldValueId", + principalSchema: "unit", + principalTable: "FieldValues", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_UnitsInTemplates_FieldValues_UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates"); + + migrationBuilder.DropPrimaryKey( + name: "PK_UnitsInTemplates", + schema: "job", + table: "UnitsInTemplates"); + + migrationBuilder.DropIndex( + name: "IX_UnitsInTemplates_UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates"); + + migrationBuilder.DropColumn( + name: "UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates"); + + migrationBuilder.AddPrimaryKey( + name: "PK_UnitsInTemplates", + schema: "job", + table: "UnitsInTemplates", + columns: new[] { "TemplateId", "UnitId" }); + + migrationBuilder.UpdateData( + schema: "task", + table: "Types", + keyColumn: "Code", + keyValue: 0, + column: "MaxExecutionTimeMinutes", + value: 30); + } + } +} diff --git a/PARR.DAL/Migrations/20260512062439_tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault.Designer.cs b/PARR.DAL/Migrations/20260512062439_tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault.Designer.cs new file mode 100644 index 00000000..14aeed04 --- /dev/null +++ b/PARR.DAL/Migrations/20260512062439_tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault.Designer.cs @@ -0,0 +1,3808 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using PARR.DAL.Context; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20260512062439_tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault")] + partial class tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.20") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("HistoryLevelId") + .HasColumnType("integer"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevelId"); + + b.HasIndex("OrderId"); + + b.HasIndex("TemplateId"); + + b.ToTable("AgentHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistoryLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AgentHistoryLevels"); + + b.HasData( + new + { + Id = 1, + Description = "Агент начал выполнять задание", + Name = "Start" + }, + new + { + Id = 5, + Description = "Агент завершил выполнение задания", + Name = "End" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Duration") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Type"); + + b.ToTable("DistributionPeriods", "schedule"); + + b.HasData( + new + { + Id = new Guid("9bd0bfa8-c316-480b-a001-e09ffe8c9340"), + Duration = "7", + Name = "Еженедельно", + Type = "Day" + }, + new + { + Id = new Guid("3a7341a8-085c-461c-babc-6b78dd5d2c67"), + Duration = "30", + Name = "Ежемесячно", + Type = "Day" + }, + new + { + Id = new Guid("0ad2dfdb-3833-46d9-979a-c408b7eadc6c"), + Duration = "90", + Name = "Каждые 90 дней", + Type = "Day" + }, + new + { + Id = new Guid("31dd3947-8471-4f09-852c-a4f075f1ba7f"), + Duration = "182", + Name = "Каждые пол года", + Type = "Day" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriodType", b => + { + b.Property("Type") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Type"); + + b.ToTable("DistributionPeriodTypes", "schedule"); + + b.HasData( + new + { + Type = "Day", + Description = "День" + }, + new + { + Type = "Month", + Description = "Месяц" + }, + new + { + Type = "Year", + Description = "Год" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("IsParentRelationships") + .HasColumnType("boolean"); + + b.Property("MaxValueRelationships") + .HasColumnType("integer"); + + b.Property("MinValueRelationships") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResponseAreaMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateNameMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("TnkId") + .HasColumnType("uuid"); + + b.Property("WorkGroupMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("TnkId"); + + b.ToTable("Jobs", "job", t => + { + t.HasComment("Таблица видов работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b => + { + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("InitUsedScheduleState") + .HasColumnType("boolean"); + + b.Property("InitUsedTemplateState") + .HasColumnType("boolean"); + + b.Property("IsEnable") + .HasColumnType("boolean"); + + b.HasKey("JobId"); + + b.ToTable("AutoControls", "job", t => + { + t.HasComment("Таблица управления автоконтролем для работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("IsInverse") + .HasColumnType("boolean"); + + b.Property("UnitFilterId") + .HasColumnType("uuid"); + + b.Property("ValueMask") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FieldId"); + + b.HasIndex("UnitFilterId"); + + b.ToTable("FieldFilters", "job", t => + { + t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AgentName") + .HasColumnType("text"); + + b.Property("AgentScript") + .HasColumnType("text"); + + b.Property("AgentTimeOutSec") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FullDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupName") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupTypeId") + .HasColumnType("uuid"); + + b.Property("GroupingUnitFieldId") + .HasColumnType("uuid"); + + b.Property("IsAgent") + .HasColumnType("boolean"); + + b.Property("IsAutoDistributionEnabled") + .HasColumnType("boolean"); + + b.Property("IsGroupByResponsible") + .HasColumnType("boolean"); + + b.Property("IsResponseAreaTimezone") + .HasColumnType("boolean"); + + b.Property("ReferenceDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ScheduleExcludeTypeCalendarId") + .HasColumnType("uuid"); + + b.Property("ScheduleExcludeTypeId") + .HasColumnType("uuid"); + + b.Property("ShortDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("Solution") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateDuration") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserTimeZoneOffsetMinutes") + .HasColumnType("integer") + .HasComment("Смещение часового пояса пользователя в минутах относительно UTC на момент ReferenceDate"); + + b.HasKey("Id"); + + b.HasIndex("GroupTypeId"); + + b.HasIndex("GroupingUnitFieldId"); + + b.HasIndex("ScheduleExcludeTypeCalendarId"); + + b.HasIndex("ScheduleExcludeTypeId"); + + b.ToTable("Groups", "job", t => + { + t.HasComment("Таблица описания групп работ, для реализации зонтиков"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupDistributionConfig", b => + { + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("DistributionPeriodId") + .HasColumnType("uuid"); + + b.Property("IsExcludeWeekends") + .HasColumnType("boolean"); + + b.Property("IsGroupingByWorkGroup") + .HasColumnType("boolean"); + + b.HasKey("GroupId"); + + b.HasIndex("DistributionPeriodId"); + + b.ToTable("GroupDistributionConfigs", "job", t => + { + t.HasComment("Настройки автораспределения для группы работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Code") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("GroupTypes", "job", t => + { + t.HasComment("Таблица типов групп работ"); + }); + + b.HasData( + new + { + Id = new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"), + Code = 0, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Обычный", + Name = "Simple" + }, + new + { + Id = new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"), + Code = 1, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зонтик", + Name = "Umbrella" + }, + new + { + Id = new Guid("318625e5-f833-436a-99df-2a382a1e71c7"), + Code = 2, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Сгруппированный", + Name = "Group" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b => + { + b.Property("UnitFilterId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("IsFullMatch") + .HasColumnType("boolean"); + + b.Property("IsInverse") + .HasColumnType("boolean"); + + b.Property("IsParent") + .HasColumnType("boolean"); + + b.Property("ValueMask") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UnitFilterId", "FieldId"); + + b.HasIndex("FieldId"); + + b.ToTable("RelationshipFilters", "job", t => + { + t.HasComment("Таблица фильтров связей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("UnitFilter") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.ToTable("UnitFilters", "job", t => + { + t.HasComment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b => + { + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("UnitFieldValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("TemplateId", "UnitId", "UnitFieldValueId"); + + b.HasIndex("UnitFieldValueId"); + + b.HasIndex("UnitId"); + + b.ToTable("UnitsInTemplates", "job", t => + { + t.HasComment("Таблица связи ЭК в шаблонах"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("GenerateDate") + .HasColumnType("timestamp with time zone"); + + b.Property("NextStatusCode") + .HasColumnType("integer"); + + b.Property("Number") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("NextStatusCode"); + + b.HasIndex("Number") + .IsUnique(); + + b.HasIndex("StatusCode"); + + b.HasIndex("TemplateId"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.OrderStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("OrderStatuses"); + + b.HasData( + new + { + Code = 1, + Description = "1-Направлен в группу", + Name = "New" + }, + new + { + Code = 2, + Description = "2-В работе", + Name = "InWork" + }, + new + { + Code = 3, + Description = "3-Приостановлен", + Name = "Stop" + }, + new + { + Code = 4, + Description = "4-Выполнен", + Name = "Complete" + }, + new + { + Code = 5, + Description = "5-Закрыт", + Name = "Closed" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.ParrComponent", b => + { + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ParrComponents"); + + b.HasData( + new + { + Id = 0, + Description = "API", + Name = "Api" + }, + new + { + Id = 1, + Description = "Загрузчик из АИХИТ", + Name = "AihitLoader" + }, + new + { + Id = 2, + Description = "Синхронизатор АИХИТ", + Name = "AihitSyncer" + }, + new + { + Id = 3, + Description = "Загрузчик нарядов из ЕСПП", + Name = "EsppOrderLoader" + }, + new + { + Id = 4, + Description = "Управление нарядами ЕСПП", + Name = "EsppOrderManager" + }, + new + { + Id = 5, + Description = "Синхронизатор расписаний", + Name = "EsppScheduleSync" + }, + new + { + Id = 6, + Description = "Синхронизатор шаблонов", + Name = "EsppTemplateSync" + }, + new + { + Id = 7, + Description = "Генератор шаблонов", + Name = "GeneratorTemplates" + }, + new + { + Id = 8, + Description = "Авто-контроль РР", + Name = "JobAutoControl" + }, + new + { + Id = 9, + Description = "Связывание нарядов ЕСПП с ПАРР (шаблонами, агентами)", + Name = "Master" + }, + new + { + Id = 10, + Description = "Рассчет даты следующего срабатывания", + Name = "NextRun" + }, + new + { + Id = 11, + Description = "Активатор шаблонов / расписаний", + Name = "TemplateActivator" + }, + new + { + Id = 12, + Description = "Автораспределение РР", + Name = "TemplateDistributor" + }, + new + { + Id = 13, + Description = "Генератор шаблонов", + Name = "TemplateTaskGenerator" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Process", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("EsppId") + .IsUnique(); + + b.ToTable("Processes"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Robot", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Robots"); + + b.HasData( + new + { + Code = 1, + Description = "Робот по созданию/изменению шаблона наряда ЕСПП", + Name = "TemplateOrder" + }, + new + { + Code = 2, + Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП", + Name = "ScheduleOrder" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptsNumber") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastRobotStatusUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("RobotCode") + .HasColumnType("integer"); + + b.Property("RobotStatusCode") + .HasColumnType("integer"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RobotCode"); + + b.HasIndex("RobotStatusCode"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("TemplateId", "RobotCode") + .IsUnique(); + + b.HasIndex("TemplateId", "RobotStatusCode"); + + b.HasIndex("TemplateId", "TaskStatusCode"); + + b.ToTable("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppMessage") + .HasColumnType("text"); + + b.Property("HistoryLevel") + .HasColumnType("integer"); + + b.Property("RobotConfigurationId") + .HasColumnType("uuid"); + + b.Property("RobotIp") + .HasColumnType("text"); + + b.Property("RobotMessage") + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("DateCreated"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("HistoryLevel", "DateCreated") + .IsDescending(false, true); + + b.HasIndex("RobotConfigurationId", "DateCreated"); + + b.ToTable("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b => + { + b.Property("Level") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Level")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Level"); + + b.ToTable("RobotHistoryLevels"); + + b.HasData( + new + { + Level = 1, + Description = "Робот начал работу ", + Name = "Start" + }, + new + { + Level = 5, + Description = "Информация", + Name = "Information" + }, + new + { + Level = 10, + Description = "Ошибка", + Name = "Error" + }, + new + { + Level = 15, + Description = "Успешно завершил работу", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("RobotStatuses"); + + b.HasData( + new + { + Code = 11, + Description = "Ожидание, ждет пока робот возьмет в работу.", + Name = "Wait" + }, + new + { + Code = 22, + Description = "Робот взял в работу.", + Name = "InProgress" + }, + new + { + Code = 33, + Description = "Ошибка отработки роботом. Требует ручного вмешательства.", + Name = "Error" + }, + new + { + Code = 44, + Description = "Робот успешно отработал.", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + + b.HasData( + new + { + Id = new Guid("c8f2f144-e6c2-45d7-ba66-5e9bbd376376"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Администратор", + Name = "administrator" + }, + new + { + Id = new Guid("13bca225-7fa4-42fa-9d80-d2d46de261fe"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Робот ЕСПП", + Name = "espp-robot" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypes", "schedule"); + + b.HasData( + new + { + Id = 1, + Description = "Через интервал", + Name = "Interval" + }, + new + { + Id = 2, + Description = "День недели: пнд, вт...", + Name = "DayOfWeek" + }, + new + { + Id = 3, + Description = "Число месяца: 1,2,3,4", + Name = "DayOfMonth" + }, + new + { + Id = 4, + Description = "Каждый: первый, второй, третий, четвертый, последний", + Name = "Order" + }, + new + { + Id = 5, + Description = "Месяц: январь, февраль...", + Name = "Month" + }, + new + { + Id = 6, + Description = "Месяц (родительный падеж): января, февраля...", + Name = "MonthGenitive" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("TypeScheduleId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.HasIndex("TypeScheduleId", "TypeId") + .IsUnique(); + + b.ToTable("EsppSchTypeConfigs", "schedule"); + + b.HasData( + new + { + Id = new Guid("d2693562-b3eb-41e9-97db-c6b5d2ef1bea"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 1, + TypeScheduleId = 1 + }, + new + { + Id = new Guid("06b2e7aa-6927-4fbf-99fb-67c92a4fce8a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 2, + TypeScheduleId = 2 + }, + new + { + Id = new Guid("78079071-ff80-417e-9bb0-d928cec853e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 3, + TypeScheduleId = 3 + }, + new + { + Id = new Guid("accb1d46-e1c1-4396-9182-4c0766155921"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("162ffe73-2428-4abe-8f83-235c2593664c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("8470d1ef-165d-42fc-ab05-8203e4d263cf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 5, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("006900b5-f65c-413e-bc67-09e6dae60b7c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 3, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("85635bc8-f17a-46b8-9c15-8615761be3d9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("439460c2-deca-4b54-80e7-2f20806696ec"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("5c63ad8c-e9b4-43fd-9d24-5c2eed80dadd"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 2, + TypeId = 6, + TypeScheduleId = 6 + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypeSchedules", "schedule"); + + b.HasData( + new + { + Id = 1, + Description = "Регулярно", + Name = "Regularly" + }, + new + { + Id = 2, + Description = "Еженедельно", + Name = "Weekly" + }, + new + { + Id = 3, + Description = "Ежемесячно", + Name = "Monthly" + }, + new + { + Id = 4, + Description = "Ежемесячно-2", + Name = "Monthly2" + }, + new + { + Id = 5, + Description = "Ежегодно", + Name = "Annually" + }, + new + { + Id = 6, + Description = "Ежегодно-2", + Name = "Annually2" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppExportValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.ToTable("EsppSchTypeValues", "schedule"); + + b.HasData( + new + { + Id = new Guid("6e3b5dd2-b2f7-40bc-bace-15bfa6bbd4ff"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "01:00:00", + Order = 0, + TypeId = 1, + Value = "Каждый час" + }, + new + { + Id = new Guid("4df04834-f14f-43d9-8984-334f080f4107"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "02:00:00", + Order = 1, + TypeId = 1, + Value = "Каждые 2 часа" + }, + new + { + Id = new Guid("dab6e3f9-2385-4966-b77c-133ad233c592"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "03:00:00", + Order = 2, + TypeId = 1, + Value = "Каждые 3 часа" + }, + new + { + Id = new Guid("035f485d-8451-47df-bfaa-ba4dd36cf146"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "04:00:00", + Order = 3, + TypeId = 1, + Value = "Каждые 4 часа" + }, + new + { + Id = new Guid("d627daa7-3eed-4571-acae-ffbb3c5bedb9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "06:00:00", + Order = 4, + TypeId = 1, + Value = "Каждые 6 часов" + }, + new + { + Id = new Guid("ae0a0015-0f1e-4496-b71e-6244f7e321e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12:00:00", + Order = 5, + TypeId = 1, + Value = "Каждые 12 часов" + }, + new + { + Id = new Guid("8df097aa-9860-4a62-9675-a8eecd3f2ce7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1 00:00:00", + Order = 6, + TypeId = 1, + Value = "Ежедневно" + }, + new + { + Id = new Guid("dee32e60-c1a1-4206-98bc-aa03deabfdf6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3 00:00:00", + Order = 7, + TypeId = 1, + Value = "Каждые 72 часа" + }, + new + { + Id = new Guid("e0465fbf-e3a5-4486-9f53-5bb85c6feeca"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4 00:00:00", + Order = 8, + TypeId = 1, + Value = "Каждые 96 часов" + }, + new + { + Id = new Guid("4e3f73d1-a0f3-4dd1-bca9-68ada0dd5ce2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14 00:00:00", + Order = 9, + TypeId = 1, + Value = "Каждые 2 недели" + }, + new + { + Id = new Guid("55833417-6a24-42f6-bcc2-5d032f883202"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "60 00:00:00", + Order = 10, + TypeId = 1, + Value = "Каждые 60 дней" + }, + new + { + Id = new Guid("7fefa052-29db-4ce5-9c57-2fd9ff855f21"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "80 00:00:00", + Order = 11, + TypeId = 1, + Value = "Каждые 80 дней" + }, + new + { + Id = new Guid("b0ca99f9-5ee0-45b3-bb80-948f82b1fcb1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "90 00:00:00", + Order = 12, + TypeId = 1, + Value = "Каждые 90 дней" + }, + new + { + Id = new Guid("086f7a37-9848-423a-a3cc-36dbb5ad43e3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "182 00:00:00", + Order = 13, + TypeId = 1, + Value = "Каждые полгода" + }, + new + { + Id = new Guid("f2da9e02-d619-4517-a598-374880a8c8e8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "540 00:00:00", + Order = 14, + TypeId = 1, + Value = "Каждые 1,5 года" + }, + new + { + Id = new Guid("f38d7d30-8923-4ea0-aa7c-5b251e19ab61"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1095 00:00:00", + Order = 15, + TypeId = 1, + Value = "Каждые 3 года" + }, + new + { + Id = new Guid("b7303461-9a30-43fa-8e55-305aa13f186f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 2, + Value = "Понедельник" + }, + new + { + Id = new Guid("e951135e-71f2-4262-9342-df4d5315ab6c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 2, + Value = "Вторник" + }, + new + { + Id = new Guid("c34d5375-70e7-4632-b3af-30e279a0621a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 2, + Value = "Среда" + }, + new + { + Id = new Guid("ec9540df-c2de-4bda-a063-34d02d4b6e03"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 2, + Value = "Четверг" + }, + new + { + Id = new Guid("2ed85534-4684-4eb2-9ccb-e264d212c945"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 2, + Value = "Пятница" + }, + new + { + Id = new Guid("a6804315-96ef-484e-82ee-c5795694468b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 2, + Value = "Суббота" + }, + new + { + Id = new Guid("eb71e699-937f-4894-9688-f7a7f95e5e58"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 2, + Value = "Воскресенье" + }, + new + { + Id = new Guid("e86adbfb-3345-4e0c-aa3b-b4418f9cfe88"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 3, + Value = "1" + }, + new + { + Id = new Guid("5b4d7ca6-31e7-475b-b7c8-13c6680c3dc3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 3, + Value = "2" + }, + new + { + Id = new Guid("0da03db0-9404-425d-bea1-5da0c9b60b59"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 3, + Value = "3" + }, + new + { + Id = new Guid("199474c8-0a77-47e5-aab8-ba33c216cc9e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 3, + Value = "4" + }, + new + { + Id = new Guid("e6619da1-f7e8-45b9-bbd3-9c17bec2ccd3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 3, + Value = "5" + }, + new + { + Id = new Guid("a8708763-c838-49a5-95fe-bf4f73518d71"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 3, + Value = "6" + }, + new + { + Id = new Guid("7ec056aa-820c-4900-96cb-4564d2ea6398"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 3, + Value = "7" + }, + new + { + Id = new Guid("554d7d0c-91b1-4b81-b94d-1ee864192962"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + Order = 7, + TypeId = 3, + Value = "8" + }, + new + { + Id = new Guid("8b7847a4-23de-4199-8aad-3b5c0323b5a2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + Order = 8, + TypeId = 3, + Value = "9" + }, + new + { + Id = new Guid("fb7f41ca-950b-4dc1-a0a6-bd9a221ab2ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + Order = 9, + TypeId = 3, + Value = "10" + }, + new + { + Id = new Guid("a28b530f-ea38-4a2c-a16b-0b7fa3770d3c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + Order = 10, + TypeId = 3, + Value = "11" + }, + new + { + Id = new Guid("7a004a11-32e1-40ae-ab35-0d3dc3a69785"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + Order = 11, + TypeId = 3, + Value = "12" + }, + new + { + Id = new Guid("e0f2f4d1-4a5e-4997-8336-83c3c35f38df"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "13", + Order = 12, + TypeId = 3, + Value = "13" + }, + new + { + Id = new Guid("9c5aaf48-88ec-4c67-b936-2be45550f8bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14", + Order = 13, + TypeId = 3, + Value = "14" + }, + new + { + Id = new Guid("8dbd680c-ce49-4d2e-8a1a-05619685e240"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "15", + Order = 14, + TypeId = 3, + Value = "15" + }, + new + { + Id = new Guid("2f476f70-b1ef-419d-aad5-3911f1e3231f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "16", + Order = 15, + TypeId = 3, + Value = "16" + }, + new + { + Id = new Guid("2c635ce2-fc18-47be-b3e9-98c211abf312"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "17", + Order = 16, + TypeId = 3, + Value = "17" + }, + new + { + Id = new Guid("f9d5b03b-624a-4f9f-8da3-1490ea5d2914"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "18", + Order = 17, + TypeId = 3, + Value = "18" + }, + new + { + Id = new Guid("4f4b249c-db60-4582-86ed-75cfee4edd0c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "19", + Order = 18, + TypeId = 3, + Value = "19" + }, + new + { + Id = new Guid("220a1464-4d39-416c-b4b2-3093eb007298"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "20", + Order = 19, + TypeId = 3, + Value = "20" + }, + new + { + Id = new Guid("c887ca60-b05d-4d3c-ad1f-223c879b1a6d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "21", + Order = 20, + TypeId = 3, + Value = "21" + }, + new + { + Id = new Guid("2905765d-63fb-41fe-a111-ee2f1d03d62e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "22", + Order = 21, + TypeId = 3, + Value = "22" + }, + new + { + Id = new Guid("dbbe704a-8d6d-40e7-bd30-6974035b1fab"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "23", + Order = 22, + TypeId = 3, + Value = "23" + }, + new + { + Id = new Guid("cf7b9645-52ed-43a2-8267-267e0aed19b1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "24", + Order = 23, + TypeId = 3, + Value = "24" + }, + new + { + Id = new Guid("454788d6-d0ad-4c07-878c-da3fd3cd05e1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "25", + Order = 24, + TypeId = 3, + Value = "25" + }, + new + { + Id = new Guid("40d70d73-8582-4be6-a9e6-503b96ae3d49"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "26", + Order = 25, + TypeId = 3, + Value = "26" + }, + new + { + Id = new Guid("8f6610dc-ef46-4842-a57e-18d7aaa75931"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "27", + Order = 26, + TypeId = 3, + Value = "27" + }, + new + { + Id = new Guid("03858472-d4ce-47fd-9497-8051728766e4"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "28", + Order = 27, + TypeId = 3, + Value = "28" + }, + new + { + Id = new Guid("b1018e07-e90e-42ee-b399-19f3d0c14dd6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "29", + Order = 28, + TypeId = 3, + Value = "29" + }, + new + { + Id = new Guid("a1669207-aa31-40fe-98d0-d941008d1655"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "30", + Order = 29, + TypeId = 3, + Value = "30" + }, + new + { + Id = new Guid("0936aa99-73e0-43de-b6df-334c1228a226"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "31", + Order = 30, + TypeId = 3, + Value = "31" + }, + new + { + Id = new Guid("626ca076-f09e-4a7a-8610-b7de6337b24a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 4, + Value = "Первый" + }, + new + { + Id = new Guid("032fbd02-67d0-4b8c-bed0-42629ab7113b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 4, + Value = "Второй" + }, + new + { + Id = new Guid("fa8a8f60-e41e-495e-ac86-35174d9976bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 4, + Value = "Третий" + }, + new + { + Id = new Guid("d2f90168-2b49-42f2-820b-79db2c522adf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 4, + Value = "Четвертый" + }, + new + { + Id = new Guid("12bb8db2-cf7f-4113-baff-6883770f1ba5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 4, + Value = "Последний" + }, + new + { + Id = new Guid("18260e91-3fbe-4401-9edc-78dbc419370e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 5, + Value = "Январь" + }, + new + { + Id = new Guid("361526aa-3e1c-452e-bb44-0ade8521830d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 5, + Value = "Февраль" + }, + new + { + Id = new Guid("fad4bdb0-6c51-4810-a30b-6d031a0d4c46"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 5, + Value = "Март" + }, + new + { + Id = new Guid("06ab835d-3d3e-4057-8422-a553b6b40995"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 5, + Value = "Апрель" + }, + new + { + Id = new Guid("83f56b5d-b16b-4aa5-89d7-a253fee4e4ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 5, + Value = "Май" + }, + new + { + Id = new Guid("e679ec84-a9ee-4bed-a051-2b14edddcb18"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 5, + Value = "Июнь" + }, + new + { + Id = new Guid("d439808a-6a10-409b-8809-a755b7cca60b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 5, + Value = "Июль" + }, + new + { + Id = new Guid("6e9972c4-6bf7-4fe4-b4ea-bbb333fb69c8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + Order = 7, + TypeId = 5, + Value = "Август" + }, + new + { + Id = new Guid("0883aac2-9d5b-4098-b672-c684d2a3a0c9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + Order = 8, + TypeId = 5, + Value = "Сентябрь" + }, + new + { + Id = new Guid("5e6592bc-acb2-45a4-979b-fdecf8457453"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + Order = 9, + TypeId = 5, + Value = "Октябрь" + }, + new + { + Id = new Guid("edd7cb49-d6a0-4969-b2d6-1967da69b336"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + Order = 10, + TypeId = 5, + Value = "Ноябрь" + }, + new + { + Id = new Guid("dd695fb2-4ad0-4cda-a4df-e15059c56b24"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + Order = 11, + TypeId = 5, + Value = "Декабрь" + }, + new + { + Id = new Guid("2f473624-4eb3-49b4-a4b9-cc7fc08a50f5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + Order = 0, + TypeId = 6, + Value = "Января" + }, + new + { + Id = new Guid("f0003490-a249-44bd-814f-4566999915d8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + Order = 1, + TypeId = 6, + Value = "Февраля" + }, + new + { + Id = new Guid("f4c3fe38-aeaa-42f7-a9ba-190ea2dfe339"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + Order = 2, + TypeId = 6, + Value = "Марта" + }, + new + { + Id = new Guid("06a8bd2f-68e1-42f5-961c-ac3b98a2181e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + Order = 3, + TypeId = 6, + Value = "Апреля" + }, + new + { + Id = new Guid("963b9c41-d607-444a-9fe0-fe429590e326"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + Order = 4, + TypeId = 6, + Value = "Мая" + }, + new + { + Id = new Guid("ec8554c8-dee4-49a1-b1b7-474ad8ec1473"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + Order = 5, + TypeId = 6, + Value = "Июня" + }, + new + { + Id = new Guid("e15c7c63-e29f-41a3-9c82-f70eb6c24fde"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + Order = 6, + TypeId = 6, + Value = "Июля" + }, + new + { + Id = new Guid("0b1f3cea-301a-4d74-9ce1-2cd93b41897d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + Order = 7, + TypeId = 6, + Value = "Августа" + }, + new + { + Id = new Guid("e2fa3769-f66f-4753-a161-35adad7717a5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + Order = 8, + TypeId = 6, + Value = "Сентября" + }, + new + { + Id = new Guid("c1de4aca-9f49-48ae-9279-cf9ec4092112"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + Order = 9, + TypeId = 6, + Value = "Октября" + }, + new + { + Id = new Guid("a74b9ebd-bcd8-4537-b371-194de2fe0a4d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + Order = 10, + TypeId = 6, + Value = "Ноября" + }, + new + { + Id = new Guid("852a5ebd-4545-494b-bc69-c27409a41adc"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + Order = 11, + TypeId = 6, + Value = "Декабря" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchValue", b => + { + b.Property("JobGroupId") + .HasColumnType("uuid"); + + b.Property("TypeValueId") + .HasColumnType("uuid"); + + b.Property("TypeConfigId") + .HasColumnType("uuid"); + + b.HasKey("JobGroupId", "TypeValueId", "TypeConfigId"); + + b.HasIndex("TypeConfigId"); + + b.HasIndex("TypeValueId"); + + b.ToTable("EsppSchValues", "schedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppName") + .IsRequired() + .HasColumnType("text"); + + b.Property("EsppValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ExcludeTypes", "schedule", t => + { + t.HasComment("Расписание регламентной работы - Тип исключения"); + }); + + b.HasData( + new + { + Id = new Guid("0595b8e0-f322-4661-b5e3-064af8fbe7cd"), + Code = "None", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "Нет исключений", + EsppValue = "NONE", + Title = "Нет исключений" + }, + new + { + Id = new Guid("2b7a4356-9aaf-4e00-b444-42f0b5010e25"), + Code = "Only", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "Выполнить ТОЛЬКО В указанном календаре", + EsppValue = "ONLY", + Title = "Выполнить ТОЛЬКО В указанном календаре" + }, + new + { + Id = new Guid("38cd9e64-27c1-4672-a805-2211952a48bd"), + Code = "Except", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "Выполнить везде, КРОМЕ указанного календаря", + EsppValue = "EXCEPT", + Title = "Выполнить везде, КРОМЕ указанного календаря" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppName") + .IsRequired() + .HasColumnType("text"); + + b.Property("EsppValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ExcludeTypeCalendars", "schedule", t => + { + t.HasComment("Расписание регламентной работы, исключение - Календарь"); + }); + + b.HasData( + new + { + Id = new Guid("a26edb88-0267-4fbf-b7ec-d172b0a86c9c"), + Code = "24x5", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "24x5", + EsppValue = "24x5", + Title = "24x5" + }, + new + { + Id = new Guid("6834f1d5-ac51-43d5-974e-4c759d7bbf9f"), + Code = "24x7", + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppName = "24x7", + EsppValue = "24x7", + Title = "24x7" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleResponseAreaTimeOffset", b => + { + b.Property("ResponseArea") + .HasColumnType("text"); + + b.Property("EsppValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("UtcTimeOffset") + .HasColumnType("interval"); + + b.HasKey("ResponseArea"); + + b.ToTable("ResponseAreaTimeOffsets", "schedule", t => + { + t.HasComment("Расписание в ЕСПП. Смещение часового пояса относительно МСК для зоны ответственности рабочей группы"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Setting", b => + { + b.Property("Name") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Name"); + + b.ToTable("Settings"); + + b.HasData( + new + { + Name = "Initiator", + Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "ОВЧАРЕНКО АЛЕКСЕЙ ВИТАЛЬЕВИЧ (OVCHARENKOAV@GVC.OAO.RZD)" + }, + new + { + Name = "ClosingCode", + Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "выполнен" + }, + new + { + Name = "Category", + Description = "Категория создаваемого объекта в ЕСПП", + Value = "регламентная работа" + }, + new + { + Name = "TemplatePrefixName", + Description = "Префикс имени шаблона в ЕСПП", + Value = "%PREFIX%-ЭИТИ-ПТК-ПАРР" + }, + new + { + Name = "RobotAttemptsNumber", + Description = "Количество попыток выполнения задания роботом", + Value = "3" + }, + new + { + Name = "RobotWaitTime", + Description = "Время ожидания выполнения роботом задания", + Value = "00:15:00" + }, + new + { + Name = "EsppScheduleTimezone", + Description = "Расписание регламентной работы - В каком часовом поясе", + Value = "MSK" + }, + new + { + Name = "ScheduleRepeatRange", + Description = "Расписание регламентной работы - Диапазн повторов", + Value = "Отсутствует дата завершения" + }, + new + { + Name = "OrderSearchDeltaDate", + Description = "Промежуток времени для поиска нарядов в ЕСПП", + Value = "01:30:00" + }, + new + { + Name = "EsppRobotAccountTimeZoneHour", + Description = "Таймзона УЗ роботов в ЕСПП, в часах (может быть положительная и отрицательная)", + Value = "3" + }, + new + { + Name = "WeekendCacheTtl", + Description = "Время хранения в кэше данных о выходных и рабочих днях", + Value = "01:00:00" + }, + new + { + Name = "TemplateNameConstantParts", + Description = "Список неизменных частей имени шаблона", + Value = "[{\"Name\":\"П-1\",\"Value\":\"ЭИТИ-ПАРР\"}]" + }, + new + { + Name = "EsppUnitTag", + Description = "Префикс тега в поле ЭК \"Дополнительная информация\"", + Value = "ПАРР_" + }, + new + { + Name = "JobIdForUnusedTemplates", + Description = "Job в который перемещаем ниспользованные шаблоны", + Value = "8f85a91c-a223-4686-bb69-1f0ee73624f2" + }, + new + { + Name = "DefaultResponseAreaToTimeOffset", + Description = "Зона ответственности для получения тайм зоны по умолчанию для расписаний", + Value = "17-МСК" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProcessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("EsppId") + .IsUnique(); + + b.HasIndex("ProcessId"); + + b.ToTable("Subprocesses"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptNumber") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("ErrorMessage") + .IsRequired() + .HasColumnType("text"); + + b.Property("StackTrace") + .HasColumnType("text"); + + b.Property("TaskId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TaskId"); + + b.ToTable("Errors", "task", t => + { + t.HasComment("Таблица ошибок заданий"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("ProcessedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("RetryCount") + .HasColumnType("integer"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.Property("TypeCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("StatusCode"); + + b.HasIndex("TypeCode"); + + b.ToTable("Tasks", "task", t => + { + t.HasComment("Таблица заданий"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskStatus", b => + { + b.Property("Code") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("Statuses", "task", t => + { + t.HasComment("Таблица статусов заданий"); + }); + + b.HasData( + new + { + Code = 0, + Description = "Ожидание", + Name = "Pending" + }, + new + { + Code = 1, + Description = "В работе", + Name = "Processing" + }, + new + { + Code = 2, + Description = "Выполнено успешно", + Name = "Success" + }, + new + { + Code = 3, + Description = "Ошибка", + Name = "Failed" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskType", b => + { + b.Property("Code") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsSingleton") + .HasColumnType("boolean"); + + b.Property("MaxExecutionTimeMinutes") + .HasColumnType("integer"); + + b.Property("MaxRetries") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RetentionDays") + .HasColumnType("integer"); + + b.HasKey("Code"); + + b.ToTable("Types", "task", t => + { + t.HasComment("Таблица типов заданий"); + }); + + b.HasData( + new + { + Code = 0, + Description = "Формирование данных для отчетности - Загруженность", + IsSingleton = true, + MaxExecutionTimeMinutes = 60, + MaxRetries = 2, + Name = "Workload", + RetentionDays = 90 + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("TaskStatuses"); + + b.HasData( + new + { + Code = 10, + Description = "Требуется создание объекта в ЕСПП", + Name = "Creating" + }, + new + { + Code = 20, + Description = "Требуется обновление объекта в ЕСПП", + Name = "Updating" + }, + new + { + Code = 30, + Description = "Нормальное состояние объекта в ЕСПП и ПАРР. Объект в ПАРР соответствует объекту в ЕСПП", + Name = "Ok" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.Property("StatusTypeId") + .HasColumnType("integer"); + + b.Property("UnitId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.HasIndex("StatusTypeId"); + + b.HasIndex("UnitId"); + + b.HasIndex("Name", "Index") + .IsUnique(); + + b.ToTable("Templates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateAddedToHistory") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.Property("StatusTypeId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("TemplateHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateStatusType", b => + { + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TemplateStatusTypes", t => + { + t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); + }); + + b.HasData( + new + { + Id = 0, + Description = "В работе", + Name = "Used" + }, + new + { + Id = 1, + Description = "Не используется", + Name = "Unused" + }, + new + { + Id = 2, + Description = "Обновляется", + Name = "Updating" + }, + new + { + Id = 3, + Description = "Ошибка", + Name = "Error" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .HasColumnType("text"); + + b.Property("SubprocessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SubprocessId"); + + b.ToTable("Tnks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.Unit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastLogon") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Units", "unit", t => + { + t.HasComment("Таблица с ЭК"); + + t.HasCheckConstraint("CK_Units_Name_Upper", "\"Name\" = UPPER(\"Name\") AND \"Name\" IS NOT NULL AND LENGTH(\"Name\")>0"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AihitName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("EsppName") + .HasColumnType("text"); + + b.Property("IsMultipleValue") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AihitName"); + + b.HasIndex("EsppName"); + + b.ToTable("Fields", "unit", t => + { + t.HasComment("Справочник полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldInUnitFieldValue", b => + { + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("FieldValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("FieldId", "FieldValueId"); + + b.HasIndex("FieldValueId"); + + b.ToTable("FieldInFieldValues", "unit", t => + { + t.HasComment("Значения полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Value") + .IsUnique(); + + b.ToTable("FieldValues", "unit", t => + { + t.HasComment("Значения полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UnitId", "FieldId"); + + b.HasIndex("FieldId"); + + b.ToTable("UnitInFields", "unit", t => + { + t.HasComment("Справочник полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b => + { + b.Property("ParentUnitId") + .HasColumnType("uuid"); + + b.Property("ChildUnitId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateSynced") + .HasColumnType("timestamp with time zone"); + + b.HasKey("ParentUnitId", "ChildUnitId"); + + b.HasIndex("ChildUnitId"); + + b.ToTable("UnitInUnits", "unit", t => + { + t.HasComment("Таблица связей иерархии между ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInValue", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("ValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UnitId", "FieldId", "ValueId"); + + b.HasIndex("ValueId"); + + b.HasIndex("FieldId", "UnitId"); + + b.HasIndex("FieldId", "ValueId"); + + b.HasIndex("UnitId", "FieldId"); + + b.ToTable("UnitInValues", "unit", t => + { + t.HasComment("Таблица связи ЭК с полями и со значениями"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitKiiUnit", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.HasKey("UnitId"); + + b.ToTable("KiiUnits", "unit", t => + { + t.HasComment("Таблица - Список ЭК КИИ, которые учавствуют в групповых работах. Создавалась как временная"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", b => + { + b.Property("FieldValueId") + .HasColumnType("uuid"); + + b.HasKey("FieldValueId"); + + b.ToTable("RegionalEkPtkGroups", "unit", t => + { + t.HasComment("Таблица - региональные группы ПТК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Ip") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastLogon") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Ip") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.UsersInRole", b => + { + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("RoleId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UsersInRoles"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.WeekendDay", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Date") + .HasColumnType("date"); + + b.HasKey("Id"); + + b.HasIndex("Date") + .IsUnique(); + + b.ToTable("WeekendDays", "schedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistory", b => + { + b.HasOne("PARR.Domain.Entities.AgentHistoryLevel", "AgentHistoryLevel") + .WithMany("AgentHistories") + .HasForeignKey("HistoryLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Order", "Order") + .WithMany("AgentHistories") + .HasForeignKey("OrderId"); + + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("AgentHistories") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AgentHistoryLevel"); + + b.Navigation("Order"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => + { + b.HasOne("PARR.Domain.Entities.DistributionPeriodType", "DistributionPeriodType") + .WithMany("Periods") + .HasForeignKey("Type") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DistributionPeriodType"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => + { + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "Group") + .WithMany("Jobs") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Tnk", "Tnk") + .WithMany("Jobs") + .HasForeignKey("TnkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Tnk"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b => + { + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") + .WithOne("AutoControl") + .HasForeignKey("PARR.Domain.Entities.Job.JobAutoControl", "JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") + .WithMany() + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter") + .WithMany("FieldFilters") + .HasForeignKey("UnitFilterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UnitField"); + + b.Navigation("UnitFilter"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => + { + b.HasOne("PARR.Domain.Entities.Job.JobGroupType", "GroupType") + .WithMany("JobGroups") + .HasForeignKey("GroupTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "GroupingUnitField") + .WithMany("JobGroupWithGrouping") + .HasForeignKey("GroupingUnitFieldId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", "ScheduleExcludeTypeCalendar") + .WithMany("JobGroups") + .HasForeignKey("ScheduleExcludeTypeCalendarId"); + + b.HasOne("PARR.Domain.Entities.Schedule.ScheduleExcludeType", "ScheduleExcludeType") + .WithMany("JobGroups") + .HasForeignKey("ScheduleExcludeTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("GroupType"); + + b.Navigation("GroupingUnitField"); + + b.Navigation("ScheduleExcludeType"); + + b.Navigation("ScheduleExcludeTypeCalendar"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupDistributionConfig", b => + { + b.HasOne("PARR.Domain.Entities.DistributionPeriod", "DistributionPeriod") + .WithMany("GroupDistributionConfig") + .HasForeignKey("DistributionPeriodId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "Group") + .WithOne("DistributionConfig") + .HasForeignKey("PARR.Domain.Entities.Job.JobGroupDistributionConfig", "GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DistributionPeriod"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") + .WithMany("RelationshipFilters") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter") + .WithMany("RelationshipFilters") + .HasForeignKey("UnitFilterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UnitField"); + + b.Navigation("UnitFilter"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => + { + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") + .WithMany("UnitFilters") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b => + { + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("UnitsInTemplate") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "UnitFieldValue") + .WithMany("UnitsInTemplates") + .HasForeignKey("UnitFieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("TemplatesInUnit") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + + b.Navigation("Unit"); + + b.Navigation("UnitFieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.HasOne("PARR.Domain.Entities.OrderStatus", "NextStatus") + .WithMany("OrdersNext") + .HasForeignKey("NextStatusCode"); + + b.HasOne("PARR.Domain.Entities.OrderStatus", "OrderStatus") + .WithMany("Orders") + .HasForeignKey("StatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("Orders") + .HasForeignKey("TemplateId"); + + b.Navigation("NextStatus"); + + b.Navigation("OrderStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => + { + b.HasOne("PARR.Domain.Entities.Robot", "Robot") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.RobotStatus", "RobotStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TaskStatus", "TaskStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("RobotConfigurations") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Robot"); + + b.Navigation("RobotStatus"); + + b.Navigation("TaskStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b => + { + b.HasOne("PARR.Domain.Entities.RobotHistoryLevel", "RobotHistoryLevel") + .WithMany("RobotHistories") + .HasForeignKey("HistoryLevel") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.RobotConfiguration", "RobotConfiguration") + .WithMany("RobotHistories") + .HasForeignKey("RobotConfigurationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TaskStatus", "StatusTask") + .WithMany("RobotHistories") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RobotConfiguration"); + + b.Navigation("RobotHistoryLevel"); + + b.Navigation("StatusTask"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => + { + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", "EsppSchTypeSchedule") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + + b.Navigation("EsppSchTypeSchedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeValues") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchValue", b => + { + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "JobGroup") + .WithMany("EsppSchValues") + .HasForeignKey("JobGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", "EsppSchTypeConfig") + .WithMany("EsppSchValues") + .HasForeignKey("TypeConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeValue", "EsppSchTypeValue") + .WithMany("EsppSchValues") + .HasForeignKey("TypeValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchTypeConfig"); + + b.Navigation("EsppSchTypeValue"); + + b.Navigation("JobGroup"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => + { + b.HasOne("PARR.Domain.Entities.Process", "Process") + .WithMany("Subprocesses") + .HasForeignKey("ProcessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Process"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskError", b => + { + b.HasOne("PARR.Domain.Entities.TaskEntities.TaskItem", "TaskItem") + .WithMany("TaskErrors") + .HasForeignKey("TaskId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TaskItem"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskItem", b => + { + b.HasOne("PARR.Domain.Entities.TaskEntities.TaskStatus", "TaskStatus") + .WithMany("Tasks") + .HasForeignKey("StatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TaskEntities.TaskType", "TaskType") + .WithMany("Tasks") + .HasForeignKey("TypeCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TaskStatus"); + + b.Navigation("TaskType"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") + .WithMany("Templates") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TemplateStatusType", "StatusType") + .WithMany("Templates") + .HasForeignKey("StatusTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("Templates") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + + b.Navigation("StatusType"); + + b.Navigation("Unit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b => + { + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("TemplateHistories") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.HasOne("PARR.Domain.Entities.Subprocess", "Subprocess") + .WithMany("Tnks") + .HasForeignKey("SubprocessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subprocess"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldInUnitFieldValue", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "Field") + .WithMany("UnitFieldValues") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "FieldValue") + .WithMany("FieldValues") + .HasForeignKey("FieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Field"); + + b.Navigation("FieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") + .WithMany("Units") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("UnitFields") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Unit"); + + b.Navigation("UnitField"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b => + { + b.HasOne("PARR.Domain.Entities.Unit.Unit", "ChildUnit") + .WithMany("ParentUnits") + .HasForeignKey("ChildUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "ParentUnit") + .WithMany("ChildUnits") + .HasForeignKey("ParentUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChildUnit"); + + b.Navigation("ParentUnit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInValue", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "Field") + .WithMany("UnitInValues") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("UnitValues") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "Value") + .WithMany("UnitInValues") + .HasForeignKey("ValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Field"); + + b.Navigation("Unit"); + + b.Navigation("Value"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitKiiUnit", b => + { + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithOne("UnitKii") + .HasForeignKey("PARR.Domain.Entities.Unit.UnitKiiUnit", "UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Unit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "FieldValue") + .WithOne("RegionalEkPtkGroup") + .HasForeignKey("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", "FieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.UsersInRole", b => + { + b.HasOne("PARR.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistoryLevel", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => + { + b.Navigation("GroupDistributionConfig"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriodType", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => + { + b.Navigation("AutoControl"); + + b.Navigation("Templates"); + + b.Navigation("UnitFilters"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => + { + b.Navigation("DistributionConfig"); + + b.Navigation("EsppSchValues"); + + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupType", b => + { + b.Navigation("JobGroups"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => + { + b.Navigation("FieldFilters"); + + b.Navigation("RelationshipFilters"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.OrderStatus", b => + { + b.Navigation("Orders"); + + b.Navigation("OrdersNext"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Process", b => + { + b.Navigation("Subprocesses"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Robot", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Role", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchType", b => + { + b.Navigation("EsppSchTypeConfigs"); + + b.Navigation("EsppSchTypeValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", b => + { + b.Navigation("EsppSchTypeConfigs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeType", b => + { + b.Navigation("JobGroups"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", b => + { + b.Navigation("JobGroups"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => + { + b.Navigation("Tnks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskItem", b => + { + b.Navigation("TaskErrors"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskStatus", b => + { + b.Navigation("Tasks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskType", b => + { + b.Navigation("Tasks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b => + { + b.Navigation("RobotConfigurations"); + + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.Navigation("AgentHistories"); + + b.Navigation("Orders"); + + b.Navigation("RobotConfigurations"); + + b.Navigation("TemplateHistories"); + + b.Navigation("UnitsInTemplate"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateStatusType", b => + { + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.Unit", b => + { + b.Navigation("ChildUnits"); + + b.Navigation("ParentUnits"); + + b.Navigation("Templates"); + + b.Navigation("TemplatesInUnit"); + + b.Navigation("UnitFields"); + + b.Navigation("UnitKii"); + + b.Navigation("UnitValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitField", b => + { + b.Navigation("JobGroupWithGrouping"); + + b.Navigation("RelationshipFilters"); + + b.Navigation("UnitFieldValues"); + + b.Navigation("UnitInValues"); + + b.Navigation("Units"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b => + { + b.Navigation("FieldValues"); + + b.Navigation("RegionalEkPtkGroup"); + + b.Navigation("UnitInValues"); + + b.Navigation("UnitsInTemplates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.User", b => + { + b.Navigation("Roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PARR.DAL/Migrations/20260512062439_tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault.cs b/PARR.DAL/Migrations/20260512062439_tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault.cs new file mode 100644 index 00000000..a4daceaa --- /dev/null +++ b/PARR.DAL/Migrations/20260512062439_tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault.cs @@ -0,0 +1,59 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + /// + public partial class tblUnitsInTemplateAddUnitFieldValueIdUnsetDefault : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates", + type: "uuid", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uuid", + oldDefaultValue: new Guid("d6485475-d4c5-47f0-a48f-b364a6321cc4")); + + migrationBuilder.AlterColumn( + name: "JobId", + schema: "public", + table: "Templates", + type: "uuid", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uuid", + oldDefaultValue: new Guid("ba05948b-b040-48cc-ab77-0accc9c223a0")); + + migrationBuilder.AlterColumn( + name: "UnitId", + schema: "public", + table: "Templates", + type: "uuid", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uuid", + oldDefaultValue: new Guid("b4dfd71a-2b2f-414f-8409-4b9abd9c4d2c")); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "UnitFieldValueId", + schema: "job", + table: "UnitsInTemplates", + type: "uuid", + nullable: false, + defaultValue: new Guid("d6485475-d4c5-47f0-a48f-b364a6321cc4"), + oldClrType: typeof(Guid), + oldType: "uuid"); + } + } +} diff --git a/PARR.DAL/Migrations/DataContextModelSnapshot.cs b/PARR.DAL/Migrations/DataContextModelSnapshot.cs index 5178014e..070bc7e2 100644 --- a/PARR.DAL/Migrations/DataContextModelSnapshot.cs +++ b/PARR.DAL/Migrations/DataContextModelSnapshot.cs @@ -22,7 +22,7 @@ namespace PARR.DAL.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b => + modelBuilder.Entity("PARR.Domain.Entities.AgentHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -51,10 +51,10 @@ namespace PARR.DAL.Migrations b.HasIndex("TemplateId"); - b.ToTable("AgentHistories", (string)null); + b.ToTable("AgentHistories"); }); - modelBuilder.Entity("PARR.DAL.Models.AgentHistoryLevel", b => + modelBuilder.Entity("PARR.Domain.Entities.AgentHistoryLevel", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -72,7 +72,7 @@ namespace PARR.DAL.Migrations b.HasKey("Id"); - b.ToTable("AgentHistoryLevels", (string)null); + b.ToTable("AgentHistoryLevels"); b.HasData( new @@ -89,7 +89,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.DistributionPeriod", b => + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -144,7 +144,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.DistributionPeriodType", b => + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriodType", b => { b.Property("Type") .HasColumnType("text"); @@ -175,7 +175,872 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.EsppSchType", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("IsParentRelationships") + .HasColumnType("boolean"); + + b.Property("MaxValueRelationships") + .HasColumnType("integer"); + + b.Property("MinValueRelationships") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResponseAreaMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateNameMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("TnkId") + .HasColumnType("uuid"); + + b.Property("WorkGroupMask") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("TnkId"); + + b.ToTable("Jobs", "job", t => + { + t.HasComment("Таблица видов работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b => + { + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("InitUsedScheduleState") + .HasColumnType("boolean"); + + b.Property("InitUsedTemplateState") + .HasColumnType("boolean"); + + b.Property("IsEnable") + .HasColumnType("boolean"); + + b.HasKey("JobId"); + + b.ToTable("AutoControls", "job", t => + { + t.HasComment("Таблица управления автоконтролем для работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("IsInverse") + .HasColumnType("boolean"); + + b.Property("UnitFilterId") + .HasColumnType("uuid"); + + b.Property("ValueMask") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FieldId"); + + b.HasIndex("UnitFilterId"); + + b.ToTable("FieldFilters", "job", t => + { + t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AgentName") + .HasColumnType("text"); + + b.Property("AgentScript") + .HasColumnType("text"); + + b.Property("AgentTimeOutSec") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FullDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupName") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupTypeId") + .HasColumnType("uuid"); + + b.Property("GroupingUnitFieldId") + .HasColumnType("uuid"); + + b.Property("IsAgent") + .HasColumnType("boolean"); + + b.Property("IsAutoDistributionEnabled") + .HasColumnType("boolean"); + + b.Property("IsGroupByResponsible") + .HasColumnType("boolean"); + + b.Property("IsResponseAreaTimezone") + .HasColumnType("boolean"); + + b.Property("ReferenceDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ScheduleExcludeTypeCalendarId") + .HasColumnType("uuid"); + + b.Property("ScheduleExcludeTypeId") + .HasColumnType("uuid"); + + b.Property("ShortDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("Solution") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateDuration") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserTimeZoneOffsetMinutes") + .HasColumnType("integer") + .HasComment("Смещение часового пояса пользователя в минутах относительно UTC на момент ReferenceDate"); + + b.HasKey("Id"); + + b.HasIndex("GroupTypeId"); + + b.HasIndex("GroupingUnitFieldId"); + + b.HasIndex("ScheduleExcludeTypeCalendarId"); + + b.HasIndex("ScheduleExcludeTypeId"); + + b.ToTable("Groups", "job", t => + { + t.HasComment("Таблица описания групп работ, для реализации зонтиков"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupDistributionConfig", b => + { + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("DistributionPeriodId") + .HasColumnType("uuid"); + + b.Property("IsExcludeWeekends") + .HasColumnType("boolean"); + + b.Property("IsGroupingByWorkGroup") + .HasColumnType("boolean"); + + b.HasKey("GroupId"); + + b.HasIndex("DistributionPeriodId"); + + b.ToTable("GroupDistributionConfigs", "job", t => + { + t.HasComment("Настройки автораспределения для группы работ"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Code") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("GroupTypes", "job", t => + { + t.HasComment("Таблица типов групп работ"); + }); + + b.HasData( + new + { + Id = new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"), + Code = 0, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Обычный", + Name = "Simple" + }, + new + { + Id = new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"), + Code = 1, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зонтик", + Name = "Umbrella" + }, + new + { + Id = new Guid("318625e5-f833-436a-99df-2a382a1e71c7"), + Code = 2, + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Сгруппированный", + Name = "Group" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b => + { + b.Property("UnitFilterId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("IsFullMatch") + .HasColumnType("boolean"); + + b.Property("IsInverse") + .HasColumnType("boolean"); + + b.Property("IsParent") + .HasColumnType("boolean"); + + b.Property("ValueMask") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UnitFilterId", "FieldId"); + + b.HasIndex("FieldId"); + + b.ToTable("RelationshipFilters", "job", t => + { + t.HasComment("Таблица фильтров связей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("UnitFilter") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.ToTable("UnitFilters", "job", t => + { + t.HasComment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b => + { + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("UnitFieldValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("TemplateId", "UnitId", "UnitFieldValueId"); + + b.HasIndex("UnitFieldValueId"); + + b.HasIndex("UnitId"); + + b.ToTable("UnitsInTemplates", "job", t => + { + t.HasComment("Таблица связи ЭК в шаблонах"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("GenerateDate") + .HasColumnType("timestamp with time zone"); + + b.Property("NextStatusCode") + .HasColumnType("integer"); + + b.Property("Number") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("NextStatusCode"); + + b.HasIndex("Number") + .IsUnique(); + + b.HasIndex("StatusCode"); + + b.HasIndex("TemplateId"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.OrderStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("OrderStatuses"); + + b.HasData( + new + { + Code = 1, + Description = "1-Направлен в группу", + Name = "New" + }, + new + { + Code = 2, + Description = "2-В работе", + Name = "InWork" + }, + new + { + Code = 3, + Description = "3-Приостановлен", + Name = "Stop" + }, + new + { + Code = 4, + Description = "4-Выполнен", + Name = "Complete" + }, + new + { + Code = 5, + Description = "5-Закрыт", + Name = "Closed" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.ParrComponent", b => + { + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ParrComponents"); + + b.HasData( + new + { + Id = 0, + Description = "API", + Name = "Api" + }, + new + { + Id = 1, + Description = "Загрузчик из АИХИТ", + Name = "AihitLoader" + }, + new + { + Id = 2, + Description = "Синхронизатор АИХИТ", + Name = "AihitSyncer" + }, + new + { + Id = 3, + Description = "Загрузчик нарядов из ЕСПП", + Name = "EsppOrderLoader" + }, + new + { + Id = 4, + Description = "Управление нарядами ЕСПП", + Name = "EsppOrderManager" + }, + new + { + Id = 5, + Description = "Синхронизатор расписаний", + Name = "EsppScheduleSync" + }, + new + { + Id = 6, + Description = "Синхронизатор шаблонов", + Name = "EsppTemplateSync" + }, + new + { + Id = 7, + Description = "Генератор шаблонов", + Name = "GeneratorTemplates" + }, + new + { + Id = 8, + Description = "Авто-контроль РР", + Name = "JobAutoControl" + }, + new + { + Id = 9, + Description = "Связывание нарядов ЕСПП с ПАРР (шаблонами, агентами)", + Name = "Master" + }, + new + { + Id = 10, + Description = "Рассчет даты следующего срабатывания", + Name = "NextRun" + }, + new + { + Id = 11, + Description = "Активатор шаблонов / расписаний", + Name = "TemplateActivator" + }, + new + { + Id = 12, + Description = "Автораспределение РР", + Name = "TemplateDistributor" + }, + new + { + Id = 13, + Description = "Генератор шаблонов", + Name = "TemplateTaskGenerator" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Process", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("EsppId") + .IsUnique(); + + b.ToTable("Processes"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Robot", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Robots"); + + b.HasData( + new + { + Code = 1, + Description = "Робот по созданию/изменению шаблона наряда ЕСПП", + Name = "TemplateOrder" + }, + new + { + Code = 2, + Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП", + Name = "ScheduleOrder" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptsNumber") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastRobotStatusUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("RobotCode") + .HasColumnType("integer"); + + b.Property("RobotStatusCode") + .HasColumnType("integer"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RobotCode"); + + b.HasIndex("RobotStatusCode"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("TemplateId", "RobotCode") + .IsUnique(); + + b.HasIndex("TemplateId", "RobotStatusCode"); + + b.HasIndex("TemplateId", "TaskStatusCode"); + + b.ToTable("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppMessage") + .HasColumnType("text"); + + b.Property("HistoryLevel") + .HasColumnType("integer"); + + b.Property("RobotConfigurationId") + .HasColumnType("uuid"); + + b.Property("RobotIp") + .HasColumnType("text"); + + b.Property("RobotMessage") + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("DateCreated"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("HistoryLevel", "DateCreated") + .IsDescending(false, true); + + b.HasIndex("RobotConfigurationId", "DateCreated"); + + b.ToTable("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b => + { + b.Property("Level") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Level")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Level"); + + b.ToTable("RobotHistoryLevels"); + + b.HasData( + new + { + Level = 1, + Description = "Робот начал работу ", + Name = "Start" + }, + new + { + Level = 5, + Description = "Информация", + Name = "Information" + }, + new + { + Level = 10, + Description = "Ошибка", + Name = "Error" + }, + new + { + Level = 15, + Description = "Успешно завершил работу", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("RobotStatuses"); + + b.HasData( + new + { + Code = 11, + Description = "Ожидание, ждет пока робот возьмет в работу.", + Name = "Wait" + }, + new + { + Code = 22, + Description = "Робот взял в работу.", + Name = "InProgress" + }, + new + { + Code = 33, + Description = "Ошибка отработки роботом. Требует ручного вмешательства.", + Name = "Error" + }, + new + { + Code = 44, + Description = "Робот успешно отработал.", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + + b.HasData( + new + { + Id = new Guid("c8f2f144-e6c2-45d7-ba66-5e9bbd376376"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Администратор", + Name = "administrator" + }, + new + { + Id = new Guid("13bca225-7fa4-42fa-9d80-d2d46de261fe"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Робот ЕСПП", + Name = "espp-robot" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -234,7 +1099,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -347,7 +1212,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeSchedule", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -406,7 +1271,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -1185,7 +2050,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchValue", b => { b.Property("JobGroupId") .HasColumnType("uuid"); @@ -1205,846 +2070,7 @@ namespace PARR.DAL.Migrations b.ToTable("EsppSchValues", "schedule"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupId") - .HasColumnType("uuid"); - - b.Property("IsParentRelationships") - .HasColumnType("boolean"); - - b.Property("MaxValueRelationships") - .HasColumnType("integer"); - - b.Property("MinValueRelationships") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ResponseAreaMask") - .IsRequired() - .HasColumnType("text"); - - b.Property("TemplateNameMask") - .IsRequired() - .HasColumnType("text"); - - b.Property("TnkId") - .HasColumnType("uuid"); - - b.Property("WorkGroupMask") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("GroupId"); - - b.HasIndex("TnkId"); - - b.ToTable("Jobs", "job", t => - { - t.HasComment("Таблица видов работ"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.JobAutoControl", b => - { - b.Property("JobId") - .HasColumnType("uuid"); - - b.Property("InitUsedScheduleState") - .HasColumnType("boolean"); - - b.Property("InitUsedTemplateState") - .HasColumnType("boolean"); - - b.Property("IsEnable") - .HasColumnType("boolean"); - - b.HasKey("JobId"); - - b.ToTable("AutoControls", "job", t => - { - t.HasComment("Таблица управления автоконтролем для работ"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.JobFieldFilter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("FieldId") - .HasColumnType("uuid"); - - b.Property("IsInverse") - .HasColumnType("boolean"); - - b.Property("UnitFilterId") - .HasColumnType("uuid"); - - b.Property("ValueMask") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("FieldId"); - - b.HasIndex("UnitFilterId"); - - b.ToTable("FieldFilters", "job", t => - { - t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.JobGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AgentName") - .HasColumnType("text"); - - b.Property("AgentScript") - .HasColumnType("text"); - - b.Property("AgentTimeOutSec") - .HasColumnType("integer"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("FullDescription") - .IsRequired() - .HasColumnType("text"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text"); - - b.Property("GroupTypeId") - .HasColumnType("uuid"); - - b.Property("GroupingUnitFieldId") - .HasColumnType("uuid"); - - b.Property("IsAgent") - .HasColumnType("boolean"); - - b.Property("IsAutoDistributionEnabled") - .HasColumnType("boolean"); - - b.Property("IsGroupByResponsible") - .HasColumnType("boolean"); - - b.Property("IsResponseAreaTimezone") - .HasColumnType("boolean"); - - b.Property("ReferenceDate") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduleExcludeTypeCalendarId") - .HasColumnType("uuid"); - - b.Property("ScheduleExcludeTypeId") - .HasColumnType("uuid"); - - b.Property("ShortDescription") - .IsRequired() - .HasColumnType("text"); - - b.Property("Solution") - .IsRequired() - .HasColumnType("text"); - - b.Property("TemplateDuration") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserTimeZoneOffsetMinutes") - .HasColumnType("integer") - .HasComment("Смещение часового пояса пользователя в минутах относительно UTC на момент ReferenceDate"); - - b.HasKey("Id"); - - b.HasIndex("GroupTypeId"); - - b.HasIndex("GroupingUnitFieldId"); - - b.HasIndex("ScheduleExcludeTypeCalendarId"); - - b.HasIndex("ScheduleExcludeTypeId"); - - b.ToTable("Groups", "job", t => - { - t.HasComment("Таблица описания групп работ, для реализации зонтиков"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.JobGroupDistributionConfig", b => - { - b.Property("GroupId") - .HasColumnType("uuid"); - - b.Property("DistributionPeriodId") - .HasColumnType("uuid"); - - b.Property("IsExcludeWeekends") - .HasColumnType("boolean"); - - b.Property("IsGroupingByWorkGroup") - .HasColumnType("boolean"); - - b.HasKey("GroupId"); - - b.HasIndex("DistributionPeriodId"); - - b.ToTable("GroupDistributionConfigs", "job", t => - { - t.HasComment("Настройки автораспределения для группы работ"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.JobGroupType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Code") - .HasColumnType("integer"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("GroupTypes", "job", t => - { - t.HasComment("Таблица типов групп работ"); - }); - - b.HasData( - new - { - Id = new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"), - Code = 0, - DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Description = "Обычный", - Name = "Simple" - }, - new - { - Id = new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"), - Code = 1, - DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Description = "Зонтик", - Name = "Umbrella" - }, - new - { - Id = new Guid("318625e5-f833-436a-99df-2a382a1e71c7"), - Code = 2, - DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Description = "Сгруппированный", - Name = "Group" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.JobRelationshipFilter", b => - { - b.Property("UnitFilterId") - .HasColumnType("uuid"); - - b.Property("FieldId") - .HasColumnType("uuid"); - - b.Property("IsFullMatch") - .HasColumnType("boolean"); - - b.Property("IsInverse") - .HasColumnType("boolean"); - - b.Property("IsParent") - .HasColumnType("boolean"); - - b.Property("ValueMask") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("UnitFilterId", "FieldId"); - - b.HasIndex("FieldId"); - - b.ToTable("RelationshipFilters", "job", t => - { - t.HasComment("Таблица фильтров связей ЭК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.JobUnitFilter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("JobId") - .HasColumnType("uuid"); - - b.Property("UnitFilter") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("JobId"); - - b.ToTable("UnitFilters", "job", t => - { - t.HasComment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpirationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("GenerateDate") - .HasColumnType("timestamp with time zone"); - - b.Property("NextStatusCode") - .HasColumnType("integer"); - - b.Property("Number") - .IsRequired() - .HasColumnType("text"); - - b.Property("ShortName") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusCode") - .HasColumnType("integer"); - - b.Property("TemplateId") - .HasColumnType("uuid"); - - b.Property("WorkGroup") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("NextStatusCode"); - - b.HasIndex("Number") - .IsUnique(); - - b.HasIndex("StatusCode"); - - b.HasIndex("TemplateId"); - - b.ToTable("Orders", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b => - { - b.Property("Code") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Code"); - - b.ToTable("OrderStatuses", (string)null); - - b.HasData( - new - { - Code = 1, - Description = "1-Направлен в группу", - Name = "New" - }, - new - { - Code = 2, - Description = "2-В работе", - Name = "InWork" - }, - new - { - Code = 3, - Description = "3-Приостановлен", - Name = "Stop" - }, - new - { - Code = 4, - Description = "4-Выполнен", - Name = "Complete" - }, - new - { - Code = 5, - Description = "5-Закрыт", - Name = "Closed" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.ParrComponent", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ParrComponents", (string)null); - - b.HasData( - new - { - Id = 0, - Description = "API", - Name = "Api" - }, - new - { - Id = 1, - Description = "Загрузчик из АИХИТ", - Name = "AihitLoader" - }, - new - { - Id = 2, - Description = "Синхронизатор АИХИТ", - Name = "AihitSyncer" - }, - new - { - Id = 3, - Description = "Загрузчик нарядов из ЕСПП", - Name = "EsppOrderLoader" - }, - new - { - Id = 4, - Description = "Управление нарядами ЕСПП", - Name = "EsppOrderManager" - }, - new - { - Id = 5, - Description = "Синхронизатор расписаний", - Name = "EsppScheduleSync" - }, - new - { - Id = 6, - Description = "Синхронизатор шаблонов", - Name = "EsppTemplateSync" - }, - new - { - Id = 7, - Description = "Генератор шаблонов", - Name = "GeneratorTemplates" - }, - new - { - Id = 8, - Description = "Авто-контроль РР", - Name = "JobAutoControl" - }, - new - { - Id = 9, - Description = "Связывание нарядов ЕСПП с ПАРР (шаблонами, агентами)", - Name = "Master" - }, - new - { - Id = 10, - Description = "Рассчет даты следующего срабатывания", - Name = "NextRun" - }, - new - { - Id = 11, - Description = "Активатор шаблонов / расписаний", - Name = "TemplateActivator" - }, - new - { - Id = 12, - Description = "Автораспределение РР", - Name = "TemplateDistributor" - }, - new - { - Id = 13, - Description = "Генератор шаблонов", - Name = "TemplateTaskGenerator" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Process", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("EsppId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("EsppId") - .IsUnique(); - - b.ToTable("Processes", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.Robot", b => - { - b.Property("Code") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Code"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("Robots", (string)null); - - b.HasData( - new - { - Code = 1, - Description = "Робот по созданию/изменению шаблона наряда ЕСПП", - Name = "TemplateOrder" - }, - new - { - Code = 2, - Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП", - Name = "ScheduleOrder" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptsNumber") - .HasColumnType("integer"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("LastRobotStatusUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("RobotCode") - .HasColumnType("integer"); - - b.Property("RobotStatusCode") - .HasColumnType("integer"); - - b.Property("TaskStatusCode") - .HasColumnType("integer"); - - b.Property("TemplateId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RobotCode"); - - b.HasIndex("RobotStatusCode"); - - b.HasIndex("TaskStatusCode"); - - b.HasIndex("TemplateId", "RobotCode") - .IsUnique(); - - b.HasIndex("TemplateId", "RobotStatusCode"); - - b.HasIndex("TemplateId", "TaskStatusCode"); - - b.ToTable("RobotConfigurations", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("EsppMessage") - .HasColumnType("text"); - - b.Property("HistoryLevel") - .HasColumnType("integer"); - - b.Property("RobotConfigurationId") - .HasColumnType("uuid"); - - b.Property("RobotIp") - .HasColumnType("text"); - - b.Property("RobotMessage") - .HasColumnType("text"); - - b.Property("TaskStatusCode") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.HasIndex("TaskStatusCode"); - - b.HasIndex("HistoryLevel", "DateCreated") - .IsDescending(false, true); - - b.HasIndex("RobotConfigurationId", "DateCreated"); - - b.ToTable("RobotHistories", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b => - { - b.Property("Level") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Level")); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Level"); - - b.ToTable("RobotHistoryLevels", (string)null); - - b.HasData( - new - { - Level = 1, - Description = "Робот начал работу ", - Name = "Start" - }, - new - { - Level = 5, - Description = "Информация", - Name = "Information" - }, - new - { - Level = 10, - Description = "Ошибка", - Name = "Error" - }, - new - { - Level = 15, - Description = "Успешно завершил работу", - Name = "Complete" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => - { - b.Property("Code") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Code"); - - b.ToTable("RobotStatuses", (string)null); - - b.HasData( - new - { - Code = 11, - Description = "Ожидание, ждет пока робот возьмет в работу.", - Name = "Wait" - }, - new - { - Code = 22, - Description = "Робот взял в работу.", - Name = "InProgress" - }, - new - { - Code = 33, - Description = "Ошибка отработки роботом. Требует ручного вмешательства.", - Name = "Error" - }, - new - { - Code = 44, - Description = "Робот успешно отработал.", - Name = "Complete" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Role", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Roles", (string)null); - - b.HasData( - new - { - Id = new Guid("c8f2f144-e6c2-45d7-ba66-5e9bbd376376"), - DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Description = "Администратор", - Name = "administrator" - }, - new - { - Id = new Guid("13bca225-7fa4-42fa-9d80-d2d46de261fe"), - DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Description = "Робот ЕСПП", - Name = "espp-robot" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Schedule.ScheduleExcludeType", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -2106,7 +2132,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.Schedule.ScheduleExcludeTypeCalendar", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -2159,7 +2185,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.Schedule.ScheduleResponseAreaTimeOffset", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleResponseAreaTimeOffset", b => { b.Property("ResponseArea") .HasColumnType("text"); @@ -2179,7 +2205,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.Setting", b => + modelBuilder.Entity("PARR.Domain.Entities.Setting", b => { b.Property("Name") .HasColumnType("text"); @@ -2194,7 +2220,7 @@ namespace PARR.DAL.Migrations b.HasKey("Name"); - b.ToTable("Settings", (string)null); + b.ToTable("Settings"); b.HasData( new @@ -2289,7 +2315,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -2318,544 +2344,7 @@ namespace PARR.DAL.Migrations b.HasIndex("ProcessId"); - b.ToTable("Subprocesses", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b => - { - b.Property("Code") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Code"); - - b.ToTable("TaskStatuses", (string)null); - - b.HasData( - new - { - Code = 10, - Description = "Требуется создание объекта в ЕСПП", - Name = "Creating" - }, - new - { - Code = 20, - Description = "Требуется обновление объекта в ЕСПП", - Name = "Updating" - }, - new - { - Code = 30, - Description = "Нормальное состояние объекта в ЕСПП и ПАРР. Объект в ПАРР соответствует объекту в ЕСПП", - Name = "Ok" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Template", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("Index") - .HasColumnType("integer"); - - b.Property("InitiatorComment") - .HasColumnType("text"); - - b.Property("InitiatorIp") - .HasColumnType("text"); - - b.Property("InitiatorParrComponentId") - .HasColumnType("integer"); - - b.Property("IsActiveSchedule") - .HasColumnType("boolean"); - - b.Property("IsActiveTemplate") - .HasColumnType("boolean"); - - b.Property("JobId") - .HasColumnType("uuid"); - - b.Property("LastRun") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NextRun") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduleEsppId") - .HasColumnType("text"); - - b.Property("StatusTypeId") - .HasColumnType("integer"); - - b.Property("UnitId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("JobId"); - - b.HasIndex("StatusTypeId"); - - b.HasIndex("UnitId"); - - b.HasIndex("Name", "Index") - .IsUnique(); - - b.ToTable("Templates", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.TemplateHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateAddedToHistory") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("InitiatorComment") - .HasColumnType("text"); - - b.Property("InitiatorIp") - .HasColumnType("text"); - - b.Property("InitiatorParrComponentId") - .HasColumnType("integer"); - - b.Property("IsActiveSchedule") - .HasColumnType("boolean"); - - b.Property("IsActiveTemplate") - .HasColumnType("boolean"); - - b.Property("LastRun") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NextRun") - .HasColumnType("timestamp with time zone"); - - b.Property("ParentId") - .HasColumnType("uuid"); - - b.Property("ScheduleEsppId") - .HasColumnType("text"); - - b.Property("StatusTypeId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.ToTable("TemplateHistories", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.TemplateStatusType", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("TemplateStatusTypes", null, t => - { - t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); - }); - - b.HasData( - new - { - Id = 0, - Description = "В работе", - Name = "Used" - }, - new - { - Id = 1, - Description = "Не используется", - Name = "Unused" - }, - new - { - Id = 2, - Description = "Обновляется", - Name = "Updating" - }, - new - { - Id = 3, - Description = "Ошибка", - Name = "Error" - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Tnk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("EsppId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ShortName") - .HasColumnType("text"); - - b.Property("SubprocessId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("SubprocessId"); - - b.ToTable("Tnks", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.Unit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("LastLogon") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("Units", "unit", t => - { - t.HasComment("Таблица с ЭК"); - - t.HasCheckConstraint("CK_Units_Name_Upper", "\"Name\" = UPPER(\"Name\") AND \"Name\" IS NOT NULL AND LENGTH(\"Name\")>0"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitField", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AihitName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Code") - .HasColumnType("text"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("EsppName") - .HasColumnType("text"); - - b.Property("IsMultipleValue") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.HasIndex("AihitName"); - - b.HasIndex("EsppName"); - - b.ToTable("Fields", "unit", t => - { - t.HasComment("Справочник полей ЭК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitFieldInUnitFieldValue", b => - { - b.Property("FieldId") - .HasColumnType("uuid"); - - b.Property("FieldValueId") - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.HasKey("FieldId", "FieldValueId"); - - b.HasIndex("FieldValueId"); - - b.ToTable("FieldInFieldValues", "unit", t => - { - t.HasComment("Значения полей ЭК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitFieldValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Value") - .IsUnique(); - - b.ToTable("FieldValues", "unit", t => - { - t.HasComment("Значения полей ЭК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInField", b => - { - b.Property("UnitId") - .HasColumnType("uuid"); - - b.Property("FieldId") - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.HasKey("UnitId", "FieldId"); - - b.HasIndex("FieldId"); - - b.ToTable("UnitInFields", "unit", t => - { - t.HasComment("Справочник полей ЭК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInUnit", b => - { - b.Property("ParentUnitId") - .HasColumnType("uuid"); - - b.Property("ChildUnitId") - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateSynced") - .HasColumnType("timestamp with time zone"); - - b.HasKey("ParentUnitId", "ChildUnitId"); - - b.HasIndex("ChildUnitId"); - - b.ToTable("UnitInUnits", "unit", t => - { - t.HasComment("Таблица связей иерархии между ЭК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInValue", b => - { - b.Property("UnitId") - .HasColumnType("uuid"); - - b.Property("FieldId") - .HasColumnType("uuid"); - - b.Property("ValueId") - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.HasKey("UnitId", "FieldId", "ValueId"); - - b.HasIndex("ValueId"); - - b.HasIndex("FieldId", "UnitId"); - - b.HasIndex("FieldId", "ValueId"); - - b.HasIndex("UnitId", "FieldId"); - - b.ToTable("UnitInValues", "unit", t => - { - t.HasComment("Таблица связи ЭК с полями и со значениями"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitKiiUnit", b => - { - b.Property("UnitId") - .HasColumnType("uuid"); - - b.HasKey("UnitId"); - - b.ToTable("KiiUnits", "unit", t => - { - t.HasComment("Таблица - Список ЭК КИИ, которые учавствуют в групповых работах. Создавалась как временная"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitRegionalEkPtkGroup", b => - { - b.Property("FieldValueId") - .HasColumnType("uuid"); - - b.HasKey("FieldValueId"); - - b.ToTable("RegionalEkPtkGroups", "unit", t => - { - t.HasComment("Таблица - региональные группы ПТК"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.UnitsInTemplate", b => - { - b.Property("TemplateId") - .HasColumnType("uuid"); - - b.Property("UnitId") - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.HasKey("TemplateId", "UnitId"); - - b.HasIndex("UnitId"); - - b.ToTable("UnitsInTemplates", "job", t => - { - t.HasComment("Таблица связи ЭК в шаблонах"); - }); - }); - - modelBuilder.Entity("PARR.DAL.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Ip") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastLogon") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Ip") - .IsUnique(); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.UsersInRole", b => - { - b.Property("RoleId") - .HasColumnType("uuid"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("RoleId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("UsersInRoles", (string)null); - }); - - modelBuilder.Entity("PARR.DAL.Models.WeekendDay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Date") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.HasIndex("Date") - .IsUnique(); - - b.ToTable("WeekendDays", "schedule"); + b.ToTable("Subprocesses"); }); modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskError", b => @@ -3023,26 +2512,542 @@ namespace PARR.DAL.Migrations Code = 0, Description = "Формирование данных для отчетности - Загруженность", IsSingleton = true, - MaxExecutionTimeMinutes = 30, + MaxExecutionTimeMinutes = 60, MaxRetries = 2, Name = "Workload", RetentionDays = 90 }); }); - modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b => + modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b => { - b.HasOne("PARR.DAL.Models.AgentHistoryLevel", "AgentHistoryLevel") + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("TaskStatuses"); + + b.HasData( + new + { + Code = 10, + Description = "Требуется создание объекта в ЕСПП", + Name = "Creating" + }, + new + { + Code = 20, + Description = "Требуется обновление объекта в ЕСПП", + Name = "Updating" + }, + new + { + Code = 30, + Description = "Нормальное состояние объекта в ЕСПП и ПАРР. Объект в ПАРР соответствует объекту в ЕСПП", + Name = "Ok" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.Property("StatusTypeId") + .HasColumnType("integer"); + + b.Property("UnitId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.HasIndex("StatusTypeId"); + + b.HasIndex("UnitId"); + + b.HasIndex("Name", "Index") + .IsUnique(); + + b.ToTable("Templates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateAddedToHistory") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("InitiatorComment") + .HasColumnType("text"); + + b.Property("InitiatorIp") + .HasColumnType("text"); + + b.Property("InitiatorParrComponentId") + .HasColumnType("integer"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.Property("StatusTypeId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("TemplateHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateStatusType", b => + { + b.Property("Id") + .HasColumnType("integer"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TemplateStatusTypes", t => + { + t.HasComment("Таблица описания критериев выборки аттрибутов ЭК"); + }); + + b.HasData( + new + { + Id = 0, + Description = "В работе", + Name = "Used" + }, + new + { + Id = 1, + Description = "Не используется", + Name = "Unused" + }, + new + { + Id = 2, + Description = "Обновляется", + Name = "Updating" + }, + new + { + Id = 3, + Description = "Ошибка", + Name = "Error" + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .HasColumnType("text"); + + b.Property("SubprocessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SubprocessId"); + + b.ToTable("Tnks"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.Unit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastLogon") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Units", "unit", t => + { + t.HasComment("Таблица с ЭК"); + + t.HasCheckConstraint("CK_Units_Name_Upper", "\"Name\" = UPPER(\"Name\") AND \"Name\" IS NOT NULL AND LENGTH(\"Name\")>0"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AihitName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("EsppName") + .HasColumnType("text"); + + b.Property("IsMultipleValue") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AihitName"); + + b.HasIndex("EsppName"); + + b.ToTable("Fields", "unit", t => + { + t.HasComment("Справочник полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldInUnitFieldValue", b => + { + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("FieldValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("FieldId", "FieldValueId"); + + b.HasIndex("FieldValueId"); + + b.ToTable("FieldInFieldValues", "unit", t => + { + t.HasComment("Значения полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Value") + .IsUnique(); + + b.ToTable("FieldValues", "unit", t => + { + t.HasComment("Значения полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UnitId", "FieldId"); + + b.HasIndex("FieldId"); + + b.ToTable("UnitInFields", "unit", t => + { + t.HasComment("Справочник полей ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b => + { + b.Property("ParentUnitId") + .HasColumnType("uuid"); + + b.Property("ChildUnitId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateSynced") + .HasColumnType("timestamp with time zone"); + + b.HasKey("ParentUnitId", "ChildUnitId"); + + b.HasIndex("ChildUnitId"); + + b.ToTable("UnitInUnits", "unit", t => + { + t.HasComment("Таблица связей иерархии между ЭК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInValue", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.Property("FieldId") + .HasColumnType("uuid"); + + b.Property("ValueId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UnitId", "FieldId", "ValueId"); + + b.HasIndex("ValueId"); + + b.HasIndex("FieldId", "UnitId"); + + b.HasIndex("FieldId", "ValueId"); + + b.HasIndex("UnitId", "FieldId"); + + b.ToTable("UnitInValues", "unit", t => + { + t.HasComment("Таблица связи ЭК с полями и со значениями"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitKiiUnit", b => + { + b.Property("UnitId") + .HasColumnType("uuid"); + + b.HasKey("UnitId"); + + b.ToTable("KiiUnits", "unit", t => + { + t.HasComment("Таблица - Список ЭК КИИ, которые учавствуют в групповых работах. Создавалась как временная"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", b => + { + b.Property("FieldValueId") + .HasColumnType("uuid"); + + b.HasKey("FieldValueId"); + + b.ToTable("RegionalEkPtkGroups", "unit", t => + { + t.HasComment("Таблица - региональные группы ПТК"); + }); + }); + + modelBuilder.Entity("PARR.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Ip") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastLogon") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Ip") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.UsersInRole", b => + { + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("RoleId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UsersInRoles"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.WeekendDay", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Date") + .HasColumnType("date"); + + b.HasKey("Id"); + + b.HasIndex("Date") + .IsUnique(); + + b.ToTable("WeekendDays", "schedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistory", b => + { + b.HasOne("PARR.Domain.Entities.AgentHistoryLevel", "AgentHistoryLevel") .WithMany("AgentHistories") .HasForeignKey("HistoryLevelId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Order", "Order") + b.HasOne("PARR.Domain.Entities.Order", "Order") .WithMany("AgentHistories") .HasForeignKey("OrderId"); - b.HasOne("PARR.DAL.Models.Template", "Template") + b.HasOne("PARR.Domain.Entities.Template", "Template") .WithMany("AgentHistories") .HasForeignKey("TemplateId") .OnDelete(DeleteBehavior.Cascade) @@ -3055,9 +3060,9 @@ namespace PARR.DAL.Migrations b.Navigation("Template"); }); - modelBuilder.Entity("PARR.DAL.Models.DistributionPeriod", b => + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => { - b.HasOne("PARR.DAL.Models.DistributionPeriodType", "DistributionPeriodType") + b.HasOne("PARR.Domain.Entities.DistributionPeriodType", "DistributionPeriodType") .WithMany("Periods") .HasForeignKey("Type") .OnDelete(DeleteBehavior.Cascade) @@ -3066,72 +3071,15 @@ namespace PARR.DAL.Migrations b.Navigation("DistributionPeriodType"); }); - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => { - b.HasOne("PARR.DAL.Models.EsppSchType", "EsppSchType") - .WithMany("EsppSchTypeConfigs") - .HasForeignKey("TypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.EsppSchTypeSchedule", "EsppSchTypeSchedule") - .WithMany("EsppSchTypeConfigs") - .HasForeignKey("TypeScheduleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("EsppSchType"); - - b.Navigation("EsppSchTypeSchedule"); - }); - - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => - { - b.HasOne("PARR.DAL.Models.EsppSchType", "EsppSchType") - .WithMany("EsppSchTypeValues") - .HasForeignKey("TypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("EsppSchType"); - }); - - modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b => - { - b.HasOne("PARR.DAL.Models.Job.JobGroup", "JobGroup") - .WithMany("EsppSchValues") - .HasForeignKey("JobGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.EsppSchTypeConfig", "EsppSchTypeConfig") - .WithMany("EsppSchValues") - .HasForeignKey("TypeConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.EsppSchTypeValue", "EsppSchTypeValue") - .WithMany("EsppSchValues") - .HasForeignKey("TypeValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("EsppSchTypeConfig"); - - b.Navigation("EsppSchTypeValue"); - - b.Navigation("JobGroup"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.Job", b => - { - b.HasOne("PARR.DAL.Models.Job.JobGroup", "Group") + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "Group") .WithMany("Jobs") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Tnk", "Tnk") + b.HasOne("PARR.Domain.Entities.Tnk", "Tnk") .WithMany("Jobs") .HasForeignKey("TnkId") .OnDelete(DeleteBehavior.Cascade) @@ -3142,26 +3090,26 @@ namespace PARR.DAL.Migrations b.Navigation("Tnk"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobAutoControl", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b => { - b.HasOne("PARR.DAL.Models.Job.Job", "Job") + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") .WithOne("AutoControl") - .HasForeignKey("PARR.DAL.Models.Job.JobAutoControl", "JobId") + .HasForeignKey("PARR.Domain.Entities.Job.JobAutoControl", "JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Job"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobFieldFilter", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b => { - b.HasOne("PARR.DAL.Models.Unit.UnitField", "UnitField") + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") .WithMany() .HasForeignKey("FieldId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Job.JobUnitFilter", "UnitFilter") + b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter") .WithMany("FieldFilters") .HasForeignKey("UnitFilterId") .OnDelete(DeleteBehavior.Cascade) @@ -3172,24 +3120,24 @@ namespace PARR.DAL.Migrations b.Navigation("UnitFilter"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobGroup", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => { - b.HasOne("PARR.DAL.Models.Job.JobGroupType", "GroupType") + b.HasOne("PARR.Domain.Entities.Job.JobGroupType", "GroupType") .WithMany("JobGroups") .HasForeignKey("GroupTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Unit.UnitField", "GroupingUnitField") + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "GroupingUnitField") .WithMany("JobGroupWithGrouping") .HasForeignKey("GroupingUnitFieldId") .OnDelete(DeleteBehavior.Restrict); - b.HasOne("PARR.DAL.Models.Schedule.ScheduleExcludeTypeCalendar", "ScheduleExcludeTypeCalendar") + b.HasOne("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", "ScheduleExcludeTypeCalendar") .WithMany("JobGroups") .HasForeignKey("ScheduleExcludeTypeCalendarId"); - b.HasOne("PARR.DAL.Models.Schedule.ScheduleExcludeType", "ScheduleExcludeType") + b.HasOne("PARR.Domain.Entities.Schedule.ScheduleExcludeType", "ScheduleExcludeType") .WithMany("JobGroups") .HasForeignKey("ScheduleExcludeTypeId") .OnDelete(DeleteBehavior.Cascade) @@ -3204,17 +3152,17 @@ namespace PARR.DAL.Migrations b.Navigation("ScheduleExcludeTypeCalendar"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobGroupDistributionConfig", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupDistributionConfig", b => { - b.HasOne("PARR.DAL.Models.DistributionPeriod", "DistributionPeriod") + b.HasOne("PARR.Domain.Entities.DistributionPeriod", "DistributionPeriod") .WithMany("GroupDistributionConfig") .HasForeignKey("DistributionPeriodId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Job.JobGroup", "Group") + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "Group") .WithOne("DistributionConfig") - .HasForeignKey("PARR.DAL.Models.Job.JobGroupDistributionConfig", "GroupId") + .HasForeignKey("PARR.Domain.Entities.Job.JobGroupDistributionConfig", "GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -3223,15 +3171,15 @@ namespace PARR.DAL.Migrations b.Navigation("Group"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobRelationshipFilter", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b => { - b.HasOne("PARR.DAL.Models.Unit.UnitField", "UnitField") + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") .WithMany("RelationshipFilters") .HasForeignKey("FieldId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Job.JobUnitFilter", "UnitFilter") + b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter") .WithMany("RelationshipFilters") .HasForeignKey("UnitFilterId") .OnDelete(DeleteBehavior.Cascade) @@ -3242,9 +3190,9 @@ namespace PARR.DAL.Migrations b.Navigation("UnitFilter"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobUnitFilter", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => { - b.HasOne("PARR.DAL.Models.Job.Job", "Job") + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") .WithMany("UnitFilters") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) @@ -3253,19 +3201,46 @@ namespace PARR.DAL.Migrations b.Navigation("Job"); }); - modelBuilder.Entity("PARR.DAL.Models.Order", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b => { - b.HasOne("PARR.DAL.Models.OrderStatus", "NextStatus") + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("UnitsInTemplate") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "UnitFieldValue") + .WithMany("UnitsInTemplates") + .HasForeignKey("UnitFieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("TemplatesInUnit") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + + b.Navigation("Unit"); + + b.Navigation("UnitFieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Order", b => + { + b.HasOne("PARR.Domain.Entities.OrderStatus", "NextStatus") .WithMany("OrdersNext") .HasForeignKey("NextStatusCode"); - b.HasOne("PARR.DAL.Models.OrderStatus", "OrderStatus") + b.HasOne("PARR.Domain.Entities.OrderStatus", "OrderStatus") .WithMany("Orders") .HasForeignKey("StatusCode") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Template", "Template") + b.HasOne("PARR.Domain.Entities.Template", "Template") .WithMany("Orders") .HasForeignKey("TemplateId"); @@ -3276,27 +3251,27 @@ namespace PARR.DAL.Migrations b.Navigation("Template"); }); - modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => { - b.HasOne("PARR.DAL.Models.Robot", "Robot") + b.HasOne("PARR.Domain.Entities.Robot", "Robot") .WithMany("RobotConfigurations") .HasForeignKey("RobotCode") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.RobotStatus", "RobotStatus") + b.HasOne("PARR.Domain.Entities.RobotStatus", "RobotStatus") .WithMany("RobotConfigurations") .HasForeignKey("RobotStatusCode") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.TaskStatus", "TaskStatus") + b.HasOne("PARR.Domain.Entities.TaskStatus", "TaskStatus") .WithMany("RobotConfigurations") .HasForeignKey("TaskStatusCode") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Template", "Template") + b.HasOne("PARR.Domain.Entities.Template", "Template") .WithMany("RobotConfigurations") .HasForeignKey("TemplateId") .OnDelete(DeleteBehavior.Cascade) @@ -3311,21 +3286,21 @@ namespace PARR.DAL.Migrations b.Navigation("Template"); }); - modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b => + modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b => { - b.HasOne("PARR.DAL.Models.RobotHistoryLevel", "RobotHistoryLevel") + b.HasOne("PARR.Domain.Entities.RobotHistoryLevel", "RobotHistoryLevel") .WithMany("RobotHistories") .HasForeignKey("HistoryLevel") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.RobotConfiguration", "RobotConfiguration") + b.HasOne("PARR.Domain.Entities.RobotConfiguration", "RobotConfiguration") .WithMany("RobotHistories") .HasForeignKey("RobotConfigurationId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.TaskStatus", "StatusTask") + b.HasOne("PARR.Domain.Entities.TaskStatus", "StatusTask") .WithMany("RobotHistories") .HasForeignKey("TaskStatusCode") .OnDelete(DeleteBehavior.Cascade) @@ -3338,9 +3313,66 @@ namespace PARR.DAL.Migrations b.Navigation("StatusTask"); }); - modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => { - b.HasOne("PARR.DAL.Models.Process", "Process") + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", "EsppSchTypeSchedule") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + + b.Navigation("EsppSchTypeSchedule"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeValues") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchValue", b => + { + b.HasOne("PARR.Domain.Entities.Job.JobGroup", "JobGroup") + .WithMany("EsppSchValues") + .HasForeignKey("JobGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", "EsppSchTypeConfig") + .WithMany("EsppSchValues") + .HasForeignKey("TypeConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Schedule.EsppSchTypeValue", "EsppSchTypeValue") + .WithMany("EsppSchValues") + .HasForeignKey("TypeValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchTypeConfig"); + + b.Navigation("EsppSchTypeValue"); + + b.Navigation("JobGroup"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => + { + b.HasOne("PARR.Domain.Entities.Process", "Process") .WithMany("Subprocesses") .HasForeignKey("ProcessId") .OnDelete(DeleteBehavior.Cascade) @@ -3349,199 +3381,6 @@ namespace PARR.DAL.Migrations b.Navigation("Process"); }); - modelBuilder.Entity("PARR.DAL.Models.Template", b => - { - b.HasOne("PARR.DAL.Models.Job.Job", "Job") - .WithMany("Templates") - .HasForeignKey("JobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.TemplateStatusType", "StatusType") - .WithMany("Templates") - .HasForeignKey("StatusTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit") - .WithMany("Templates") - .HasForeignKey("UnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Job"); - - b.Navigation("StatusType"); - - b.Navigation("Unit"); - }); - - modelBuilder.Entity("PARR.DAL.Models.TemplateHistory", b => - { - b.HasOne("PARR.DAL.Models.Template", "Template") - .WithMany("TemplateHistories") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Template"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Tnk", b => - { - b.HasOne("PARR.DAL.Models.Subprocess", "Subprocess") - .WithMany("Tnks") - .HasForeignKey("SubprocessId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subprocess"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitFieldInUnitFieldValue", b => - { - b.HasOne("PARR.DAL.Models.Unit.UnitField", "Field") - .WithMany("UnitFieldValues") - .HasForeignKey("FieldId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.Unit.UnitFieldValue", "FieldValue") - .WithMany("FieldValues") - .HasForeignKey("FieldValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Field"); - - b.Navigation("FieldValue"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInField", b => - { - b.HasOne("PARR.DAL.Models.Unit.UnitField", "UnitField") - .WithMany("Units") - .HasForeignKey("FieldId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit") - .WithMany("UnitFields") - .HasForeignKey("UnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Unit"); - - b.Navigation("UnitField"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInUnit", b => - { - b.HasOne("PARR.DAL.Models.Unit.Unit", "ChildUnit") - .WithMany("ParentUnits") - .HasForeignKey("ChildUnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.Unit.Unit", "ParentUnit") - .WithMany("ChildUnits") - .HasForeignKey("ParentUnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ChildUnit"); - - b.Navigation("ParentUnit"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInValue", b => - { - b.HasOne("PARR.DAL.Models.Unit.UnitField", "Field") - .WithMany("UnitInValues") - .HasForeignKey("FieldId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit") - .WithMany("UnitValues") - .HasForeignKey("UnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.Unit.UnitFieldValue", "Value") - .WithMany("UnitInValues") - .HasForeignKey("ValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Field"); - - b.Navigation("Unit"); - - b.Navigation("Value"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitKiiUnit", b => - { - b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit") - .WithOne("UnitKii") - .HasForeignKey("PARR.DAL.Models.Unit.UnitKiiUnit", "UnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Unit"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitRegionalEkPtkGroup", b => - { - b.HasOne("PARR.DAL.Models.Unit.UnitFieldValue", "FieldValue") - .WithOne("RegionalEkPtkGroup") - .HasForeignKey("PARR.DAL.Models.Unit.UnitRegionalEkPtkGroup", "FieldValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FieldValue"); - }); - - modelBuilder.Entity("PARR.DAL.Models.UnitsInTemplate", b => - { - b.HasOne("PARR.DAL.Models.Template", "Template") - .WithMany("UnitsInTemplate") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit") - .WithMany("TemplatesInUnit") - .HasForeignKey("UnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Template"); - - b.Navigation("Unit"); - }); - - modelBuilder.Entity("PARR.DAL.Models.UsersInRole", b => - { - b.HasOne("PARR.DAL.Models.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PARR.DAL.Models.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskError", b => { b.HasOne("PARR.Domain.Entities.TaskEntities.TaskItem", "TaskItem") @@ -3572,44 +3411,196 @@ namespace PARR.DAL.Migrations b.Navigation("TaskType"); }); - modelBuilder.Entity("PARR.DAL.Models.AgentHistoryLevel", b => + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.HasOne("PARR.Domain.Entities.Job.Job", "Job") + .WithMany("Templates") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.TemplateStatusType", "StatusType") + .WithMany("Templates") + .HasForeignKey("StatusTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("Templates") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + + b.Navigation("StatusType"); + + b.Navigation("Unit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b => + { + b.HasOne("PARR.Domain.Entities.Template", "Template") + .WithMany("TemplateHistories") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.HasOne("PARR.Domain.Entities.Subprocess", "Subprocess") + .WithMany("Tnks") + .HasForeignKey("SubprocessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subprocess"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldInUnitFieldValue", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "Field") + .WithMany("UnitFieldValues") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "FieldValue") + .WithMany("FieldValues") + .HasForeignKey("FieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Field"); + + b.Navigation("FieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField") + .WithMany("Units") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("UnitFields") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Unit"); + + b.Navigation("UnitField"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b => + { + b.HasOne("PARR.Domain.Entities.Unit.Unit", "ChildUnit") + .WithMany("ParentUnits") + .HasForeignKey("ChildUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "ParentUnit") + .WithMany("ChildUnits") + .HasForeignKey("ParentUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChildUnit"); + + b.Navigation("ParentUnit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInValue", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitField", "Field") + .WithMany("UnitInValues") + .HasForeignKey("FieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithMany("UnitValues") + .HasForeignKey("UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "Value") + .WithMany("UnitInValues") + .HasForeignKey("ValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Field"); + + b.Navigation("Unit"); + + b.Navigation("Value"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitKiiUnit", b => + { + b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit") + .WithOne("UnitKii") + .HasForeignKey("PARR.Domain.Entities.Unit.UnitKiiUnit", "UnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Unit"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", b => + { + b.HasOne("PARR.Domain.Entities.Unit.UnitFieldValue", "FieldValue") + .WithOne("RegionalEkPtkGroup") + .HasForeignKey("PARR.Domain.Entities.Unit.UnitRegionalEkPtkGroup", "FieldValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FieldValue"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.UsersInRole", b => + { + b.HasOne("PARR.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.Domain.Entities.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.AgentHistoryLevel", b => { b.Navigation("AgentHistories"); }); - modelBuilder.Entity("PARR.DAL.Models.DistributionPeriod", b => + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriod", b => { b.Navigation("GroupDistributionConfig"); }); - modelBuilder.Entity("PARR.DAL.Models.DistributionPeriodType", b => + modelBuilder.Entity("PARR.Domain.Entities.DistributionPeriodType", b => { b.Navigation("Periods"); }); - modelBuilder.Entity("PARR.DAL.Models.EsppSchType", b => - { - b.Navigation("EsppSchTypeConfigs"); - - b.Navigation("EsppSchTypeValues"); - }); - - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => - { - b.Navigation("EsppSchValues"); - }); - - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeSchedule", b => - { - b.Navigation("EsppSchTypeConfigs"); - }); - - modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => - { - b.Navigation("EsppSchValues"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Job.Job", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b => { b.Navigation("AutoControl"); @@ -3618,7 +3609,7 @@ namespace PARR.DAL.Migrations b.Navigation("UnitFilters"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobGroup", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroup", b => { b.Navigation("DistributionConfig"); @@ -3627,149 +3618,97 @@ namespace PARR.DAL.Migrations b.Navigation("Jobs"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobGroupType", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobGroupType", b => { b.Navigation("JobGroups"); }); - modelBuilder.Entity("PARR.DAL.Models.Job.JobUnitFilter", b => + modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b => { b.Navigation("FieldFilters"); b.Navigation("RelationshipFilters"); }); - modelBuilder.Entity("PARR.DAL.Models.Order", b => + modelBuilder.Entity("PARR.Domain.Entities.Order", b => { b.Navigation("AgentHistories"); }); - modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b => + modelBuilder.Entity("PARR.Domain.Entities.OrderStatus", b => { b.Navigation("Orders"); b.Navigation("OrdersNext"); }); - modelBuilder.Entity("PARR.DAL.Models.Process", b => + modelBuilder.Entity("PARR.Domain.Entities.Process", b => { b.Navigation("Subprocesses"); }); - modelBuilder.Entity("PARR.DAL.Models.Robot", b => + modelBuilder.Entity("PARR.Domain.Entities.Robot", b => { b.Navigation("RobotConfigurations"); }); - modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b => { b.Navigation("RobotHistories"); }); - modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b => + modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b => { b.Navigation("RobotHistories"); }); - modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => + modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b => { b.Navigation("RobotConfigurations"); }); - modelBuilder.Entity("PARR.DAL.Models.Role", b => + modelBuilder.Entity("PARR.Domain.Entities.Role", b => { b.Navigation("Users"); }); - modelBuilder.Entity("PARR.DAL.Models.Schedule.ScheduleExcludeType", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchType", b => + { + b.Navigation("EsppSchTypeConfigs"); + + b.Navigation("EsppSchTypeValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeConfig", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeSchedule", b => + { + b.Navigation("EsppSchTypeConfigs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.EsppSchTypeValue", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeType", b => { b.Navigation("JobGroups"); }); - modelBuilder.Entity("PARR.DAL.Models.Schedule.ScheduleExcludeTypeCalendar", b => + modelBuilder.Entity("PARR.Domain.Entities.Schedule.ScheduleExcludeTypeCalendar", b => { b.Navigation("JobGroups"); }); - modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + modelBuilder.Entity("PARR.Domain.Entities.Subprocess", b => { b.Navigation("Tnks"); }); - modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b => - { - b.Navigation("RobotConfigurations"); - - b.Navigation("RobotHistories"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Template", b => - { - b.Navigation("AgentHistories"); - - b.Navigation("Orders"); - - b.Navigation("RobotConfigurations"); - - b.Navigation("TemplateHistories"); - - b.Navigation("UnitsInTemplate"); - }); - - modelBuilder.Entity("PARR.DAL.Models.TemplateStatusType", b => - { - b.Navigation("Templates"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Tnk", b => - { - b.Navigation("Jobs"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.Unit", b => - { - b.Navigation("ChildUnits"); - - b.Navigation("ParentUnits"); - - b.Navigation("Templates"); - - b.Navigation("TemplatesInUnit"); - - b.Navigation("UnitFields"); - - b.Navigation("UnitKii"); - - b.Navigation("UnitValues"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitField", b => - { - b.Navigation("JobGroupWithGrouping"); - - b.Navigation("RelationshipFilters"); - - b.Navigation("UnitFieldValues"); - - b.Navigation("UnitInValues"); - - b.Navigation("Units"); - }); - - modelBuilder.Entity("PARR.DAL.Models.Unit.UnitFieldValue", b => - { - b.Navigation("FieldValues"); - - b.Navigation("RegionalEkPtkGroup"); - - b.Navigation("UnitInValues"); - }); - - modelBuilder.Entity("PARR.DAL.Models.User", b => - { - b.Navigation("Roles"); - }); - modelBuilder.Entity("PARR.Domain.Entities.TaskEntities.TaskItem", b => { b.Navigation("TaskErrors"); @@ -3784,6 +3723,82 @@ namespace PARR.DAL.Migrations { b.Navigation("Tasks"); }); + + modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b => + { + b.Navigation("RobotConfigurations"); + + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Template", b => + { + b.Navigation("AgentHistories"); + + b.Navigation("Orders"); + + b.Navigation("RobotConfigurations"); + + b.Navigation("TemplateHistories"); + + b.Navigation("UnitsInTemplate"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.TemplateStatusType", b => + { + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Tnk", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.Unit", b => + { + b.Navigation("ChildUnits"); + + b.Navigation("ParentUnits"); + + b.Navigation("Templates"); + + b.Navigation("TemplatesInUnit"); + + b.Navigation("UnitFields"); + + b.Navigation("UnitKii"); + + b.Navigation("UnitValues"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitField", b => + { + b.Navigation("JobGroupWithGrouping"); + + b.Navigation("RelationshipFilters"); + + b.Navigation("UnitFieldValues"); + + b.Navigation("UnitInValues"); + + b.Navigation("Units"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b => + { + b.Navigation("FieldValues"); + + b.Navigation("RegionalEkPtkGroup"); + + b.Navigation("UnitInValues"); + + b.Navigation("UnitsInTemplates"); + }); + + modelBuilder.Entity("PARR.Domain.Entities.User", b => + { + b.Navigation("Roles"); + }); #pragma warning restore 612, 618 } } diff --git a/PARR.Domain/Entities/UnitsInTemplate.cs b/PARR.Domain/Entities/Job/UnitsInTemplate.cs similarity index 75% rename from PARR.Domain/Entities/UnitsInTemplate.cs rename to PARR.Domain/Entities/Job/UnitsInTemplate.cs index afc09a8d..24dc5ef6 100644 --- a/PARR.Domain/Entities/UnitsInTemplate.cs +++ b/PARR.Domain/Entities/Job/UnitsInTemplate.cs @@ -2,20 +2,28 @@ using PARR.Domain.Constants; using System.ComponentModel.DataAnnotations.Schema; -namespace PARR.Domain.Entities +namespace PARR.Domain.Entities.Job { [Table("UnitsInTemplates", Schema = DatabaseSchemas.Job)] [Comment("Таблица связи ЭК в шаблонах")] public class UnitsInTemplate { public Guid TemplateId { get; set; } + public Guid UnitId { get; set; } + public DateTimeOffset DateCreated { get; set; } + public Guid UnitFieldValueId { get; set; } + [ForeignKey(nameof(TemplateId))] public Template? Template { get; set; } [ForeignKey(nameof(UnitId))] public Unit.Unit? Unit { get; set; } + + [ForeignKey(nameof(UnitFieldValueId))] + public Unit.UnitFieldValue? UnitFieldValue { get; set; } + } } diff --git a/PARR.Domain/Entities/Template.cs b/PARR.Domain/Entities/Template.cs index 345ce55d..219e4fa3 100644 --- a/PARR.Domain/Entities/Template.cs +++ b/PARR.Domain/Entities/Template.cs @@ -2,6 +2,7 @@ using PARR.Domain.Entities.Base; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.Base.History.Base; +using PARR.Domain.Entities.Job; using PARR.Domain.Enums; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.Domain/Entities/Unit/Unit.cs b/PARR.Domain/Entities/Unit/Unit.cs index 30828203..8831ff75 100644 --- a/PARR.Domain/Entities/Unit/Unit.cs +++ b/PARR.Domain/Entities/Unit/Unit.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using PARR.Domain.Constants; using PARR.Domain.Entities.Base; +using PARR.Domain.Entities.Job; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.Domain/Entities/Unit/UnitFieldValue.cs b/PARR.Domain/Entities/Unit/UnitFieldValue.cs index 8c5c339d..fc6fca43 100644 --- a/PARR.Domain/Entities/Unit/UnitFieldValue.cs +++ b/PARR.Domain/Entities/Unit/UnitFieldValue.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using PARR.Domain.Constants; using PARR.Domain.Entities.Base; +using PARR.Domain.Entities.Job; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -27,5 +28,7 @@ namespace PARR.Domain.Entities.Unit public ICollection FieldValues { get; set; } = new HashSet(); public UnitRegionalEkPtkGroup? RegionalEkPtkGroup { get; set; } + + public ICollection UnitsInTemplates { get; set; } = new HashSet(); } } diff --git a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs index fadf9697..fd824805 100644 --- a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs +++ b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs @@ -7,6 +7,7 @@ using PARR.Core.Services.Shortcodes; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; +using PARR.Domain.Entities.Job; using PARR.Domain.Enums; using PARR.TemplateGeneratorWorker.Services; diff --git a/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs b/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs index 481c1c64..008b6b86 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs @@ -6,6 +6,7 @@ using PARR.Core.Repositories.Interfaces.Job; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; +using PARR.Domain.Entities.Job; using PARR.Domain.Enums; using PARR.Domain.Settings; using PARR.TemplateMatcher.Services.Interfaces; diff --git a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs index cde14d30..5959bc87 100644 --- a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs +++ b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs @@ -7,6 +7,7 @@ using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; +using PARR.Domain.Entities.Job; using PARR.Domain.Enums; namespace PARR.TemplateUpdater.Services