I'll implement Phase 5A async outbox and event-handler updates. Exploring the codebase to understand the current domain events, notifications, and infrastructure.
[tool: todo_write — Tool use: todo_write]
[tool: task_v2 — Tool use: task_v2]
Reading key files to implement the outbox pattern.
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/OutboundNotification.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/DomainEventDispatcher.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/RegistrationConfirmedNotificationHandler.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/Registration/ConfirmRegistration/ConfirmRegistrationHandl]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/DependencyInjection.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/IOutboundNotificationRepository.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Repositories/OutboundNotificationRepository.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Configurations/OutboundNotificationConfiguration.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/BirthRegisteredNotificationHandler.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/AddressChangedNotificationHandler.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/Registration/ListOutboundNotifications/ListOutboundNotifi]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Web/Features/Registration/Pages/OutboundNotificationsPage.razor]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/Features/Registration/CertificatesAndNotificationsTests.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/BirthDeclaration/ConfirmBirthDeclaration/ConfirmBirthDecl]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/ChangeOfAddress/ConfirmAddressChange/ConfirmAddressChange]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/MunicipalAppFactory.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Api/Program.cs]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: glob_file_search — Tool use: glob_file_search • Searched codebase "" • 25 results in 1 directory]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Repositories/RegistrationCaseRepository.cs]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/SchaerbeekMunicipality.Infrastructure.csproj]
Implementing the outbox pattern: extending the domain model, then adding the worker, adapters, and handler updates.
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/OutboundNotificationDeliveryStatus.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/OutboundNotification.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/OutboundNotification.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/OutboundNotification.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/OutboundNotification.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/OutboundNotification.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Domain/Notifications/IOutboundNotificationRepository.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Configurations/OutboundNotificationConfiguration.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Repositories/OutboundNotificationRepository.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IIntegrationAdapter.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxOptions.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/SimulatedIntegrationAdapter.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationAdapterRegistry.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IIntegrationOutboxProcessor.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxProcessor.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxWorker.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/SimulatedIntegrationAdapter.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxServiceCollectionExtensions.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/DomainEventDispatcher.cs]
Simplifying DomainEventDispatcher and applying the remaining updates.
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/DomainEventDispatcher.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/DependencyInjection.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/DependencyInjection.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/RegistrationConfirmedNotificationHandler.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/BirthRegisteredNotificationHandler.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Events/AddressChangedNotificationHandler.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/Registration/ConfirmRegistration/ConfirmRegistrationHandl]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/BirthDeclaration/ConfirmBirthDeclaration/ConfirmBirthDecl]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/ChangeOfAddress/ConfirmAddressChange/ConfirmAddressChange]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/Registration/ListOutboundNotifications/ListOutboundNotifi]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/Registration/ListOutboundNotifications/ListOutboundNotifi]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Web/Features/Registration/Pages/OutboundNotificationsPage.razor]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Web/Features/Registration/Pages/OutboundNotificationsPage.razor]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Web/Features/Registration/Pages/OutboundNotificationsPage.razor]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/MunicipalAppFactory.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/MunicipalAppFactory.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Application/Features/Registration/CaseAuditRecorder.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxServiceCollectionExtensions.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/Features/Registration/CertificatesAndNotificationsTests.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/Features/Registration/CertificatesAndNotificationsTests.cs]
Generating the EF migration and building the solution.
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet ef migrations add OutboundNotificationDeliveryLifecycle --project src/S]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet build 2>&1]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxServiceCollectionExtensions.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxServiceCollectionExtensions.cs]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxServiceCollectionExtensions.cs]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Integrations/IntegrationOutboxServiceCollectionExtensions.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet build 2>&1]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet ef migrations add OutboundNotificationDeliveryLifecycle --project src/S]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Migrations/20260709193137_Phase13ChangeOfAddress.cs]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Migrations/MunicipalDbContextModelSnapshot.cs]
[tool: glob_file_search — Tool use: glob_file_search • Searched codebase "" • 0 results in 1 directory]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet test tests/SchaerbeekMunicipality.Integration.Tests --filter "Fully]
Fixing EF enum translation in the repository query.
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Configurations/OutboundNotificationConfiguration.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet test tests/SchaerbeekMunicipality.Integration.Tests --filter "Fully]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Repositories/OutboundNotificationRepository.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet test tests/SchaerbeekMunicipality.Integration.Tests --filter "Fully]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Repositories/OutboundNotificationRepository.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet test tests/SchaerbeekMunicipality.Integration.Tests --filter "Fully]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/Repositories/OutboundNotificationRepository.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet test tests/SchaerbeekMunicipality.Integration.Tests --filter "Fully]
Creating the EF migration and running the full test suite.
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Migrations/20260709193137_Phase13ChangeOfAddress.Designer.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet test 2>&1]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Api/SchaerbeekMunicipality.Api.csproj]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/Persistence/PostgreSqlMigrationTests.cs]
[tool: ripgrep_raw_search — Tool use: ripgrep_raw_search]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Persistence/MunicipalDbContextFactory.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet ef migrations add OutboundNotificationDeliveryLifecycle --project src/S]
[tool: glob_file_search — Tool use: glob_file_search • Searched codebase "" • 2 results in 1 directory]
[tool: read_file_v2 — Tool use: read_file_v2 • Read file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Migrations/20260711184545_OutboundNotificationDeliveryLifecycle]
Updating the migration so existing rows are marked as Sent.
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/src/SchaerbeekMunicipality.Infrastructure/Migrations/20260711184545_OutboundNotificationDeliveryLifecycle]
[tool: edit_file_v2 — Tool use: edit_file_v2 • Edit file: /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality/tests/SchaerbeekMunicipality.Integration.Tests/MunicipalAppFactory.cs]
[tool: run_terminal_command_v2 — Tool use: run_terminal_command_v2 • Run command: cd /Users/[user]/Projects/Private/dotnet/SchaerbeekMunicipality && dotnet test 2>&1]
All tests pass. Marking todos complete.
[tool: todo_write — Tool use: todo_write]
[tool: read_lints — Tool use: read_lints]
Phase 5A is implemented. Outbound notifications now use a transactional outbox with async delivery, and the admin UI shows delivery status.
Workstream A — Async outbox
Domain
- Added
OutboundNotificationDeliveryStatus (Pending → Processing → Sent / Failed)
- Extended
OutboundNotification with AttemptCount, NextAttemptAt, SentAt, LastError, and lifecycle methods (MarkProcessing, MarkSent, RecordDeliveryFailure with exponential backoff)
Infrastructure
IIntegrationAdapter + simulated adapters per recipient (log + configurable delay)
IntegrationOutboxProcessor claims pending messages and delivers via adapters
IntegrationOutboxWorker (BackgroundService) polls every 5 seconds
ClaimPendingBatchAsync on the repository for batch claiming
- EF migration
20260711184545_OutboundNotificationDeliveryLifecycle (existing rows backfilled as Sent)
Transactional boundary
DomainEventDispatcher now runs handlers in the current scope (same DbContext)
- Confirm handlers dispatch domain events before
SaveChangesAsync, so notifications are persisted atomically with case changes
- Notification handlers only enqueue (
AddAsync); they no longer call SaveChangesAsync
Workstream B (partial) — Admin visibility
OutboundNotificationDto extended with DeliveryStatus, AttemptCount, SentAt, LastError
OutboundNotificationsPage shows a status chip, attempt count, and last error
Tests
- Updated
ConfirmRegistration_CreatesOutboundNotifications to assert Pending status after confirm
- Added
ConfirmRegistration_EnqueuedNotifications_AreDeliveredByOutboxProcessor covering enqueue → processor → Sent
- Integration test factory disables the background worker; tests invoke
IIntegrationOutboxProcessor explicitly
All 171 tests pass (76 domain + 95 integration).
Confirm registration now returns immediately while the worker delivers notifications in the background. Failed deliveries retry with backoff (30s, 60s, 120s, …) up to 5 attempts, then move to Failed and appear in the admin UI.