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));
    }
}
