Commit Graph

4 Commits

Author SHA1 Message Date
35094529bb Refactor: Remove IServiceCollection dependency
Removed the IServiceCollection dependency and related code from MessagingServiceApplicationConfiguration.cs. This includes the private property `Services`, the boolean field `_luckyPennySoftLicenseKeyAdded`, and the constructor that initialized `Services`. The `EnsureConfigured` method remains, but its functionality may be impacted by these changes.
2026-11-04 11:37:57 +01:00
8cfa803cd3 Refactor DI and update namespace structure
Removed `AddMessagingServiceApplication` method from `DependencyInjection` class, simplifying service configuration. Updated namespaces from `DigitalData.MessagingService.Infrastructure` to `DigitalData.MessagingService.Infrastructure.DependencyInjection` for better organization. Adjusted `Program.cs` to use a lambda for setting `LuckyPennySoftLicenseKey`. Updated `using` directives in `EmailSyncWorker.cs` and `Program.cs` to reflect these changes.
2026-11-02 15:23:32 +01:00
82be3c5a4f Refactor configuration handling
Refactored `MessagingServiceApplicationConfiguration` to simplify the tracking of the LuckyPennySoft license key configuration by replacing the `_configured` tuple with a boolean. Removed email account configuration methods from this class.

Updated `MessagingServiceInfrastructureConfiguration` to introduce a new `_configured` tuple for tracking `RabbitMqConnectionFactory` and `EmailAccounts` configurations. Added methods for configuring email accounts and updated the `EnsureRabbitMqConnectionFactoryAdded` method to include email account checks.

Changed the namespace of `EmailAccountsOptions.cs` to `DigitalData.MessagingService.Infrastructure.Options`.

Modified `Program.cs` to include email account configuration in the infrastructure setup.

Added new files `DependencyInjectionExtensions.cs` and `MessagingServiceConfiguration.cs` as placeholders for future extensions, wrapped in `#if NET` directives.

Removed an `<ItemGroup>` from `DigitalData.MessagingService.Infrastructure.csproj` and updated `DigitalData.MessagingService.Client.csproj` for XML compliance.
2026-11-02 15:23:21 +01:00
084ddc4b56 refactor(application): introduce MessagingServiceApplicationConfiguration builder
Replace the implicit IConfiguration-based DI registration with an explicit
builder that validates required steps at startup.

- Add MessagingServiceApplicationConfiguration with mandatory steps:
    SetLuckyPennySoftLicenseKey(), ConfigureEmailAccounts() / PublishOnly()
- EnsureConfigured() throws at registration time if either step is missing,
  surfacing misconfiguration before the app starts
- Keep the IConfiguration convenience overload as a thin wrapper over the
  builder for backward-compatible call sites
- Move DependencyInjection.cs into a DependencyInjection/ subfolder alongside
  the new configuration class
2026-11-02 15:02:07 +01:00