using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
public class Instance
{
/// Primary key.
public int Id { get; set; }
/// Foreign key to the template this instance is based on.
public int TemplateId { get; set; }
/// Foreign key to the site where this instance is deployed.
public int SiteId { get; set; }
/// Optional foreign key to the organisational area this instance belongs to.
public int? AreaId { get; set; }
/// System-wide unique name that identifies this instance.
public string UniqueName { get; set; }
/// Current lifecycle state of the instance.
public InstanceState State { get; set; }
/// Per-attribute value overrides applied on top of the template defaults.
public ICollection AttributeOverrides { get; set; } = new List();
/// Per-alarm configuration overrides applied on top of the template defaults.
public ICollection AlarmOverrides { get; set; } = new List();
/// Data-connection bindings that map template tags to site data sources.
public ICollection ConnectionBindings { get; set; } = new List();
///
/// Initializes a new instance with the required unique name.
///
/// System-wide unique name for this instance.
public Instance(string uniqueName)
{
UniqueName = uniqueName ?? throw new ArgumentNullException(nameof(uniqueName));
}
}