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,65 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
|
||||
|
||||
public class Template
|
||||
{
|
||||
/// <summary>
|
||||
/// The unique identifier for the template.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// The name of the template.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Optional description of the template.
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
/// <summary>
|
||||
/// The identifier of the parent template, if this template inherits from another.
|
||||
/// </summary>
|
||||
public int? ParentTemplateId { get; set; }
|
||||
/// <summary>
|
||||
/// The identifier of the folder containing this template.
|
||||
/// </summary>
|
||||
public int? FolderId { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of attributes defined in this template.
|
||||
/// </summary>
|
||||
public ICollection<TemplateAttribute> Attributes { get; set; } = new List<TemplateAttribute>();
|
||||
/// <summary>
|
||||
/// Collection of alarms defined in this template.
|
||||
/// </summary>
|
||||
public ICollection<TemplateAlarm> Alarms { get; set; } = new List<TemplateAlarm>();
|
||||
/// <summary>
|
||||
/// Collection of scripts defined in this template.
|
||||
/// </summary>
|
||||
public ICollection<TemplateScript> Scripts { get; set; } = new List<TemplateScript>();
|
||||
/// <summary>
|
||||
/// Collection of compositions defined in this template.
|
||||
/// </summary>
|
||||
public ICollection<TemplateComposition> Compositions { get; set; } = new List<TemplateComposition>();
|
||||
|
||||
/// <summary>
|
||||
/// True when this template was auto-derived to back a TemplateComposition
|
||||
/// slot. Derived templates inherit from a base (see <see cref="ParentTemplateId"/>),
|
||||
/// are owned by their composition row (see <see cref="OwnerCompositionId"/>),
|
||||
/// and are hidden from the main template tree by default.
|
||||
/// </summary>
|
||||
public bool IsDerived { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Back-reference to the <see cref="TemplateComposition"/> that owns this
|
||||
/// derived template. Non-null only when <see cref="IsDerived"/>; cascade-
|
||||
/// delete when the composition is removed. Always null on base templates.
|
||||
/// </summary>
|
||||
public int? OwnerCompositionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Template with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the template.</param>
|
||||
public Template(string name)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
|
||||
|
||||
public class TemplateAlarm
|
||||
{
|
||||
/// <summary>Database primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Foreign key to the owning <see cref="Template"/>.</summary>
|
||||
public int TemplateId { get; set; }
|
||||
/// <summary>Unique alarm name within the template.</summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>Optional human-readable description of the alarm.</summary>
|
||||
public string? Description { get; set; }
|
||||
/// <summary>Alarm priority level; lower values indicate higher priority.</summary>
|
||||
public int PriorityLevel { get; set; }
|
||||
/// <summary>When true, this alarm is locked and cannot be overridden in derived templates.</summary>
|
||||
public bool IsLocked { get; set; }
|
||||
/// <summary>Type of trigger condition that activates this alarm.</summary>
|
||||
public AlarmTriggerType TriggerType { get; set; }
|
||||
/// <summary>JSON-serialized trigger configuration specific to the <see cref="TriggerType"/>.</summary>
|
||||
public string? TriggerConfiguration { get; set; }
|
||||
/// <summary>Optional ID of the script to execute when the alarm triggers.</summary>
|
||||
public int? OnTriggerScriptId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// True when this row was copied from the base template and has not been
|
||||
/// overridden on the derived template. Changes to the base flow downward
|
||||
/// for inherited rows; an explicit override flips this to false.
|
||||
/// Always false on base (non-derived) templates.
|
||||
/// </summary>
|
||||
public bool IsInherited { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set on a base alarm. When true, derived templates may not override the
|
||||
/// alarm — the row is rendered readonly with a 🔒 in the derived UI, and
|
||||
/// any attempt to update it through the API is rejected.
|
||||
/// </summary>
|
||||
public bool LockedInDerived { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="TemplateAlarm"/> with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The unique alarm name within the template.</param>
|
||||
public TemplateAlarm(string name)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
|
||||
|
||||
public class TemplateAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the attribute ID.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the template ID that owns this attribute.
|
||||
/// </summary>
|
||||
public int TemplateId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the attribute name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the attribute value.
|
||||
/// </summary>
|
||||
public string? Value { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the data type of the attribute.
|
||||
/// </summary>
|
||||
public DataType DataType { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the attribute is locked from override.
|
||||
/// </summary>
|
||||
public bool IsLocked { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the attribute description.
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the data source reference for this attribute.
|
||||
/// </summary>
|
||||
public string? DataSourceReference { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// True when this row was copied from the base template and has not been
|
||||
/// overridden on the derived template. Changes to the base flow downward
|
||||
/// for inherited rows; an explicit override flips this to false.
|
||||
/// Always false on base (non-derived) templates.
|
||||
/// </summary>
|
||||
public bool IsInherited { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set on a base attribute. When true, derived templates may not override
|
||||
/// the value — the row is rendered readonly with a 🔒 in the derived UI,
|
||||
/// and any attempt to update it through the API is rejected.
|
||||
/// </summary>
|
||||
public bool LockedInDerived { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TemplateAttribute"/> class with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The attribute name.</param>
|
||||
public TemplateAttribute(string name)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
|
||||
|
||||
public class TemplateComposition
|
||||
{
|
||||
/// <summary>Primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Foreign key to the parent template that includes this composition.</summary>
|
||||
public int TemplateId { get; set; }
|
||||
/// <summary>Foreign key to the template being composed into the parent.</summary>
|
||||
public int ComposedTemplateId { get; set; }
|
||||
/// <summary>Name of the composition instance within the parent template's namespace.</summary>
|
||||
public string InstanceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new template composition with the required instance name.
|
||||
/// </summary>
|
||||
/// <param name="instanceName">Name of this composition slot within the parent template.</param>
|
||||
public TemplateComposition(string instanceName)
|
||||
{
|
||||
InstanceName = instanceName ?? throw new ArgumentNullException(nameof(instanceName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
|
||||
|
||||
public class TemplateFolder
|
||||
{
|
||||
/// <summary>Database primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Display name for the folder.</summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>ID of the parent folder, or null for root-level folders.</summary>
|
||||
public int? ParentFolderId { get; set; }
|
||||
/// <summary>Display ordering position within the parent folder.</summary>
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="TemplateFolder"/> with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The display name for the folder.</param>
|
||||
public TemplateFolder(string name)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
|
||||
|
||||
public class TemplateScript
|
||||
{
|
||||
/// <summary>
|
||||
/// The script identifier.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The template identifier this script belongs to.
|
||||
/// </summary>
|
||||
public int TemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The script name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the script is locked for editing.
|
||||
/// </summary>
|
||||
public bool IsLocked { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The script code.
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The trigger type for the script, or null.
|
||||
/// </summary>
|
||||
public string? TriggerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The trigger configuration, or null.
|
||||
/// </summary>
|
||||
public string? TriggerConfiguration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The parameter definitions in JSON format, or null.
|
||||
/// </summary>
|
||||
public string? ParameterDefinitions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The return type definition in JSON format, or null.
|
||||
/// </summary>
|
||||
public string? ReturnDefinition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The minimum time between script runs, or null.
|
||||
/// </summary>
|
||||
public TimeSpan? MinTimeBetweenRuns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// True when this row was copied from the base template and has not been
|
||||
/// overridden on the derived template. Changes to the base flow downward
|
||||
/// for inherited rows; an explicit override flips this to false.
|
||||
/// Always false on base (non-derived) templates.
|
||||
/// </summary>
|
||||
public bool IsInherited { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set on a base script. When true, derived templates may not override
|
||||
/// the script body — the row is rendered readonly in the derived
|
||||
/// UI, and any attempt to update it through the API is rejected.
|
||||
/// </summary>
|
||||
public bool LockedInDerived { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the TemplateScript.
|
||||
/// </summary>
|
||||
/// <param name="name">The script name.</param>
|
||||
/// <param name="code">The script code.</param>
|
||||
public TemplateScript(string name, string code)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
Code = code ?? throw new ArgumentNullException(nameof(code));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user