namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites;

public class Site
{
    /// <summary>Primary key.</summary>
    public int Id { get; set; }
    /// <summary>Human-readable display name for the site.</summary>
    public string Name { get; set; }
    /// <summary>Machine-readable identifier used in Akka addresses and API routing.</summary>
    public string SiteIdentifier { get; set; }
    /// <summary>Optional description of the site.</summary>
    public string? Description { get; set; }
    /// <summary>Akka remote address for site node A.</summary>
    public string? NodeAAddress { get; set; }
    /// <summary>Akka remote address for site node B.</summary>
    public string? NodeBAddress { get; set; }
    /// <summary>gRPC endpoint for site node A used by the central SiteStreamGrpcClient.</summary>
    public string? GrpcNodeAAddress { get; set; }
    /// <summary>gRPC endpoint for site node B used by the central SiteStreamGrpcClient.</summary>
    public string? GrpcNodeBAddress { get; set; }

    /// <summary>
    /// Initializes a new site with the required name and identifier.
    /// </summary>
    /// <param name="name">Human-readable display name.</param>
    /// <param name="siteIdentifier">Machine-readable identifier used in Akka addresses.</param>
    public Site(string name, string siteIdentifier)
    {
        Name = name ?? throw new ArgumentNullException(nameof(name));
        SiteIdentifier = siteIdentifier ?? throw new ArgumentNullException(nameof(siteIdentifier));
    }
}
