using Microsoft.Extensions.Options;
using ScadaLink.HealthMonitoring;

namespace ScadaLink.Host;

/// <summary>
/// Provides the site identity from NodeOptions configuration.
/// </summary>
public class SiteIdentityProvider : ISiteIdentityProvider
{
    public string SiteId { get; }

    public SiteIdentityProvider(IOptions<NodeOptions> nodeOptions)
    {
        SiteId = nodeOptions.Value.SiteId
            ?? throw new InvalidOperationException("SiteId is required for site nodes.");
    }
}
