Refactor DI and update dependencies

- Enhanced `AddAutoMapper` configuration for flexibility.
- Replaced `IEnvelopeMailService` with `IEnvelopeNotificationService`.
- Migrated from `IUserRepository` to `EGDbContext` for data access.
- Updated RabbitMQ configuration to use `AddMessagingServiceHttpClient`.
- Removed `AddUserManager` and `AddDispatcher` registrations.
- Added conditional `FluentValidation` dependencies for target frameworks.
- Upgraded `MediatR` to 14.2.0 and `AutoMapper` to 16.2.0.
- Added `HtmlSanitizer` dependency.
- Improved error handling and logging in `ReadOnlyController`.
This commit is contained in:
2026-11-17 20:09:23 +01:00
parent 6eb92a31a6
commit 224d029c18
6 changed files with 47 additions and 45 deletions

View File

@@ -5,8 +5,6 @@ using DigitalData.Core.Abstractions;
using DigitalData.Core.Abstractions.Security.Extensions;
using DigitalData.Core.API;
using DigitalData.Core.Application;
using DigitalData.EmailProfilerDispatcher;
using DigitalData.UserManager.DependencyInjection;
using EnvelopeGenerator.Application;
using EnvelopeGenerator.Application.Common.Interfaces;
using EnvelopeGenerator.Application.Common.Interfaces.Doc;
@@ -288,11 +286,6 @@ try
.AddAuthenticationSchemes(AuthScheme.Sender, AuthScheme.Receiver)
.RequireAuthenticatedUser());
// User Manager
#pragma warning disable CS0618
builder.Services.AddUserManager<EGDbContext>();
#pragma warning restore CS0618
// LDAP Directory Search
builder.ConfigureBySection<DirectorySearchOptions>();
builder.Services.AddDirectorySearchService(config.GetSection("DirectorySearchOptions"));
@@ -335,8 +328,6 @@ try
.AddNotificationInfrastructure(config);
#pragma warning restore CS0618
builder.Services.AddDispatcher<EGDbContext>();
// User Preferences (theme, dark mode, grid layouts — stored in TBDD_CACHE)
// Registration handled by Infrastructure DependencyInjection (AddEnvelopeGeneratorInfrastructureServices)
@@ -367,7 +358,6 @@ try
builder.Services.AddScoped<SignatureCacheService>();
builder.Services.AddDocInfrastructure();
builder.Services.AddCryptInfrastructure(config);
builder.Services.AddScoped<EnvelopeGenerator.Application.Common.Interfaces.Services.IEnvelopeMailService, EnvelopeGenerator.Application.Services.EnvelopeMailService>();
builder.Services.AddSingleton<AppVersionService>();
// EnvelopeService with HttpClient factory (for SSR scenarios)