using System;
using System.Collections.Generic;

namespace StellaOps.Authority.Plugins;

internal sealed record AuthorityPluginRegistrationSummary(
    IReadOnlyCollection<string> RegisteredPlugins,
    IReadOnlyCollection<AuthorityPluginRegistrationFailure> Failures,
    IReadOnlyCollection<string> MissingOrderedPlugins)
{
    public static AuthorityPluginRegistrationSummary Empty { get; } =
        new AuthorityPluginRegistrationSummary(
            Array.Empty<string>(),
            Array.Empty<AuthorityPluginRegistrationFailure>(),
            Array.Empty<string>());

    public bool HasFailures => Failures.Count > 0 || MissingOrderedPlugins.Count > 0;
}

internal sealed record AuthorityPluginRegistrationFailure(string PluginName, string Reason);
