namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
///
/// A template-defined binding to a native alarm source: a data connection plus
/// a source reference (OPC UA SourceNode/notifier nodeId, or MxAccess
/// object/area). At deploy time the instance subscribes and mirrors all
/// conditions discovered under the source. Inheritance/lock semantics mirror
/// .
///
public class TemplateNativeAlarmSource
{
/// Database primary key.
public int Id { get; set; }
/// Foreign key to the owning .
public int TemplateId { get; set; }
/// Unique source binding name within the template.
public string Name { get; set; }
/// Optional human-readable description.
public string? Description { get; set; }
/// Name of the data connection that owns the alarm feed.
public string ConnectionName { get; set; } = string.Empty;
/// Source reference (OPC UA SourceNode/notifier nodeId, or MxAccess object/area).
public string SourceReference { get; set; } = string.Empty;
/// Optional condition filter; null = mirror all conditions under the source.
public string? ConditionFilter { get; set; }
/// When true, this binding cannot be overridden in derived templates.
public bool IsLocked { get; set; }
/// True when copied from a base template and not yet overridden on the derived template.
public bool IsInherited { get; set; }
/// Set on a base binding; when true derived templates may not override it.
public bool LockedInDerived { get; set; }
/// Initializes a new binding with the specified name.
/// The unique binding name within the template.
public TemplateNativeAlarmSource(string name) =>
Name = name ?? throw new ArgumentNullException(nameof(name));
}