feat(notification-outbox): register NotificationOutbox singleton in Host

Wire the Notification Outbox into the Host central role:
- Program.cs: call AddNotificationOutbox() on the central path (binds
  NotificationOutboxOptions via BindConfiguration; no explicit Configure).
- AkkaHostedService.RegisterCentralActors(): create the NotificationOutboxActor
  as a non-role-scoped central cluster singleton + proxy, then send
  RegisterNotificationOutbox(proxy) to the CentralCommunicationActor.
- appsettings.Central.json: add the ScadaLink:NotificationOutbox section with
  the NotificationOutboxOptions defaults.
- SiteServiceRegistration: remove the now-dead AddNotificationService() call -
  sites forward notifications to central rather than delivering over SMTP, and
  no site component consumes the SMTP machinery.
- Host.csproj: add the ScadaLink.NotificationOutbox project reference.
- Tests: add central outbox singleton/proxy actor-path assertions, drop the
  site OAuth2TokenService/INotificationDeliveryService resolution assertions,
  and add NotificationOutbox to the component-library IConfiguration check.
This commit is contained in:
Joseph Doherty
2026-05-19 02:44:32 -04:00
parent 2ff62a2ceb
commit 1d495d1a87
8 changed files with 59 additions and 4 deletions

View File

@@ -97,6 +97,14 @@ public class CentralActorPathTests : IAsyncLifetime
public async Task CentralActors_Management_Exists()
=> await AssertActorExists("/user/management");
[Fact]
public async Task CentralActors_NotificationOutboxSingleton_Exists()
=> await AssertActorExists("/user/notification-outbox-singleton");
[Fact]
public async Task CentralActors_NotificationOutboxProxy_Exists()
=> await AssertActorExists("/user/notification-outbox-proxy");
private async Task AssertActorExists(string path)
{
Assert.NotNull(_actorSystem);

View File

@@ -353,7 +353,6 @@ public class SiteCompositionRootTests : IDisposable
new object[] { typeof(ReplicationService) },
new object[] { typeof(ISiteEventLogger) },
new object[] { typeof(IEventLogQueryService) },
new object[] { typeof(OAuth2TokenService) },
new object[] { typeof(ISiteIdentityProvider) },
new object[] { typeof(IHealthReportTransport) },
};
@@ -377,8 +376,6 @@ public class SiteCompositionRootTests : IDisposable
new object[] { typeof(IExternalSystemClient) },
new object[] { typeof(DatabaseGateway) },
new object[] { typeof(IDatabaseGateway) },
new object[] { typeof(NotificationDeliveryService) },
new object[] { typeof(INotificationDeliveryService) },
};
// --- Implementation type assertions ---

View File

@@ -21,6 +21,7 @@ public class OptionsTests
typeof(HealthMonitoring.ServiceCollectionExtensions).Assembly,
typeof(ExternalSystemGateway.ServiceCollectionExtensions).Assembly,
typeof(NotificationService.ServiceCollectionExtensions).Assembly,
typeof(NotificationOutbox.ServiceCollectionExtensions).Assembly,
typeof(TemplateEngine.ServiceCollectionExtensions).Assembly,
typeof(DeploymentManager.ServiceCollectionExtensions).Assembly,
typeof(Security.ServiceCollectionExtensions).Assembly,