feat(notification-outbox): add notification message and outbox query contracts

This commit is contained in:
Joseph Doherty
2026-05-19 01:13:36 -04:00
parent 6056ad58b0
commit c547f82957
3 changed files with 322 additions and 0 deletions
@@ -0,0 +1,42 @@
namespace ScadaLink.Commons.Messages.Notification;
/// <summary>
/// Site -> Central: submit a notification for central delivery.
/// Fire-and-forget with ack; the site retries until a <see cref="NotificationSubmitAck"/> is received.
/// </summary>
public record NotificationSubmit(
string NotificationId,
string ListName,
string Subject,
string Body,
string SourceSiteId,
string? SourceInstanceId,
string? SourceScript,
DateTimeOffset SiteEnqueuedAt);
/// <summary>
/// Central -> Site: ack sent after the notification row is persisted.
/// Idempotent — safe to re-send for the same <see cref="NotificationId"/>.
/// </summary>
public record NotificationSubmitAck(
string NotificationId,
bool Accepted,
string? Error);
/// <summary>
/// Site -> Central: query the central delivery status for a <see cref="NotificationId"/>.
/// </summary>
public record NotificationStatusQuery(
string CorrelationId,
string NotificationId);
/// <summary>
/// Central -> Site: response carrying the current delivery status for a queried notification.
/// </summary>
public record NotificationStatusResponse(
string CorrelationId,
bool Found,
string Status,
int RetryCount,
string? LastError,
DateTimeOffset? DeliveredAt);