using System.Collections.Generic;
using System.Linq;
using InABox.Integration.Awg;

namespace InABox.Integration.Logikal
{
    public interface ILogikalPartsResponse<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour> 
        : IAwgBOM<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
        where TFinish : ILogikalFinish
        where TProfile : ILogikalProfile
        where TGasket : ILogikalGasket
        where TComponent : ILogikalComponent
        where TGlass : ILogikalGlass
        where TLabour : ILogikalLabour
    {
        byte[] ExcelData { get; set; }
        byte[] SQLiteData { get; set; }
    }

    public abstract class AbstractLogikalPartsResponse<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour> 
        : LogikalResponse, ILogikalPartsResponse<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
        where TFinish : ILogikalFinish
        where TProfile : ILogikalProfile
        where TGasket : ILogikalGasket
        where TComponent : ILogikalComponent
        where TGlass : ILogikalGlass
        where TLabour : ILogikalLabour
    {
        public IEnumerable<TFinish> Finishes { get; set; }
        
        public IEnumerable<TProfile> Profiles { get; set; }
        
        public IEnumerable<TGasket> Gaskets { get; set; }

        public IEnumerable<TComponent> Components { get; set; }

        public IEnumerable<TGlass> Glass { get; set; }

        public IEnumerable<TLabour> Labour { get; set; }

        public byte[] ExcelData { get; set; }
        
        public byte[] SQLiteData { get; set; }

        public override string ToString() => $"{Finishes?.Count() ?? 0} Finishes / {Profiles?.Count() ?? 0} Profiles / {Gaskets?.Count() ?? 0} Gaskets / {Components?.Count() ?? 0} Components / {Glass?.Count() ?? 0} Glass/ {Labour?.Count() ?? 0} Activities  found";
    }


}