using System;
using System.Collections.Generic;

namespace ZB.MOM.WW.MxGateway.Worker.MxAccess;

public sealed class MxAccessShutdownResult
{
    /// <summary>Initializes a new instance of the <see cref="MxAccessShutdownResult"/> class.</summary>
    /// <param name="failures">List of failures encountered during graceful shutdown.</param>
    public MxAccessShutdownResult(IReadOnlyList<MxAccessShutdownFailure> failures)
    {
        Failures = failures ?? throw new ArgumentNullException(nameof(failures));
    }

    /// <summary>Gets the list of shutdown failures.</summary>
    public IReadOnlyList<MxAccessShutdownFailure> Failures { get; }

    /// <summary>Gets a value indicating whether the shutdown succeeded with no failures.</summary>
    public bool Succeeded => Failures.Count == 0;
}
