feat(notification-outbox): add NotificationOutboxActor ingest

This commit is contained in:
Joseph Doherty
2026-05-19 01:36:13 -04:00
parent 435c853dce
commit 4dc9f9e159
3 changed files with 254 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using Akka.Actor;
namespace ScadaLink.NotificationOutbox.Messages;
/// <summary>
/// Actor-internal message types for the <see cref="NotificationOutboxActor"/>. These are
/// never sent across the network — they bridge the actor's async repository/delivery work
/// back onto the actor's own mailbox so handlers run single-threaded on the actor.
/// </summary>
internal static class InternalMessages
{
/// <summary>
/// Result of an asynchronous ingest persistence attempt, piped back to the actor.
/// Carries the original <paramref name="Sender"/> so the actor can ack the site that
/// submitted the notification once the insert completes.
/// </summary>
/// <param name="NotificationId">Id of the notification that was submitted.</param>
/// <param name="Sender">Original submitter to receive the ack.</param>
/// <param name="Succeeded">
/// True if persistence completed without error — covers both a fresh insert and an
/// already-existing row (idempotent re-submission). False only when the repository threw.
/// </param>
/// <param name="Error">Failure detail when <paramref name="Succeeded"/> is false; otherwise null.</param>
internal sealed record IngestPersisted(
string NotificationId,
IActorRef Sender,
bool Succeeded,
string? Error);
}