diff --git a/src/Portal.Backend.sln b/src/Portal.Backend.sln index 45967dba53..802022cfad 100644 --- a/src/Portal.Backend.sln +++ b/src/Portal.Backend.sln @@ -1678,6 +1678,12 @@ Global {07BDC20D-23DD-4C0E-9C3D-B1D232AF17E3}.Release|x86.Build.0 = Release|Any CPU {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Release|x86.ActiveCfg = Release|Any CPU + {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Release|x86.Build.0 = Release|Any CPU + {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Debug|x86.ActiveCfg = Debug|Any CPU + {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Debug|x86.Build.0 = Debug|Any CPU + {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D666EADA-770A-42FF-B891-5745F7A6BC2F}.Release|Any CPU.Build.0 = Release|Any CPU {59E4B63B-BEA2-4CDA-98F0-13962146AEA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {59E4B63B-BEA2-4CDA-98F0-13962146AEA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {59E4B63B-BEA2-4CDA-98F0-13962146AEA5}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/src/maintenance/Maintenance.App/Program.cs b/src/maintenance/Maintenance.App/Program.cs index 91d7cacdc7..4c06841e10 100644 --- a/src/maintenance/Maintenance.App/Program.cs +++ b/src/maintenance/Maintenance.App/Program.cs @@ -21,11 +21,17 @@ using Laraue.EfCoreTriggers.PostgreSql.Extensions; using Microsoft.EntityFrameworkCore; using Org.Eclipse.TractusX.Portal.Backend.Clearinghouse.Library; +using Org.Eclipse.TractusX.Portal.Backend.Custodian.Library; +using Org.Eclipse.TractusX.Portal.Backend.Custodian.Library.BusinessLogic; using Org.Eclipse.TractusX.Portal.Backend.Framework.Logging; +using Org.Eclipse.TractusX.Portal.Backend.Framework.Token; using Org.Eclipse.TractusX.Portal.Backend.Maintenance.App.DependencyInjection; using Org.Eclipse.TractusX.Portal.Backend.Maintenance.App.Services; +using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Auditing; +using Org.Eclipse.TractusX.Portal.Backend.Processes.ApplicationChecklist.Library; +using Org.Eclipse.TractusX.Portal.Backend.Processes.ProcessIdentity; using Org.Eclipse.TractusX.Portal.Backend.Processes.ProcessIdentity.DependencyInjection; using Serilog; @@ -41,8 +47,14 @@ .AddMaintenanceService() .AddConfigurationProcessIdentityIdDetermination(hostContext.Configuration.GetSection("ProcessIdentity")) .AddBatchDelete(hostContext.Configuration.GetSection("BatchDelete")) + .AddTransient() + .AddTransient() + .AddTransient() + .AddTransient() + .AddTransient() .AddClearinghouseService(hostContext.Configuration.GetSection("Clearinghouse")) .AddDbAuditing() + .AddPortalRepositories(hostContext.Configuration) .AddDbContext(o => o.UseNpgsql(hostContext.Configuration.GetConnectionString("PortalDb")) .UsePostgreSqlTriggers()); diff --git a/src/processes/Processes.ProcessIdentity/ProcessIdentityDataDetermination.cs b/src/processes/Processes.ProcessIdentity/ProcessIdentityDataDetermination.cs index cdb46469fd..7468813450 100644 --- a/src/processes/Processes.ProcessIdentity/ProcessIdentityDataDetermination.cs +++ b/src/processes/Processes.ProcessIdentity/ProcessIdentityDataDetermination.cs @@ -24,25 +24,21 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Processes.ProcessIdentity; -public class ProcessIdentityDataDetermination : IProcessIdentityDataDetermination +public class ProcessIdentityDataDetermination( + IPortalRepositories portalRepositories, + IProcessIdentityDataBuilder processIdentityDataBuilder) + : IProcessIdentityDataDetermination { - private readonly IIdentityRepository _identityRepository; - private readonly IProcessIdentityDataBuilder _processIdentityDataBuilder; - - public ProcessIdentityDataDetermination(IPortalRepositories portalRepositories, IProcessIdentityDataBuilder processIdentityDataBuilder) - { - _identityRepository = portalRepositories.GetInstance(); - _processIdentityDataBuilder = processIdentityDataBuilder; - } + private readonly IIdentityRepository _identityRepository = portalRepositories.GetInstance(); /// public async Task GetIdentityData() { (IdentityTypeId IdentityTypeId, Guid CompanyId) identityData; - if ((identityData = await _identityRepository.GetActiveIdentityDataByIdentityId(_processIdentityDataBuilder.IdentityId).ConfigureAwait(ConfigureAwaitOptions.None)) == default) - throw new ConflictException($"Identity {_processIdentityDataBuilder.IdentityId} could not be found"); + if ((identityData = await _identityRepository.GetActiveIdentityDataByIdentityId(processIdentityDataBuilder.IdentityId).ConfigureAwait(ConfigureAwaitOptions.None)) == default) + throw new ConflictException($"Identity {processIdentityDataBuilder.IdentityId} could not be found"); - _processIdentityDataBuilder.AddIdentityData(identityData.IdentityTypeId, identityData.CompanyId); + processIdentityDataBuilder.AddIdentityData(identityData.IdentityTypeId, identityData.CompanyId); } } diff --git a/src/registration/Registration.Service/Program.cs b/src/registration/Registration.Service/Program.cs index 703f18fb59..79edabd770 100644 --- a/src/registration/Registration.Service/Program.cs +++ b/src/registration/Registration.Service/Program.cs @@ -44,6 +44,7 @@ await WebAppHelper builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient() + .AddTransient() .ConfigureRegistrationSettings(builder.Configuration.GetSection("Registration")) .AddTransient();