diff --git a/PARR.AIHIT/AIHIT/ISyncher.cs b/PARR.AIHIT/AIHIT/ISyncher.cs index 1ed16e0d..4e2913c9 100644 --- a/PARR.AIHIT/AIHIT/ISyncher.cs +++ b/PARR.AIHIT/AIHIT/ISyncher.cs @@ -2,7 +2,6 @@ { public interface ISyncher { - Task InvokeAsync(); Task InvokeFromDatabase(); } } diff --git a/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs b/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs index 668c32a6..a1c47e7f 100644 --- a/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs +++ b/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs @@ -3,8 +3,6 @@ using PARR.AIHIT.MappingProfiles.Resolvers; using PARR.AIHIT.Models; using PARR.DAL.Models; using PARR.DAL.Models.AIHIT; -using PARR.DAL.Models.V1; -using System.Xml; namespace PARR.AIHIT.MappingProfiles { @@ -12,14 +10,14 @@ namespace PARR.AIHIT.MappingProfiles { public RequestToDomain() { - CreateMap() - .ForMember(d => d.HostName, o => o.MapFrom(s => (s.Attributes!["ХОСТ"] != null) ? s.Attributes!["ХОСТ"]!.Value.Trim() : "")) - .ForMember(d => d.IP, o => o.MapFrom(s => s.Attributes!["IP_АДРЕС"]!.Value.Trim())) - .ForMember(d => d.RegionalEK, o => o.MapFrom(s => s.Attributes!["РЕГИОНАЛЬНЫЙ_ЭК"]!.Value.Trim())) - .ForMember(d => d.LinkEK, o => o.MapFrom(s => s.Attributes!["СВЯЗАННЫЙ_ЭК"]!.Value.Trim())) - .ForMember(d => d.Status, o => o.MapFrom(s => s.Attributes!["СТАТУС"]!.Value.Trim())) - .ForMember(d => d.WorkGroup, o => o.MapFrom(s => (s.Attributes!["РАБОЧАЯ_ГР_ОТВ_ЗА_ЭК"] != null) ? s.Attributes!["РАБОЧАЯ_ГР_ОТВ_ЗА_ЭК"]!.Value.Trim() : "")) - .ForMember(d => d.Responsible, o => o.MapFrom(s => s.Attributes!["ОТВЕТСТВЕННЫЙ_ЗА_ЭК"]!.Value.Trim())); + //CreateMap() + // .ForMember(d => d.HostName, o => o.MapFrom(s => (s.Attributes!["ХОСТ"] != null) ? s.Attributes!["ХОСТ"]!.Value.Trim() : "")) + // .ForMember(d => d.IP, o => o.MapFrom(s => s.Attributes!["IP_АДРЕС"]!.Value.Trim())) + // .ForMember(d => d.RegionalEK, o => o.MapFrom(s => s.Attributes!["РЕГИОНАЛЬНЫЙ_ЭК"]!.Value.Trim())) + // .ForMember(d => d.LinkEK, o => o.MapFrom(s => s.Attributes!["СВЯЗАННЫЙ_ЭК"]!.Value.Trim())) + // .ForMember(d => d.Status, o => o.MapFrom(s => s.Attributes!["СТАТУС"]!.Value.Trim())) + // .ForMember(d => d.WorkGroup, o => o.MapFrom(s => (s.Attributes!["РАБОЧАЯ_ГР_ОТВ_ЗА_ЭК"] != null) ? s.Attributes!["РАБОЧАЯ_ГР_ОТВ_ЗА_ЭК"]!.Value.Trim() : "")) + // .ForMember(d => d.Responsible, o => o.MapFrom(s => s.Attributes!["ОТВЕТСТВЕННЫЙ_ЗА_ЭК"]!.Value.Trim())); CreateMap() .ForMember(d => d.Ek, o => o.MapFrom(s => s.EKFindCode))//TODO Определить имя хоста по diff --git a/PARR.AIHIT/AIHIT/Syncher.cs b/PARR.AIHIT/AIHIT/Syncher.cs index f67f5e59..e8a1f36f 100644 --- a/PARR.AIHIT/AIHIT/Syncher.cs +++ b/PARR.AIHIT/AIHIT/Syncher.cs @@ -1,32 +1,19 @@ using AutoMapper; -using MailKit.Search; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using MimeKit; -using PARR.AIHIT.Services; -using PARR.AIHIT.Settings; using PARR.DAL.Contracts; using PARR.DAL.Extensions; using PARR.DAL.Models; using PARR.DAL.Models.AIHIT; -using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.AIHIT; -using PARR.DAL.Services.Interfaces.V1; -using PARR.Mail.Services; using System.Text; -using System.Xml; namespace PARR.AIHIT { internal class Syncher : ISyncher { private readonly ILogger logger; - private readonly IMailService mailService; - private readonly SyncherSettings syncherSettings; - private readonly V1_IHostService V1_hostService; - private readonly V1_IApplicationInHostService V1_appInHostService; - private readonly V1_IApplicationService V1_appService; private readonly IHostService hostService; private readonly IMapper mapper; private readonly IApplicationService appService; @@ -34,26 +21,18 @@ namespace PARR.AIHIT private readonly IApplicationInHostService appInHostService; private readonly IRawDataEKService rawDataEKService; private readonly ISettingService settingService; - private readonly IAIHITService aihitService; public List AppTypes { get; private set; } = new List(); public Syncher( ILogger logger, - IMailService mailService, - SyncherSettings syncherSettings, - V1_IHostService V1_hostService, - V1_IApplicationService V1_appService, - V1_IApplicationTypeService V1_appTypeService, - V1_IApplicationInHostService V1_appInHostService, IHostService hostService, IMapper mapper, IApplicationService appService, IApplicationTypeService appTypeService, IApplicationInHostService appInHostService, IRawDataEKService rawDataEKService, - ISettingService settingService, - IAIHITService aihitService + ISettingService settingService ) { this.hostService = hostService; @@ -63,13 +42,7 @@ namespace PARR.AIHIT this.appInHostService = appInHostService; this.rawDataEKService = rawDataEKService; this.settingService = settingService; - this.aihitService = aihitService; this.logger = logger; - this.mailService = mailService; - this.syncherSettings = syncherSettings; - this.V1_hostService = V1_hostService; - this.V1_appService = V1_appService; - this.V1_appInHostService = V1_appInHostService; } private async Task GetAppTypesAsync() @@ -77,137 +50,6 @@ namespace PARR.AIHIT AppTypes = await appTypeService.Get().ToListAsync(); } - public async Task InvokeAsync() - { - await GetAppTypesAsync(); - - - var messages = await mailService.CheckMailAsync(SearchQuery.NotSeen); - if (!messages.Any()) - { - return; - } - var filtered = messages.Where(m => syncherSettings.IncludeAddressesArray.Any(i => m.Envelope.From.Mailboxes.FirstOrDefault()?.Address == i)).ToList(); - var lastMessage = filtered.OrderByDescending(f => f.Date).First(); - var attachments = await mailService.GetAttachmentsAsync(lastMessage); - - foreach (var attachment in attachments) - { - if (attachment is MessagePart) - { - continue; - } - else - { - using var stream = new MemoryStream(); - ((MimePart)attachment).Content.DecodeTo(stream); - if (stream.Position > 0) stream.Position = 0; - - var fileName = EncodeString(((MimePart)attachment).FileName); - logger.LogInformation($" Получен файл {fileName}"); - if (fileName.Equals("Компонентный состав регионального ЭК.xml")) - { - XmlDocument doc = new XmlDocument(); - doc.Load(stream); - var vms = doc.GetElementsByTagName("Сведения"); - //var hosts = await hostService.Get().ToListAsync(); - foreach (XmlNode vm in vms) - { - var ip = vm?.Attributes?["IP_АДРЕС"]?.Value.Trim(); - if (ip == null) continue; - var regionalEK = vm!.Attributes!["РЕГИОНАЛЬНЫЙ_ЭК"]!.Value.Trim(); - var linkEK = vm!.Attributes!["СВЯЗАННЫЙ_ЭК"]!.Value.Trim(); - if (!linkEK.StartsWith("ВРТ")) continue; - - // var foundHost = await hostService.GetHostAsync(ip, linkEK, regionalEK); - var foundHost = await V1_hostService.GetHostWithAppsAsync(ip, linkEK, regionalEK); - var mappedHost = mapper.Map(vm); - - var hostApplications = await V1_GetAndFillApplicationsAsync(vm); - - if (foundHost == null) - { - // создаем - if (!await V1_hostService.CreateAsync(mappedHost) || !await V1_hostService.CommitAsync()) - { - logger.LogError($"Не удалось создать узел {mappedHost.IP} {mappedHost.RegionalEK}"); - continue; - } - else - logger.LogInformation($"----- Создан Host: {mappedHost.Id}, {mappedHost.LinkEK} -----"); - - - // Синхронизация Applications - await V1_SyncApplicationAndHostAsync(foundHost, hostApplications); - } - else - { - // обновляем - var isChanged = false; - if (!foundHost.RegionalEK!.Equals(mappedHost.RegionalEK)) - { - foundHost.RegionalEK = mappedHost.RegionalEK; isChanged = true; - } - else if (!foundHost.LinkEK!.Equals(mappedHost.LinkEK)) - { - foundHost.LinkEK = mappedHost.LinkEK; - isChanged = true; - } - else if (!foundHost.Status!.Equals(mappedHost.Status)) - { - foundHost.Status = mappedHost.Status; - isChanged = true; - } - else if (!foundHost.WorkGroup!.Equals(mappedHost.WorkGroup)) - { - foundHost.WorkGroup = mappedHost.WorkGroup; - isChanged = true; - } - else if (!foundHost.Responsible!.Equals(mappedHost.Responsible)) - { - foundHost.Responsible = mappedHost.Responsible; - isChanged = true; - } - //else if (!foundHost.OS!.Equals(mappedHost.OS)) - //{ - // foundHost.OS = mappedHost.OS; - // isChanged = true; - //} - //else if (!foundHost.DB!.Equals(mappedHost.DB)) - //{ - // foundHost.DB = mappedHost.DB; - // isChanged = true; - //} - //else if (!foundHost.APP!.Equals(mappedHost.APP)) - //{ - // foundHost.APP = mappedHost.APP; - // isChanged = true; - //} - - if (isChanged) - { - foundHost.DateModified = DateTimeOffset.UtcNow; - if (!await V1_hostService.CommitAsync()) - logger.LogError($"Не удалось обновить узел {mappedHost.IP} {mappedHost.RegionalEK}"); - else - logger.LogInformation($"----- Обновлён Host: {mappedHost.Id}, {mappedHost.LinkEK} -----"); - } - - // Синхронизация Applications - await V1_SyncApplicationAndHostAsync(foundHost, hostApplications, true); - } - } - } - break; - } - } - - //прочитано для всех - foreach (var message in filtered) - { - await mailService.SetAsSeenAsync(message); - } - } public async Task InvokeFromDatabase() { @@ -274,7 +116,7 @@ namespace PARR.AIHIT foreach (var ek in eks) { - if (ek.IP == null) + if (ek.IP == null) continue; var foundHost = await hostService.GetHostWithAppsAsync(ek.IP); @@ -327,93 +169,7 @@ namespace PARR.AIHIT } } } - private async Task V1_SyncApplicationAndHostAsync(V1_Host? host, List hostApplications, bool isUpdateDateModified = false) - { - var isUpdated = false; - if (host == null) - return; - logger.LogInformation($"--- Host: {host.Id}, {host.LinkEK} начало синхронизации приложений ({hostApplications.Count()}) ---"); - - foreach (var changedHostApp in hostApplications) - { - var exist = host.ApplicationsInHosts.FirstOrDefault(a => a.ApplicationId == changedHostApp.Id); - - if (exist == null) - { - //add - logger.LogInformation($"Host: {host.Id}, {host.LinkEK} добавление нового приложения Application {changedHostApp.Name}"); - - var newAppHost = new V1_ApplicationInHost { Id = Guid.NewGuid(), ApplicationId = changedHostApp.Id, HostId = host.Id }; - if (!await V1_appInHostService.CreateAsync(newAppHost)) - logger.LogError($"Не удалось создать ApplicationInHost {changedHostApp.Name}, host: {host.Id}, {host.LinkEK}"); - - isUpdated = true; - } - } - - foreach (var app in host.ApplicationsInHosts) - { - var appToRemove = hostApplications.FirstOrDefault(a => a.Id == app.Id); - - if (appToRemove == null) - { - //todo remove appToRemove - var obj = await V1_appInHostService.Get().FirstOrDefaultAsync(t => t.ApplicationId == app.Id && t.HostId == host.Id); - if (obj != null) - { - logger.LogInformation($"Host: {host.Id}, {host.LinkEK} удаление неактуального приложения Application {app.Application?.Name}"); - V1_appInHostService.Delete(obj); - - isUpdated = true; - } - } - } - - if (isUpdated && isUpdateDateModified) - host.DateModified = DateTimeOffset.UtcNow; - - if (!await appInHostService.CommitAsync()) - logger.LogError($"Не удалось обновить ApplicationInHost для Host: {host.LinkEK}, {host.Id}"); - - logger.LogInformation($"=== Host: {host.Id}, {host.LinkEK} конец синхронизации приложений ==="); - - } - - private async Task> V1_GetAndFillApplicationsAsync(XmlNode vm) - { - logger.LogInformation($"--- Начало парсинга данных о программном обеспечении(СП, БД, ОС) из Xml документа от АИХ ИТ ---"); - var applications = new List(); - - //TODO GetAppFromXML(vm?.Attributes?["СП"]?.Value).ForEach(async item => await CreateAppIfNotExistAsync(item, ApplicationTypesEnum.APP)); - //GetDBFromXML(vm?.Attributes?["СУБД"]?.Value).ForEach(async item => await CreateAppIfNotExistAsync(item, ApplicationTypesEnum.DB)); - //GetOSFromXML(vm?.Attributes?["ОС"]?.Value).ForEach(async item => await CreateAppIfNotExistAsync(item, ApplicationTypesEnum.OS)); - var appList = GetAppFromXML(vm?.Attributes?["СП"]?.Value); - foreach (var app in appList) - { - var created = await V1_CreateAppIfNotExistAsync(app, ApplicationTypesEnum.APP); - if (created != null) - applications.Add(created); - } - var dbList = GetAppFromXML(vm?.Attributes?["СУБД"]?.Value); - foreach (var db in dbList) - { - var created = await V1_CreateAppIfNotExistAsync(db, ApplicationTypesEnum.DB); - if (created != null) - applications.Add(created); - } - var osList = GetAppFromXML(vm?.Attributes?["ОС"]?.Value); - foreach (var os in appList) - { - var created = await V1_CreateAppIfNotExistAsync(os, ApplicationTypesEnum.OS); - if (created != null) - applications.Add(created); - } - - logger.LogInformation($"=== Конец парсинга данных о программном обеспечении(СП, БД, ОС) из Xml документа от АИХ ИТ ==="); - - return applications; - } private async Task SyncApplicationAndHostAsync(Host? host, List hostApplications, bool isUpdateDateModified = false) { @@ -467,6 +223,8 @@ namespace PARR.AIHIT logger.LogInformation($"=== Host: {host.Id} конец синхронизации приложений ==="); } + + private async Task> GetAndFillApplicationsAsync(RawDataEK vm) { logger.LogInformation($"--- Начало парсинга данных о программном обеспечении(СП, БД, ОС) из АИХ ИТ ---"); @@ -508,6 +266,7 @@ namespace PARR.AIHIT return applications; } + private List GetAppFromXML(string? appField) { if (string.IsNullOrEmpty(appField)) @@ -519,6 +278,7 @@ namespace PARR.AIHIT return appList; } + private List GetDBFromXML(string? dbField) { if (string.IsNullOrEmpty(dbField)) @@ -530,6 +290,7 @@ namespace PARR.AIHIT return dbList; } + private List GetOSFromXML(string? osField) { if (string.IsNullOrEmpty(osField)) @@ -541,36 +302,6 @@ namespace PARR.AIHIT return osList; } - private async Task V1_CreateAppIfNotExistAsync(string appName, ApplicationTypesEnum type)//Application application) - { - if (string.IsNullOrEmpty(appName) || string.IsNullOrWhiteSpace(appName)) return null; - - var existApp = await V1_appService.GetByNameAsync(appName); - if (existApp != null) - return existApp; - - //Создаем - var appType = GetAppTypeByName(type); - if (appType == null) - { - logger.LogError($"Не удалось создать запись в таблице Applications: {appName}, так как не получил AppType: {type.ToString()}"); - return null; - } - - var app = new V1_Application - { - Id = Guid.NewGuid(), - Name = appName.Trim(), - ApplicationTypeId = appType.Id - }; - - if (!await V1_appService.CreateAsync(app) || !await V1_appService.CommitAsync()) - logger.LogError($"Не удалось создать запись в таблице Application: {appName}, {app.ToJson()}"); - else - logger.LogInformation($"Создана запись а таблице Application: {appName}, {app.ToJson()}"); - - return await V1_appService.GetAsync(app.Id); - } private async Task CreateAppIfNotExistAsync(string appName, ApplicationTypesEnum type)//Application application) { @@ -603,6 +334,7 @@ namespace PARR.AIHIT return await appService.GetAsync(app.Id); } + private ApplicationType? GetAppTypeByName(ApplicationTypesEnum type) { var existType = AppTypes.FirstOrDefault(t => t.Name == type.ToString()); @@ -612,6 +344,7 @@ namespace PARR.AIHIT return existType; } + private static string EncodeString(string str) { byte[] bStr = Encoding.GetEncoding("koi8r").GetBytes(str); diff --git a/PARR.API/Contracts/V1/ApiRoutes.cs b/PARR.API/Contracts/V1/ApiRoutes.cs index 239ea788..a1afcbcf 100644 --- a/PARR.API/Contracts/V1/ApiRoutes.cs +++ b/PARR.API/Contracts/V1/ApiRoutes.cs @@ -27,20 +27,6 @@ public const string Metrics = Base + "/metrics"; } - public static class Jobs - { - public const string GetAll = Base + "/jobs/"; - - public const string GetByIp = Base + "/jobs/ip/"; - //public const string Get = Base + "/schedulers/" + getParam; - - //public const string GetAreas = Base + "/schedulers/" + getParam + "/areas"; - //public const string GetPlaces = Base + "/schedulers/" + getParam + "/places"; - //public const string GetTemplates = Base + "/schedulers/" + getParam + "/templates"; - - public const string getParam = "{id}"; - } - public static class AgentTask { public const string GetByIp = Base + "/agent-tasks/ip"; diff --git a/PARR.API/Contracts/V1/Requests/Queries/AgentTaskGetByIpQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/AgentTaskGetByIpQuery.cs index 1e196552..a4f06f56 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/AgentTaskGetByIpQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/AgentTaskGetByIpQuery.cs @@ -3,12 +3,12 @@ public class AgentTaskGetByIpQuery { /// - /// По-умолчанию берётся IP-клиента + /// По умолчанию берётся IP-клиента /// public string? Ip { get; set; } /// - /// По-умолчанию расписание на сегодня + /// По умолчанию расписание на сегодня /// public DateTimeOffset? Date { get; set; } } diff --git a/PARR.API/Contracts/V1/Requests/Queries/JobGetAllQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/JobGetAllQuery.cs deleted file mode 100644 index a908f2e3..00000000 --- a/PARR.API/Contracts/V1/Requests/Queries/JobGetAllQuery.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace PARR.API.Contracts.V1.Requests.Queries -{ - public class JobGetAllQuery - { - /// - /// true - вкл задания, false - выкл задания, null - все задания - /// - public bool? IsEnabled { get; set; } - - /// - /// Список запланированных заданий на указанную дату - /// - public DateTimeOffset? StartDatePlanned { get; set; } - } -} diff --git a/PARR.API/Contracts/V1/Requests/Queries/JobGetByIpQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/JobGetByIpQuery.cs deleted file mode 100644 index d0b17884..00000000 --- a/PARR.API/Contracts/V1/Requests/Queries/JobGetByIpQuery.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace PARR.API.Contracts.V1.Requests.Queries -{ - public class JobGetByIpQuery - { - /// - /// По-умолчанию берётся IP-клиента или указанный вручную - /// - public string? Ip { get; set; } - - /// - /// По-умолчанию расписание на сегодня или указанную дату - /// - public DateTimeOffset? Date { get; set; } - - /// - /// Вернуть полностью объект Job в json формате или вернуть краткий список со временем - /// - public bool? IsFullResponse { get; set; } - } -} diff --git a/PARR.API/Contracts/V1/Responses/JobModeResponse.cs b/PARR.API/Contracts/V1/Responses/JobModeResponse.cs deleted file mode 100644 index 7c2737ee..00000000 --- a/PARR.API/Contracts/V1/Responses/JobModeResponse.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace PARR.API.Contracts.V1.Responses -{ - public class JobModeResponse - { - public Guid Id { get; set; } - public required string Name { get; set; } - } -} diff --git a/PARR.API/Contracts/V1/Responses/JobResponse.cs b/PARR.API/Contracts/V1/Responses/JobResponse.cs deleted file mode 100644 index 9fff3474..00000000 --- a/PARR.API/Contracts/V1/Responses/JobResponse.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace PARR.API.Contracts.V1.Responses -{ - public class JobBaseResponse - { - public required string Name { get; set; } - public DateTimeOffset StartAt { get; set; } - public int FrequencyMinute { get; set; } - public required JobModeResponse JobMode { get; set; } - public required string Script { get; set; } - } - - public class JobGetAllResponse : JobBaseResponse - { - public Guid Id { get; set; } - public bool IsEnabled { get; set; } - } - - public class JobResponse - { - - } - - public class JobMinResponse - { - public List Scheduled { get; set; } = new List(); - } - - public class JobMinScheduleResponse - { - public DateTimeOffset StartAt { get; set; } - - public required string Script { get; set; } - - public required string Name { get; set; } - } -} diff --git a/PARR.API/Controllers/V1/JobController.cs b/PARR.API/Controllers/V1/JobController.cs deleted file mode 100644 index bac92efe..00000000 --- a/PARR.API/Controllers/V1/JobController.cs +++ /dev/null @@ -1,254 +0,0 @@ -using AutoMapper; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using PARR.API.Contracts.V1; -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.V1; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.API.Controllers.V1 -{ - public class JobController : BaseApiController - { - private readonly IMapper mapper; - private readonly V1_IJobService jobService; - //private readonly ISchedulerService schedulerService; - private readonly IClientService clientService; - private readonly V1_IHostService v1_hostService; - private readonly V1_IJobJournalService jobJournalService; - - public JobController( - IMapper mapper, - V1_IJobService jobService, - IClientService clientService, - V1_IHostService v1_hostService, - V1_IJobJournalService jobJournalService - ) - { - this.mapper = mapper; - this.jobService = jobService; - //this.schedulerService = schedulerService; - this.clientService = clientService; - this.v1_hostService = v1_hostService; - this.jobJournalService = jobJournalService; - } - - - /// - /// (НЕ РАБОТАЕТ. АДАПТАЦИЯ ПОД НОВУЮ ВЕРСИЮ) Список всех jobов постранично в соотвествии с фильтрами - /// - /// - /// - [HttpGet(ApiRoutes.Jobs.GetAll)] - public async Task GetAll([FromQuery] PaginationQuery paginationQuery, [FromQuery] JobGetAllQuery filter) - { - var paginationFilter = mapper.Map(paginationQuery); - IQueryable query = jobService.Get().Include(t => t.JobMode).OrderBy(s => s.StartAt); - - if (filter.IsEnabled.HasValue) - query = query.Where(t => t.IsEnabled == filter.IsEnabled); - - if (filter.StartDatePlanned.HasValue) - query = query.Where(t => t.StartAt.DateTime.Date <= filter.StartDatePlanned.Value.DateTime.Date); ; - - var jobs = await jobService.GetPage(query, paginationFilter).ToListAsync(); - - if (!jobs.Any()) - return NoContent(); - - var jobResponse = mapper.Map>(jobs); - var paginationResponse = new PagedResponse(jobResponse, true).GetPaginatedProps(paginationFilter, query); - - return Ok(paginationResponse); - } - - - /// - /// (НЕ РАБОТАЕТ. АДАПТАЦИЯ ПОД НОВУЮ ВЕРСИЮ) Список заданий на запуск по IP-адресу клиента исполнения - /// - /// - /// - [HttpGet(ApiRoutes.Jobs.GetByIp)] - public async Task GetByClientIP([FromQuery] JobGetByIpQuery requestQuery) - { - var ip = requestQuery.Ip ?? clientService.GetClientIp()?.ToString(); - if (string.IsNullOrEmpty(ip)) - return BadRequest(new Response(false, new List { new ErrorModel { Message = "Client IP address is null." } })); - - var date = requestQuery.Date ?? DateTimeOffset.UtcNow; - - // С одним IP может быть несколько информационных систем, соответственного а таблице храниться несколько записей хостов с одинаковым IP - var hosts = await v1_hostService.Get().Where(h => h.IP == ip).ToListAsync(); - - var hostJobsDict = new Dictionary>(); - foreach (var host in hosts) - { - var jobsHost = await jobService.Get() - .Include(a => a.Application).ThenInclude(ah => ah.ApplicationsInHosts)/*.ThenInclude(h => h.Host)*/ - .Include(jm => jm.JobMode) - .AsSplitQuery() - .Where(j => j.Application != null && j.Application.ApplicationsInHosts.Any(ah => ah.HostId == host.Id) && j.IsEnabled && j.StartAt <= date) - .ToListAsync(); - - if (jobsHost.Any()) - { - hostJobsDict.Add(host, jobsHost); - } - } - - var jobsList = new List(); - var jobsToResponse = new List(); - - foreach (var hostAndJobs in hostJobsDict) - { - foreach (var item in hostAndJobs.Value) - { - if (!jobsList.Contains(item)) - { - jobsList.Add(item); - - var plannedJobs = await GetListJobsAsync(item, hostAndJobs.Key, date); - jobsToResponse.AddRange(plannedJobs); - } - } - } - - jobsToResponse = jobsToResponse.OrderBy(t => t.StartAt).ToList(); - - if (!jobsToResponse.Any()) - return NoContent(); - - if (requestQuery.IsFullResponse == true) - { - // возврат самого полного ответа - var jobResponse = mapper.Map>(jobsToResponse); - return Ok(new Response>(jobResponse, true)); - } - - - // возврат минимального ответа - return Ok(mapper.Map(jobsToResponse)); - - //try - //{ - // return Ok(jobsToResponse.ToDictionary(t => t.ScriptName, d => d.StartAt)); - //} - //catch (ArgumentException ex) - //{ - // return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Не могу создать json объект с одинаковым значением ключа (ScriptName). {ex.Message}" } })); - //} - } - - - private async Task> GetListJobsAsync(V1_Job job, V1_Host host, DateTimeOffset queryDate) - { - var jobs = new List(); - - #region description - // freaq > суток или нет? - - //----------- - // меньше суток - //фрек=10 мин - // старт эт = 17:00 и != сегодня - - //цикл 17:00 -10мин пока не начнется вчерашний день - //цикл 17:00 +10мин пока не начентся завтрашний день - - // елси страт эт == сегодня - //цикл 17:00 +10мин пока не начентся завтрашний день - - //----------- - - // ------freaq больше суток-------- - // журнал берем последнее событие (че там со статусами? не надо пока), к нему пребавляем фрек, и смотрим == сегодня или нет, если сегодня то добавляем - // -------------- - #endregion - - var allDayMinutes = 1440; - if (job.Frequency >= allDayMinutes) - { - //больше или = суток - - var lastJournalItem = await jobJournalService.GetLastAsync(job.Id, host.Id, queryDate); - if (lastJournalItem == null) - { - // если в истории нет записей, то запускаем сегодня в стартЭт - // берем квери дэйт и ем задаем время из Джобс СтартЭт - var startDateTimeNext = new DateTimeOffset(queryDate.Year, queryDate.Month, queryDate.Day, job.StartAt.Hour, job.StartAt.Minute, job.StartAt.Second, new TimeSpan(0)); - var jobToAdded = mapper.Map(job);//new Job { StartAt = startDateTimeNext }; - jobToAdded.StartAt = startDateTimeNext; - - jobs.Add(jobToAdded); - } - else - { - var startDateNext = lastJournalItem.DateOper.DateTime.AddMinutes(job.Frequency); - if (startDateNext.Date == queryDate.DateTime.Date) - { - // если берем прошлую последнюю операцию из журнала, и к ней прибавить фрекунси, то время следующего старта сдвинется на время выполнения прошлого задания - // чтобы это избежать, берем квери дэйт и ем задаем время из Джобс СтартЭт - var startDateTimeNext = new DateTimeOffset(queryDate.Year, queryDate.Month, queryDate.Day, job.StartAt.Hour, job.StartAt.Minute, job.StartAt.Second, new TimeSpan(0)); - var jobToAdded = mapper.Map(job); - jobToAdded.StartAt = startDateTimeNext; - jobs.Add(jobToAdded); - } - } - } - else - { - //меньше суток - var startAtMinutes = (job.StartAt - job.StartAt.StartOfDay()).TotalMinutes; - - // если дата старта != queryDate - if (job.StartAt.DateTime.Date != queryDate.DateTime.Date) - { - // отнимаем пока не наступили прошлые стуки - var min = startAtMinutes; - while (min >= 0) - { - //var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) }; - var jobToAdded = mapper.Map(job); - jobToAdded.StartAt = queryDate.StartOfDay().AddMinutes(min); - jobs.Add(jobToAdded); - min = min - job.Frequency; - } - - // прибавляем пока не наступят след сутки - min = startAtMinutes + job.Frequency; - while (min < allDayMinutes) - { - //var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) }; - var jobToAdded = mapper.Map(job); - jobToAdded.StartAt = queryDate.StartOfDay().AddMinutes(min); - jobs.Add(jobToAdded); - min = min + job.Frequency; - } - } - else - { - // = queryDate - // прибавляем пока не наступят след сутки - var min = startAtMinutes; - while (min < allDayMinutes) - { - //var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) }; - var jobToAdded = mapper.Map(job); - jobToAdded.StartAt = queryDate.StartOfDay().AddMinutes(min); - jobs.Add(jobToAdded); - min = min + job.Frequency; - } - } - } - - return jobs; - } - - } -} diff --git a/PARR.API/MappingProfiles/DomainToDomainProfile.cs b/PARR.API/MappingProfiles/DomainToDomainProfile.cs index 498b6a71..5197fd08 100644 --- a/PARR.API/MappingProfiles/DomainToDomainProfile.cs +++ b/PARR.API/MappingProfiles/DomainToDomainProfile.cs @@ -1,5 +1,4 @@ using AutoMapper; -using PARR.DAL.Models.V1; namespace PARR.API.MappingProfiles { @@ -7,7 +6,7 @@ namespace PARR.API.MappingProfiles { public DomainToDomainProfile() { - CreateMap(); + //CreateMap(); } } } diff --git a/PARR.API/MappingProfiles/DomainToResponseProfile.cs b/PARR.API/MappingProfiles/DomainToResponseProfile.cs index 70d45115..d76c4fa7 100644 --- a/PARR.API/MappingProfiles/DomainToResponseProfile.cs +++ b/PARR.API/MappingProfiles/DomainToResponseProfile.cs @@ -4,7 +4,6 @@ using PARR.API.MappingProfiles.Resolvers; using PARR.BLL.Helpers; using PARR.DAL.DomainModels; using PARR.DAL.Models; -using PARR.DAL.Models.V1; namespace PARR.API.MappingProfiles { @@ -12,23 +11,6 @@ namespace PARR.API.MappingProfiles { public DomainToResponseProfile() { - // --- Job --- - CreateMap() - .Include() - .ForMember(d => d.FrequencyMinute, o => o.MapFrom(s => s.Frequency)) - .ForMember(d => d.Script, o => o.MapFrom(s => s.ScriptName)); - - CreateMap(); - - CreateMap, JobMinResponse>() - .ForMember(d => d.Scheduled, o => o.MapFrom(s => s)); - - CreateMap() - .ForMember(d => d.Script, o => o.MapFrom(s => s.ScriptName)); - // === Job === - - CreateMap(); - // --- Template --- CreateMap() .ForMember(d => d.Work, o => o.MapFrom(s => s.ApplicationsInWork!.Work)) diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index a2f73990..2e5d996c 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -2,8 +2,6 @@ using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Models.AIHIT; -using PARR.DAL.Models.V1; -using System; namespace PARR.DAL.Context { @@ -11,19 +9,6 @@ namespace PARR.DAL.Context { public DataContext(DbContextOptions options) : base(options) { } - #region v1 - public DbSet JobTypes { get; set; } - public DbSet JobCategories { get; set; } - public DbSet JobModes { get; set; } - public DbSet JobStatuses { get; set; } - public DbSet V1_Hosts { get; set; } - public DbSet Jobs { get; set; } - public DbSet JobJournals { get; set; } - public DbSet V1_Applications { get; set; } - public DbSet V1_ApplicationTypes { get; set; } - public DbSet V1_ApplicationsInHosts { get; set; } - #endregion - public DbSet Hosts { get; set; } public DbSet EkStatuses { get; set; } public DbSet ResponseAreas { get; set; } @@ -64,23 +49,6 @@ namespace PARR.DAL.Context var dateCreated = new DateTimeOffset(2023, 05, 01, 0, 0, 0, new TimeSpan(0)); - modelBuilder.Entity(f => - { - f.HasData( - new() { Id = new Guid("FBA4202C-5BAD-49C4-B076-D1CA6E1FB158"), DateCreated = dateCreated, DateModified = null, Name = JobModeEnum.auto.ToString() }, - new() { Id = new Guid("7516B952-510D-4AAA-971C-A14B184FC1D5"), DateCreated = dateCreated, DateModified = null, Name = JobModeEnum.manual.ToString() } - ); - }); - - modelBuilder.Entity(f => - { - f.HasData( - new() { Id = new Guid("EDEF6DC3-ADAD-4C77-8AD1-63BB9052355A"), DateCreated = dateCreated, DateModified = null, Name = JobStatusEnum.started.ToString(), Description = "Задание запущено" }, - new() { Id = new Guid("7B945EB6-D885-4570-AFF5-8866F1F75FF2"), DateCreated = dateCreated, DateModified = null, Name = JobStatusEnum.finished.ToString(), Description = "Задание выполнено" } - ); - }); - - modelBuilder.Entity(f => { f.HasData( @@ -179,6 +147,7 @@ namespace PARR.DAL.Context ); }); + #region Robots modelBuilder.Entity(f => { @@ -208,6 +177,8 @@ namespace PARR.DAL.Context ); }); + #endregion + #region EsppSchedules modelBuilder.Entity(f => diff --git a/PARR.DAL/Contracts/JobModeEnum.cs b/PARR.DAL/Contracts/JobModeEnum.cs deleted file mode 100644 index 98bc70b7..00000000 --- a/PARR.DAL/Contracts/JobModeEnum.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace PARR.DAL.Contracts -{ - public enum JobModeEnum - { - auto, - manual - } -} diff --git a/PARR.DAL/Contracts/JobStatusEnum.cs b/PARR.DAL/Contracts/JobStatusEnum.cs deleted file mode 100644 index 456cf3f2..00000000 --- a/PARR.DAL/Contracts/JobStatusEnum.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace PARR.DAL.Contracts -{ - public enum JobStatusEnum - { - started, - finished - } -} diff --git a/PARR.DAL/Migrations/20231017233652_RemoveTblsV1.Designer.cs b/PARR.DAL/Migrations/20231017233652_RemoveTblsV1.Designer.cs new file mode 100644 index 00000000..12d605dc --- /dev/null +++ b/PARR.DAL/Migrations/20231017233652_RemoveTblsV1.Designer.cs @@ -0,0 +1,2423 @@ +// +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("20231017233652_RemoveTblsV1")] + partial class RemoveTblsV1 + { + /// + 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("AgentName") + .HasColumnType("text"); + + b.Property("AgentScript") + .HasColumnType("text"); + + b.Property("AgentTimeOutSec") + .HasColumnType("integer"); + + 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("IsAgent") + .HasColumnType("boolean"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + 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.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"); + + 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.DAL.Models.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"); + + 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.DAL.Models.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"); + + 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.DAL.Models.EsppSchTypeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.ToTable("EsppSchTypeValues"); + + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + TypeId = 1, + Value = "Каждые 98 часов" + }, + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + 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)), + TypeId = 6, + Value = "Декабря" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b => + { + b.Property("ApplicationsInWorkId") + .HasColumnType("uuid"); + + b.Property("TypeValueId") + .HasColumnType("uuid"); + + b.Property("TypeConfigId") + .HasColumnType("uuid"); + + b.HasKey("ApplicationsInWorkId", "TypeValueId", "TypeConfigId"); + + b.HasIndex("TypeConfigId"); + + b.HasIndex("TypeValueId"); + + b.ToTable("EsppSchValues"); + }); + + 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.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" + }, + new + { + Name = "ScheduleTimezone", + Description = "Расписание регламентной работы - В каком часовом поясе", + Value = "MSK" + }, + new + { + Name = "ScheduleExclude", + Description = "Расписание регламентной работы - Тип исключения", + Value = "Нет исключений" + }, + new + { + Name = "ScheduleRepeatRange", + Description = "Расписание регламентной работы - Диапазн повторов", + Value = "Отсутствует дата завершения" + }); + }); + + 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("ScheduleEsppId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationInWorkId"); + + b.HasIndex("HostId"); + + b.HasIndex("Name") + .IsUnique(); + + 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.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.EsppSchTypeConfig", 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.ApplicationsInWork", "ApplicationsInWork") + .WithMany("EsppSchValues") + .HasForeignKey("ApplicationsInWorkId") + .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("ApplicationsInWork"); + + b.Navigation("EsppSchTypeConfig"); + + b.Navigation("EsppSchTypeValue"); + }); + + 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("RobotConfigurations") + .HasForeignKey("RobotStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "TaskStatus") + .WithMany("RobotConfigurations") + .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("TaskStatus"); + + 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("RobotHistories") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RobotConfiguration"); + + b.Navigation("RobotHistoryLevel"); + + b.Navigation("StatusTask"); + }); + + 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.Navigation("ApplicationsInWork"); + + b.Navigation("Host"); + }); + + 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.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("EsppSchValues"); + + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EkStatus", b => + { + b.Navigation("Hosts"); + }); + + 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.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"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.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("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.Navigation("Works"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.Navigation("ApplicationsInWorks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PARR.DAL/Migrations/20231017233652_RemoveTblsV1.cs b/PARR.DAL/Migrations/20231017233652_RemoveTblsV1.cs new file mode 100644 index 00000000..5f5a181a --- /dev/null +++ b/PARR.DAL/Migrations/20231017233652_RemoveTblsV1.cs @@ -0,0 +1,365 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace PARR.DAL.Migrations +{ + /// + public partial class RemoveTblsV1 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "V1_ApplicationsInHost"); + + migrationBuilder.DropTable( + name: "V1_JobJournals"); + + migrationBuilder.DropTable( + name: "V1_Applications"); + + migrationBuilder.DropTable( + name: "V1_Hosts"); + + migrationBuilder.DropTable( + name: "V1_JobStatuses"); + + migrationBuilder.DropTable( + name: "V1_Jobs"); + + migrationBuilder.DropTable( + name: "V1_ApplicationTypes"); + + migrationBuilder.DropTable( + name: "V1_JobCategorys"); + + migrationBuilder.DropTable( + name: "V1_JobModes"); + + migrationBuilder.DropTable( + name: "V1_JobTypes"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "V1_ApplicationTypes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + Description = table.Column(type: "text", nullable: true), + Name = table.Column(type: "text", nullable: false), + V1_ApplicationTypeId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_ApplicationTypes", x => x.Id); + table.ForeignKey( + name: "FK_V1_ApplicationTypes_V1_ApplicationTypes_V1_ApplicationTypeId", + column: x => x.V1_ApplicationTypeId, + principalTable: "V1_ApplicationTypes", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "V1_Hosts", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + HostName = table.Column(type: "text", nullable: true), + IP = table.Column(type: "text", nullable: false), + LinkEK = table.Column(type: "text", nullable: true), + RegionalEK = table.Column(type: "text", nullable: true), + Responsible = table.Column(type: "text", nullable: true), + Status = table.Column(type: "text", nullable: true), + WorkGroup = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_Hosts", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "V1_JobCategorys", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + Description = table.Column(type: "text", nullable: true), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_JobCategorys", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "V1_JobModes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_JobModes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "V1_JobStatuses", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + Description = table.Column(type: "text", nullable: true), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_JobStatuses", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "V1_JobTypes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + Description = table.Column(type: "text", nullable: true), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_JobTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "V1_Applications", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationTypeId = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_Applications", x => x.Id); + table.ForeignKey( + name: "FK_V1_Applications_V1_ApplicationTypes_ApplicationTypeId", + column: x => x.ApplicationTypeId, + principalTable: "V1_ApplicationTypes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "V1_Jobs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: false), + JobCategoryId = table.Column(type: "uuid", nullable: true), + JobModeId = table.Column(type: "uuid", nullable: false), + JobTypeId = table.Column(type: "uuid", nullable: true), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + Frequency = table.Column(type: "integer", nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + Name = table.Column(type: "text", nullable: false), + ScriptName = table.Column(type: "text", nullable: false), + StartAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_Jobs", x => x.Id); + table.ForeignKey( + name: "FK_V1_Jobs_Applications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "Applications", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_V1_Jobs_V1_JobCategorys_JobCategoryId", + column: x => x.JobCategoryId, + principalTable: "V1_JobCategorys", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_V1_Jobs_V1_JobModes_JobModeId", + column: x => x.JobModeId, + principalTable: "V1_JobModes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_V1_Jobs_V1_JobTypes_JobTypeId", + column: x => x.JobTypeId, + principalTable: "V1_JobTypes", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "V1_ApplicationsInHost", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: false), + HostId = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + V1_ApplicationId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_ApplicationsInHost", x => x.Id); + table.ForeignKey( + name: "FK_V1_ApplicationsInHost_Applications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "Applications", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_V1_ApplicationsInHost_V1_Applications_V1_ApplicationId", + column: x => x.V1_ApplicationId, + principalTable: "V1_Applications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_V1_ApplicationsInHost_V1_Hosts_HostId", + column: x => x.HostId, + principalTable: "V1_Hosts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "V1_JobJournals", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + HostId = table.Column(type: "uuid", nullable: false), + JobId = table.Column(type: "uuid", nullable: false), + JobStatusId = table.Column(type: "uuid", nullable: false), + DateCreated = table.Column(type: "timestamp with time zone", nullable: false), + DateModified = table.Column(type: "timestamp with time zone", nullable: true), + DateOper = table.Column(type: "timestamp with time zone", nullable: false), + Info = table.Column(type: "text", nullable: true), + Other = table.Column(type: "text", nullable: true), + TimeOut = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_V1_JobJournals", x => x.Id); + table.ForeignKey( + name: "FK_V1_JobJournals_V1_Hosts_HostId", + column: x => x.HostId, + principalTable: "V1_Hosts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_V1_JobJournals_V1_JobStatuses_JobStatusId", + column: x => x.JobStatusId, + principalTable: "V1_JobStatuses", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_V1_JobJournals_V1_Jobs_JobId", + column: x => x.JobId, + principalTable: "V1_Jobs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.InsertData( + table: "V1_JobModes", + columns: new[] { "Id", "DateCreated", "DateModified", "Name" }, + values: new object[,] + { + { new Guid("7516b952-510d-4aaa-971c-a14b184fc1d5"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "manual" }, + { new Guid("fba4202c-5bad-49c4-b076-d1ca6e1fb158"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "auto" } + }); + + migrationBuilder.InsertData( + table: "V1_JobStatuses", + columns: new[] { "Id", "DateCreated", "DateModified", "Description", "Name" }, + values: new object[,] + { + { new Guid("7b945eb6-d885-4570-aff5-8866f1f75ff2"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Задание выполнено", "finished" }, + { new Guid("edef6dc3-adad-4c77-8ad1-63bb9052355a"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Задание запущено", "started" } + }); + + migrationBuilder.CreateIndex( + name: "IX_V1_Applications_ApplicationTypeId", + table: "V1_Applications", + column: "ApplicationTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_ApplicationsInHost_ApplicationId", + table: "V1_ApplicationsInHost", + column: "ApplicationId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_ApplicationsInHost_HostId", + table: "V1_ApplicationsInHost", + column: "HostId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_ApplicationsInHost_V1_ApplicationId", + table: "V1_ApplicationsInHost", + column: "V1_ApplicationId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_ApplicationTypes_V1_ApplicationTypeId", + table: "V1_ApplicationTypes", + column: "V1_ApplicationTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_JobJournals_HostId", + table: "V1_JobJournals", + column: "HostId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_JobJournals_JobId", + table: "V1_JobJournals", + column: "JobId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_JobJournals_JobStatusId", + table: "V1_JobJournals", + column: "JobStatusId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_Jobs_ApplicationId", + table: "V1_Jobs", + column: "ApplicationId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_Jobs_JobCategoryId", + table: "V1_Jobs", + column: "JobCategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_Jobs_JobModeId", + table: "V1_Jobs", + column: "JobModeId"); + + migrationBuilder.CreateIndex( + name: "IX_V1_Jobs_JobTypeId", + table: "V1_Jobs", + column: "JobTypeId"); + } + } +} diff --git a/PARR.DAL/Migrations/DataContextModelSnapshot.cs b/PARR.DAL/Migrations/DataContextModelSnapshot.cs index 7a47def5..8c4f255e 100644 --- a/PARR.DAL/Migrations/DataContextModelSnapshot.cs +++ b/PARR.DAL/Migrations/DataContextModelSnapshot.cs @@ -2037,353 +2037,6 @@ namespace PARR.DAL.Migrations 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") @@ -2641,105 +2294,6 @@ namespace PARR.DAL.Migrations 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") @@ -2856,48 +2410,6 @@ namespace PARR.DAL.Migrations 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"); diff --git a/PARR.DAL/Models/V1/V1_Application.cs b/PARR.DAL/Models/V1/V1_Application.cs deleted file mode 100644 index 0ae1f1d9..00000000 --- a/PARR.DAL/Models/V1/V1_Application.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_Applications")] - public class V1_Application : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - public required string Name { get; set; } - - public Guid ApplicationTypeId { get; set; } - [ForeignKey(nameof(ApplicationTypeId))] - public V1_ApplicationType? ApplicationType { get; set; } - - - public ICollection V1_ApplicationsInHosts { get; set; } = new HashSet(); - //public ICollection Applications { get;set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/V1/V1_ApplicationInHost.cs b/PARR.DAL/Models/V1/V1_ApplicationInHost.cs deleted file mode 100644 index 292a424e..00000000 --- a/PARR.DAL/Models/V1/V1_ApplicationInHost.cs +++ /dev/null @@ -1,23 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_ApplicationsInHost")] - public class V1_ApplicationInHost : IBase - { - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - - public Guid ApplicationId { get; set; } - - [ForeignKey(nameof(ApplicationId))] - public Application? Application { get; set; } - - public Guid HostId { get; set; } - - [ForeignKey(nameof(HostId))] - public V1_Host? Host { get; set; } - } -} diff --git a/PARR.DAL/Models/V1/V1_ApplicationType.cs b/PARR.DAL/Models/V1/V1_ApplicationType.cs deleted file mode 100644 index 872986df..00000000 --- a/PARR.DAL/Models/V1/V1_ApplicationType.cs +++ /dev/null @@ -1,18 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_ApplicationTypes")] - public class V1_ApplicationType : IBase - { - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - public required string Name { get; set; } - public string? Description { get; set; } - - - public ICollection V1_ApplicationTypes { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/V1/V1_Host.cs b/PARR.DAL/Models/V1/V1_Host.cs deleted file mode 100644 index 19b59390..00000000 --- a/PARR.DAL/Models/V1/V1_Host.cs +++ /dev/null @@ -1,27 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_Hosts")] - public class V1_Host : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - public string? HostName { get; set; } - public required string IP { get; set; } - public string? RegionalEK { get; set; } - public string? LinkEK { get; set; } - public string? Status { get; set; } - public string? WorkGroup { get; set; } - public string? Responsible { get; set; } - - - - public ICollection JobJournals { get; set; } = new HashSet(); - public ICollection ApplicationsInHosts { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/V1/V1_Job.cs b/PARR.DAL/Models/V1/V1_Job.cs deleted file mode 100644 index f3b98d7e..00000000 --- a/PARR.DAL/Models/V1/V1_Job.cs +++ /dev/null @@ -1,50 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_Jobs")] - public class V1_Job : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - public required string Name { get; set; } - public required string ScriptName { get; set; } - - - public Guid JobModeId { get; set; } - [ForeignKey(nameof(JobModeId))] - public V1_JobMode? JobMode { get; set; } - - public Guid? JobCategoryId { get; set; } - [ForeignKey(nameof(JobCategoryId))] - public V1_JobCategory? JobCategorye { get; set; } - - public Guid? JobTypeId { get; set; } - [ForeignKey(nameof(JobTypeId))] - public V1_JobType? JobType { get; set; } - - public Guid ApplicationId { get; set; } - [ForeignKey(nameof(ApplicationId))] - public Application? Application { get; set; } - /// - /// Частота запуска Job в минутах - /// - public int Frequency { get; set; } - /// - /// В режиме manual значит время регистрации регламентной работы АСУ ЕСПП, в auto - время старта Job. - /// - public DateTimeOffset StartAt { get; set; } - /// - /// Активация Job - /// - public bool IsEnabled { get; set; } - - - public ICollection Journals { get; set; } = new HashSet(); - - } -} diff --git a/PARR.DAL/Models/V1/V1_JobCategory.cs b/PARR.DAL/Models/V1/V1_JobCategory.cs deleted file mode 100644 index aa793de0..00000000 --- a/PARR.DAL/Models/V1/V1_JobCategory.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_JobCategorys")] - public class V1_JobCategory : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// app, db - /// - public required string Name { get; set; } - public string? Description { get; set; } - - - - public ICollection Jobs { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/V1/V1_JobJournal.cs b/PARR.DAL/Models/V1/V1_JobJournal.cs deleted file mode 100644 index 0b985492..00000000 --- a/PARR.DAL/Models/V1/V1_JobJournal.cs +++ /dev/null @@ -1,39 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_JobJournals")] - public class V1_JobJournal : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - public DateTimeOffset DateOper { get; set; } - public string? Other { get; set; } - //Возможно нужно перенести в Job - public int? TimeOut { get; set; } - //Возможно нужно перенести в Job - public string? Info { get; set; } - - - - public Guid JobStatusId { get; set; } - - [ForeignKey(nameof(JobStatusId))] - public V1_JobStatus? Status { get; set; } - - - public Guid HostId { get; set; } - - [ForeignKey(nameof(HostId))] - public V1_Host? Host { get; set; } - - - public Guid JobId { get; set; } - [ForeignKey(nameof(JobId))] - public V1_Job? Job { get; set; } - } -} diff --git a/PARR.DAL/Models/V1/V1_JobMode.cs b/PARR.DAL/Models/V1/V1_JobMode.cs deleted file mode 100644 index ceae9da9..00000000 --- a/PARR.DAL/Models/V1/V1_JobMode.cs +++ /dev/null @@ -1,23 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_JobModes")] - public class V1_JobMode : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// manual, auto - /// - public required string Name { get; set; } - - - - public ICollection Jobs { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/V1/V1_JobStatus.cs b/PARR.DAL/Models/V1/V1_JobStatus.cs deleted file mode 100644 index 0e66419d..00000000 --- a/PARR.DAL/Models/V1/V1_JobStatus.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_JobStatuses")] - public class V1_JobStatus : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// started, finished, timeout, error - /// - public required string Name { get; set; } - public string? Description { get; set; } - - - - public ICollection Journals { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/V1/V1_JobType.cs b/PARR.DAL/Models/V1/V1_JobType.cs deleted file mode 100644 index 788be86b..00000000 --- a/PARR.DAL/Models/V1/V1_JobType.cs +++ /dev/null @@ -1,23 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - [Table("V1_JobTypes")] - public class V1_JobType : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// log-rotate, vacuum-psqld - /// - public required string Name { get; set; } - public string? Description { get; set; } - - - public ICollection Jobs { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/V1/V1_Scheduler.cs b/PARR.DAL/Models/V1/V1_Scheduler.cs deleted file mode 100644 index 05a99b9e..00000000 --- a/PARR.DAL/Models/V1/V1_Scheduler.cs +++ /dev/null @@ -1,19 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models.V1 -{ - //[Table("Schedulers")] - //public class Scheduler : IBase - //{ - // //[Key] - // //public Guid Id { get; set; } - // //public DateTimeOffset DateCreated { get; set; } - // //public DateTimeOffset? DateModified { get; set; } - // //public string? Name { get; set; } - // //public int Frequency { get; set; } - // //public required DateTimeOffset StartAt { get; set; } - // //public bool IsEnabled { get; set; } - //} -} diff --git a/PARR.DAL/ParrDalInstaller.cs b/PARR.DAL/ParrDalInstaller.cs index 137b34f8..823822e0 100644 --- a/PARR.DAL/ParrDalInstaller.cs +++ b/PARR.DAL/ParrDalInstaller.cs @@ -7,10 +7,8 @@ using PARR.DAL.Contracts; using PARR.DAL.Services.Implementation; using PARR.DAL.Services.Implementations; using PARR.DAL.Services.Implementations.AIHIT; -using PARR.DAL.Services.Implementations.V1; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.AIHIT; -using PARR.DAL.Services.Interfaces.V1; using PARR.DAL.TransformServices; namespace PARR.DAL @@ -31,7 +29,7 @@ namespace PARR.DAL .UseNpgsql(configuration.GetConnectionString("DefaultConnection")) ); - services.AddTransient(); + // Entity services services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -42,11 +40,6 @@ namespace PARR.DAL services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/PARR.DAL/Services/Implementations/HostService.cs b/PARR.DAL/Services/Implementations/HostService.cs index 34fdd3fb..22fb16eb 100644 --- a/PARR.DAL/Services/Implementations/HostService.cs +++ b/PARR.DAL/Services/Implementations/HostService.cs @@ -35,7 +35,7 @@ namespace PARR.DAL.Services.Implementations // return null; //} return await EntitySet - .Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType) + .Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t!.ApplicationType) .AsSplitQuery() .FirstOrDefaultAsync(h => h.IP == IP); } diff --git a/PARR.DAL/Services/Implementations/V1/V1_ApplicationInHostService.cs b/PARR.DAL/Services/Implementations/V1/V1_ApplicationInHostService.cs deleted file mode 100644 index 0bf159e1..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_ApplicationInHostService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_ApplicationInHostService : BaseService, V1_IApplicationInHostService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_ApplicationInHostService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - - protected override DbSet EntitySet => dataContext.V1_ApplicationsInHosts; - - protected override DataContext EntitiContext => dataContext; - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_ApplicationService.cs b/PARR.DAL/Services/Implementations/V1/V1_ApplicationService.cs deleted file mode 100644 index 2f9dde3e..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_ApplicationService.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_ApplicationService : BaseService, V1_IApplicationService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_ApplicationService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - - protected override DbSet EntitySet => dataContext.V1_Applications; - - protected override DataContext EntitiContext => dataContext; - - public async Task GetByNameAsync(string appName) - { - return await EntitySet.FirstOrDefaultAsync(t => t.Name.ToLower() == appName.Trim().ToLower()); - } - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_ApplicationTypeService.cs b/PARR.DAL/Services/Implementations/V1/V1_ApplicationTypeService.cs deleted file mode 100644 index b0d31a1b..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_ApplicationTypeService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_ApplicationTypeService : BaseService, V1_IApplicationTypeService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_ApplicationTypeService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - - protected override DbSet EntitySet => dataContext.V1_ApplicationTypes; - - protected override DataContext EntitiContext => dataContext; - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_HostService.cs b/PARR.DAL/Services/Implementations/V1/V1_HostService.cs deleted file mode 100644 index 82c2e831..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_HostService.cs +++ /dev/null @@ -1,143 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.DomainModels; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_HostService : BaseService, V1_IHostService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - protected override DbSet EntitySet => dataContext.V1_Hosts; - - protected override DataContext EntitiContext => dataContext; - public V1_HostService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - - public async Task GetHostWithAppsAsync(string IP, string RegionalEK) - { - - //try - //{ - // var host = await EntitySet.FirstAsync(h => h.IP == IP && h.RegionalEK == RegionalEK); - // return host; - //} - //catch - //{ - // logger.LogInformation($"Не найден узел с IP адресом {IP} и региональным ЭК {RegionalEK}"); - // return null; - //} - return await EntitySet - .Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType) - .AsSplitQuery() - .FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK); - } - - public async Task GetHostWithAppsAsync(string IP, string linkEK, string regionalEK) - { - return await EntitySet - .Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType) - .AsSplitQuery() - .FirstOrDefaultAsync(h => h.IP == IP && h.LinkEK == linkEK && h.RegionalEK == regionalEK); - } - - - public async Task GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK) - { - return await EntitySet.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK); - } - - public Task GetAsync(Guid id) - { - throw new NotImplementedException(); - } - - public IQueryable Get() - { - throw new NotImplementedException(); - } - - public IQueryable GetPage(IQueryable query, PaginationFilter paginationFilter) - { - throw new NotImplementedException(); - } - - public Task CreateAsync(V1_Host obj) - { - throw new NotImplementedException(); - } - - public Task AddRangeAsync(List objs) - { - throw new NotImplementedException(); - } - - public Task DeleteAsync(Guid id) - { - throw new NotImplementedException(); - } - - public bool Delete(V1_Host obj) - { - throw new NotImplementedException(); - } - - public Task CommitAsync() - { - throw new NotImplementedException(); - } - - //public async Task GetHostByRegionalEKAsync(string RegionalEK)И - //{ - // try - // { - // var host = await EntitySet.FirstAsync(h => h.RegionalEK == RegionalEK); - // return host; - // } - // catch - // { - // logger.LogInformation($"Не найден узел с региональным ЭК {RegionalEK}"); - // return null; - // } - //} - - //public async Task UpdateAsync(Host host) - //{ - // var orig = await EntitySet.FirstAsync(h => h.IP == host.IP); - // if (orig == null) - // return false; - - // orig.DateModified = DateTimeOffset.UtcNow; - // orig.HostName = host.HostName; - // orig.RegionalEK = host.RegionalEK; - // orig.LinkEK = host.LinkEK; - // orig.Status = host.Status; - // orig.WorkGroup = host.WorkGroup; - // orig.Responsible = host.Responsible; - // orig.OS = host.OS; - // orig.DB = host.DB; - // orig.APP = host.APP; - - // if (!await CommitAsync()) - // { - // logger.LogError($"Ошибка обновления узла {host.IP}"); - // return false; - // } - // else - // { - // logger.LogInformation($"Обновлен узел {host.IP}"); - // return true; - // } - - //} - - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_JobCategoryService.cs b/PARR.DAL/Services/Implementations/V1/V1_JobCategoryService.cs deleted file mode 100644 index a9125853..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_JobCategoryService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_JobCategoryService : BaseService, V1_IJobCategoryService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_JobCategoryService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - protected override DbSet EntitySet => dataContext.JobCategories; - - protected override DataContext EntitiContext => dataContext; - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_JobJournalService.cs b/PARR.DAL/Services/Implementations/V1/V1_JobJournalService.cs deleted file mode 100644 index 319394eb..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_JobJournalService.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Extensions; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_JobJournalService : BaseService, V1_IJobJournalService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_JobJournalService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - protected override DbSet EntitySet => dataContext.JobJournals; - - protected override DataContext EntitiContext => dataContext; - - public async Task GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date) - { - //var n=DateTimeOffset.UtcNow; - //var opers = await EntitySet - // .Where(j => j.JobId == jobId && j.HostId == hostId && (j.DateOper!=DateTimeOffset.MinValue))/*date.StartOfDay()*/// && j.DateOper < date.EndOfDay())) - // .OrderBy(t => t.DateOper) - // .LastOrDefaultAsync(); - - var opers = await EntitySet - .Where(j => j.JobId == jobId && j.HostId == hostId && j.DateOper.DateTime.Date == date.DateTime.Date) - .OrderBy(t => t.DateOper) - .LastOrDefaultAsync(); - - return opers; - } - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_JobModeService.cs b/PARR.DAL/Services/Implementations/V1/V1_JobModeService.cs deleted file mode 100644 index d63ecd48..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_JobModeService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_JobModeService : BaseService, V1_IJobModeService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_JobModeService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - protected override DbSet EntitySet => dataContext.JobModes; - - protected override DataContext EntitiContext => dataContext; - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_JobService.cs b/PARR.DAL/Services/Implementations/V1/V1_JobService.cs deleted file mode 100644 index 3cfdf2d6..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_JobService.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_JobService : BaseService, V1_IJobService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_JobService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - protected override DbSet EntitySet => dataContext.Jobs; - - protected override DataContext EntitiContext => dataContext; - - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_JobStatusService.cs b/PARR.DAL/Services/Implementations/V1/V1_JobStatusService.cs deleted file mode 100644 index 60524cbf..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_JobStatusService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces.V1; - -namespace PARR.DAL.Services.Implementations.V1 -{ - internal class V1_JobStatusService : BaseService, V1_IJobStatusService - { - private readonly DataContext dataContext; - private readonly ILogger logger; - - public V1_JobStatusService(DataContext dataContext, ILogger logger) : base(logger) - { - this.dataContext = dataContext; - this.logger = logger; - } - protected override DbSet EntitySet => dataContext.JobStatuses; - - protected override DataContext EntitiContext => dataContext; - } -} diff --git a/PARR.DAL/Services/Implementations/V1/V1_SchedulerService.cs b/PARR.DAL/Services/Implementations/V1/V1_SchedulerService.cs deleted file mode 100644 index 109da96d..00000000 --- a/PARR.DAL/Services/Implementations/V1/V1_SchedulerService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using PARR.DAL.Context; -using PARR.DAL.Models; -using PARR.DAL.Services.Abstracts; -using PARR.DAL.Services.Interfaces; - -namespace PARR.DAL.Services.Implementations.V1 -{ - //internal class SchedulerService : BaseService, ISchedulerService - //{ - // private readonly DataContext dataContext; - - // public SchedulerService(DataContext dataContext, ILogger logger) : base(logger) - // { - // this.dataContext = dataContext; - // } - // protected override DbSet EntitySet => dataContext.Schedulers; - - // protected override DataContext EntitiContext => dataContext; - //} -} diff --git a/PARR.DAL/Services/Interfaces/IHostService.cs b/PARR.DAL/Services/Interfaces/IHostService.cs index 2ae00399..372ea38d 100644 --- a/PARR.DAL/Services/Interfaces/IHostService.cs +++ b/PARR.DAL/Services/Interfaces/IHostService.cs @@ -1,5 +1,4 @@ using PARR.DAL.Models; -using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IApplicationInHostService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IApplicationInHostService.cs deleted file mode 100644 index 48eb7ec7..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IApplicationInHostService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - public interface V1_IApplicationInHostService : IBaseService - { - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IApplicationService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IApplicationService.cs deleted file mode 100644 index d53814c5..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IApplicationService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - public interface V1_IApplicationService : IBaseService - { - Task GetByNameAsync(string appName); - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IApplicationTypeService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IApplicationTypeService.cs deleted file mode 100644 index 6a433b79..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IApplicationTypeService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - public interface V1_IApplicationTypeService : IBaseService - { - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IHostService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IHostService.cs deleted file mode 100644 index fd17e4fd..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IHostService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using PARR.DAL.Models; -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - public interface V1_IHostService : IBaseService - { - Task GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK); - Task GetHostWithAppsAsync(string IP, string linkEK, string regionalEK); - //Task GetHostByRegionalEKAsync(string LinkEK); - //Task UpdateAsync(Host host); - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IJobCategoryService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IJobCategoryService.cs deleted file mode 100644 index 0d9b83b7..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IJobCategoryService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - internal interface V1_IJobCategoryService : IBaseService - { - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IJobJournalService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IJobJournalService.cs deleted file mode 100644 index 569b92b6..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IJobJournalService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models.V1; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - public interface V1_IJobJournalService - { - Task GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date); - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IJobModeService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IJobModeService.cs deleted file mode 100644 index 6d4173be..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IJobModeService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - internal interface V1_IJobModeService : IBaseService - { - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IJobService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IJobService.cs deleted file mode 100644 index dc666114..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IJobService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - public interface V1_IJobService : IBaseService - { - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_IJobStatusService.cs b/PARR.DAL/Services/Interfaces/V1/V1_IJobStatusService.cs deleted file mode 100644 index 99c9c6c1..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_IJobStatusService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models.V1; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - internal interface V1_IJobStatusService : IBaseService - { - } -} diff --git a/PARR.DAL/Services/Interfaces/V1/V1_ISchedulerService.cs b/PARR.DAL/Services/Interfaces/V1/V1_ISchedulerService.cs deleted file mode 100644 index 3499ba77..00000000 --- a/PARR.DAL/Services/Interfaces/V1/V1_ISchedulerService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.DAL.Models; -using PARR.DAL.Services.Interfaces.Base; - -namespace PARR.DAL.Services.Interfaces.V1 -{ - //public interface V1_ISchedulerService : IBaseService - //{ - //} -}