using System.Collections.Generic;
using System.Linq;

namespace MarcusLaw.OutlookAddin.Core.Models
{
    public sealed class FilingBatchSummary
    {
        public IReadOnlyList<FilingItemResult> Items { get; set; } = new List<FilingItemResult>();

        public int FiledCount => Items.Count(i => i.Outcome == FilingOutcome.Filed);

        public int QueuedCount => Items.Count(i => i.Outcome == FilingOutcome.Queued);

        public int FailedCount => Items.Count(i => i.Outcome == FilingOutcome.Failed);

        public bool AuthRequired => Items.Any(i => i.Outcome == FilingOutcome.AuthRequired);
    }
}
