refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.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>
|
||||
/// <param name="OriginExecutionId">
|
||||
/// The originating script execution's <c>ExecutionId</c> (Audit Log #23). Stamped at
|
||||
/// <c>Notify.Send</c> time and carried, inside the serialized payload, through the site
|
||||
/// store-and-forward buffer so the central dispatcher can echo it onto the
|
||||
/// <c>NotifyDeliver</c> audit rows. Additive trailing member — null for messages built
|
||||
/// before the field existed, or for notifications raised outside a script execution.
|
||||
/// </param>
|
||||
/// <param name="OriginParentExecutionId">
|
||||
/// The originating routed script execution's <c>ParentExecutionId</c> (Audit Log #23).
|
||||
/// Stamped at <c>Notify.Send</c> time and carried, inside the serialized payload, through
|
||||
/// the site store-and-forward buffer so the central dispatcher can echo it onto the
|
||||
/// <c>NotifyDeliver</c> audit rows. Additive trailing member — null for messages built
|
||||
/// before the field existed, or for non-routed runs.
|
||||
/// </param>
|
||||
/// <param name="SourceNode">
|
||||
/// The cluster node on which the notification was emitted — `node-a` / `node-b` for site
|
||||
/// submissions, `central-a` / `central-b` for central-originated rows. Stamped by the
|
||||
/// emitting node from <c>INodeIdentityProvider</c> and carried, inside the serialized
|
||||
/// payload, through the site store-and-forward buffer so the central dispatcher can
|
||||
/// persist it on the <c>Notifications</c> row and echo it onto the <c>NotifyDeliver</c>
|
||||
/// audit rows. Additive trailing member — null for messages built before the field
|
||||
/// existed.
|
||||
/// </param>
|
||||
public record NotificationSubmit(
|
||||
string NotificationId,
|
||||
string ListName,
|
||||
string Subject,
|
||||
string Body,
|
||||
string SourceSiteId,
|
||||
string? SourceInstanceId,
|
||||
string? SourceScript,
|
||||
DateTimeOffset SiteEnqueuedAt,
|
||||
Guid? OriginExecutionId = null,
|
||||
Guid? OriginParentExecutionId = null,
|
||||
string? SourceNode = null);
|
||||
|
||||
/// <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);
|
||||
|
||||
/// <summary>
|
||||
/// Notification Outbox: the delivery status of a notification, as returned to a
|
||||
/// script by <c>Notify.Status(id)</c>.
|
||||
///
|
||||
/// <see cref="Status"/> is either a central status (<c>Pending</c>, <c>Retrying</c>,
|
||||
/// <c>Delivered</c>, <c>Parked</c>, <c>Discarded</c>), the site-local <c>Forwarding</c>
|
||||
/// state (the notification is still buffered at the site and has not yet been
|
||||
/// forwarded/acked), or <c>Unknown</c> (no central row and not buffered locally).
|
||||
/// </summary>
|
||||
public record NotificationDeliveryStatus(
|
||||
string Status,
|
||||
int RetryCount,
|
||||
string? LastError,
|
||||
DateTimeOffset? DeliveredAt);
|
||||
@@ -0,0 +1,161 @@
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications;
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Outbox UI -> Central: paginated, filtered query over the notification outbox.
|
||||
/// All filter fields are optional; <see cref="StuckOnly"/> restricts results to stuck notifications.
|
||||
/// </summary>
|
||||
public record NotificationOutboxQueryRequest(
|
||||
string CorrelationId,
|
||||
string? StatusFilter,
|
||||
string? TypeFilter,
|
||||
string? SourceSiteFilter,
|
||||
string? ListNameFilter,
|
||||
bool StuckOnly,
|
||||
string? SubjectKeyword,
|
||||
DateTimeOffset? From,
|
||||
DateTimeOffset? To,
|
||||
int PageNumber,
|
||||
int PageSize,
|
||||
string? SourceNodeFilter = null);
|
||||
|
||||
/// <summary>
|
||||
/// A single notification row summarised for outbox UI display.
|
||||
/// </summary>
|
||||
public record NotificationSummary(
|
||||
string NotificationId,
|
||||
string Type,
|
||||
string ListName,
|
||||
string Subject,
|
||||
string Status,
|
||||
int RetryCount,
|
||||
string? LastError,
|
||||
string SourceSiteId,
|
||||
string? SourceInstanceId,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset? DeliveredAt,
|
||||
bool IsStuck,
|
||||
string? SourceNode = null);
|
||||
|
||||
/// <summary>
|
||||
/// Central -> Outbox UI: paginated response for a <see cref="NotificationOutboxQueryRequest"/>.
|
||||
/// </summary>
|
||||
public record NotificationOutboxQueryResponse(
|
||||
string CorrelationId,
|
||||
bool Success,
|
||||
string? ErrorMessage,
|
||||
IReadOnlyList<NotificationSummary> Notifications,
|
||||
int TotalCount);
|
||||
|
||||
/// <summary>
|
||||
/// Outbox UI -> Central: request to immediately retry delivery of a notification.
|
||||
/// </summary>
|
||||
public record RetryNotificationRequest(
|
||||
string CorrelationId,
|
||||
string NotificationId);
|
||||
|
||||
/// <summary>
|
||||
/// Central -> Outbox UI: result of a <see cref="RetryNotificationRequest"/>.
|
||||
/// </summary>
|
||||
public record RetryNotificationResponse(
|
||||
string CorrelationId,
|
||||
bool Success,
|
||||
string? ErrorMessage);
|
||||
|
||||
/// <summary>
|
||||
/// Outbox UI -> Central: request to discard (cancel) a pending or stuck notification.
|
||||
/// </summary>
|
||||
public record DiscardNotificationRequest(
|
||||
string CorrelationId,
|
||||
string NotificationId);
|
||||
|
||||
/// <summary>
|
||||
/// Central -> Outbox UI: result of a <see cref="DiscardNotificationRequest"/>.
|
||||
/// </summary>
|
||||
public record DiscardNotificationResponse(
|
||||
string CorrelationId,
|
||||
bool Success,
|
||||
string? ErrorMessage);
|
||||
|
||||
/// <summary>
|
||||
/// Outbox UI -> Central: request for the full detail of a single notification
|
||||
/// (including Body and resolved recipients), for the report detail modal.
|
||||
/// </summary>
|
||||
public record NotificationDetailRequest(
|
||||
string CorrelationId,
|
||||
string NotificationId);
|
||||
|
||||
/// <summary>
|
||||
/// Central -> Outbox UI: full detail for one notification. On a repository fault or
|
||||
/// missing row, Success is false / Detail is null and ErrorMessage carries the cause.
|
||||
/// </summary>
|
||||
public record NotificationDetailResponse(
|
||||
string CorrelationId,
|
||||
bool Success,
|
||||
string? ErrorMessage,
|
||||
NotificationDetail? Detail);
|
||||
|
||||
/// <summary>
|
||||
/// Full notification detail for the report detail modal — everything in the grid's
|
||||
/// NotificationSummary plus Body, ResolvedTargets (recipients), TypeData, SourceScript,
|
||||
/// and the additional lifecycle timestamps.
|
||||
/// </summary>
|
||||
public record NotificationDetail(
|
||||
string NotificationId,
|
||||
string Type,
|
||||
string ListName,
|
||||
string Subject,
|
||||
string Body,
|
||||
string Status,
|
||||
int RetryCount,
|
||||
string? LastError,
|
||||
string? ResolvedTargets,
|
||||
string? TypeData,
|
||||
string SourceSiteId,
|
||||
string? SourceInstanceId,
|
||||
string? SourceScript,
|
||||
DateTimeOffset SiteEnqueuedAt,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset? LastAttemptAt,
|
||||
DateTimeOffset? NextAttemptAt,
|
||||
DateTimeOffset? DeliveredAt,
|
||||
string? SourceNode = null);
|
||||
|
||||
/// <summary>
|
||||
/// Outbox UI -> Central: request for the notification outbox KPI summary.
|
||||
/// </summary>
|
||||
public record NotificationKpiRequest(
|
||||
string CorrelationId);
|
||||
|
||||
/// <summary>
|
||||
/// Central -> Outbox UI: KPI summary for the notification outbox dashboard.
|
||||
/// On a repository fault <see cref="Success"/> is <c>false</c>, <see cref="ErrorMessage"/>
|
||||
/// carries the cause, and the KPI fields are zeroed/<c>null</c>.
|
||||
/// </summary>
|
||||
public record NotificationKpiResponse(
|
||||
string CorrelationId,
|
||||
bool Success,
|
||||
string? ErrorMessage,
|
||||
int QueueDepth,
|
||||
int StuckCount,
|
||||
int ParkedCount,
|
||||
int DeliveredLastInterval,
|
||||
TimeSpan? OldestPendingAge);
|
||||
|
||||
/// <summary>
|
||||
/// Outbox UI -> Central: request for the per-source-site notification outbox KPI breakdown.
|
||||
/// </summary>
|
||||
public record PerSiteNotificationKpiRequest(
|
||||
string CorrelationId);
|
||||
|
||||
/// <summary>
|
||||
/// Central -> Outbox UI: per-site KPI breakdown for the Notification KPIs page.
|
||||
/// On a repository fault <see cref="Success"/> is <c>false</c>, <see cref="ErrorMessage"/>
|
||||
/// carries the cause, and <see cref="Sites"/> is empty.
|
||||
/// </summary>
|
||||
public record PerSiteNotificationKpiResponse(
|
||||
string CorrelationId,
|
||||
bool Success,
|
||||
string? ErrorMessage,
|
||||
IReadOnlyList<SiteNotificationKpiSnapshot> Sites);
|
||||
Reference in New Issue
Block a user