namespace ZB.MOM.WW.MxGateway.Server.Configuration;

public sealed class DashboardOptions
{
    /// <summary>Gets whether the dashboard is enabled.</summary>
    public bool Enabled { get; init; } = true;

    /// <summary>Gets whether anonymous localhost access to dashboard is allowed.</summary>
    public bool AllowAnonymousLocalhost { get; init; } = true;

    /// <summary>Gets the dashboard snapshot update interval in milliseconds.</summary>
    public int SnapshotIntervalMilliseconds { get; init; } = 1_000;

    /// <summary>Gets the maximum number of recent faults to display.</summary>
    public int RecentFaultLimit { get; init; } = 100;

    /// <summary>Gets the maximum number of recent sessions to display.</summary>
    public int RecentSessionLimit { get; init; } = 200;

    /// <summary>Gets whether to show full tag values in the dashboard.</summary>
    public bool ShowTagValues { get; init; }

    /// <summary>
    /// LDAP group → dashboard role mapping. Values must be one of
    /// <see cref="DashboardRoles.Admin"/> or <see cref="DashboardRoles.Viewer"/>.
    /// Users with no matching group are rejected at login.
    /// </summary>
    public Dictionary<string, string> GroupToRole { get; init; } = new(StringComparer.OrdinalIgnoreCase);
}
