From a89605d02a3a647499f3ae2769524740366ead57 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Mon, 4 May 2026 11:55:07 +1000 Subject: [PATCH] =?UTF-8?q?feat(dal,core):=20=D0=9F=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D1=8B=20=D0=BE=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=B2=D1=88=D0=B8=D0=B5=D1=81=D1=8F=20=D0=BE=D0=B1=D1=8A=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D1=8B=20=D0=B8=D0=B7=20dal=20=20=D0=B2=20core.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V1/Requests/Queries/ApplicationQuery.cs | 4 +- PARR.API/Controllers/V1/JobController.cs | 6 +- PARR.API/Controllers/V1/JobGroupController.cs | 2 +- .../V1/JobUnitPreviewController.cs | 2 +- .../Controllers/V1/RobotTaskController.cs | 6 +- .../V1/ShortcodeApplyController.cs | 2 +- .../Controllers/V1/ShortcodeController.cs | 2 +- .../V1/Statistics/StatOrderController.cs | 2 +- .../V1/Statistics/StatRobotTaskController.cs | 2 - .../StatTemplateAutoControlController.cs | 2 +- .../V1/Statistics/StatTemplateController.cs | 3 +- .../StatTemplateDistributionController.cs | 4 +- .../V1/Statistics/StatUnitController.cs | 2 +- .../StatUnitFieldValuesController.cs | 2 +- PARR.API/Controllers/V1/SyncTaskController.cs | 2 +- PARR.API/Controllers/V1/TemplateController.cs | 4 +- .../V1/TemplateSyncStateController.cs | 1 - PARR.API/Controllers/V1/TestController.cs | 3 +- .../DomainToResponseProfile.cs | 3 +- .../Resolvers/JobGroupScheduleResolver.cs | 2 +- .../RobotTaskScheduleRepeatRangeResolver.cs | 2 +- .../RobotTaskTemplateCategoryResolver.cs | 2 +- .../RobotTaskTemplateClosingCodeResolver.cs | 2 +- .../RobotTaskTemplateInitiatorResolver.cs | 2 +- .../Resolvers/TemplateCategoryResolver.cs | 2 +- .../Resolvers/TemplateClosingCodeResolver.cs | 2 +- .../Resolvers/TemplateInitiatorResolver.cs | 2 +- .../Resolvers/TemplateScheduleResolver.cs | 2 +- .../RobotHistoryRequestValidator.cs | 1 - .../TemplateRobotStatusRequestValidator.cs | 1 - PARR.Core/DependencyInjection.cs | 30 +++++++++- .../Extensions/GeneralExtesions.cs | 2 +- PARR.Core/PARR.Core.csproj | 1 + PARR.Core/Properties/AssemblyInfo.cs | 4 ++ .../Interfaces/Unit/IUnitInValueRepository.cs | 2 + .../Interfaces/Unit/IUnitRepository.cs | 12 ++++ .../IMatchingStatusService.cs | 6 +- .../MatchingStatusService.cs | 5 +- .../NextRunServices/INextRunService.cs | 4 +- .../Models/TemplateNextRunDto.cs | 2 +- .../Models/TemplateNextRunResultDto.cs | 2 +- .../Models/TemplateWithWorkGroupDto.cs | 2 +- .../NextRunServices/NextRunService.cs | 10 ++-- .../EsppScheduleTransformService.cs | 4 +- .../IEsppScheduleTransformService.cs | 2 +- .../Subservices/ITemplateDistributor.cs | 4 +- .../Subservices/TemplateDistributor.cs | 4 +- .../Shortcodes/IShortcodesService.cs | 4 +- .../Services}/Shortcodes/ShortcodesService.cs | 8 +-- .../UnitFilterService/IUnitFilterService.cs | 4 +- .../Models/FilteredUnitContext.cs | 2 +- .../Models/RelatedUnitDto.cs | 2 +- .../Models/UnitFilterResultDto.cs | 2 +- .../Models/UnitFilterServiceOptions.cs | 2 +- .../UnitFilterService/Models/UnitValueDto.cs | 2 +- .../UnitFilterService/UnitFilterService.cs | 57 +++++++++++-------- .../UnitFilterServiceIntegrationTests.cs | 2 +- .../PARR.DAL.IntegrationTests.csproj | 1 + .../TestDataGenerator.cs | 4 -- .../Implementations/ShortcodesServiceTests.cs | 6 +- PARR.DAL.Tests/TestDataGenerator.cs | 7 +-- .../EsppScheduleTransformServiceTests.cs | 3 +- .../DbSettings/DBConfigurationProvider.cs | 2 +- PARR.DAL/Context/DataContext.cs | 4 +- PARR.DAL/DependencyInjection.cs | 28 ++++----- .../EsppSchTypeConfigRepository.cs | 1 - ...cheduleResponseAreaTimeOffsetRepository.cs | 2 +- .../Unit/UnitInValueRepository.cs | 23 ++++++++ PARR.DAL/Repositories/Unit/UnitRepository.cs | 38 +++++++++++++ PARR.DAL/Repositories/WeekendDayRepository.cs | 2 +- .../DTOs/Matching}/MatchingStatus.cs | 2 +- .../DTOs/Shortcode}/ShortcodeInfoDto.cs | 2 +- .../Settings}/AIHTITSettings.cs | 5 +- .../Settings}/SettingsFromDb.cs | 21 +++++-- PARR.EsppOrderLoader/EsppOrderLoader.cs | 2 +- PARR.EsppScheduleSync/ScheduleSyncher.cs | 4 +- PARR.EsppSync/SyncService.cs | 2 +- PARR.EsppTemplateSync/TemplateMQSyncer.cs | 2 +- PARR.NextRun/Services/NextRunUpdateService.cs | 2 +- .../TemplateDistributor.cs | 2 +- .../TemplateGenerator.cs | 4 +- .../GroupedTemplateSynchronizer.cs | 4 +- .../SimpleTemplateSynchronizer.cs | 8 +-- .../Implemetaions/TemplateDeactivator.cs | 2 +- .../Implemetaions/TemplateNameNormalizer.cs | 2 +- .../Services/TemplateUpdaterService.cs | 4 +- PARR.Test/NextRun/NextRunTest.cs | 6 +- 87 files changed, 276 insertions(+), 174 deletions(-) rename {PARR.DAL => PARR.Core}/Extensions/GeneralExtesions.cs (98%) create mode 100644 PARR.Core/Properties/AssemblyInfo.cs rename {PARR.DAL/DomainServices/Interfaces => PARR.Core/Services/MatchingStatusService}/IMatchingStatusService.cs (91%) rename {PARR.DAL/DomainServices/Implementations => PARR.Core/Services/MatchingStatusService}/MatchingStatusService.cs (97%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/INextRunService.cs (97%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/Models/TemplateNextRunDto.cs (85%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/Models/TemplateNextRunResultDto.cs (88%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/Models/TemplateWithWorkGroupDto.cs (65%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/NextRunService.cs (99%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/Subservices/EsppScheduleTransformService.cs (99%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/Subservices/IEsppScheduleTransformService.cs (93%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/Subservices/ITemplateDistributor.cs (96%) rename {PARR.DAL => PARR.Core/Services}/NextRunServices/Subservices/TemplateDistributor.cs (99%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/Shortcodes/IShortcodesService.cs (80%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/Shortcodes/ShortcodesService.cs (99%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/UnitFilterService/IUnitFilterService.cs (97%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/UnitFilterService/Models/FilteredUnitContext.cs (78%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/UnitFilterService/Models/RelatedUnitDto.cs (91%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/UnitFilterService/Models/UnitFilterResultDto.cs (94%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/UnitFilterService/Models/UnitFilterServiceOptions.cs (64%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/UnitFilterService/Models/UnitValueDto.cs (85%) rename {PARR.DAL/DomainServices => PARR.Core/Services}/UnitFilterService/UnitFilterService.cs (96%) rename {PARR.DAL/DomainModels => PARR.Domain/DTOs/Matching}/MatchingStatus.cs (96%) rename {PARR.DAL/DomainModels => PARR.Domain/DTOs/Shortcode}/ShortcodeInfoDto.cs (86%) rename {PARR.DAL/Contracts => PARR.Domain/Settings}/AIHTITSettings.cs (68%) rename {PARR.DAL/Contracts => PARR.Domain/Settings}/SettingsFromDb.cs (89%) diff --git a/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs index 2068773b..6fe07215 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs @@ -1,6 +1,4 @@ -using PARR.DAL.Contracts; - -namespace PARR.API.Contracts.V1.Requests.Queries +namespace PARR.API.Contracts.V1.Requests.Queries { public class ApplicationQuery { diff --git a/PARR.API/Controllers/V1/JobController.cs b/PARR.API/Controllers/V1/JobController.cs index 8de9cd89..621554c1 100644 --- a/PARR.API/Controllers/V1/JobController.cs +++ b/PARR.API/Controllers/V1/JobController.cs @@ -14,12 +14,12 @@ using PARR.API.Services.Interfaces; using PARR.API.Settings; 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.Unit; -using PARR.DAL.DomainServices.Interfaces; -using PARR.DAL.DomainServices.UnitFilterService; -using PARR.DAL.Extensions; +using PARR.Core.Services.MatchingStatusService; +using PARR.Core.Services.UnitFilterService; using PARR.Domain.Common.Pagination; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Common.Roles; diff --git a/PARR.API/Controllers/V1/JobGroupController.cs b/PARR.API/Controllers/V1/JobGroupController.cs index a24ef402..e568e2f9 100644 --- a/PARR.API/Controllers/V1/JobGroupController.cs +++ b/PARR.API/Controllers/V1/JobGroupController.cs @@ -16,7 +16,7 @@ using PARR.Core.Common.Helpers; using PARR.Core.Common.Interfaces.RabbitServices; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.DomainServices.Interfaces; +using PARR.Core.Services.MatchingStatusService; using PARR.Domain.Common.Pagination; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Common.Roles; diff --git a/PARR.API/Controllers/V1/JobUnitPreviewController.cs b/PARR.API/Controllers/V1/JobUnitPreviewController.cs index 00ee45a5..9d0993a8 100644 --- a/PARR.API/Controllers/V1/JobUnitPreviewController.cs +++ b/PARR.API/Controllers/V1/JobUnitPreviewController.cs @@ -10,7 +10,7 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.DomainServices.UnitFilterService; +using PARR.Core.Services.UnitFilterService; using PARR.Domain.Common.Roles; using Job = PARR.Domain.Entities.Job.Job; diff --git a/PARR.API/Controllers/V1/RobotTaskController.cs b/PARR.API/Controllers/V1/RobotTaskController.cs index 567fcda2..8f9af29f 100644 --- a/PARR.API/Controllers/V1/RobotTaskController.cs +++ b/PARR.API/Controllers/V1/RobotTaskController.cs @@ -10,13 +10,13 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.BLL.Helpers; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.Contracts; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Common.Roles; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; +using PARR.Domain.Settings; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ShortcodeApplyController.cs b/PARR.API/Controllers/V1/ShortcodeApplyController.cs index 7fa0251a..d80060d7 100644 --- a/PARR.API/Controllers/V1/ShortcodeApplyController.cs +++ b/PARR.API/Controllers/V1/ShortcodeApplyController.cs @@ -6,7 +6,7 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.DomainServices.Shortcodes; +using PARR.Core.Services.Shortcodes; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ShortcodeController.cs b/PARR.API/Controllers/V1/ShortcodeController.cs index 213a8277..cd67aac1 100644 --- a/PARR.API/Controllers/V1/ShortcodeController.cs +++ b/PARR.API/Controllers/V1/ShortcodeController.cs @@ -5,7 +5,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.DAL.DomainServices.Shortcodes; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 diff --git a/PARR.API/Controllers/V1/Statistics/StatOrderController.cs b/PARR.API/Controllers/V1/Statistics/StatOrderController.cs index e90fe970..583c9ab3 100644 --- a/PARR.API/Controllers/V1/Statistics/StatOrderController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatOrderController.cs @@ -10,7 +10,7 @@ using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics diff --git a/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs b/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs index da615373..ba9862fb 100644 --- a/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs @@ -2,14 +2,12 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using NodaTime.Extensions; using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.Contracts; using PARR.Domain.Common.Roles; using PARR.Domain.Enums; diff --git a/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs b/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs index 1247869b..49205754 100644 --- a/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs @@ -7,7 +7,7 @@ using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1.Statistics diff --git a/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs b/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs index f6ade931..4863e6ec 100644 --- a/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs @@ -8,8 +8,7 @@ using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.Contracts; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Roles; using PARR.Domain.Enums; diff --git a/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs b/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs index 00f15a6d..0261d5f1 100644 --- a/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs @@ -11,8 +11,8 @@ using PARR.API.Controllers.V1.Base; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Common.Roles; using PARR.Domain.Entities; using PARR.Domain.Entities.Job; diff --git a/PARR.API/Controllers/V1/Statistics/StatUnitController.cs b/PARR.API/Controllers/V1/Statistics/StatUnitController.cs index facec2ad..3883f50b 100644 --- a/PARR.API/Controllers/V1/Statistics/StatUnitController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatUnitController.cs @@ -8,7 +8,7 @@ using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics diff --git a/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs b/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs index b6916b96..14bee057 100644 --- a/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs @@ -7,7 +7,7 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics diff --git a/PARR.API/Controllers/V1/SyncTaskController.cs b/PARR.API/Controllers/V1/SyncTaskController.cs index ec66348e..9b7425b9 100644 --- a/PARR.API/Controllers/V1/SyncTaskController.cs +++ b/PARR.API/Controllers/V1/SyncTaskController.cs @@ -6,7 +6,7 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.API.Settings; using PARR.Core.Common.Interfaces.RabbitServices; -using PARR.DAL.DomainServices.Interfaces; +using PARR.Core.Services.MatchingStatusService; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; diff --git a/PARR.API/Controllers/V1/TemplateController.cs b/PARR.API/Controllers/V1/TemplateController.cs index 038e909b..e12dc6f9 100644 --- a/PARR.API/Controllers/V1/TemplateController.cs +++ b/PARR.API/Controllers/V1/TemplateController.cs @@ -14,13 +14,13 @@ using PARR.BLL.Helpers; using PARR.Core.Common.Helpers; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.Contracts; -using PARR.DAL.DomainServices.Shortcodes; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Common.Pagination; using PARR.Domain.Common.Roles; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; +using PARR.Domain.Settings; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/TemplateSyncStateController.cs b/PARR.API/Controllers/V1/TemplateSyncStateController.cs index 90d72794..573b624c 100644 --- a/PARR.API/Controllers/V1/TemplateSyncStateController.cs +++ b/PARR.API/Controllers/V1/TemplateSyncStateController.cs @@ -7,7 +7,6 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.Contracts; using PARR.Domain.Common.Roles; using PARR.Domain.Enums; diff --git a/PARR.API/Controllers/V1/TestController.cs b/PARR.API/Controllers/V1/TestController.cs index 0c79222c..8e2032dd 100644 --- a/PARR.API/Controllers/V1/TestController.cs +++ b/PARR.API/Controllers/V1/TestController.cs @@ -7,8 +7,7 @@ using PARR.API.Services.Interfaces; using PARR.API.Settings; using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.NextRunServices; - +using PARR.Core.Services.NextRunServices; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/MappingProfiles/DomainToResponseProfile.cs b/PARR.API/MappingProfiles/DomainToResponseProfile.cs index a13440fc..42e4c730 100644 --- a/PARR.API/MappingProfiles/DomainToResponseProfile.cs +++ b/PARR.API/MappingProfiles/DomainToResponseProfile.cs @@ -3,7 +3,8 @@ using PARR.API.Authentication.Models; using PARR.API.Contracts.V1.Responses; using PARR.API.MappingProfiles.Resolvers; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.DomainModels; +using PARR.Domain.DTOs.Matching; +using PARR.Domain.DTOs.Shortcode; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.Job; diff --git a/PARR.API/MappingProfiles/Resolvers/JobGroupScheduleResolver.cs b/PARR.API/MappingProfiles/Resolvers/JobGroupScheduleResolver.cs index 9c24d22d..25ea36e9 100644 --- a/PARR.API/MappingProfiles/Resolvers/JobGroupScheduleResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/JobGroupScheduleResolver.cs @@ -1,8 +1,8 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.Contracts; using PARR.Domain.Entities.Job; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/RobotTaskScheduleRepeatRangeResolver.cs b/PARR.API/MappingProfiles/Resolvers/RobotTaskScheduleRepeatRangeResolver.cs index fd4da706..0e0814c0 100644 --- a/PARR.API/MappingProfiles/Resolvers/RobotTaskScheduleRepeatRangeResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/RobotTaskScheduleRepeatRangeResolver.cs @@ -1,7 +1,7 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateCategoryResolver.cs b/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateCategoryResolver.cs index 6e4c742f..1da8eb0d 100644 --- a/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateCategoryResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateCategoryResolver.cs @@ -1,7 +1,7 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateClosingCodeResolver.cs b/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateClosingCodeResolver.cs index 6af28abf..127e1da1 100644 --- a/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateClosingCodeResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateClosingCodeResolver.cs @@ -1,7 +1,7 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateInitiatorResolver.cs b/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateInitiatorResolver.cs index eb2a3c13..2ee640c0 100644 --- a/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateInitiatorResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/RobotTaskTemplateInitiatorResolver.cs @@ -1,7 +1,7 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/TemplateCategoryResolver.cs b/PARR.API/MappingProfiles/Resolvers/TemplateCategoryResolver.cs index 17cf0049..32008c87 100644 --- a/PARR.API/MappingProfiles/Resolvers/TemplateCategoryResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/TemplateCategoryResolver.cs @@ -1,7 +1,7 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/TemplateClosingCodeResolver.cs b/PARR.API/MappingProfiles/Resolvers/TemplateClosingCodeResolver.cs index 2fd95d47..f9921ea8 100644 --- a/PARR.API/MappingProfiles/Resolvers/TemplateClosingCodeResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/TemplateClosingCodeResolver.cs @@ -1,7 +1,7 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/TemplateInitiatorResolver.cs b/PARR.API/MappingProfiles/Resolvers/TemplateInitiatorResolver.cs index e1e3935b..f5dcb85a 100644 --- a/PARR.API/MappingProfiles/Resolvers/TemplateInitiatorResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/TemplateInitiatorResolver.cs @@ -1,7 +1,7 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/MappingProfiles/Resolvers/TemplateScheduleResolver.cs b/PARR.API/MappingProfiles/Resolvers/TemplateScheduleResolver.cs index 3f7ba436..9449dbd7 100644 --- a/PARR.API/MappingProfiles/Resolvers/TemplateScheduleResolver.cs +++ b/PARR.API/MappingProfiles/Resolvers/TemplateScheduleResolver.cs @@ -1,8 +1,8 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.API.MappingProfiles.Resolvers { diff --git a/PARR.API/Validators/RobotHistoryRequestValidator.cs b/PARR.API/Validators/RobotHistoryRequestValidator.cs index 91053b1f..d0773ebc 100644 --- a/PARR.API/Validators/RobotHistoryRequestValidator.cs +++ b/PARR.API/Validators/RobotHistoryRequestValidator.cs @@ -1,6 +1,5 @@ using FluentValidation; using PARR.API.Contracts.V1.Requests; -using PARR.DAL.Contracts; using PARR.Domain.Enums; namespace PARR.API.Validators diff --git a/PARR.API/Validators/TemplateRobotStatusRequestValidator.cs b/PARR.API/Validators/TemplateRobotStatusRequestValidator.cs index f79fe2a1..357f3bc2 100644 --- a/PARR.API/Validators/TemplateRobotStatusRequestValidator.cs +++ b/PARR.API/Validators/TemplateRobotStatusRequestValidator.cs @@ -1,6 +1,5 @@ using FluentValidation; using PARR.API.Contracts.V1.Requests; -using PARR.DAL.Contracts; using PARR.Domain.Enums; namespace PARR.API.Validators diff --git a/PARR.Core/DependencyInjection.cs b/PARR.Core/DependencyInjection.cs index caad7159..f9ee8c39 100644 --- a/PARR.Core/DependencyInjection.cs +++ b/PARR.Core/DependencyInjection.cs @@ -3,12 +3,18 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using PARR.Core.Common.Implementations; using PARR.Core.Common.Interfaces; +using PARR.Core.Services.MatchingStatusService; +using PARR.Core.Services.NextRunServices; +using PARR.Core.Services.NextRunServices.Subservices; +using PARR.Core.Services.Shortcodes; using PARR.Core.Services.TaskServices.Handlers; using PARR.Core.Services.TaskServices.Handlers.Factory; using PARR.Core.Services.TaskServices.Implementations; using PARR.Core.Services.TaskServices.Interfaces; using PARR.Core.Services.TaskServices.Providers; using PARR.Core.Services.TaskServices.ReconciliationHosted; +using PARR.Core.Services.UnitFilterService; +using PARR.Core.Services.UnitFilterService.Models; using PARR.Core.Services.Workload.Implementations; using PARR.Core.Services.Workload.Interfaces; using PARR.Domain.Enums; @@ -65,9 +71,31 @@ namespace PARR.Core #region Services + services.AddTransient(); + services.AddTransient(); + //services.AddScoped(); - //services.AddTransient(); + + + + #endregion + + #region NextRun + + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + #endregion + + #region UnitFilterService + + services.AddTransient(); + services.Configure(options => + { + options.LoadBatchSize = 50; + }); #endregion diff --git a/PARR.DAL/Extensions/GeneralExtesions.cs b/PARR.Core/Extensions/GeneralExtesions.cs similarity index 98% rename from PARR.DAL/Extensions/GeneralExtesions.cs rename to PARR.Core/Extensions/GeneralExtesions.cs index 808fb825..d5099bf7 100644 --- a/PARR.DAL/Extensions/GeneralExtesions.cs +++ b/PARR.Core/Extensions/GeneralExtesions.cs @@ -2,7 +2,7 @@ using System.Text.Json; using System.Text.Unicode; -namespace PARR.DAL.Extensions +namespace PARR.Core.Extensions { public static class GeneralExtesions { diff --git a/PARR.Core/PARR.Core.csproj b/PARR.Core/PARR.Core.csproj index a7524906..ede68966 100644 --- a/PARR.Core/PARR.Core.csproj +++ b/PARR.Core/PARR.Core.csproj @@ -15,6 +15,7 @@ + diff --git a/PARR.Core/Properties/AssemblyInfo.cs b/PARR.Core/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..ec359717 --- /dev/null +++ b/PARR.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,4 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("PARR.DAL.Tests")] +[assembly: InternalsVisibleTo("PARR.DAL.IntegrationTests")] diff --git a/PARR.Core/Repositories/Interfaces/Unit/IUnitInValueRepository.cs b/PARR.Core/Repositories/Interfaces/Unit/IUnitInValueRepository.cs index 240cca22..7c9f5c56 100644 --- a/PARR.Core/Repositories/Interfaces/Unit/IUnitInValueRepository.cs +++ b/PARR.Core/Repositories/Interfaces/Unit/IUnitInValueRepository.cs @@ -24,5 +24,7 @@ namespace PARR.Core.Repositories.Interfaces.Unit Task GetMostFrequentValueForFieldAsync(List unitIds, string fieldName); IQueryable Get(); + + IQueryable GetMatchingTargetIds(Guid fieldId, string valueMask); } } diff --git a/PARR.Core/Repositories/Interfaces/Unit/IUnitRepository.cs b/PARR.Core/Repositories/Interfaces/Unit/IUnitRepository.cs index be3443f7..f5f0bfed 100644 --- a/PARR.Core/Repositories/Interfaces/Unit/IUnitRepository.cs +++ b/PARR.Core/Repositories/Interfaces/Unit/IUnitRepository.cs @@ -4,6 +4,18 @@ namespace PARR.Core.Repositories.Interfaces.Unit { public interface IUnitRepository : IBaseRepository { + IQueryable GetInitialUnitIds(string dbValueMask); + + /// + /// Получить юниты по Id атрибута и маски значения + /// + /// + /// + /// + /// true - не содержит, false - содержит + /// + IQueryable GetUnitByFieldAndValue(IQueryable query, Guid fieldId, string valueMask, bool isInverse = false); + IQueryable GetWithIncludes(); } } diff --git a/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs b/PARR.Core/Services/MatchingStatusService/IMatchingStatusService.cs similarity index 91% rename from PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs rename to PARR.Core/Services/MatchingStatusService/IMatchingStatusService.cs index b2f11758..63ca9d35 100644 --- a/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs +++ b/PARR.Core/Services/MatchingStatusService/IMatchingStatusService.cs @@ -1,8 +1,8 @@ -using PARR.DAL.DomainModels; -using PARR.Domain.Cache.Models; +using PARR.Domain.Cache.Models; +using PARR.Domain.DTOs.Matching; using PARR.Domain.Enums; -namespace PARR.DAL.DomainServices.Interfaces +namespace PARR.Core.Services.MatchingStatusService { /// /// Сервис по управлению статусом Matching`a diff --git a/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs b/PARR.Core/Services/MatchingStatusService/MatchingStatusService.cs similarity index 97% rename from PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs rename to PARR.Core/Services/MatchingStatusService/MatchingStatusService.cs index 19bd9c14..93fef426 100644 --- a/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs +++ b/PARR.Core/Services/MatchingStatusService/MatchingStatusService.cs @@ -1,12 +1,11 @@ using Microsoft.EntityFrameworkCore; using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces.Job; -using PARR.DAL.DomainModels; -using PARR.DAL.DomainServices.Interfaces; using PARR.Domain.Cache.Models; +using PARR.Domain.DTOs.Matching; using PARR.Domain.Enums; -namespace PARR.DAL.DomainServices.Implementations +namespace PARR.Core.Services.MatchingStatusService { internal class MatchingStatusService : IMatchingStatusService { diff --git a/PARR.DAL/NextRunServices/INextRunService.cs b/PARR.Core/Services/NextRunServices/INextRunService.cs similarity index 97% rename from PARR.DAL/NextRunServices/INextRunService.cs rename to PARR.Core/Services/NextRunServices/INextRunService.cs index 9031e522..32b505c4 100644 --- a/PARR.DAL/NextRunServices/INextRunService.cs +++ b/PARR.Core/Services/NextRunServices/INextRunService.cs @@ -1,8 +1,8 @@ -using PARR.DAL.NextRunServices.Models; +using PARR.Core.Services.NextRunServices.Models; using PARR.Domain.Entities.Job; using PARR.Domain.Enums; -namespace PARR.DAL.NextRunServices +namespace PARR.Core.Services.NextRunServices { public interface INextRunService { diff --git a/PARR.DAL/NextRunServices/Models/TemplateNextRunDto.cs b/PARR.Core/Services/NextRunServices/Models/TemplateNextRunDto.cs similarity index 85% rename from PARR.DAL/NextRunServices/Models/TemplateNextRunDto.cs rename to PARR.Core/Services/NextRunServices/Models/TemplateNextRunDto.cs index e2a498f6..db90f6c3 100644 --- a/PARR.DAL/NextRunServices/Models/TemplateNextRunDto.cs +++ b/PARR.Core/Services/NextRunServices/Models/TemplateNextRunDto.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.NextRunServices.Models +namespace PARR.Core.Services.NextRunServices.Models { /// /// Модель шаблона, для расчета NextRun diff --git a/PARR.DAL/NextRunServices/Models/TemplateNextRunResultDto.cs b/PARR.Core/Services/NextRunServices/Models/TemplateNextRunResultDto.cs similarity index 88% rename from PARR.DAL/NextRunServices/Models/TemplateNextRunResultDto.cs rename to PARR.Core/Services/NextRunServices/Models/TemplateNextRunResultDto.cs index 4852c7b4..adcdf6c5 100644 --- a/PARR.DAL/NextRunServices/Models/TemplateNextRunResultDto.cs +++ b/PARR.Core/Services/NextRunServices/Models/TemplateNextRunResultDto.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.NextRunServices.Models +namespace PARR.Core.Services.NextRunServices.Models { /// /// Модель, результат распределения шаблона diff --git a/PARR.DAL/NextRunServices/Models/TemplateWithWorkGroupDto.cs b/PARR.Core/Services/NextRunServices/Models/TemplateWithWorkGroupDto.cs similarity index 65% rename from PARR.DAL/NextRunServices/Models/TemplateWithWorkGroupDto.cs rename to PARR.Core/Services/NextRunServices/Models/TemplateWithWorkGroupDto.cs index cdae20a5..b3db1506 100644 --- a/PARR.DAL/NextRunServices/Models/TemplateWithWorkGroupDto.cs +++ b/PARR.Core/Services/NextRunServices/Models/TemplateWithWorkGroupDto.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.NextRunServices.Models +namespace PARR.Core.Services.NextRunServices.Models { internal record TemplateWithWorkGroupDto(Guid Id, DateTimeOffset? NextRun, string WorkGroup); diff --git a/PARR.DAL/NextRunServices/NextRunService.cs b/PARR.Core/Services/NextRunServices/NextRunService.cs similarity index 99% rename from PARR.DAL/NextRunServices/NextRunService.cs rename to PARR.Core/Services/NextRunServices/NextRunService.cs index a9042271..7c974df3 100644 --- a/PARR.DAL/NextRunServices/NextRunService.cs +++ b/PARR.Core/Services/NextRunServices/NextRunService.cs @@ -3,15 +3,15 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.Contracts; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.NextRunServices.Models; -using PARR.DAL.NextRunServices.Subservices; +using PARR.Core.Services.NextRunServices.Models; +using PARR.Core.Services.NextRunServices.Subservices; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Entities; using PARR.Domain.Entities.Job; using PARR.Domain.Enums; +using PARR.Domain.Settings; -namespace PARR.DAL.NextRunServices +namespace PARR.Core.Services.NextRunServices { internal class NextRunService : INextRunService { diff --git a/PARR.DAL/NextRunServices/Subservices/EsppScheduleTransformService.cs b/PARR.Core/Services/NextRunServices/Subservices/EsppScheduleTransformService.cs similarity index 99% rename from PARR.DAL/NextRunServices/Subservices/EsppScheduleTransformService.cs rename to PARR.Core/Services/NextRunServices/Subservices/EsppScheduleTransformService.cs index 43afa0d7..732ce214 100644 --- a/PARR.DAL/NextRunServices/Subservices/EsppScheduleTransformService.cs +++ b/PARR.Core/Services/NextRunServices/Subservices/EsppScheduleTransformService.cs @@ -1,10 +1,8 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.DomainModels; using PARR.Domain.Enums; -using System.Text.Json; -namespace PARR.DAL.NextRunServices.Subservices +namespace PARR.Core.Services.NextRunServices.Subservices { internal class EsppScheduleTransformService : IEsppScheduleTransformService { diff --git a/PARR.DAL/NextRunServices/Subservices/IEsppScheduleTransformService.cs b/PARR.Core/Services/NextRunServices/Subservices/IEsppScheduleTransformService.cs similarity index 93% rename from PARR.DAL/NextRunServices/Subservices/IEsppScheduleTransformService.cs rename to PARR.Core/Services/NextRunServices/Subservices/IEsppScheduleTransformService.cs index fc4e7d75..bc41daad 100644 --- a/PARR.DAL/NextRunServices/Subservices/IEsppScheduleTransformService.cs +++ b/PARR.Core/Services/NextRunServices/Subservices/IEsppScheduleTransformService.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.NextRunServices.Subservices +namespace PARR.Core.Services.NextRunServices.Subservices { /// /// Сервис трансформации расписания ЕСПП в дату/расписание diff --git a/PARR.DAL/NextRunServices/Subservices/ITemplateDistributor.cs b/PARR.Core/Services/NextRunServices/Subservices/ITemplateDistributor.cs similarity index 96% rename from PARR.DAL/NextRunServices/Subservices/ITemplateDistributor.cs rename to PARR.Core/Services/NextRunServices/Subservices/ITemplateDistributor.cs index 043fc44a..1081c721 100644 --- a/PARR.DAL/NextRunServices/Subservices/ITemplateDistributor.cs +++ b/PARR.Core/Services/NextRunServices/Subservices/ITemplateDistributor.cs @@ -1,6 +1,6 @@ -using PARR.DAL.NextRunServices.Models; +using PARR.Core.Services.NextRunServices.Models; -namespace PARR.DAL.NextRunServices.Subservices +namespace PARR.Core.Services.NextRunServices.Subservices { internal interface ITemplateDistributor { diff --git a/PARR.DAL/NextRunServices/Subservices/TemplateDistributor.cs b/PARR.Core/Services/NextRunServices/Subservices/TemplateDistributor.cs similarity index 99% rename from PARR.DAL/NextRunServices/Subservices/TemplateDistributor.cs rename to PARR.Core/Services/NextRunServices/Subservices/TemplateDistributor.cs index 4e8b2396..af81ea34 100644 --- a/PARR.DAL/NextRunServices/Subservices/TemplateDistributor.cs +++ b/PARR.Core/Services/NextRunServices/Subservices/TemplateDistributor.cs @@ -1,9 +1,9 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.NextRunServices.Models; +using PARR.Core.Services.NextRunServices.Models; -namespace PARR.DAL.NextRunServices.Subservices +namespace PARR.Core.Services.NextRunServices.Subservices { /// /// Распределитель шаблонов с поддержкой часовых поясов. diff --git a/PARR.DAL/DomainServices/Shortcodes/IShortcodesService.cs b/PARR.Core/Services/Shortcodes/IShortcodesService.cs similarity index 80% rename from PARR.DAL/DomainServices/Shortcodes/IShortcodesService.cs rename to PARR.Core/Services/Shortcodes/IShortcodesService.cs index 43fa9e3e..1355061d 100644 --- a/PARR.DAL/DomainServices/Shortcodes/IShortcodesService.cs +++ b/PARR.Core/Services/Shortcodes/IShortcodesService.cs @@ -1,8 +1,8 @@ -using PARR.DAL.DomainModels; +using PARR.Domain.DTOs.Shortcode; using PARR.Domain.Entities; using System.Runtime.CompilerServices; -namespace PARR.DAL.DomainServices.Shortcodes +namespace PARR.Core.Services.Shortcodes { public interface IShortcodesService { diff --git a/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs b/PARR.Core/Services/Shortcodes/ShortcodesService.cs similarity index 99% rename from PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs rename to PARR.Core/Services/Shortcodes/ShortcodesService.cs index 2a9a314f..8ff84c7e 100644 --- a/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs +++ b/PARR.Core/Services/Shortcodes/ShortcodesService.cs @@ -4,18 +4,18 @@ using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.Contracts; -using PARR.DAL.DomainModels; -using PARR.DAL.DomainServices.UnitFilterService; +using PARR.Core.Services.UnitFilterService; using PARR.Domain.Cache.Models; using PARR.Domain.Common.Template; +using PARR.Domain.DTOs.Shortcode; using PARR.Domain.Entities; using PARR.Domain.Entities.Job; using PARR.Domain.Enums; +using PARR.Domain.Settings; using System.Runtime.CompilerServices; using System.Text.RegularExpressions; -namespace PARR.DAL.DomainServices.Shortcodes +namespace PARR.Core.Services.Shortcodes { /// /// Сервис для подстановки шорткодов в строке на основе данных шаблона. diff --git a/PARR.DAL/DomainServices/UnitFilterService/IUnitFilterService.cs b/PARR.Core/Services/UnitFilterService/IUnitFilterService.cs similarity index 97% rename from PARR.DAL/DomainServices/UnitFilterService/IUnitFilterService.cs rename to PARR.Core/Services/UnitFilterService/IUnitFilterService.cs index 71d397b9..e9e8865a 100644 --- a/PARR.DAL/DomainServices/UnitFilterService/IUnitFilterService.cs +++ b/PARR.Core/Services/UnitFilterService/IUnitFilterService.cs @@ -1,7 +1,7 @@ -using PARR.DAL.DomainServices.UnitFilterService.Models; +using PARR.Core.Services.UnitFilterService.Models; using PARR.Domain.Entities.Job; -namespace PARR.DAL.DomainServices.UnitFilterService +namespace PARR.Core.Services.UnitFilterService { public interface IUnitFilterService { diff --git a/PARR.DAL/DomainServices/UnitFilterService/Models/FilteredUnitContext.cs b/PARR.Core/Services/UnitFilterService/Models/FilteredUnitContext.cs similarity index 78% rename from PARR.DAL/DomainServices/UnitFilterService/Models/FilteredUnitContext.cs rename to PARR.Core/Services/UnitFilterService/Models/FilteredUnitContext.cs index 50bb68c1..0466fa3e 100644 --- a/PARR.DAL/DomainServices/UnitFilterService/Models/FilteredUnitContext.cs +++ b/PARR.Core/Services/UnitFilterService/Models/FilteredUnitContext.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.DomainServices.UnitFilterService.Models +namespace PARR.Core.Services.UnitFilterService.Models { internal class FilteredUnitContext { diff --git a/PARR.DAL/DomainServices/UnitFilterService/Models/RelatedUnitDto.cs b/PARR.Core/Services/UnitFilterService/Models/RelatedUnitDto.cs similarity index 91% rename from PARR.DAL/DomainServices/UnitFilterService/Models/RelatedUnitDto.cs rename to PARR.Core/Services/UnitFilterService/Models/RelatedUnitDto.cs index 0850783b..97341176 100644 --- a/PARR.DAL/DomainServices/UnitFilterService/Models/RelatedUnitDto.cs +++ b/PARR.Core/Services/UnitFilterService/Models/RelatedUnitDto.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.DomainServices.UnitFilterService.Models +namespace PARR.Core.Services.UnitFilterService.Models { /// /// Связанный юнит с его значениями diff --git a/PARR.DAL/DomainServices/UnitFilterService/Models/UnitFilterResultDto.cs b/PARR.Core/Services/UnitFilterService/Models/UnitFilterResultDto.cs similarity index 94% rename from PARR.DAL/DomainServices/UnitFilterService/Models/UnitFilterResultDto.cs rename to PARR.Core/Services/UnitFilterService/Models/UnitFilterResultDto.cs index d2e3adef..ad4e1508 100644 --- a/PARR.DAL/DomainServices/UnitFilterService/Models/UnitFilterResultDto.cs +++ b/PARR.Core/Services/UnitFilterService/Models/UnitFilterResultDto.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.DomainServices.UnitFilterService.Models +namespace PARR.Core.Services.UnitFilterService.Models { /// /// Результат фильтрации Unit'ов с полной информацией для синхронизаторов. diff --git a/PARR.DAL/DomainServices/UnitFilterService/Models/UnitFilterServiceOptions.cs b/PARR.Core/Services/UnitFilterService/Models/UnitFilterServiceOptions.cs similarity index 64% rename from PARR.DAL/DomainServices/UnitFilterService/Models/UnitFilterServiceOptions.cs rename to PARR.Core/Services/UnitFilterService/Models/UnitFilterServiceOptions.cs index 3c94f0c0..25a38c32 100644 --- a/PARR.DAL/DomainServices/UnitFilterService/Models/UnitFilterServiceOptions.cs +++ b/PARR.Core/Services/UnitFilterService/Models/UnitFilterServiceOptions.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.DomainServices.UnitFilterService.Models +namespace PARR.Core.Services.UnitFilterService.Models { internal class UnitFilterServiceOptions { diff --git a/PARR.DAL/DomainServices/UnitFilterService/Models/UnitValueDto.cs b/PARR.Core/Services/UnitFilterService/Models/UnitValueDto.cs similarity index 85% rename from PARR.DAL/DomainServices/UnitFilterService/Models/UnitValueDto.cs rename to PARR.Core/Services/UnitFilterService/Models/UnitValueDto.cs index 6dd38d07..c67b5325 100644 --- a/PARR.DAL/DomainServices/UnitFilterService/Models/UnitValueDto.cs +++ b/PARR.Core/Services/UnitFilterService/Models/UnitValueDto.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.DomainServices.UnitFilterService.Models +namespace PARR.Core.Services.UnitFilterService.Models { /// diff --git a/PARR.DAL/DomainServices/UnitFilterService/UnitFilterService.cs b/PARR.Core/Services/UnitFilterService/UnitFilterService.cs similarity index 96% rename from PARR.DAL/DomainServices/UnitFilterService/UnitFilterService.cs rename to PARR.Core/Services/UnitFilterService/UnitFilterService.cs index b0fae6f8..41d7d23f 100644 --- a/PARR.DAL/DomainServices/UnitFilterService/UnitFilterService.cs +++ b/PARR.Core/Services/UnitFilterService/UnitFilterService.cs @@ -4,14 +4,14 @@ using Microsoft.Extensions.Options; using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.DomainServices.UnitFilterService.Models; +using PARR.Core.Services.UnitFilterService.Models; using PARR.Domain.Cache.Models; using PARR.Domain.Entities.Job; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; using System.Diagnostics; -namespace PARR.DAL.DomainServices.UnitFilterService; +namespace PARR.Core.Services.UnitFilterService; internal class UnitFilterService : IUnitFilterService { @@ -294,18 +294,20 @@ internal class UnitFilterService : IUnitFilterService logger.LogDebug(" FieldFilter #{Index}: Поле='{FieldName}', Маска='{Mask}', IsInverse={IsInverse}", filterIndex, fieldName, dbValueMask, fieldFilter.IsInverse); - if (fieldFilter.IsInverse) - { - query = query.Where(u => !u.UnitValues.Any(v => - v.FieldId == fieldFilter.FieldId && - EF.Functions.ILike(v.Value.Value, dbValueMask))); - } - else - { - query = query.Where(u => u.UnitValues.Any(v => - v.FieldId == fieldFilter.FieldId && - EF.Functions.ILike(v.Value.Value, dbValueMask))); - } + //if (fieldFilter.IsInverse) + //{ + // query = query.Where(u => !u.UnitValues.Any(v => + // v.FieldId == fieldFilter.FieldId && + // EF.Functions.ILike(v.Value.Value, dbValueMask))); + //} + //else + //{ + // query = query.Where(u => u.UnitValues.Any(v => + // v.FieldId == fieldFilter.FieldId && + // EF.Functions.ILike(v.Value.Value, dbValueMask))); + //} + + query = unitService.GetUnitByFieldAndValue(query, fieldFilter.FieldId, fieldFilter.ValueMask!, fieldFilter.IsInverse); #if DEBUG if (unitIds.Contains(targetUnitId)) @@ -836,13 +838,16 @@ internal class UnitFilterService : IUnitFilterService isParentDirection ? "Parent" : "Child", fieldName, dbValueMask, relFilter.IsInverse, relFilter.IsFullMatch); - var matchingTargetIds = await unitInValueService.Get() - .AsNoTracking() - .Where(uiv => uiv.FieldId == relFilter.FieldId) - .Where(uiv => EF.Functions.ILike(uiv.Value.Value, dbValueMask)) - .Select(uiv => uiv.UnitId) - .Distinct() - .ToListAsync(cancellationToken); + //var matchingTargetIds = await unitInValueService.Get() + // .AsNoTracking() + // .Where(uiv => uiv.FieldId == relFilter.FieldId) + // .Where(uiv => EF.Functions.ILike(uiv.Value.Value, dbValueMask)) + // .Select(uiv => uiv.UnitId) + // .Distinct() + // .ToListAsync(cancellationToken); + + var matchingTargetIds = await unitInValueService.GetMatchingTargetIds(relFilter.FieldId, dbValueMask) + .ToListAsync(cancellationToken); var filteredMatchingTargetIds = matchingTargetIds .Intersect(allTargetIds) @@ -974,10 +979,12 @@ internal class UnitFilterService : IUnitFilterService var dbValueMask = NormalizeLikeMask(filter.UnitFilter); - var initialUnitIds = await unitService.Get().AsNoTracking() - .Where(unit => EF.Functions.ILike(unit.Name, dbValueMask)) - .Select(u => u.Id) - .ToListAsync(cancellationToken); + //var initialUnitIds = await unitService.Get().AsNoTracking() + // .Where(unit => EF.Functions.ILike(unit.Name, dbValueMask)) + // .Select(u => u.Id) + // .ToListAsync(cancellationToken); + + var initialUnitIds = await unitService.GetInitialUnitIds(dbValueMask).ToListAsync(cancellationToken); var toCache = new UnitFilterIds { diff --git a/PARR.DAL.IntegrationTests/Integration/UnitFilterServiceIntegrationTests.cs b/PARR.DAL.IntegrationTests/Integration/UnitFilterServiceIntegrationTests.cs index acb5c92f..4b26e288 100644 --- a/PARR.DAL.IntegrationTests/Integration/UnitFilterServiceIntegrationTests.cs +++ b/PARR.DAL.IntegrationTests/Integration/UnitFilterServiceIntegrationTests.cs @@ -4,8 +4,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; +using PARR.Core.Services.UnitFilterService; using PARR.DAL.Context; -using PARR.DAL.DomainServices.UnitFilterService; using PARR.DAL.Repositories.Job; using PARR.DAL.Repositories.Unit; diff --git a/PARR.DAL.IntegrationTests/PARR.DAL.IntegrationTests.csproj b/PARR.DAL.IntegrationTests/PARR.DAL.IntegrationTests.csproj index d2e9911e..284a20a7 100644 --- a/PARR.DAL.IntegrationTests/PARR.DAL.IntegrationTests.csproj +++ b/PARR.DAL.IntegrationTests/PARR.DAL.IntegrationTests.csproj @@ -27,6 +27,7 @@ + diff --git a/PARR.DAL.IntegrationTests/TestDataGenerator.cs b/PARR.DAL.IntegrationTests/TestDataGenerator.cs index 8f13adb5..7ddac6f4 100644 --- a/PARR.DAL.IntegrationTests/TestDataGenerator.cs +++ b/PARR.DAL.IntegrationTests/TestDataGenerator.cs @@ -1,11 +1,7 @@ using PARR.DAL.Context; -using PARR.DAL.Contracts; using PARR.Domain.Entities.Job; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; -using System; -using System.Collections.Generic; -using System.Text; namespace PARR.DAL.IntegrationTests { diff --git a/PARR.DAL.Tests/DomainServices/Implementations/ShortcodesServiceTests.cs b/PARR.DAL.Tests/DomainServices/Implementations/ShortcodesServiceTests.cs index 964a131a..c2811efe 100644 --- a/PARR.DAL.Tests/DomainServices/Implementations/ShortcodesServiceTests.cs +++ b/PARR.DAL.Tests/DomainServices/Implementations/ShortcodesServiceTests.cs @@ -2,9 +2,9 @@ using Moq; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.Contracts; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.DomainServices.UnitFilterService; +using PARR.Core.Services.Shortcodes; +using PARR.Core.Services.UnitFilterService; +using PARR.Domain.Settings; namespace PARR.DAL.Tests.DomainServices.Implementations { diff --git a/PARR.DAL.Tests/TestDataGenerator.cs b/PARR.DAL.Tests/TestDataGenerator.cs index 3eaadc21..fa97f333 100644 --- a/PARR.DAL.Tests/TestDataGenerator.cs +++ b/PARR.DAL.Tests/TestDataGenerator.cs @@ -1,12 +1,7 @@ -using Microsoft.EntityFrameworkCore; -using PARR.DAL.Context; -using PARR.DAL.Contracts; +using PARR.DAL.Context; using PARR.Domain.Entities.Job; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; -using System; -using System.Collections.Generic; -using System.Linq; namespace PARR.DAL.Tests { diff --git a/PARR.DAL.Tests/TransformServices/EsppScheduleTransformServiceTests.cs b/PARR.DAL.Tests/TransformServices/EsppScheduleTransformServiceTests.cs index 1759abc0..ce700959 100644 --- a/PARR.DAL.Tests/TransformServices/EsppScheduleTransformServiceTests.cs +++ b/PARR.DAL.Tests/TransformServices/EsppScheduleTransformServiceTests.cs @@ -1,8 +1,7 @@ using Microsoft.Extensions.Logging; using Moq; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.DomainModels; -using PARR.DAL.NextRunServices.Subservices; +using PARR.Core.Services.NextRunServices.Subservices; using PARR.Domain.Entities.Schedule; using PARR.Domain.Enums; diff --git a/PARR.DAL/Configurations/DbSettings/DBConfigurationProvider.cs b/PARR.DAL/Configurations/DbSettings/DBConfigurationProvider.cs index de8f1405..c5ef5027 100644 --- a/PARR.DAL/Configurations/DbSettings/DBConfigurationProvider.cs +++ b/PARR.DAL/Configurations/DbSettings/DBConfigurationProvider.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using PARR.DAL.Context; -using PARR.DAL.Contracts; +using PARR.Domain.Settings; namespace PARR.DAL.Configurations.DbSettings { diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index 1df48de8..13567dcd 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore; -using PARR.DAL.Contracts; -using PARR.DAL.Extensions; +using PARR.Core.Extensions; using PARR.Domain.Common.Roles; using PARR.Domain.Common.Template; using PARR.Domain.Entities; @@ -9,6 +8,7 @@ using PARR.Domain.Entities.Schedule; using PARR.Domain.Entities.TaskEntities; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; +using PARR.Domain.Settings; namespace PARR.DAL.Context { diff --git a/PARR.DAL/DependencyInjection.cs b/PARR.DAL/DependencyInjection.cs index 2b67327c..3ec8fee0 100644 --- a/PARR.DAL/DependencyInjection.cs +++ b/PARR.DAL/DependencyInjection.cs @@ -9,14 +9,6 @@ using PARR.Core.Repositories.Interfaces.TaskRepositories; using PARR.Core.Repositories.Interfaces.Unit; using PARR.DAL.Configurations.DbSettings; using PARR.DAL.Context; -using PARR.DAL.Contracts; -using PARR.DAL.DomainServices.Implementations; -using PARR.DAL.DomainServices.Interfaces; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.DomainServices.UnitFilterService; -using PARR.DAL.DomainServices.UnitFilterService.Models; -using PARR.DAL.NextRunServices; -using PARR.DAL.NextRunServices.Subservices; using PARR.DAL.Repositories; using PARR.DAL.Repositories.Job; using PARR.DAL.Repositories.Schedule; @@ -130,22 +122,22 @@ namespace PARR.DAL #region NextRun Services - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + //services.AddTransient(); + //services.AddTransient(); + //services.AddTransient(); #endregion #region DomainServces - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + //services.AddTransient(); + //services.AddTransient(); + //services.AddTransient(); - services.Configure(options => - { - options.LoadBatchSize = 50; - }); + //services.Configure(options => + //{ + // options.LoadBatchSize = 50; + //}); #endregion diff --git a/PARR.DAL/Repositories/EsppSchTypeConfigRepository.cs b/PARR.DAL/Repositories/EsppSchTypeConfigRepository.cs index bfb452ab..e440f6e0 100644 --- a/PARR.DAL/Repositories/EsppSchTypeConfigRepository.cs +++ b/PARR.DAL/Repositories/EsppSchTypeConfigRepository.cs @@ -2,7 +2,6 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Schedule; using PARR.DAL.Context; -using PARR.DAL.DomainModels; using PARR.DAL.Repositories.Base; using PARR.Domain.Entities.Schedule; diff --git a/PARR.DAL/Repositories/Schedule/ScheduleResponseAreaTimeOffsetRepository.cs b/PARR.DAL/Repositories/Schedule/ScheduleResponseAreaTimeOffsetRepository.cs index 96ab48b4..1682ad9d 100644 --- a/PARR.DAL/Repositories/Schedule/ScheduleResponseAreaTimeOffsetRepository.cs +++ b/PARR.DAL/Repositories/Schedule/ScheduleResponseAreaTimeOffsetRepository.cs @@ -2,8 +2,8 @@ using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces.Schedule; using PARR.DAL.Context; -using PARR.DAL.Contracts; using PARR.Domain.Entities.Schedule; +using PARR.Domain.Settings; namespace PARR.DAL.Repositories.Schedule { diff --git a/PARR.DAL/Repositories/Unit/UnitInValueRepository.cs b/PARR.DAL/Repositories/Unit/UnitInValueRepository.cs index 06ecfc0b..c7d5d0c2 100644 --- a/PARR.DAL/Repositories/Unit/UnitInValueRepository.cs +++ b/PARR.DAL/Repositories/Unit/UnitInValueRepository.cs @@ -127,6 +127,29 @@ namespace PARR.DAL.Repositories.Unit logger.LogDebug("Наиболее частое значение для поля '{FieldName}': {Value}", fieldName, mostFrequentValue); return mostFrequentValue; } + + + public IQueryable GetMatchingTargetIds(Guid fieldId, string valueMask) + { + //TODO: Вынесено из UnitFilterService + + //var matchingTargetIds = await unitInValueService.Get() + // .AsNoTracking() + // .Where(uiv => uiv.FieldId == relFilter.FieldId) + // .Where(uiv => EF.Functions.ILike(uiv.Value.Value, dbValueMask)) + // .Select(uiv => uiv.UnitId) + // .Distinct() + // .ToListAsync(cancellationToken); + + return Get() + .AsNoTracking() + .Where(uiv => uiv.FieldId == fieldId) + .Where(uiv => EF.Functions.ILike(uiv.Value.Value, valueMask)) + .Select(uiv => uiv.UnitId) + .Distinct(); + } + + } } diff --git a/PARR.DAL/Repositories/Unit/UnitRepository.cs b/PARR.DAL/Repositories/Unit/UnitRepository.cs index e349e324..94b61d40 100644 --- a/PARR.DAL/Repositories/Unit/UnitRepository.cs +++ b/PARR.DAL/Repositories/Unit/UnitRepository.cs @@ -4,6 +4,7 @@ using PARR.Core.Repositories.Interfaces.Unit; using PARR.DAL.Context; using PARR.DAL.Repositories.Base; + namespace PARR.DAL.Repositories.Unit { internal class UnitRepository : BaseRepository, IUnitRepository @@ -19,5 +20,42 @@ namespace PARR.DAL.Repositories.Unit .Include(t => t.UnitValues) .ThenInclude(t => t.Value); } + + + public IQueryable GetUnitByFieldAndValue(IQueryable query, Guid fieldId, string valueMask, bool isInverse = false) + { + //TODO: вынесено из UnitFilterService + + if (isInverse) + { + query = query.Where(u => !u.UnitValues.Any(v => + v.FieldId == fieldId && + EF.Functions.ILike(v.Value.Value, valueMask))); + } + else + { + query = query.Where(u => u.UnitValues.Any(v => + v.FieldId == fieldId && + EF.Functions.ILike(v.Value.Value, valueMask))); + } + + return query; + } + + public IQueryable GetInitialUnitIds(string dbValueMask) + { + //TODO: вынесено из UnitFilterService + + //var initialUnitIds = await unitService.Get().AsNoTracking() + //.Where(unit => EF.Functions.ILike(unit.Name, dbValueMask)) + //.Select(u => u.Id) + //.ToListAsync(cancellationToken); + + return Get().AsNoTracking() + .Where(unit => EF.Functions.ILike(unit.Name, dbValueMask)) + .Select(u => u.Id); + } + + } } diff --git a/PARR.DAL/Repositories/WeekendDayRepository.cs b/PARR.DAL/Repositories/WeekendDayRepository.cs index 1d737809..0760d480 100644 --- a/PARR.DAL/Repositories/WeekendDayRepository.cs +++ b/PARR.DAL/Repositories/WeekendDayRepository.cs @@ -3,9 +3,9 @@ using Microsoft.Extensions.Logging; using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces; using PARR.DAL.Context; -using PARR.DAL.Contracts; using PARR.DAL.Repositories.Base; using PARR.Domain.Entities; +using PARR.Domain.Settings; namespace PARR.DAL.Repositories { diff --git a/PARR.DAL/DomainModels/MatchingStatus.cs b/PARR.Domain/DTOs/Matching/MatchingStatus.cs similarity index 96% rename from PARR.DAL/DomainModels/MatchingStatus.cs rename to PARR.Domain/DTOs/Matching/MatchingStatus.cs index 42732ab1..598e3491 100644 --- a/PARR.DAL/DomainModels/MatchingStatus.cs +++ b/PARR.Domain/DTOs/Matching/MatchingStatus.cs @@ -1,6 +1,6 @@ using PARR.Domain.Cache.Models; -namespace PARR.DAL.DomainModels +namespace PARR.Domain.DTOs.Matching { /// /// Статус matching`a diff --git a/PARR.DAL/DomainModels/ShortcodeInfoDto.cs b/PARR.Domain/DTOs/Shortcode/ShortcodeInfoDto.cs similarity index 86% rename from PARR.DAL/DomainModels/ShortcodeInfoDto.cs rename to PARR.Domain/DTOs/Shortcode/ShortcodeInfoDto.cs index 0db1d4bb..5c0caedf 100644 --- a/PARR.DAL/DomainModels/ShortcodeInfoDto.cs +++ b/PARR.Domain/DTOs/Shortcode/ShortcodeInfoDto.cs @@ -1,6 +1,6 @@ using PARR.Domain.Enums; -namespace PARR.DAL.DomainModels +namespace PARR.Domain.DTOs.Shortcode { public class ShortcodeInfoDto { diff --git a/PARR.DAL/Contracts/AIHTITSettings.cs b/PARR.Domain/Settings/AIHTITSettings.cs similarity index 68% rename from PARR.DAL/Contracts/AIHTITSettings.cs rename to PARR.Domain/Settings/AIHTITSettings.cs index 73b22099..63b6ad2e 100644 --- a/PARR.DAL/Contracts/AIHTITSettings.cs +++ b/PARR.Domain/Settings/AIHTITSettings.cs @@ -1,7 +1,10 @@ -namespace PARR.DAL.Contracts +namespace PARR.Domain.Settings { public class AIHTITSettings { + //TODO: AIHTITSettings - не используется??? + + public const string RespAreaGroupName = "ResponsibleArea"; public const string StatusGroupName = "Status"; public const string Delimiters = "Delimiters"; diff --git a/PARR.DAL/Contracts/SettingsFromDb.cs b/PARR.Domain/Settings/SettingsFromDb.cs similarity index 89% rename from PARR.DAL/Contracts/SettingsFromDb.cs rename to PARR.Domain/Settings/SettingsFromDb.cs index 2177bc94..bbc3af2a 100644 --- a/PARR.DAL/Contracts/SettingsFromDb.cs +++ b/PARR.Domain/Settings/SettingsFromDb.cs @@ -1,9 +1,10 @@ -using PARR.DAL.Extensions; -using PARR.Domain.Common.Template; +using PARR.Domain.Common.Template; using System.ComponentModel.DataAnnotations.Schema; +using System.Text.Encodings.Web; using System.Text.Json; +using System.Text.Unicode; -namespace PARR.DAL.Contracts +namespace PARR.Domain.Settings { /// /// Настройки из БД @@ -62,7 +63,19 @@ namespace PARR.DAL.Contracts set { if (value != null) - TemplateNameConstantParts = value.ToJson() ?? string.Empty; + { + //TemplateNameConstantParts = value.ToJson() ?? string.Empty; + try + { + TemplateNameConstantParts = JsonSerializer.Serialize(value, new JsonSerializerOptions { Encoder = JavaScriptEncoder.Create(UnicodeRanges.All, UnicodeRanges.Cyrillic) }); + } + catch + { + TemplateNameConstantParts = string.Empty; + } + } + + } } diff --git a/PARR.EsppOrderLoader/EsppOrderLoader.cs b/PARR.EsppOrderLoader/EsppOrderLoader.cs index c496d96c..027d4461 100644 --- a/PARR.EsppOrderLoader/EsppOrderLoader.cs +++ b/PARR.EsppOrderLoader/EsppOrderLoader.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using PARR.Core.Common.Interfaces; -using PARR.DAL.Contracts; +using PARR.Domain.Settings; using PARR.EsppApi; using PARR.EsppApi.Models; using PARR.EsppApi.Models.Query; diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index 81479378..cb1dae20 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -5,11 +5,11 @@ using PARR.BLL.Helpers; using PARR.Core.Common.Interfaces.RabbitServices; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Schedule; -using PARR.DAL.Contracts; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; +using PARR.Domain.Settings; using PARR.EsppScheduleSync.Domain; using PARR.EsppScheduleSync.Settings; using PARR.EsppSync; diff --git a/PARR.EsppSync/SyncService.cs b/PARR.EsppSync/SyncService.cs index b1c4de92..d2660d87 100644 --- a/PARR.EsppSync/SyncService.cs +++ b/PARR.EsppSync/SyncService.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.DomainServices.Shortcodes; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; diff --git a/PARR.EsppTemplateSync/TemplateMQSyncer.cs b/PARR.EsppTemplateSync/TemplateMQSyncer.cs index 0313d601..76ad95c1 100644 --- a/PARR.EsppTemplateSync/TemplateMQSyncer.cs +++ b/PARR.EsppTemplateSync/TemplateMQSyncer.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging; using PARR.Core.Common.Interfaces.RabbitServices; -using PARR.DAL.Contracts; using PARR.Domain.Entities; +using PARR.Domain.Settings; using PARR.EsppSync; using PARR.EsppTemplateSync.Domain; using PARR.EsppTemplateSync.Settings; diff --git a/PARR.NextRun/Services/NextRunUpdateService.cs b/PARR.NextRun/Services/NextRunUpdateService.cs index 708ea354..b814d355 100644 --- a/PARR.NextRun/Services/NextRunUpdateService.cs +++ b/PARR.NextRun/Services/NextRunUpdateService.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; diff --git a/PARR.TemplateDistributor/TemplateDistributor.cs b/PARR.TemplateDistributor/TemplateDistributor.cs index 02dc25f4..5f802082 100644 --- a/PARR.TemplateDistributor/TemplateDistributor.cs +++ b/PARR.TemplateDistributor/TemplateDistributor.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Enums; diff --git a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs index 6c8734af..fadf9697 100644 --- a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs +++ b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs @@ -2,8 +2,8 @@ using PARR.Core.Common.Interfaces; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; diff --git a/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs b/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs index 535b7696..48333313 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs @@ -4,8 +4,8 @@ using PARR.Core.Common.Interfaces.RabbitServices; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.DomainServices.Interfaces; -using PARR.DAL.DomainServices.UnitFilterService; +using PARR.Core.Services.MatchingStatusService; +using PARR.Core.Services.UnitFilterService; using PARR.Domain.Cache.Models; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; diff --git a/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs b/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs index a67199ff..5638122f 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs @@ -5,16 +5,16 @@ using PARR.Core.Common.Interfaces.RabbitServices; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.Contracts; -using PARR.DAL.DomainServices.Interfaces; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.DomainServices.UnitFilterService; +using PARR.Core.Services.MatchingStatusService; +using PARR.Core.Services.Shortcodes; +using PARR.Core.Services.UnitFilterService; using PARR.Domain.Cache.Models; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.Job; using PARR.Domain.Enums; +using PARR.Domain.Settings; using PARR.TemplateMatcher.Services.Interfaces; using PARR.TemplateMatcher.Settings; diff --git a/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs b/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs index 88a352cc..4b382273 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs @@ -3,11 +3,11 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; -using PARR.DAL.Contracts; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; +using PARR.Domain.Settings; using PARR.TemplateMatcher.Services.Interfaces; using PARR.TemplateMatcher.Settings; diff --git a/PARR.TemplateMatcher/Services/Implemetaions/TemplateNameNormalizer.cs b/PARR.TemplateMatcher/Services/Implemetaions/TemplateNameNormalizer.cs index 13d124a0..67bf594c 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/TemplateNameNormalizer.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/TemplateNameNormalizer.cs @@ -1,4 +1,4 @@ -using PARR.DAL.DomainServices.Shortcodes; +using PARR.Core.Services.Shortcodes; using PARR.Domain.Entities; using PARR.TemplateMatcher.Services.Interfaces; using System.Runtime.CompilerServices; diff --git a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs index 00a0c6d7..cde14d30 100644 --- a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs +++ b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs @@ -1,10 +1,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; +using PARR.Core.Extensions; using PARR.Core.Repositories.Interfaces; using PARR.Core.Repositories.Interfaces.Job; using PARR.Core.Repositories.Interfaces.Unit; -using PARR.DAL.Extensions; -using PARR.DAL.NextRunServices; +using PARR.Core.Services.NextRunServices; using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities; using PARR.Domain.Enums; diff --git a/PARR.Test/NextRun/NextRunTest.cs b/PARR.Test/NextRun/NextRunTest.cs index 83c381a9..cd4ba64c 100644 --- a/PARR.Test/NextRun/NextRunTest.cs +++ b/PARR.Test/NextRun/NextRunTest.cs @@ -1,7 +1,7 @@ using PARR.Core.Repositories.Interfaces; -using PARR.DAL.DomainServices.Shortcodes; -using PARR.DAL.NextRunServices; -using PARR.DAL.NextRunServices.Models; +using PARR.Core.Services.NextRunServices; +using PARR.Core.Services.NextRunServices.Models; +using PARR.Core.Services.Shortcodes; namespace PARR.Test.NextRun {