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:
Joseph Doherty
2026-05-28 09:37:45 -04:00
parent 6d87ee3c3b
commit 7b0b9c7365
1531 changed files with 11180 additions and 11054 deletions
@@ -0,0 +1,98 @@
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
/// <summary>
/// A single notification queued in the central outbox. Created at a site (where the
/// <see cref="NotificationId"/> GUID is generated) and forwarded to the central cluster
/// for delivery, retry, and audit. The lifecycle is tracked by <see cref="Status"/>.
/// </summary>
public class Notification
{
/// <summary>GUID primary key, generated at the originating site.</summary>
public string NotificationId { get; set; }
/// <summary>Gets or sets the notification type.</summary>
public NotificationType Type { get; set; }
/// <summary>Gets or sets the notification list name.</summary>
public string ListName { get; set; }
/// <summary>Gets or sets the notification subject.</summary>
public string Subject { get; set; }
/// <summary>Gets or sets the notification body.</summary>
public string Body { get; set; }
/// <summary>JSON extensibility hook for channel-specific payload data.</summary>
public string? TypeData { get; set; }
/// <summary>Gets or sets the notification delivery status.</summary>
public NotificationStatus Status { get; set; } = NotificationStatus.Pending;
/// <summary>Gets or sets the delivery retry count.</summary>
public int RetryCount { get; set; }
/// <summary>Gets or sets the last error message, if any.</summary>
public string? LastError { get; set; }
/// <summary>Resolved delivery targets snapshotted at delivery time, for audit.</summary>
public string? ResolvedTargets { get; set; }
/// <summary>Gets or sets the originating site ID.</summary>
public string SourceSiteId { get; set; }
/// <summary>
/// The cluster node on which the notification was emitted — `node-a` / `node-b`
/// for site rows (qualified by <see cref="SourceSiteId"/>), `central-a` / `central-b`
/// for central-originated rows. Carried from the site on the
/// <see cref="Commons.Messages.Notification.NotificationSubmit"/> and persisted at
/// central; nullable so rows submitted before the column existed don't block ingest.
/// </summary>
public string? SourceNode { get; set; }
/// <summary>Gets or sets the originating instance ID, if any.</summary>
public string? SourceInstanceId { get; set; }
/// <summary>Gets or sets the originating script name, if any.</summary>
public string? SourceScript { get; set; }
/// <summary>
/// The originating script execution's <c>ExecutionId</c> (Audit Log #23). Carried from
/// the site on the <see cref="Commons.Messages.Notification.NotificationSubmit"/> so the
/// central dispatcher can stamp the same id onto its <c>NotifyDeliver</c> audit rows,
/// correlating them with the site-emitted <c>NotifySend</c> row. Null for notifications
/// submitted before the column existed, or raised outside a script-execution context.
/// </summary>
public Guid? OriginExecutionId { get; set; }
/// <summary>
/// The originating routed script execution's <c>ParentExecutionId</c> (Audit Log #23).
/// Carried from the site on the <see cref="Commons.Messages.Notification.NotificationSubmit"/>
/// so the central dispatcher can stamp the same parent id onto its <c>NotifyDeliver</c>
/// audit rows, correlating them with the site-emitted <c>NotifySend</c> row. Null for
/// non-routed runs, or for notifications submitted before the column existed.
/// </summary>
public Guid? OriginParentExecutionId { get; set; }
/// <summary>Gets or sets the time when the notification was enqueued at the site.</summary>
public DateTimeOffset SiteEnqueuedAt { get; set; }
/// <summary>Central ingest time.</summary>
public DateTimeOffset CreatedAt { get; set; }
/// <summary>Gets or sets the time of the last delivery attempt, if any.</summary>
public DateTimeOffset? LastAttemptAt { get; set; }
/// <summary>Gets or sets the time of the next scheduled delivery attempt, if any.</summary>
public DateTimeOffset? NextAttemptAt { get; set; }
/// <summary>Gets or sets the time the notification was delivered, if any.</summary>
public DateTimeOffset? DeliveredAt { get; set; }
/// <summary>
/// Initializes a new instance of the Notification class.
/// </summary>
/// <param name="notificationId">The notification ID (GUID).</param>
/// <param name="type">The notification type.</param>
/// <param name="listName">The notification list name.</param>
/// <param name="subject">The notification subject.</param>
/// <param name="body">The notification body text.</param>
/// <param name="sourceSiteId">The originating site ID.</param>
public Notification(string notificationId, NotificationType type, string listName,
string subject, string body, string sourceSiteId)
{
NotificationId = notificationId ?? throw new ArgumentNullException(nameof(notificationId));
Type = type;
ListName = listName ?? throw new ArgumentNullException(nameof(listName));
Subject = subject ?? throw new ArgumentNullException(nameof(subject));
Body = body ?? throw new ArgumentNullException(nameof(body));
SourceSiteId = sourceSiteId ?? throw new ArgumentNullException(nameof(sourceSiteId));
}
}
@@ -0,0 +1,22 @@
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
public class NotificationList
{
/// <summary>Primary key.</summary>
public int Id { get; set; }
/// <summary>Display name of the notification list.</summary>
public string Name { get; set; }
/// <summary>Delivery type discriminator (e.g., Email).</summary>
public NotificationType Type { get; set; } = NotificationType.Email;
/// <summary>Recipients belonging to this list.</summary>
public ICollection<NotificationRecipient> Recipients { get; set; } = new List<NotificationRecipient>();
/// <summary>Initializes the notification list with the given name.</summary>
/// <param name="name">Display name of the notification list.</param>
public NotificationList(string name)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
}
}
@@ -0,0 +1,24 @@
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
public class NotificationRecipient
{
/// <summary>Gets or sets the database primary key.</summary>
public int Id { get; set; }
/// <summary>Gets or sets the id of the parent notification list.</summary>
public int NotificationListId { get; set; }
/// <summary>Gets or sets the display name of the recipient.</summary>
public string Name { get; set; }
/// <summary>Gets or sets the recipient's email address.</summary>
public string EmailAddress { get; set; }
/// <summary>
/// Initializes a new <see cref="NotificationRecipient"/> with the required fields.
/// </summary>
/// <param name="name">Display name of the recipient.</param>
/// <param name="emailAddress">Email address of the recipient.</param>
public NotificationRecipient(string name, string emailAddress)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
EmailAddress = emailAddress ?? throw new ArgumentNullException(nameof(emailAddress));
}
}
@@ -0,0 +1,40 @@
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
public class SmtpConfiguration
{
/// <summary>Gets or sets the primary key.</summary>
public int Id { get; set; }
/// <summary>Gets or sets the SMTP server hostname or IP address.</summary>
public string Host { get; set; }
/// <summary>Gets or sets the SMTP server port number.</summary>
public int Port { get; set; }
/// <summary>Gets or sets the authentication type (e.g. Basic, OAuth2ClientCredentials).</summary>
public string AuthType { get; set; }
/// <summary>Gets or sets the serialized credentials (password or OAuth2 client secret), or null when not applicable.</summary>
public string? Credentials { get; set; }
/// <summary>Gets or sets the TLS mode (None, StartTLS, or SSL), or null to use the provider default.</summary>
public string? TlsMode { get; set; }
/// <summary>Gets or sets the sender address placed in the From header.</summary>
public string FromAddress { get; set; }
/// <summary>Gets or sets the connection timeout in seconds.</summary>
public int ConnectionTimeoutSeconds { get; set; }
/// <summary>Gets or sets the maximum number of concurrent SMTP connections.</summary>
public int MaxConcurrentConnections { get; set; }
/// <summary>Gets or sets the maximum number of delivery retries before parking.</summary>
public int MaxRetries { get; set; }
/// <summary>Gets or sets the delay between retry attempts.</summary>
public TimeSpan RetryDelay { get; set; }
/// <summary>
/// Initializes a new <see cref="SmtpConfiguration"/> with required fields.
/// </summary>
/// <param name="host">SMTP server hostname or IP address.</param>
/// <param name="authType">Authentication type string (e.g. Basic, OAuth2ClientCredentials).</param>
/// <param name="fromAddress">Sender address for the From header.</param>
public SmtpConfiguration(string host, string authType, string fromAddress)
{
Host = host ?? throw new ArgumentNullException(nameof(host));
AuthType = authType ?? throw new ArgumentNullException(nameof(authType));
FromAddress = fromAddress ?? throw new ArgumentNullException(nameof(fromAddress));
}
}