refactor(application)!: accept license key directly in AddMessagingServiceApplication

Remove MessagingServiceApplicationConfiguration and pass the LuckyPennySoft license key as a string. Program.cs now reads the value from configuration and fails fast with a clear error when it is missing.

BREAKING CHANGE: AddMessagingServiceApplication now takes a license key string.
This commit is contained in:
2026-11-04 14:53:09 +01:00
parent ad2a5240d2
commit eed9a0e915
3 changed files with 6 additions and 46 deletions

View File

@@ -65,7 +65,9 @@ try
builder.Configuration.AddJsonFile("appsettings.Secrets.json", optional: true, reloadOnChange: true);
// Register Application layer (MediatR, AutoMapper, FluentValidation)
builder.Services.AddMessagingServiceApplication(cfg => cfg.SetLuckyPennySoftLicenseKey(builder.Configuration));
var LuckyPennySoftLicenseKey = builder.Configuration.GetValue<string>("LuckyPennySoftLicenseKey")
?? throw new InvalidOperationException("The required configuration value 'LuckyPennySoftLicenseKey' is missing. Please ensure it is properly configured.");
builder.Services.AddMessagingServiceApplication(LuckyPennySoftLicenseKey);
// Register Infrastructure layer (RabbitMQ, Repositories, etc.)
builder.Services.AddInfrastructure(cfg => cfg