From 9060db1fe422fef66eb0919cf5acf4e02b9d9e5f Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Fri, 6 Oct 2023 13:58:10 +1000 Subject: [PATCH] =?UTF-8?q?feat(api):=20RobotHistoryController=20-=20?= =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D1=8B=20=D1=80=D0=BE=D0=B1=D0=BE=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API/Contracts/V1/ApiRoutes.cs | 6 +- .../V1/Requests/RobotHistoryRequest.cs | 15 + .../Requests/RobotTemplateHistoryRequest.cs | 18 - ...oryResponse.cs => RobotHistoryResponse.cs} | 10 +- .../Controllers/V1/RobotHistoryController.cs | 126 + .../V1/RobotTemplateHistoryController.cs | 126 - .../DomainToResponseProfile.cs | 4 +- .../RobotHistoryRequestValidator.cs | 18 + .../RobotTemplateHistoryRequestValidator.cs | 17 - PARR.DAL/Context/DataContext.cs | 3 +- PARR.DAL/Contracts/RobotHistoryLevelEnum.cs | 7 +- ...9_TblRobotHistoryLevelRmBreake.Designer.cs | 2031 +++++++++++++++++ ...1006014239_TblRobotHistoryLevelRmBreake.cs | 28 + .../Migrations/DataContextModelSnapshot.cs | 6 - 14 files changed, 2228 insertions(+), 187 deletions(-) create mode 100644 PARR.API/Contracts/V1/Requests/RobotHistoryRequest.cs delete mode 100644 PARR.API/Contracts/V1/Requests/RobotTemplateHistoryRequest.cs rename PARR.API/Contracts/V1/Responses/{RobotTemplateHistoryResponse.cs => RobotHistoryResponse.cs} (55%) create mode 100644 PARR.API/Controllers/V1/RobotHistoryController.cs delete mode 100644 PARR.API/Controllers/V1/RobotTemplateHistoryController.cs create mode 100644 PARR.API/Validators/RobotHistoryRequestValidator.cs delete mode 100644 PARR.API/Validators/RobotTemplateHistoryRequestValidator.cs create mode 100644 PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.Designer.cs create mode 100644 PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.cs diff --git a/PARR.API/Contracts/V1/ApiRoutes.cs b/PARR.API/Contracts/V1/ApiRoutes.cs index 37a5be11..324039ba 100644 --- a/PARR.API/Contracts/V1/ApiRoutes.cs +++ b/PARR.API/Contracts/V1/ApiRoutes.cs @@ -71,10 +71,10 @@ public const string templateId = "{templateId}"; } - public static class RobotTemplateHistory + public static class RobotHistory { - public const string GetAll = Base + "/robot-template-histories/"; - public const string Create = Base + "/robot-template-histories/"; + //public const string GetAll = Base + "/robot-histories/"; + public const string Create = Base + "/robot-histories/"; } public static class StatusTemplate diff --git a/PARR.API/Contracts/V1/Requests/RobotHistoryRequest.cs b/PARR.API/Contracts/V1/Requests/RobotHistoryRequest.cs new file mode 100644 index 00000000..5bb30e25 --- /dev/null +++ b/PARR.API/Contracts/V1/Requests/RobotHistoryRequest.cs @@ -0,0 +1,15 @@ +using PARR.DAL.Contracts; + +namespace PARR.API.Contracts.V1.Requests +{ + public class RobotHistoryRequest + { + public RobotHistoryLevelEnum HistoryLevel { get; set; } + + public string? RobotMessage { get; set; } + + public string? EsppMessage { get; set; } + + public Guid TaskId { get; set; } + } +} diff --git a/PARR.API/Contracts/V1/Requests/RobotTemplateHistoryRequest.cs b/PARR.API/Contracts/V1/Requests/RobotTemplateHistoryRequest.cs deleted file mode 100644 index c5c366ac..00000000 --- a/PARR.API/Contracts/V1/Requests/RobotTemplateHistoryRequest.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace PARR.API.Contracts.V1.Requests -{ - public class RobotTemplateHistoryRequest - { - public int HistoryLevel { get; set; } - - public string? RobotMessage { get; set; } - - public string? EsppMessage { get; set; } - - public Guid TemplateId { get; set; } - - /// - /// ИД серии - идентификатор полного цикла выполнения роботом текущего задания. Если не передать, сгенерируется автоматически, в дальнейшем в рамках шагов по текущему заданию использовать его. - /// - public Guid? IdSeries { get; set; } - } -} diff --git a/PARR.API/Contracts/V1/Responses/RobotTemplateHistoryResponse.cs b/PARR.API/Contracts/V1/Responses/RobotHistoryResponse.cs similarity index 55% rename from PARR.API/Contracts/V1/Responses/RobotTemplateHistoryResponse.cs rename to PARR.API/Contracts/V1/Responses/RobotHistoryResponse.cs index 7ea8ae96..c2930742 100644 --- a/PARR.API/Contracts/V1/Responses/RobotTemplateHistoryResponse.cs +++ b/PARR.API/Contracts/V1/Responses/RobotHistoryResponse.cs @@ -1,6 +1,6 @@ namespace PARR.API.Contracts.V1.Responses { - public class RobotTemplateHistoryResponse + public class RobotHistoryResponse { public Guid Id { get; set; } @@ -10,13 +10,9 @@ public string? EsppMessage { get; set; } - public int TemplateStatusCode { get; set; } + public int TaskStatusCode { get; set; } - public Guid TemplateId { get; set; } - - public string TemplateName { get; set; } = string.Empty; - - public Guid IdSeries { get; set; } + public Guid TaskId { get; set; } public RobotHistoryLevelResponse? Level { get; set; } diff --git a/PARR.API/Controllers/V1/RobotHistoryController.cs b/PARR.API/Controllers/V1/RobotHistoryController.cs new file mode 100644 index 00000000..15f48e29 --- /dev/null +++ b/PARR.API/Controllers/V1/RobotHistoryController.cs @@ -0,0 +1,126 @@ +using AutoMapper; +using FluentValidation; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using PARR.API.Contracts.V1; +using PARR.API.Contracts.V1.Requests; +using PARR.API.Contracts.V1.Responses; +using PARR.API.Contracts.V1.Responses.Base; +using PARR.API.Controllers.V1.Base; +using PARR.API.Services.Interfaces; +using PARR.DAL.Models; +using PARR.DAL.Services.Interfaces; + +namespace PARR.API.Controllers.V1 +{ + public class RobotHistoryController : BaseApiController + { + private readonly IValidator validator; + private readonly ITemplateService templateService; + private readonly IRobotTemplateHistoryService historyService; + private readonly IMapper mapper; + private readonly IUriService uriService; + private readonly IRobotHistoryService robotHistoryService; + private readonly IRobotConfigurationService robotConfigurationService; + + public RobotHistoryController( + IValidator validator, + ITemplateService templateService, + IRobotTemplateHistoryService historyService, + IMapper mapper, + IUriService uriService, + IRobotHistoryService robotHistoryService, + IRobotConfigurationService robotConfigurationService + ) + { + this.validator = validator; + this.templateService = templateService; + this.historyService = historyService; + this.mapper = mapper; + this.uriService = uriService; + this.robotHistoryService = robotHistoryService; + this.robotConfigurationService = robotConfigurationService; + } + + + ///// + ///// Получить историю робота шаблонов + ///// + ///// + ///// + ///// + //[HttpGet(ApiRoutes.RobotTemplateHistory.GetAll)] + //public async Task GetAll([FromQuery] PaginationQuery paginationQuery, [FromQuery] RobotTemplateHistoryQuery filter) + //{ + // var paginationFilter = mapper.Map(paginationQuery); + + // IQueryable query = historyService.Get() + // .Include(t => t.Template) + // .Include(t => t.RobotHistoryLevel) + // .OrderByDescending(t => t.DateCreated).ThenBy(t => t.IdSeries); + + // if (filter.IdSeries != null) + // query = query.Where(t => t.IdSeries == filter.IdSeries); + + // if (filter.TemplateId != null) + // query = query.Where(t => t.TemplateId == filter.TemplateId); + + + // var history = await historyService.GetPage(query, paginationFilter).ToListAsync(); + + // if (!history.Any()) + // return NoContent(); + + // var response = mapper.Map>(history); + // var paginationResponse = new PagedResponse(response, true).GetPaginatedProps(paginationFilter, query); + + // return Ok(paginationResponse); + //} + + + /// + /// Добавить историю работы робота + /// + /// + /// + [HttpPost(ApiRoutes.RobotHistory.Create)] + public async Task Create([FromBody] RobotHistoryRequest request) + { + var resultValidate = await validator.ValidateAsync(request); + if (!resultValidate.IsValid) + return BadRequest(new Response(resultValidate.Errors)); + + var config = await robotConfigurationService.GetAsync(request.TaskId); + if (config == null) + return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Не найдено задание с id: {request.TaskId}" } })); + + + var history = new RobotHistory + { + Id = Guid.NewGuid(), + HistoryLevel = (int)request.HistoryLevel, + RobotMessage = request.RobotMessage, + EsppMessage = request.EsppMessage, + TaskStatusCode = config.TaskStatusCode, + RobotConfigurationId = request.TaskId + }; + + if (!await robotHistoryService.CreateAsync(history) || !await robotHistoryService.CommitAsync()) + return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Ошибка при добавлении записи в историю" } })); + + var createdObj = await robotHistoryService.Get() + .Include(t => t.RobotConfiguration) + .Include(t => t.RobotHistoryLevel) + .FirstOrDefaultAsync(t => t.Id == history.Id); + + var response = mapper.Map(createdObj); + + //todo: createdUri + //var createdUri = uriService.GetAllUri(ApiRoutes.RobotTemplateHistory.GetAll) + $"?{nameof(RobotTemplateHistoryQuery.IdSeries)}={createdObj!.IdSeries}"; + var createdUri = ""; + + return Created(createdUri, new Response(response, true)); + } + + } +} diff --git a/PARR.API/Controllers/V1/RobotTemplateHistoryController.cs b/PARR.API/Controllers/V1/RobotTemplateHistoryController.cs deleted file mode 100644 index b41f1e94..00000000 --- a/PARR.API/Controllers/V1/RobotTemplateHistoryController.cs +++ /dev/null @@ -1,126 +0,0 @@ -using AutoMapper; -using FluentValidation; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using PARR.API.Contracts.V1; -using PARR.API.Contracts.V1.Requests; -using PARR.API.Contracts.V1.Requests.Queries; -using PARR.API.Contracts.V1.Responses; -using PARR.API.Contracts.V1.Responses.Base; -using PARR.API.Controllers.V1.Base; -using PARR.API.Extensions; -using PARR.API.Services.Interfaces; -using PARR.DAL.DomainModels; -using PARR.DAL.Models; -using PARR.DAL.Services.Interfaces; - -namespace PARR.API.Controllers.V1 -{ - public class RobotTemplateHistoryController : BaseApiController - { - private readonly IValidator validator; - private readonly ITemplateService templateService; - private readonly IRobotTemplateHistoryService historyService; - private readonly IMapper mapper; - private readonly IUriService uriService; - - public RobotTemplateHistoryController( - IValidator validator, - ITemplateService templateService, - IRobotTemplateHistoryService historyService, - IMapper mapper, - IUriService uriService - ) - { - this.validator = validator; - this.templateService = templateService; - this.historyService = historyService; - this.mapper = mapper; - this.uriService = uriService; - } - - - /// - /// Получить историю робота шаблонов - /// - /// - /// - /// - [HttpGet(ApiRoutes.RobotTemplateHistory.GetAll)] - public async Task GetAll([FromQuery] PaginationQuery paginationQuery, [FromQuery] RobotTemplateHistoryQuery filter) - { - var paginationFilter = mapper.Map(paginationQuery); - - IQueryable query = historyService.Get() - .Include(t => t.Template) - .Include(t => t.RobotHistoryLevel) - .OrderByDescending(t => t.DateCreated).ThenBy(t => t.IdSeries); - - if (filter.IdSeries != null) - query = query.Where(t => t.IdSeries == filter.IdSeries); - - if (filter.TemplateId != null) - query = query.Where(t => t.TemplateId == filter.TemplateId); - - - var history = await historyService.GetPage(query, paginationFilter).ToListAsync(); - - if (!history.Any()) - return NoContent(); - - var response = mapper.Map>(history); - var paginationResponse = new PagedResponse(response, true).GetPaginatedProps(paginationFilter, query); - - return Ok(paginationResponse); - } - - - /// - /// Добавить историю робота шаблонов - /// - /// - /// - [HttpPost(ApiRoutes.RobotTemplateHistory.Create)] - public async Task Create([FromBody] RobotTemplateHistoryRequest request) - { - var resultValidate = await validator.ValidateAsync(request); - if (!resultValidate.IsValid) - return BadRequest(new Response(resultValidate.Errors)); - - var template = await templateService.GetAsync(request.TemplateId); - - if (template == null) - return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Не найден шаблон с id: {request.TemplateId}" } })); - - if (request.IdSeries == null) - request.IdSeries = Guid.NewGuid(); - - //var historyItem = new RobotTemplateHistory - //{ - // Id = Guid.NewGuid(), - // HistoryLevel = request.HistoryLevel, - // RobotMessage = request.RobotMessage, - // EsppMessage = request.EsppMessage, - // TemplateId = request.TemplateId, - // TemplateStatusCode = template.StatusCode, - // IdSeries = request.IdSeries.Value - //}; - - //if (!await historyService.CreateAsync(historyItem) || !await historyService.CommitAsync()) - // return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Ошибка при добавлении записи в историю" } })); - - //var createdObj = await historyService.Get() - // .Include(t => t.Template) - // .Include(t => t.RobotHistoryLevel) - // .FirstOrDefaultAsync(t => t.Id == historyItem.Id); - - //var response = mapper.Map(createdObj); - //var createdUri = uriService.GetAllUri(ApiRoutes.RobotTemplateHistory.GetAll) + $"?{nameof(RobotTemplateHistoryQuery.IdSeries)}={createdObj!.IdSeries}"; - - //return Created(createdUri, new Response(response, true)); - - return Ok("Доделать"); - } - - } -} diff --git a/PARR.API/MappingProfiles/DomainToResponseProfile.cs b/PARR.API/MappingProfiles/DomainToResponseProfile.cs index 7a63a326..9355d0e1 100644 --- a/PARR.API/MappingProfiles/DomainToResponseProfile.cs +++ b/PARR.API/MappingProfiles/DomainToResponseProfile.cs @@ -87,10 +87,10 @@ namespace PARR.API.MappingProfiles CreateMap(); - CreateMap() + CreateMap() .ForMember(d => d.Level, o => o.MapFrom(s => s.RobotHistoryLevel)) .ForMember(d => d.Date, o => o.MapFrom(s => s.DateCreated)) - .ForMember(d => d.TemplateName, o => o.MapFrom(s => s.Template!.Name)); + .ForMember(d => d.TaskId, o => o.MapFrom(s => s.RobotConfigurationId)); // --- RobotConfiguration --- diff --git a/PARR.API/Validators/RobotHistoryRequestValidator.cs b/PARR.API/Validators/RobotHistoryRequestValidator.cs new file mode 100644 index 00000000..2b76f02a --- /dev/null +++ b/PARR.API/Validators/RobotHistoryRequestValidator.cs @@ -0,0 +1,18 @@ +using FluentValidation; +using PARR.API.Contracts.V1.Requests; +using PARR.DAL.Contracts; + +namespace PARR.API.Validators +{ + public class RobotHistoryRequestValidator : AbstractValidator + { + public RobotHistoryRequestValidator() + { + RuleFor(r => r.HistoryLevel) + .Must(t => t == RobotHistoryLevelEnum.Inforamtion || t == RobotHistoryLevelEnum.Error) + .WithMessage($"Допустимые значения: {(int)RobotHistoryLevelEnum.Inforamtion}, {(int)RobotHistoryLevelEnum.Error}"); + + RuleFor(r => r.TaskId).NotNull().NotEmpty(); + } + } +} diff --git a/PARR.API/Validators/RobotTemplateHistoryRequestValidator.cs b/PARR.API/Validators/RobotTemplateHistoryRequestValidator.cs deleted file mode 100644 index 93be9fbf..00000000 --- a/PARR.API/Validators/RobotTemplateHistoryRequestValidator.cs +++ /dev/null @@ -1,17 +0,0 @@ -using FluentValidation; -using PARR.API.Contracts.V1.Requests; -using PARR.DAL.Contracts; - -namespace PARR.API.Validators -{ - public class RobotTemplateHistoryRequestValidator : AbstractValidator - { - public RobotTemplateHistoryRequestValidator() - { - var levels = new List { (int)RobotHistoryLevelEnum.Start, (int)RobotHistoryLevelEnum.Inforamtion, (int)RobotHistoryLevelEnum.Error, (int)RobotHistoryLevelEnum.Complete, (int)RobotHistoryLevelEnum.Breake }; - RuleFor(r => r.HistoryLevel).Must(t => levels.Contains(t)).WithMessage($"Допустимые значения: {string.Join(", ", levels)}"); - - RuleFor(r => r.TemplateId).NotNull().NotEmpty(); - } - } -} diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index 45de5bc6..125fa912 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -188,8 +188,7 @@ namespace PARR.DAL.Context new { Level = (int)RobotHistoryLevelEnum.Start, Name = RobotHistoryLevelEnum.Start.ToString(), Description = "Робот начал работу " }, new { Level = (int)RobotHistoryLevelEnum.Inforamtion, Name = RobotHistoryLevelEnum.Inforamtion.ToString(), Description = "Информация" }, new { Level = (int)RobotHistoryLevelEnum.Error, Name = RobotHistoryLevelEnum.Error.ToString(), Description = "Ошибка" }, - new { Level = (int)RobotHistoryLevelEnum.Complete, Name = RobotHistoryLevelEnum.Complete.ToString(), Description = "Успешно завершил работу" }, - new { Level = (int)RobotHistoryLevelEnum.Breake, Name = RobotHistoryLevelEnum.Breake.ToString(), Description = "Завершил работу с ошибкой (не отработал до конца)" } + new { Level = (int)RobotHistoryLevelEnum.Complete, Name = RobotHistoryLevelEnum.Complete.ToString(), Description = "Успешно завершил работу" } ); }); diff --git a/PARR.DAL/Contracts/RobotHistoryLevelEnum.cs b/PARR.DAL/Contracts/RobotHistoryLevelEnum.cs index d57a5c19..5cac6410 100644 --- a/PARR.DAL/Contracts/RobotHistoryLevelEnum.cs +++ b/PARR.DAL/Contracts/RobotHistoryLevelEnum.cs @@ -23,11 +23,6 @@ /// /// Успешно завершил работу /// - Complete = 15, - - /// - /// Завершил работу с ошибкой (не отработал до конца) - /// - Breake = 20 + Complete = 15 } } diff --git a/PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.Designer.cs b/PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.Designer.cs new file mode 100644 index 00000000..31e01672 --- /dev/null +++ b/PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.Designer.cs @@ -0,0 +1,2031 @@ +// +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("20231006014239_TblRobotHistoryLevelRmBreake")] + partial class TblRobotHistoryLevelRmBreake + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PARR.DAL.Models.AIHIT.RawDataEK", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AIHID") + .HasColumnType("integer"); + + b.Property("APPType") + .HasColumnType("text"); + + b.Property("AdditionalInfo") + .HasColumnType("text"); + + b.Property("CKBSServerType") + .HasColumnType("text"); + + b.Property("CTSDirection") + .HasColumnType("text"); + + b.Property("ClientOS") + .HasColumnType("text"); + + b.Property("ClientSoftware") + .HasColumnType("text"); + + b.Property("Company") + .HasColumnType("text"); + + b.Property("CreateTime") + .HasColumnType("text"); + + b.Property("DBType") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EKCategory") + .HasColumnType("text"); + + b.Property("EKFindCode") + .HasColumnType("text"); + + b.Property("EKRegister") + .HasColumnType("text"); + + b.Property("EKRevizor") + .HasColumnType("text"); + + b.Property("EKSubCategory") + .HasColumnType("text"); + + b.Property("EKType") + .HasColumnType("text"); + + b.Property("EndExplotationDate") + .HasColumnType("text"); + + b.Property("FullName") + .HasColumnType("text"); + + b.Property("IBServerType") + .HasColumnType("text"); + + b.Property("IP") + .HasColumnType("text"); + + b.Property("InfrastructureServerType") + .HasColumnType("text"); + + b.Property("IsActive") + .HasColumnType("text"); + + b.Property("IsImportant") + .HasColumnType("text"); + + b.Property("IsUnreliableData") + .HasColumnType("character(1)"); + + b.Property("Location") + .HasColumnType("text"); + + b.Property("Metka") + .HasColumnType("text"); + + b.Property("MonitoringServerType") + .HasColumnType("text"); + + b.Property("NetworkName") + .HasColumnType("text"); + + b.Property("NewEKFindCode") + .HasColumnType("text"); + + b.Property("OSType") + .HasColumnType("text"); + + b.Property("OldEKFindCode") + .HasColumnType("text"); + + b.Property("PlannedTimeToRepair") + .HasColumnType("text"); + + b.Property("Prescription") + .HasColumnType("text"); + + b.Property("ProductCode") + .HasColumnType("text"); + + b.Property("ResponseArea") + .HasColumnType("text"); + + b.Property("ResponsibleByEK") + .HasColumnType("text"); + + b.Property("ServiceCode") + .HasColumnType("text"); + + b.Property("ShiftWorkGroup") + .HasColumnType("text"); + + b.Property("ShortName") + .HasColumnType("text"); + + b.Property("StartExplotationDate") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("SysModTime") + .HasColumnType("text"); + + b.Property("SysModUser") + .HasColumnType("text"); + + b.Property("TargetRepairTime") + .HasColumnType("text"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("RawDataEKs", "AIHIT"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AIHIT.Setting", 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("Description") + .HasColumnType("text"); + + b.Property("Group") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Settings", "AIHIT"); + + b.HasData( + new + { + Id = new Guid("b16afd06-605b-499f-9e35-a19586de96b0"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ГВЦ", + Value = "00-ГВЦ" + }, + new + { + Id = new Guid("42a2ec03-da3a-45fc-971e-399910fdc5ae"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ОКТ", + Value = "01-ОКТ" + }, + new + { + Id = new Guid("17efaf65-ae8c-45f1-b187-e6cb1bd6385b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КЛГ", + Value = "10-КЛГ" + }, + new + { + Id = new Guid("51270997-20f6-4a61-85ac-64f6b6dd5dc4"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "МСК", + Value = "17-МСК" + }, + new + { + Id = new Guid("b94f8c38-e78a-494e-81ba-39e4e902ffcc"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ГОР", + Value = "24-ГОР" + }, + new + { + Id = new Guid("52ba20ea-4e7a-4500-939b-e2cff563809a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СЕВ", + Value = "28-СЕВ" + }, + new + { + Id = new Guid("cb9da805-29e9-4e08-b1ed-d4b374920f77"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СКВ", + Value = "51-СКВ" + }, + new + { + Id = new Guid("1943a65c-2060-4b5f-af1f-acec74835481"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЮВСТ", + Value = "58-ЮВСТ" + }, + new + { + Id = new Guid("4d9ef2ee-d4fa-4d28-a93b-6f1fd0a639f9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ПРИВ", + Value = "61-ПРИВ" + }, + new + { + Id = new Guid("f1a54c25-a93a-4fe3-8268-afbcc435b6e9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КБШ", + Value = "63-КБШ" + }, + new + { + Id = new Guid("cc839c48-62bb-46a8-924c-85b5e7a3e245"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СВРД", + Value = "76-СВРД" + }, + new + { + Id = new Guid("c98fb684-ff03-441e-a9c3-ac5071d69857"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЮУР", + Value = "80-ЮУР" + }, + new + { + Id = new Guid("f2684a90-6029-4476-bd3d-e713a8a228d6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЗСИБ", + Value = "83-ЗСИБ" + }, + new + { + Id = new Guid("b3c73162-21ea-42f0-b0e1-3c5076176f8a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КРАСН", + Value = "88-КРАСН" + }, + new + { + Id = new Guid("a8cff6fd-28b7-49f2-a412-9208c10f6516"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ВСИБ", + Value = "92-ВСИБ" + }, + new + { + Id = new Guid("50f66704-4d26-4587-bb1e-dca70c8f4b89"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЗАБ", + Value = "94-ЗАБ" + }, + new + { + Id = new Guid("1fd43634-4a06-4237-9727-edfa6f3eebe8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ДВС", + Value = "96-ДВС" + }, + new + { + Id = new Guid("77c73c0a-8e4d-4676-b6e2-6a112f20e346"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Статус актуальных ЭК", + Group = "Status", + Name = "Exploitation", + Value = "3-В эксплуатации" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationTypeId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationTypeId"); + + b.ToTable("Applications"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("HostId"); + + b.ToTable("ApplicationsInHost"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationType", 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("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ApplicationTypes"); + + b.HasData( + new + { + Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле СП xml АИХ ИТ", + Name = "APP" + }, + new + { + Id = new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле ОС xml АИХ ИТ", + Name = "OS" + }, + new + { + Id = new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле СУБД xml АИХ ИТ", + Name = "DB" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FullDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("Solution") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateDuration") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("WorkId", "ApplicationId") + .IsUnique(); + + b.ToTable("ApplicationsInWorks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EkStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("EkStatuses"); + + b.HasData( + new + { + Code = 1, + Name = "1-Новый" + }, + new + { + Code = 2, + Name = "2-Подготовка к эксплуатации" + }, + new + { + Code = 3, + Name = "3-В эксплуатации" + }, + new + { + Code = 4, + Name = "4-В ремонте" + }, + new + { + Code = 5, + Name = "5-В резерве" + }, + new + { + Code = 6, + Name = "6-Выведен из эксплуатации" + }, + new + { + Code = 7, + Name = "7-Тестовый" + }, + new + { + Code = 9, + Name = "9-В разработке" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", 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("Ek") + .IsRequired() + .HasColumnType("text"); + + b.Property("EkStatusCode") + .HasColumnType("integer"); + + b.Property("IP") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResponseAreaCode") + .HasColumnType("integer"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("EkStatusCode"); + + b.HasIndex("ResponseAreaCode"); + + b.ToTable("Hosts"); + }); + + 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.ToTable("Processes"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("ResponseAreas"); + + b.HasData( + new + { + Code = 96, + Name = "96-ДВС" + }, + new + { + Code = 94, + Name = "94-ЗАБ" + }, + new + { + Code = 92, + Name = "92-ВСИБ" + }, + new + { + Code = 88, + Name = "88-КРАСН" + }, + new + { + Code = 83, + Name = "83-ЗСИБ" + }, + new + { + Code = 80, + Name = "80-ЮУР" + }, + new + { + Code = 76, + Name = "76-СВРД" + }, + new + { + Code = 63, + Name = "63-КБШ" + }, + new + { + Code = 61, + Name = "61-ПРИВ" + }, + new + { + Code = 58, + Name = "58-ЮВСТ" + }, + new + { + Code = 51, + Name = "51-СКВ" + }, + new + { + Code = 28, + Name = "28-СЕВ" + }, + new + { + Code = 24, + Name = "24-ГОР" + }, + new + { + Code = 17, + Name = "17-МСК" + }, + new + { + Code = 10, + Name = "10-КЛГ" + }, + new + { + Code = 1, + Name = "01-ОКТ" + }, + new + { + Code = 99, + Name = "00-ГВЦ" + }); + }); + + 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"); + + 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.ToTable("RobotConfigurations"); + }); + + 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("RobotMessage") + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevel"); + + b.HasIndex("RobotConfigurationId"); + + b.HasIndex("TaskStatusCode"); + + b.ToTable("RobotHistories"); + }); + + 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"); + + b.HasData( + new + { + Level = 1, + Description = "Робот начал работу ", + Name = "Start" + }, + new + { + Level = 5, + Description = "Информация", + Name = "Inforamtion" + }, + 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"); + + 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.RobotTemplateHistory", 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("IdSeries") + .HasColumnType("uuid"); + + b.Property("RobotMessage") + .HasColumnType("text"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("TemplateStatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevel"); + + b.HasIndex("TemplateId"); + + b.HasIndex("TemplateStatusCode"); + + b.ToTable("RobotTemplateHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.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 = "КУЗНЕЦОВ МИХАИЛ ВАЛЕРЬЕВИЧ (IVC_KUZNETSOVMV@DVGD.OAO.RZD)" + }, + new + { + Name = "ClosingCode", + Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "выполнен" + }, + new + { + Name = "Category", + Description = "Категория создаваемого объекта в ЕСПП", + Value = "регламентная работа" + }, + new + { + Name = "TemplatePrefixName", + Description = "Префикс имени шаблона в ЕСПП", + Value = "ПАРР-ДВС-ПТК" + }, + new + { + Name = "RobotAttemptsNumber", + Description = "Количество попыток выполнения задания роботом", + Value = "3" + }, + new + { + Name = "RobotWaitTime", + Description = "Время ожидания выполнения роботом задания", + Value = "00:15:00" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.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("ProcessId"); + + b.ToTable("Subprocesses"); + }); + + 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"); + + 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("ApplicationInWorkId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RobotAttemptsNumber") + .HasColumnType("integer"); + + b.Property("RobotLastStatusUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("RobotStatusCode") + .HasColumnType("integer"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationInWorkId"); + + b.HasIndex("HostId"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("RobotStatusCode"); + + b.HasIndex("StatusCode"); + + b.ToTable("Templates"); + }); + + 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("SubprocessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SubprocessId"); + + b.ToTable("Tnks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationTypeId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationTypeId"); + + b.ToTable("V1_Applications"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationInHost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.Property("V1_ApplicationId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("HostId"); + + b.HasIndex("V1_ApplicationId"); + + b.ToTable("V1_ApplicationsInHost"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", 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("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("V1_ApplicationTypeId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("V1_ApplicationTypeId"); + + b.ToTable("V1_ApplicationTypes"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", 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("HostName") + .HasColumnType("text"); + + b.Property("IP") + .IsRequired() + .HasColumnType("text"); + + b.Property("LinkEK") + .HasColumnType("text"); + + b.Property("RegionalEK") + .HasColumnType("text"); + + b.Property("Responsible") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("V1_Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Frequency") + .HasColumnType("integer"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("JobCategoryId") + .HasColumnType("uuid"); + + b.Property("JobModeId") + .HasColumnType("uuid"); + + b.Property("JobTypeId") + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ScriptName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StartAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("JobCategoryId"); + + b.HasIndex("JobModeId"); + + b.HasIndex("JobTypeId"); + + b.ToTable("V1_Jobs"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobCategory", 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("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("V1_JobCategorys"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobJournal", 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("DateOper") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.Property("Info") + .HasColumnType("text"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("JobStatusId") + .HasColumnType("uuid"); + + b.Property("Other") + .HasColumnType("text"); + + b.Property("TimeOut") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("HostId"); + + b.HasIndex("JobId"); + + b.HasIndex("JobStatusId"); + + b.ToTable("V1_JobJournals"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobMode", 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("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("V1_JobModes"); + + b.HasData( + new + { + Id = new Guid("fba4202c-5bad-49c4-b076-d1ca6e1fb158"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "auto" + }, + new + { + Id = new Guid("7516b952-510d-4aaa-971c-a14b184fc1d5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "manual" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobStatus", 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("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("V1_JobStatuses"); + + b.HasData( + new + { + Id = new Guid("edef6dc3-adad-4c77-8ad1-63bb9052355a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Задание запущено", + Name = "started" + }, + new + { + Id = new Guid("7b945eb6-d885-4570-aff5-8866f1f75ff2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Задание выполнено", + Name = "finished" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobType", 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("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("V1_JobTypes"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", 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("TnkId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TnkId"); + + b.ToTable("Works"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType") + .WithMany("Applications") + .HasForeignKey("ApplicationTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationType"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany("ApplicationsInHosts") + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Host", "Host") + .WithMany("ApplicationsInHosts") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Application"); + + b.Navigation("Host"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany("ApplicationsInWorks") + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Work", "Work") + .WithMany("ApplicationsInWorks") + .HasForeignKey("WorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Application"); + + b.Navigation("Work"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.HasOne("PARR.DAL.Models.EkStatus", "EkStatus") + .WithMany("Hosts") + .HasForeignKey("EkStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.ResponseArea", "ResponseArea") + .WithMany("Hosts") + .HasForeignKey("ResponseAreaCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EkStatus"); + + b.Navigation("ResponseArea"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.HasOne("PARR.DAL.Models.Robot", "Robot") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.RobotStatus", "RobotStatus") + .WithMany() + .HasForeignKey("RobotStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "StatusTask") + .WithMany() + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("RobotConfigurations") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Robot"); + + b.Navigation("RobotStatus"); + + b.Navigation("StatusTask"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b => + { + b.HasOne("PARR.DAL.Models.RobotHistoryLevel", "RobotHistoryLevel") + .WithMany("RobotHistories") + .HasForeignKey("HistoryLevel") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.RobotConfiguration", "RobotConfiguration") + .WithMany("RobotHistories") + .HasForeignKey("RobotConfigurationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "StatusTask") + .WithMany() + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RobotConfiguration"); + + b.Navigation("RobotHistoryLevel"); + + b.Navigation("StatusTask"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotTemplateHistory", b => + { + b.HasOne("PARR.DAL.Models.RobotHistoryLevel", "RobotHistoryLevel") + .WithMany("robotTemplateHistories") + .HasForeignKey("HistoryLevel") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("RobotTemplateHistories") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "StatusTemplate") + .WithMany("RobotTemplateHistories") + .HasForeignKey("TemplateStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RobotHistoryLevel"); + + b.Navigation("StatusTemplate"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.HasOne("PARR.DAL.Models.Process", "Process") + .WithMany("Subprocesses") + .HasForeignKey("ProcessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Process"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork") + .WithMany("Templates") + .HasForeignKey("ApplicationInWorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Host", "Host") + .WithMany("Templates") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.RobotStatus", "RobotStatus") + .WithMany("Templates") + .HasForeignKey("RobotStatusCode"); + + b.HasOne("PARR.DAL.Models.TaskStatus", "StatusTask") + .WithMany("Templates") + .HasForeignKey("StatusCode"); + + b.Navigation("ApplicationsInWork"); + + b.Navigation("Host"); + + b.Navigation("RobotStatus"); + + b.Navigation("StatusTask"); + }); + + 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.V1.V1_Application", b => + { + b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", "ApplicationType") + .WithMany() + .HasForeignKey("ApplicationTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationType"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationInHost", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany() + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.V1.V1_Host", "Host") + .WithMany("ApplicationsInHosts") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.V1.V1_Application", null) + .WithMany("V1_ApplicationsInHosts") + .HasForeignKey("V1_ApplicationId"); + + b.Navigation("Application"); + + b.Navigation("Host"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b => + { + b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", null) + .WithMany("V1_ApplicationTypes") + .HasForeignKey("V1_ApplicationTypeId"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany() + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.V1.V1_JobCategory", "JobCategorye") + .WithMany("Jobs") + .HasForeignKey("JobCategoryId"); + + b.HasOne("PARR.DAL.Models.V1.V1_JobMode", "JobMode") + .WithMany("Jobs") + .HasForeignKey("JobModeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.V1.V1_JobType", "JobType") + .WithMany("Jobs") + .HasForeignKey("JobTypeId"); + + b.Navigation("Application"); + + b.Navigation("JobCategorye"); + + b.Navigation("JobMode"); + + b.Navigation("JobType"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobJournal", b => + { + b.HasOne("PARR.DAL.Models.V1.V1_Host", "Host") + .WithMany("JobJournals") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.V1.V1_Job", "Job") + .WithMany("Journals") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.V1.V1_JobStatus", "Status") + .WithMany("Journals") + .HasForeignKey("JobStatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Host"); + + b.Navigation("Job"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.HasOne("PARR.DAL.Models.Tnk", "Tnk") + .WithMany("Works") + .HasForeignKey("TnkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tnk"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.Navigation("ApplicationsInHosts"); + + b.Navigation("ApplicationsInWorks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + { + b.Navigation("Applications"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EkStatus", b => + { + b.Navigation("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.Navigation("ApplicationsInHosts"); + + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Process", b => + { + b.Navigation("Subprocesses"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b => + { + b.Navigation("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Robot", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b => + { + b.Navigation("RobotHistories"); + + b.Navigation("robotTemplateHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => + { + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.Navigation("Tnks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b => + { + b.Navigation("RobotTemplateHistories"); + + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.Navigation("RobotConfigurations"); + + b.Navigation("RobotTemplateHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.Navigation("Works"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b => + { + b.Navigation("V1_ApplicationsInHosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b => + { + b.Navigation("V1_ApplicationTypes"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", b => + { + b.Navigation("ApplicationsInHosts"); + + b.Navigation("JobJournals"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b => + { + b.Navigation("Journals"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobCategory", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobMode", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobStatus", b => + { + b.Navigation("Journals"); + }); + + modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobType", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.Navigation("ApplicationsInWorks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.cs b/PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.cs new file mode 100644 index 00000000..71ac122d --- /dev/null +++ b/PARR.DAL/Migrations/20231006014239_TblRobotHistoryLevelRmBreake.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + /// + public partial class TblRobotHistoryLevelRmBreake : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "RobotHistoryLevels", + keyColumn: "Level", + keyValue: 20); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "RobotHistoryLevels", + columns: new[] { "Level", "Description", "Name" }, + values: new object[] { 20, "Завершил работу с ошибкой (не отработал до конца)", "Breake" }); + } + } +} diff --git a/PARR.DAL/Migrations/DataContextModelSnapshot.cs b/PARR.DAL/Migrations/DataContextModelSnapshot.cs index 98bf63e1..d5cef6e9 100644 --- a/PARR.DAL/Migrations/DataContextModelSnapshot.cs +++ b/PARR.DAL/Migrations/DataContextModelSnapshot.cs @@ -896,12 +896,6 @@ namespace PARR.DAL.Migrations Level = 15, Description = "Успешно завершил работу", Name = "Complete" - }, - new - { - Level = 20, - Description = "Завершил работу с ошибкой (не отработал до конца)", - Name = "Breake" }); });