diff --git a/PARR.AIHITMainSyncer/Services/SyncerService.cs b/PARR.AIHITMainSyncer/Services/SyncerService.cs index 70dc91b5..0bc37390 100644 --- a/PARR.AIHITMainSyncer/Services/SyncerService.cs +++ b/PARR.AIHITMainSyncer/Services/SyncerService.cs @@ -258,7 +258,7 @@ namespace PARR.AIHITMainSyncer.Services } -private async Task SyncValuesAsync(List values) + private async Task SyncValuesAsync(List values) { bool hasNull = values.Any(v => v is null); var normalizedNoneNullValues = values @@ -356,7 +356,8 @@ private async Task SyncValuesAsync(List values) { logger.LogDebug("Успешно сохранено поле: {FieldName}", item); } - } } + } + } private bool IsStringEqual(string? value1, string? value2) { diff --git a/PARR.API/Controllers/V1/JobController.cs b/PARR.API/Controllers/V1/JobController.cs index 279e2dbc..3fcab36d 100644 --- a/PARR.API/Controllers/V1/JobController.cs +++ b/PARR.API/Controllers/V1/JobController.cs @@ -16,7 +16,8 @@ using PARR.Core.Common.Helpers; using PARR.Core.Common.Interfaces.RabbitServices; using PARR.Core.Extensions; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.MatchingStatusService; using PARR.Core.Services.UnitFilterService; @@ -24,7 +25,7 @@ using PARR.Domain.Common.Pagination; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1 @@ -43,7 +44,6 @@ namespace PARR.API.Controllers.V1 private readonly IRabbitService _mqService; private readonly MqSettings _mqSettings; private readonly IClientService _clientService; - private readonly IJobAutoControlRepository _jobAutoControlRepository; private readonly IMatchingStatusService _matchingStatusService; public JobController( @@ -58,7 +58,6 @@ namespace PARR.API.Controllers.V1 IRabbitService mqService, MqSettings mqSettings, IClientService clientService, - IJobAutoControlRepository jobAutoControlRepository, IMatchingStatusService matchingStatusService ) { @@ -70,7 +69,6 @@ namespace PARR.API.Controllers.V1 _mqService = mqService; _mqSettings = mqSettings; _clientService = clientService; - _jobAutoControlRepository = jobAutoControlRepository; _matchingStatusService = matchingStatusService; } diff --git a/PARR.API/Controllers/V1/JobGroupController.cs b/PARR.API/Controllers/V1/JobGroupController.cs index 30c5db67..b88ae2b6 100644 --- a/PARR.API/Controllers/V1/JobGroupController.cs +++ b/PARR.API/Controllers/V1/JobGroupController.cs @@ -14,7 +14,8 @@ using PARR.API.Services.Interfaces; using PARR.API.Settings; using PARR.Core.Common.Helpers; using PARR.Core.Common.Interfaces.RabbitServices; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Schedule; using PARR.Core.Services.MatchingStatusService; using PARR.Domain.Common.Pagination; diff --git a/PARR.API/Controllers/V1/JobGroupTypeController.cs b/PARR.API/Controllers/V1/JobGroupTypeController.cs index 91f2547f..a78ccbfe 100644 --- a/PARR.API/Controllers/V1/JobGroupTypeController.cs +++ b/PARR.API/Controllers/V1/JobGroupTypeController.cs @@ -6,7 +6,7 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 diff --git a/PARR.API/Controllers/V1/JobUnitPreviewController.cs b/PARR.API/Controllers/V1/JobUnitPreviewController.cs index f2cec171..cb94baa5 100644 --- a/PARR.API/Controllers/V1/JobUnitPreviewController.cs +++ b/PARR.API/Controllers/V1/JobUnitPreviewController.cs @@ -12,7 +12,7 @@ using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.UnitFilterService; using PARR.Domain.Common.Roles; -using Job = PARR.Domain.Entities.Job.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/TemplateActivatorController.cs b/PARR.API/Controllers/V1/TemplateActivatorController.cs index 5e8e02db..a0822a1a 100644 --- a/PARR.API/Controllers/V1/TemplateActivatorController.cs +++ b/PARR.API/Controllers/V1/TemplateActivatorController.cs @@ -1,5 +1,4 @@ -using FluentValidation; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Requests; @@ -8,7 +7,7 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.API.Settings; using PARR.Core.Common.Interfaces.RabbitServices; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; diff --git a/PARR.API/MappingProfiles/DomainToResponseProfile.cs b/PARR.API/MappingProfiles/DomainToResponseProfile.cs index b1e2b251..457c6391 100644 --- a/PARR.API/MappingProfiles/DomainToResponseProfile.cs +++ b/PARR.API/MappingProfiles/DomainToResponseProfile.cs @@ -13,7 +13,7 @@ using PARR.Domain.DTOs.User; using PARR.Domain.DTOs.Workload; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.Domain.Entities.Schedule; using PARR.Domain.Entities.Unit; diff --git a/PARR.API/MappingProfiles/RequestToDomainProfile.cs b/PARR.API/MappingProfiles/RequestToDomainProfile.cs index ba67bb7e..2e9501e6 100644 --- a/PARR.API/MappingProfiles/RequestToDomainProfile.cs +++ b/PARR.API/MappingProfiles/RequestToDomainProfile.cs @@ -3,7 +3,7 @@ using PARR.API.Contracts.V1.Requests; using PARR.API.Contracts.V1.Requests.Queries; using PARR.Domain.Common.Pagination; using PARR.Domain.DTOs.RobotSnapshotDTO; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.API.MappingProfiles { diff --git a/PARR.API/Validators/JobGroupValidator.cs b/PARR.API/Validators/JobGroupValidator.cs index d885d2e1..3133cba0 100644 --- a/PARR.API/Validators/JobGroupValidator.cs +++ b/PARR.API/Validators/JobGroupValidator.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using PARR.API.Contracts.V1.Requests; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; using PARR.Core.Repositories.Interfaces.Schedule; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Domain.Enums; diff --git a/PARR.API/Validators/JobRequestValidator.cs b/PARR.API/Validators/JobRequestValidator.cs index 33ea9456..80e1733c 100644 --- a/PARR.API/Validators/JobRequestValidator.cs +++ b/PARR.API/Validators/JobRequestValidator.cs @@ -1,9 +1,8 @@ using FluentValidation; using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json.Linq; using PARR.API.Contracts.V1.Requests; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; using PARR.Core.Repositories.Interfaces.Unit; namespace PARR.API.Validators @@ -12,20 +11,17 @@ namespace PARR.API.Validators { private readonly ITnkRepository _tnkRepository; private readonly IJobGroupRepository _jobGroupRepository; - private readonly IJobRepository _jobRepository; private readonly IUnitFieldRepository _unitFieldRepository; //private JobGroup? jobGroup; public JobRequestValidator( ITnkRepository tnkRepository, IJobGroupRepository jobGroupRepository, - IJobRepository jobRepository, IUnitFieldRepository unitFieldRepository ) { _tnkRepository = tnkRepository; _jobGroupRepository = jobGroupRepository; - _jobRepository = jobRepository; _unitFieldRepository = unitFieldRepository; RuleFor(t => t.Name) diff --git a/PARR.API/Validators/MatchTemplatesRequestValidator.cs b/PARR.API/Validators/MatchTemplatesRequestValidator.cs index 959a17f8..ecdc53f6 100644 --- a/PARR.API/Validators/MatchTemplatesRequestValidator.cs +++ b/PARR.API/Validators/MatchTemplatesRequestValidator.cs @@ -2,7 +2,8 @@ using Microsoft.EntityFrameworkCore; using PARR.API.Contracts.V1.Requests; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Enums; namespace PARR.API.Validators diff --git a/PARR.API/Validators/TemplateActivatorRequestValidator.cs b/PARR.API/Validators/TemplateActivatorRequestValidator.cs index 05519417..c692fdb1 100644 --- a/PARR.API/Validators/TemplateActivatorRequestValidator.cs +++ b/PARR.API/Validators/TemplateActivatorRequestValidator.cs @@ -1,7 +1,8 @@ using FluentValidation; using PARR.API.Contracts.V1.Requests; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Enums; namespace PARR.API.Validators diff --git a/PARR.Core/Common/Helpers/JobGroupCloneHelper.cs b/PARR.Core/Common/Helpers/JobGroupCloneHelper.cs index 16cf8ec3..55a9bc46 100644 --- a/PARR.Core/Common/Helpers/JobGroupCloneHelper.cs +++ b/PARR.Core/Common/Helpers/JobGroupCloneHelper.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.Domain.Entities.Schedule; @@ -15,16 +15,13 @@ namespace PARR.Core.Common.Helpers; public class JobGroupCloneHelper { private readonly IJobGroupRepository groupRepository; - private readonly IJobRepository jobRepository; private readonly ILogger logger; public JobGroupCloneHelper( IJobGroupRepository groupRepository, - IJobRepository jobRepository, ILogger logger) { this.groupRepository = groupRepository; - this.jobRepository = jobRepository; this.logger = logger; } diff --git a/PARR.Core/Common/Helpers/JobGroupUnitFilterSynchronizeHelper.cs b/PARR.Core/Common/Helpers/JobGroupUnitFilterSynchronizeHelper.cs index 9beadac2..c8bfbd15 100644 --- a/PARR.Core/Common/Helpers/JobGroupUnitFilterSynchronizeHelper.cs +++ b/PARR.Core/Common/Helpers/JobGroupUnitFilterSynchronizeHelper.cs @@ -1,13 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +using PARR.Domain.Entities.JobEntities; namespace PARR.Core.Common.Helpers; diff --git a/PARR.Core/Repositories/Interfaces/Job/IJobRepository.cs b/PARR.Core/Repositories/Interfaces/Job/IJobRepository.cs deleted file mode 100644 index ed7baba9..00000000 --- a/PARR.Core/Repositories/Interfaces/Job/IJobRepository.cs +++ /dev/null @@ -1,8 +0,0 @@ -using PARR.Core.Repositories.Base; - -namespace PARR.Core.Repositories.Interfaces.Job -{ - public interface IJobRepository : IBaseRepository - { - } -} diff --git a/PARR.Core/Repositories/Interfaces/Job/IJobGroupRepository.cs b/PARR.Core/Repositories/Interfaces/JobGroupRepositories/IJobGroupRepository.cs similarity index 87% rename from PARR.Core/Repositories/Interfaces/Job/IJobGroupRepository.cs rename to PARR.Core/Repositories/Interfaces/JobGroupRepositories/IJobGroupRepository.cs index 66d58676..7d1f5f5f 100644 --- a/PARR.Core/Repositories/Interfaces/Job/IJobGroupRepository.cs +++ b/PARR.Core/Repositories/Interfaces/JobGroupRepositories/IJobGroupRepository.cs @@ -1,7 +1,7 @@ using PARR.Core.Repositories.Base; using PARR.Domain.Entities.JobGroupEntities; -namespace PARR.Core.Repositories.Interfaces.Job +namespace PARR.Core.Repositories.Interfaces.JobGroupRepositories { public interface IJobGroupRepository : IBaseRepository { diff --git a/PARR.Core/Repositories/Interfaces/Job/IJobGroupTypeRepository.cs b/PARR.Core/Repositories/Interfaces/JobGroupRepositories/IJobGroupTypeRepository.cs similarity index 73% rename from PARR.Core/Repositories/Interfaces/Job/IJobGroupTypeRepository.cs rename to PARR.Core/Repositories/Interfaces/JobGroupRepositories/IJobGroupTypeRepository.cs index 17e730e2..15e516a8 100644 --- a/PARR.Core/Repositories/Interfaces/Job/IJobGroupTypeRepository.cs +++ b/PARR.Core/Repositories/Interfaces/JobGroupRepositories/IJobGroupTypeRepository.cs @@ -1,7 +1,7 @@ using PARR.Core.Repositories.Base; using PARR.Domain.Entities.JobGroupEntities; -namespace PARR.Core.Repositories.Interfaces.Job +namespace PARR.Core.Repositories.Interfaces.JobGroupRepositories { public interface IJobGroupTypeRepository : IBaseRepository { diff --git a/PARR.Core/Repositories/Interfaces/Job/IFieldFilterRepository.cs b/PARR.Core/Repositories/Interfaces/JobRepositories/IFieldFilterRepository.cs similarity index 57% rename from PARR.Core/Repositories/Interfaces/Job/IFieldFilterRepository.cs rename to PARR.Core/Repositories/Interfaces/JobRepositories/IFieldFilterRepository.cs index c45e9061..7b89ee73 100644 --- a/PARR.Core/Repositories/Interfaces/Job/IFieldFilterRepository.cs +++ b/PARR.Core/Repositories/Interfaces/JobRepositories/IFieldFilterRepository.cs @@ -1,7 +1,7 @@ using PARR.Core.Repositories.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; -namespace PARR.Core.Repositories.Interfaces.Job +namespace PARR.Core.Repositories.Interfaces.JobRepositories { public interface IFieldFilterRepository : IBaseRepository { diff --git a/PARR.Core/Repositories/Interfaces/Job/IJobAutoControlRepository.cs b/PARR.Core/Repositories/Interfaces/JobRepositories/IJobAutoControlRepository.cs similarity index 62% rename from PARR.Core/Repositories/Interfaces/Job/IJobAutoControlRepository.cs rename to PARR.Core/Repositories/Interfaces/JobRepositories/IJobAutoControlRepository.cs index e0937825..3939bee6 100644 --- a/PARR.Core/Repositories/Interfaces/Job/IJobAutoControlRepository.cs +++ b/PARR.Core/Repositories/Interfaces/JobRepositories/IJobAutoControlRepository.cs @@ -1,6 +1,6 @@ -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; -namespace PARR.Core.Repositories.Interfaces.Job +namespace PARR.Core.Repositories.Interfaces.JobRepositories { public interface IJobAutoControlRepository { diff --git a/PARR.Core/Repositories/Interfaces/JobRepositories/IJobRepository.cs b/PARR.Core/Repositories/Interfaces/JobRepositories/IJobRepository.cs new file mode 100644 index 00000000..99bdcbf9 --- /dev/null +++ b/PARR.Core/Repositories/Interfaces/JobRepositories/IJobRepository.cs @@ -0,0 +1,9 @@ +using PARR.Core.Repositories.Base; +using PARR.Domain.Entities.JobEntities; + +namespace PARR.Core.Repositories.Interfaces.JobRepositories +{ + public interface IJobRepository : IBaseRepository + { + } +} diff --git a/PARR.Core/Repositories/Interfaces/Job/IJobUnitFilterRepository.cs b/PARR.Core/Repositories/Interfaces/JobRepositories/IJobUnitFilterRepository.cs similarity index 57% rename from PARR.Core/Repositories/Interfaces/Job/IJobUnitFilterRepository.cs rename to PARR.Core/Repositories/Interfaces/JobRepositories/IJobUnitFilterRepository.cs index 1250cdc2..e156efa4 100644 --- a/PARR.Core/Repositories/Interfaces/Job/IJobUnitFilterRepository.cs +++ b/PARR.Core/Repositories/Interfaces/JobRepositories/IJobUnitFilterRepository.cs @@ -1,7 +1,7 @@ using PARR.Core.Repositories.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; -namespace PARR.Core.Repositories.Interfaces.Job +namespace PARR.Core.Repositories.Interfaces.JobRepositories { public interface IJobUnitFilterRepository : IBaseRepository { diff --git a/PARR.Core/Services/MatchingStatusService/MatchingStatusService.cs b/PARR.Core/Services/MatchingStatusService/MatchingStatusService.cs index b2460671..2d52c15d 100644 --- a/PARR.Core/Services/MatchingStatusService/MatchingStatusService.cs +++ b/PARR.Core/Services/MatchingStatusService/MatchingStatusService.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using PARR.Core.Common.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Cache.Models; using PARR.Domain.DTOs.Matching; using PARR.Domain.Enums; diff --git a/PARR.Core/Services/Shortcodes/ShortcodesService.cs b/PARR.Core/Services/Shortcodes/ShortcodesService.cs index ac5f2d86..39ac1007 100644 --- a/PARR.Core/Services/Shortcodes/ShortcodesService.cs +++ b/PARR.Core/Services/Shortcodes/ShortcodesService.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.Shortcodes.Enums; using PARR.Core.Services.Shortcodes.Handlers; @@ -10,7 +10,7 @@ using PARR.Core.Services.Shortcodes.Models; using PARR.Domain.Cache.Models; using PARR.Domain.DTOs.Shortcode; using PARR.Domain.Entities; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; using PARR.Domain.Settings; using System.Runtime.CompilerServices; @@ -79,8 +79,8 @@ internal class ShortcodesService : IShortcodesService Index: template.Index, JobId: template.JobId, UnitId: template.UnitId, - UnitName: initialUnitName ?? string.Empty, - Job: initialJob, + UnitName: initialUnitName ?? string.Empty, + Job: initialJob, UnitsInTemplate: initialUnitsInTemplate, UnitTags: new List(), RelatedUnitTags: new Dictionary>() diff --git a/PARR.Core/Services/UnitFilterService/IUnitFilterService.cs b/PARR.Core/Services/UnitFilterService/IUnitFilterService.cs index e9e8865a..15be7d67 100644 --- a/PARR.Core/Services/UnitFilterService/IUnitFilterService.cs +++ b/PARR.Core/Services/UnitFilterService/IUnitFilterService.cs @@ -1,5 +1,5 @@ using PARR.Core.Services.UnitFilterService.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.Core.Services.UnitFilterService { diff --git a/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UmbrellaFilter.cs b/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UmbrellaFilter.cs index 1a7015cf..ae529f4d 100644 --- a/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UmbrellaFilter.cs +++ b/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UmbrellaFilter.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging; using PARR.Core.Services.UnitFilterService.Matchers.Interfaces; using PARR.Core.Services.UnitFilterService.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; namespace PARR.Core.Services.UnitFilterService.Matchers; diff --git a/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitFieldMatcher.cs b/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitFieldMatcher.cs index 363a33bc..9262c684 100644 --- a/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitFieldMatcher.cs +++ b/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitFieldMatcher.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.UnitFilterService.Matchers.Interfaces; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.Core.Services.UnitFilterService.Matchers; diff --git a/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitRelationshipMatcher.cs b/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitRelationshipMatcher.cs index d454ac6f..08d02ecf 100644 --- a/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitRelationshipMatcher.cs +++ b/PARR.Core/Services/UnitFilterService/Matchers/Implemetations/UnitRelationshipMatcher.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.UnitFilterService.Matchers.Interfaces; using PARR.Core.Services.UnitFilterService.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.Core.Services.UnitFilterService.Matchers; diff --git a/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUmbrellaFilter.cs b/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUmbrellaFilter.cs index 00f16657..f5c59101 100644 --- a/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUmbrellaFilter.cs +++ b/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUmbrellaFilter.cs @@ -1,5 +1,5 @@ using PARR.Core.Services.UnitFilterService.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.Core.Services.UnitFilterService.Matchers.Interfaces { diff --git a/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitFieldMatcher.cs b/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitFieldMatcher.cs index 7825530b..88d17fa5 100644 --- a/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitFieldMatcher.cs +++ b/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitFieldMatcher.cs @@ -1,4 +1,4 @@ -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.Core.Services.UnitFilterService.Matchers.Interfaces { diff --git a/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitRelationshipMatcher.cs b/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitRelationshipMatcher.cs index 3a0a78ca..ff857f3b 100644 --- a/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitRelationshipMatcher.cs +++ b/PARR.Core/Services/UnitFilterService/Matchers/Interfaces/IUnitRelationshipMatcher.cs @@ -1,5 +1,5 @@ using PARR.Core.Services.UnitFilterService.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.Core.Services.UnitFilterService.Matchers.Interfaces { diff --git a/PARR.Core/Services/UnitFilterService/UnitFilterService.cs b/PARR.Core/Services/UnitFilterService/UnitFilterService.cs index ab0faecf..db4b4323 100644 --- a/PARR.Core/Services/UnitFilterService/UnitFilterService.cs +++ b/PARR.Core/Services/UnitFilterService/UnitFilterService.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.Core.Common.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.UnitFilterService.Matchers.Interfaces; using PARR.Core.Services.UnitFilterService.Models; using PARR.Core.Services.UnitService.Interfaces; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.Unit; using System.Diagnostics; diff --git a/PARR.Core/Services/Workload/Implementations/WorkloadService.cs b/PARR.Core/Services/Workload/Implementations/WorkloadService.cs index c1531fa7..316ce985 100644 --- a/PARR.Core/Services/Workload/Implementations/WorkloadService.cs +++ b/PARR.Core/Services/Workload/Implementations/WorkloadService.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.TaskRepositories; using PARR.Core.Services.NextRunServices; using PARR.Core.Services.TaskServices.Helpers; @@ -10,7 +10,6 @@ using PARR.Core.Services.Workload.Interfaces; using PARR.Core.Services.Workload.Models; using PARR.Domain.Cache.Models; using PARR.Domain.DTOs.Workload; -using PARR.Domain.Entities; using PARR.Domain.Enums; using PARR.Domain.Enums.Workload; diff --git a/PARR.DAL.Tests/Services/UnitFilterService/UnitFilterServiceTests.cs b/PARR.DAL.Tests/Services/UnitFilterService/UnitFilterServiceTests.cs index 73955928..62c71430 100644 --- a/PARR.DAL.Tests/Services/UnitFilterService/UnitFilterServiceTests.cs +++ b/PARR.DAL.Tests/Services/UnitFilterService/UnitFilterServiceTests.cs @@ -3,15 +3,14 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Moq; using PARR.Core.Common.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.Core.Services.UnitFilterService; using PARR.Core.Services.UnitFilterService.Matchers.Interfaces; using PARR.Core.Services.UnitFilterService.Models; using PARR.Core.Services.UnitService.Interfaces; using PARR.DAL.Context; using PARR.Domain.Cache.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index 971db050..7f41b69b 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -3,7 +3,7 @@ using PARR.Core.Extensions; using PARR.Domain.Common.Roles; using PARR.Domain.Common.Template; using PARR.Domain.Entities; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.Domain.Entities.RobotEntities; using PARR.Domain.Entities.Schedule; diff --git a/PARR.DAL/DependencyInjection.cs b/PARR.DAL/DependencyInjection.cs index 69b8728d..cbb67de0 100644 --- a/PARR.DAL/DependencyInjection.cs +++ b/PARR.DAL/DependencyInjection.cs @@ -3,8 +3,8 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.RobotRepositories; using PARR.Core.Repositories.Interfaces.Schedule; using PARR.Core.Repositories.Interfaces.TaskRepositories; @@ -14,6 +14,7 @@ using PARR.DAL.Context; using PARR.DAL.Repositories; using PARR.DAL.Repositories.Job; using PARR.DAL.Repositories.JobGroupRepositories; +using PARR.DAL.Repositories.JobRepositories; using PARR.DAL.Repositories.RobotRepositories; using PARR.DAL.Repositories.Schedule; using PARR.DAL.Repositories.TaskRepositories; diff --git a/PARR.DAL/Repositories/Job/JobGroupRepository.cs b/PARR.DAL/Repositories/JobGroupRepositories/JobGroupRepository.cs similarity index 83% rename from PARR.DAL/Repositories/Job/JobGroupRepository.cs rename to PARR.DAL/Repositories/JobGroupRepositories/JobGroupRepository.cs index a6a5a292..e81655e9 100644 --- a/PARR.DAL/Repositories/Job/JobGroupRepository.cs +++ b/PARR.DAL/Repositories/JobGroupRepositories/JobGroupRepository.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; using PARR.DAL.Context; using PARR.DAL.Repositories.Base; using PARR.Domain.Entities.JobGroupEntities; -namespace PARR.DAL.Repositories.Job +namespace PARR.DAL.Repositories.JobGroupRepositories { internal class JobGroupRepository : BaseRepository, IJobGroupRepository { diff --git a/PARR.DAL/Repositories/Job/JobGroupTypeRepository.cs b/PARR.DAL/Repositories/JobGroupRepositories/JobGroupTypeRepository.cs similarity index 77% rename from PARR.DAL/Repositories/Job/JobGroupTypeRepository.cs rename to PARR.DAL/Repositories/JobGroupRepositories/JobGroupTypeRepository.cs index b4aab26e..0cdadad2 100644 --- a/PARR.DAL/Repositories/Job/JobGroupTypeRepository.cs +++ b/PARR.DAL/Repositories/JobGroupRepositories/JobGroupTypeRepository.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; using PARR.DAL.Context; using PARR.DAL.Repositories.Base; using PARR.Domain.Entities.JobGroupEntities; -namespace PARR.DAL.Repositories.Job +namespace PARR.DAL.Repositories.JobGroupRepositories { internal class JobGroupTypeRepository : BaseRepository, IJobGroupTypeRepository { diff --git a/PARR.DAL/Repositories/Job/FieldFilterRepository.cs b/PARR.DAL/Repositories/JobRepositories/FieldFilterRepository.cs similarity index 79% rename from PARR.DAL/Repositories/Job/FieldFilterRepository.cs rename to PARR.DAL/Repositories/JobRepositories/FieldFilterRepository.cs index 914b34c0..29623167 100644 --- a/PARR.DAL/Repositories/Job/FieldFilterRepository.cs +++ b/PARR.DAL/Repositories/JobRepositories/FieldFilterRepository.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.DAL.Context; using PARR.DAL.Repositories.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.DAL.Repositories.Job { diff --git a/PARR.DAL/Repositories/Job/JobAutoControlRepository.cs b/PARR.DAL/Repositories/JobRepositories/JobAutoControlRepository.cs similarity index 85% rename from PARR.DAL/Repositories/Job/JobAutoControlRepository.cs rename to PARR.DAL/Repositories/JobRepositories/JobAutoControlRepository.cs index 13acfcab..0fe80ee8 100644 --- a/PARR.DAL/Repositories/Job/JobAutoControlRepository.cs +++ b/PARR.DAL/Repositories/JobRepositories/JobAutoControlRepository.cs @@ -1,6 +1,6 @@ -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.DAL.Context; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.DAL.Repositories.Job { diff --git a/PARR.DAL/Repositories/Job/JobRepository.cs b/PARR.DAL/Repositories/JobRepositories/JobRepository.cs similarity index 80% rename from PARR.DAL/Repositories/Job/JobRepository.cs rename to PARR.DAL/Repositories/JobRepositories/JobRepository.cs index 40c0ecca..5cb9e77a 100644 --- a/PARR.DAL/Repositories/Job/JobRepository.cs +++ b/PARR.DAL/Repositories/JobRepositories/JobRepository.cs @@ -1,16 +1,16 @@ using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.DAL.Context; using PARR.DAL.Repositories.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; -namespace PARR.DAL.Repositories.Job +namespace PARR.DAL.Repositories.JobRepositories { - internal class JobRepository : BaseRepository, IJobRepository + internal class JobRepository : BaseRepository, IJobRepository { public JobRepository(DataContext dataContext, ILogger logger) : base(logger, dataContext) { } - public override Task CreateAsync(Domain.Entities.Job.Job obj) + public override Task CreateAsync(Domain.Entities.JobEntities.Job obj) { if (obj.AutoControl == null) obj.AutoControl = new JobAutoControl @@ -22,7 +22,7 @@ namespace PARR.DAL.Repositories.Job } - public override Task AddRangeAsync(List objs) + public override Task AddRangeAsync(List objs) { objs.ForEach(job => { diff --git a/PARR.DAL/Repositories/Job/JobUnitFilterRepository.cs b/PARR.DAL/Repositories/JobRepositories/JobUnitFilterRepository.cs similarity index 80% rename from PARR.DAL/Repositories/Job/JobUnitFilterRepository.cs rename to PARR.DAL/Repositories/JobRepositories/JobUnitFilterRepository.cs index b0e64151..8c096761 100644 --- a/PARR.DAL/Repositories/Job/JobUnitFilterRepository.cs +++ b/PARR.DAL/Repositories/JobRepositories/JobUnitFilterRepository.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.DAL.Context; using PARR.DAL.Repositories.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.DAL.Repositories.Job { diff --git a/PARR.Domain/Entities/Job/Job.cs b/PARR.Domain/Entities/JobEntities/Job.cs similarity index 98% rename from PARR.Domain/Entities/Job/Job.cs rename to PARR.Domain/Entities/JobEntities/Job.cs index 549bcc8b..ec5c8707 100644 --- a/PARR.Domain/Entities/Job/Job.cs +++ b/PARR.Domain/Entities/JobEntities/Job.cs @@ -5,7 +5,7 @@ using PARR.Domain.Entities.JobGroupEntities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace PARR.Domain.Entities.Job +namespace PARR.Domain.Entities.JobEntities { [Table("Jobs", Schema = DatabaseSchemas.Job)] [Comment("Таблица видов работ")] diff --git a/PARR.Domain/Entities/Job/JobAutoControl.cs b/PARR.Domain/Entities/JobEntities/JobAutoControl.cs similarity index 96% rename from PARR.Domain/Entities/Job/JobAutoControl.cs rename to PARR.Domain/Entities/JobEntities/JobAutoControl.cs index 87b34722..fde2d142 100644 --- a/PARR.Domain/Entities/Job/JobAutoControl.cs +++ b/PARR.Domain/Entities/JobEntities/JobAutoControl.cs @@ -3,7 +3,7 @@ using PARR.Domain.Constants; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace PARR.Domain.Entities.Job +namespace PARR.Domain.Entities.JobEntities { [Table("AutoControls", Schema = DatabaseSchemas.Job)] [Comment("Таблица управления автоконтролем для работ")] diff --git a/PARR.Domain/Entities/Job/JobFieldFilter.cs b/PARR.Domain/Entities/JobEntities/JobFieldFilter.cs similarity index 96% rename from PARR.Domain/Entities/Job/JobFieldFilter.cs rename to PARR.Domain/Entities/JobEntities/JobFieldFilter.cs index bedc78d0..56de954b 100644 --- a/PARR.Domain/Entities/Job/JobFieldFilter.cs +++ b/PARR.Domain/Entities/JobEntities/JobFieldFilter.cs @@ -5,7 +5,7 @@ using PARR.Domain.Entities.Unit; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace PARR.Domain.Entities.Job +namespace PARR.Domain.Entities.JobEntities { [Table("FieldFilters", Schema = DatabaseSchemas.Job)] [Comment("Таблица описания критериев выборки аттрибутов ЭК")] diff --git a/PARR.Domain/Entities/Job/JobRelationshipFilter.cs b/PARR.Domain/Entities/JobEntities/JobRelationshipFilter.cs similarity index 96% rename from PARR.Domain/Entities/Job/JobRelationshipFilter.cs rename to PARR.Domain/Entities/JobEntities/JobRelationshipFilter.cs index a981e26b..adea308e 100644 --- a/PARR.Domain/Entities/Job/JobRelationshipFilter.cs +++ b/PARR.Domain/Entities/JobEntities/JobRelationshipFilter.cs @@ -3,7 +3,7 @@ using PARR.Domain.Constants; using PARR.Domain.Entities.Unit; using System.ComponentModel.DataAnnotations.Schema; -namespace PARR.Domain.Entities.Job +namespace PARR.Domain.Entities.JobEntities { [Table("RelationshipFilters", Schema = DatabaseSchemas.Job)] [Comment("Таблица фильтров связей ЭК")] diff --git a/PARR.Domain/Entities/Job/JobUnitFilter.cs b/PARR.Domain/Entities/JobEntities/JobUnitFilter.cs similarity index 96% rename from PARR.Domain/Entities/Job/JobUnitFilter.cs rename to PARR.Domain/Entities/JobEntities/JobUnitFilter.cs index 6a9ea5b4..120618b2 100644 --- a/PARR.Domain/Entities/Job/JobUnitFilter.cs +++ b/PARR.Domain/Entities/JobEntities/JobUnitFilter.cs @@ -4,7 +4,7 @@ using PARR.Domain.Entities.Base; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace PARR.Domain.Entities.Job +namespace PARR.Domain.Entities.JobEntities { [Table("UnitFilters", Schema = DatabaseSchemas.Job)] [Comment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП")] diff --git a/PARR.Domain/Entities/Job/UnitsInTemplate.cs b/PARR.Domain/Entities/JobEntities/UnitsInTemplate.cs similarity index 94% rename from PARR.Domain/Entities/Job/UnitsInTemplate.cs rename to PARR.Domain/Entities/JobEntities/UnitsInTemplate.cs index 24dc5ef6..8fa813dd 100644 --- a/PARR.Domain/Entities/Job/UnitsInTemplate.cs +++ b/PARR.Domain/Entities/JobEntities/UnitsInTemplate.cs @@ -2,7 +2,7 @@ using PARR.Domain.Constants; using System.ComponentModel.DataAnnotations.Schema; -namespace PARR.Domain.Entities.Job +namespace PARR.Domain.Entities.JobEntities { [Table("UnitsInTemplates", Schema = DatabaseSchemas.Job)] [Comment("Таблица связи ЭК в шаблонах")] diff --git a/PARR.Domain/Entities/JobGroupEntities/JobGroup.cs b/PARR.Domain/Entities/JobGroupEntities/JobGroup.cs index f88ccd85..6dfa2a49 100644 --- a/PARR.Domain/Entities/JobGroupEntities/JobGroup.cs +++ b/PARR.Domain/Entities/JobGroupEntities/JobGroup.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using PARR.Domain.Constants; using PARR.Domain.Entities.Base; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.Schedule; using PARR.Domain.Entities.Unit; using PARR.Domain.Settings; @@ -180,7 +181,7 @@ namespace PARR.Domain.Entities.JobGroupEntities [ForeignKey(nameof(GroupTypeId))] public JobGroupType? GroupType { get; set; } - public ICollection Jobs { get; set; } = new HashSet(); + public ICollection Jobs { get; set; } = new HashSet(); public ICollection EsppSchValues { get; set; } = new HashSet(); diff --git a/PARR.Domain/Entities/JobGroupEntities/JobGroupRelationshipFilter.cs b/PARR.Domain/Entities/JobGroupEntities/JobGroupRelationshipFilter.cs index 7bd271f7..419e19e5 100644 --- a/PARR.Domain/Entities/JobGroupEntities/JobGroupRelationshipFilter.cs +++ b/PARR.Domain/Entities/JobGroupEntities/JobGroupRelationshipFilter.cs @@ -1,14 +1,7 @@ using Microsoft.EntityFrameworkCore; -using PARR.Domain.Cache.Models; using PARR.Domain.Constants; -using PARR.Domain.Entities.Job; using PARR.Domain.Entities.Unit; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace PARR.Domain.Entities.JobGroupEntities { diff --git a/PARR.Domain/Entities/Template.cs b/PARR.Domain/Entities/Template.cs index 219e4fa3..bc3c8eb8 100644 --- a/PARR.Domain/Entities/Template.cs +++ b/PARR.Domain/Entities/Template.cs @@ -2,7 +2,7 @@ using PARR.Domain.Entities.Base; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.Base.History.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -77,7 +77,7 @@ namespace PARR.Domain.Entities //public Host? Host { get; set; } [ForeignKey(nameof(JobId))] - public Job.Job? Job { get; set; } + public JobEntities.Job? Job { get; set; } [ForeignKey(nameof(UnitId))] public Unit.Unit? Unit { get; set; } diff --git a/PARR.Domain/Entities/Tnk.cs b/PARR.Domain/Entities/Tnk.cs index 803136be..4124c710 100644 --- a/PARR.Domain/Entities/Tnk.cs +++ b/PARR.Domain/Entities/Tnk.cs @@ -1,4 +1,5 @@ using PARR.Domain.Entities.Base; +using PARR.Domain.Entities.JobEntities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -30,6 +31,6 @@ namespace PARR.Domain.Entities public Subprocess? Subprocess { get; set; } - public ICollection Jobs { get; set; } = new HashSet(); + public ICollection Jobs { get; set; } = new HashSet(); } } diff --git a/PARR.Domain/Entities/Unit/Unit.cs b/PARR.Domain/Entities/Unit/Unit.cs index 93b43b2e..f2581984 100644 --- a/PARR.Domain/Entities/Unit/Unit.cs +++ b/PARR.Domain/Entities/Unit/Unit.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using PARR.Domain.Constants; using PARR.Domain.Entities.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.Domain/Entities/Unit/UnitField.cs b/PARR.Domain/Entities/Unit/UnitField.cs index 58c32a7d..3d05f0b3 100644 --- a/PARR.Domain/Entities/Unit/UnitField.cs +++ b/PARR.Domain/Entities/Unit/UnitField.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using PARR.Domain.Constants; using PARR.Domain.Entities.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.Domain/Entities/Unit/UnitFieldValue.cs b/PARR.Domain/Entities/Unit/UnitFieldValue.cs index fc6fca43..df66a1f3 100644 --- a/PARR.Domain/Entities/Unit/UnitFieldValue.cs +++ b/PARR.Domain/Entities/Unit/UnitFieldValue.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using PARR.Domain.Constants; using PARR.Domain.Entities.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.TemplateActivator/Services/ValidatorService.cs b/PARR.TemplateActivator/Services/ValidatorService.cs index 830567ff..77666fa8 100644 --- a/PARR.TemplateActivator/Services/ValidatorService.cs +++ b/PARR.TemplateActivator/Services/ValidatorService.cs @@ -2,10 +2,11 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Base; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Entities; using PARR.Domain.Entities.Base; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.Domain.Enums; diff --git a/PARR.TemplateGeneratorWorker/Services/ValidatorService.cs b/PARR.TemplateGeneratorWorker/Services/ValidatorService.cs index c46bcbd8..ac4e1041 100644 --- a/PARR.TemplateGeneratorWorker/Services/ValidatorService.cs +++ b/PARR.TemplateGeneratorWorker/Services/ValidatorService.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Unit; diff --git a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs index 13b54697..9cfd6ec7 100644 --- a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs +++ b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Services.NextRunServices; using PARR.Core.Services.Shortcodes; using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; using PARR.TemplateGeneratorWorker.Services; diff --git a/PARR.TemplateMatcher/Models/TemplateAllocationRequest.cs b/PARR.TemplateMatcher/Models/TemplateAllocationRequest.cs index 5be8606f..7f221e0a 100644 --- a/PARR.TemplateMatcher/Models/TemplateAllocationRequest.cs +++ b/PARR.TemplateMatcher/Models/TemplateAllocationRequest.cs @@ -1,6 +1,6 @@ using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.Unit; namespace PARR.TemplateMatcher.Models diff --git a/PARR.TemplateMatcher/Services/AutoControlResolver.cs b/PARR.TemplateMatcher/Services/AutoControlResolver.cs new file mode 100644 index 00000000..d1a368fe --- /dev/null +++ b/PARR.TemplateMatcher/Services/AutoControlResolver.cs @@ -0,0 +1,41 @@ +using PARR.Domain.Entities.JobEntities; +using PARR.Domain.Entities.JobGroupEntities; + +namespace PARR.TemplateMatcher.Services +{ + /// + /// Определяет начальные статусы шаблона и расписания на основе типа группы работ. + /// Если IsJobGroupAutoControl == true → берём из JobGroup.AutoControl. + /// Иначе → берём из Job.AutoControl. + /// + public static class AutoControlResolver + { + public static (bool IsActiveTemplate, bool IsActiveSchedule) ResolveInitStates( + Job job, + JobGroup? jobGroup, + bool defaultTemplateState = false, + bool defaultScheduleState = false) + { + // Тип группы определяет источник настроек + var isGroupLevel = jobGroup?.GroupType?.IsJobGroupAutoControl == true; + + if (isGroupLevel && jobGroup!.AutoControl != null) + { + return ( + jobGroup.AutoControl.InitUsedTemplateState, + jobGroup.AutoControl.InitUsedScheduleState + ); + } + + if (!isGroupLevel && job.AutoControl != null) + { + return ( + job.AutoControl.InitUsedTemplateState, + job.AutoControl.InitUsedScheduleState + ); + } + + return (defaultTemplateState, defaultScheduleState); + } + } +} diff --git a/PARR.TemplateMatcher/Services/GroupedSync/GroupedSyncContext.cs b/PARR.TemplateMatcher/Services/GroupedSync/GroupedSyncContext.cs index 0a31a947..bc3f332d 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/GroupedSyncContext.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/GroupedSyncContext.cs @@ -1,6 +1,6 @@ using PARR.Core.Services.UnitFilterService.Models; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.TemplateMatcher.Models; diff --git a/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateBuilder.cs b/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateBuilder.cs index c09f9fc1..fa85da21 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateBuilder.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateBuilder.cs @@ -4,7 +4,7 @@ using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.Shortcodes; using PARR.Domain.Constants; using PARR.Domain.Entities; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.TemplateMatcher.Models; diff --git a/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateProcessor.cs b/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateProcessor.cs index 0234c9f4..c2db4fc7 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateProcessor.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/GroupedTemplateProcessor.cs @@ -6,7 +6,7 @@ using PARR.Core.Repositories.Interfaces.Unit; using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; using PARR.TemplateMatcher.Models; using PARR.TemplateMatcher.Services.Interfaces; diff --git a/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateBuilder.cs b/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateBuilder.cs index d763ab0c..9ac61f6e 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateBuilder.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateBuilder.cs @@ -1,4 +1,4 @@ -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; using PARR.TemplateMatcher.Models; diff --git a/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateProcessor.cs b/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateProcessor.cs index 7aee31be..c7966001 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateProcessor.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/IGroupedTemplateProcessor.cs @@ -1,5 +1,5 @@ using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.TemplateMatcher.Models; namespace PARR.TemplateMatcher.Services.GroupedSync; diff --git a/PARR.TemplateMatcher/Services/GroupedSync/IUnitInTemplateConflictMapper.cs b/PARR.TemplateMatcher/Services/GroupedSync/IUnitInTemplateConflictMapper.cs index bebba37f..985fd970 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/IUnitInTemplateConflictMapper.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/IUnitInTemplateConflictMapper.cs @@ -1,5 +1,5 @@ using PARR.Core.Services.UnitFilterService.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.TemplateMatcher.Services.GroupedSync { diff --git a/PARR.TemplateMatcher/Services/GroupedSync/LoadJobGroupStage.cs b/PARR.TemplateMatcher/Services/GroupedSync/LoadJobGroupStage.cs index 115be29f..a7e8fb67 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/LoadJobGroupStage.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/LoadJobGroupStage.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; using PARR.TemplateMatcher.Services.GroupedSync; namespace PARR.TemplateMatcher.Services.Implementations.GroupedSync; @@ -24,6 +24,7 @@ internal class LoadJobGroupStage : IGroupedSyncStage .AsNoTracking() .AsSingleQuery() .Include(jg => jg.GroupType) + .Include(jg => jg.AutoControl) .Include(jg => jg.Jobs).ThenInclude(j => j.AutoControl) .Include(jg => jg.Jobs).ThenInclude(j => j.UnitFilters) .ThenInclude(uf => uf.RelationshipFilters).ThenInclude(rf => rf.UnitField) diff --git a/PARR.TemplateMatcher/Services/GroupedSync/UnitInTemplateConflictMapper.cs b/PARR.TemplateMatcher/Services/GroupedSync/UnitInTemplateConflictMapper.cs index 952ca8fd..4c4e3e67 100644 --- a/PARR.TemplateMatcher/Services/GroupedSync/UnitInTemplateConflictMapper.cs +++ b/PARR.TemplateMatcher/Services/GroupedSync/UnitInTemplateConflictMapper.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.UnitFilterService.Models; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.TemplateMatcher.Services.GroupedSync; internal class UnitInTemplateConflictMapper : IUnitInTemplateConflictMapper diff --git a/PARR.TemplateMatcher/Services/Implementations/JobValidatorService.cs b/PARR.TemplateMatcher/Services/Implementations/JobValidatorService.cs index 528e0f51..7ab8de1a 100644 --- a/PARR.TemplateMatcher/Services/Implementations/JobValidatorService.cs +++ b/PARR.TemplateMatcher/Services/Implementations/JobValidatorService.cs @@ -1,5 +1,5 @@ using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.TemplateMatcher.Services.Interfaces; namespace PARR.TemplateMatcher.Services.Implementations diff --git a/PARR.TemplateMatcher/Services/Implementations/SimpleTemplateSynchronizer.cs b/PARR.TemplateMatcher/Services/Implementations/SimpleTemplateSynchronizer.cs index 00ba7f30..27db4b42 100644 --- a/PARR.TemplateMatcher/Services/Implementations/SimpleTemplateSynchronizer.cs +++ b/PARR.TemplateMatcher/Services/Implementations/SimpleTemplateSynchronizer.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using PARR.Core.Common.Interfaces.RabbitServices; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.MatchingStatusService; using PARR.Core.Services.UnitFilterService; @@ -11,7 +11,7 @@ using PARR.Domain.Cache.Models; using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; using PARR.Domain.Settings; diff --git a/PARR.TemplateMatcher/Services/Implementations/TemplateDeactivator.cs b/PARR.TemplateMatcher/Services/Implementations/TemplateDeactivator.cs index a0851e2a..d1974096 100644 --- a/PARR.TemplateMatcher/Services/Implementations/TemplateDeactivator.cs +++ b/PARR.TemplateMatcher/Services/Implementations/TemplateDeactivator.cs @@ -2,11 +2,11 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; using PARR.Domain.Settings; using PARR.TemplateMatcher.Services.Interfaces; diff --git a/PARR.TemplateMatcher/Services/Implementations/TemplateMatcher.cs b/PARR.TemplateMatcher/Services/Implementations/TemplateMatcher.cs index ccf35168..15da9ca3 100644 --- a/PARR.TemplateMatcher/Services/Implementations/TemplateMatcher.cs +++ b/PARR.TemplateMatcher/Services/Implementations/TemplateMatcher.cs @@ -1,8 +1,9 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobGroupRepositories; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; using PARR.TemplateMatcher.Services.GroupedSync; using PARR.TemplateMatcher.Services.Interfaces; diff --git a/PARR.TemplateMatcher/Services/Implementations/TemplateReuser.cs b/PARR.TemplateMatcher/Services/Implementations/TemplateReuser.cs index cbf59631..16ea0117 100644 --- a/PARR.TemplateMatcher/Services/Implementations/TemplateReuser.cs +++ b/PARR.TemplateMatcher/Services/Implementations/TemplateReuser.cs @@ -4,7 +4,7 @@ using PARR.Core.Repositories.Interfaces; using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; using PARR.TemplateMatcher.Services.Interfaces; diff --git a/PARR.TemplateMatcher/Services/Interfaces/ITemplateReuser.cs b/PARR.TemplateMatcher/Services/Interfaces/ITemplateReuser.cs index 39a6e13a..666d6cc4 100644 --- a/PARR.TemplateMatcher/Services/Interfaces/ITemplateReuser.cs +++ b/PARR.TemplateMatcher/Services/Interfaces/ITemplateReuser.cs @@ -1,6 +1,6 @@ using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.Unit; namespace PARR.TemplateMatcher.Services.Interfaces diff --git a/PARR.TemplateMatcher/Services/SimpleSync/LoadJobStage.cs b/PARR.TemplateMatcher/Services/SimpleSync/LoadJobStage.cs index 2e0133b8..d4849ddf 100644 --- a/PARR.TemplateMatcher/Services/SimpleSync/LoadJobStage.cs +++ b/PARR.TemplateMatcher/Services/SimpleSync/LoadJobStage.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.TemplateMatcher.Services.SimpleSync; namespace PARR.TemplateMatcher.Services.Implementations.SimpleSync; @@ -26,6 +26,7 @@ internal class LoadJobStage : ISimpleSyncStage .Include(j => j.AutoControl) .Include(j => j.Tnk) .Include(j => j.Group).ThenInclude(g => g!.GroupType) + .Include(j => j.AutoControl) .Include(j => j.UnitFilters).ThenInclude(uf => uf.RelationshipFilters) .FirstOrDefaultAsync(j => j.Id == context.JobId, ct); diff --git a/PARR.TemplateMatcher/Services/SimpleSync/SimpleSyncContext.cs b/PARR.TemplateMatcher/Services/SimpleSync/SimpleSyncContext.cs index 4d73958b..a64ffda7 100644 --- a/PARR.TemplateMatcher/Services/SimpleSync/SimpleSyncContext.cs +++ b/PARR.TemplateMatcher/Services/SimpleSync/SimpleSyncContext.cs @@ -1,6 +1,6 @@ using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; namespace PARR.TemplateMatcher.Services.SimpleSync { diff --git a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs index 12c0b282..ca86b4e5 100644 --- a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs +++ b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs @@ -2,11 +2,11 @@ using Microsoft.Extensions.Logging; using PARR.Core.Extensions; using PARR.Core.Repositories.Interfaces; -using PARR.Core.Repositories.Interfaces.Job; +using PARR.Core.Repositories.Interfaces.JobRepositories; using PARR.Core.Repositories.Interfaces.Unit; using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Rabbit.Messages.TemplateMatching; -using PARR.Domain.Entities.Job; +using PARR.Domain.Entities.JobEntities; using PARR.Domain.Enums; namespace PARR.TemplateUpdater.Services