using C4IT.FASD.Base;
using FasdDesktopUi.Basics.CustomEvents;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FasdDesktopUi.Basics.Services.SupportCase
{
    public interface ISupportCase
    {
        cSupportCaseDataProvider SupportCaseDataProviderArtifact { get; }
        void Initialize();
        void AddCaseRelations(ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> relations);
        ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> GetCaseRelations();
        Task LoadSupportCaseDataAsync(cF4sdApiSearchResultRelation relation, IEnumerable<string> tablesToLoad);
        IEnumerable<object> GetSupportCaseHealthcardData(cF4sdApiSearchResultRelation relation, cValueAddress valueAddress);
        void UpdateSupportCaseDataCache(cF4sdApiSearchResultRelation relation, IEnumerable<cF4SDHealthCardRawData.cHealthCardTable> tables);
        void InvalidateCaseDataCacheFor(cF4sdApiSearchResultRelation relation);
        void InvalidateLatestCaseDataCacheFor(cF4sdApiSearchResultRelation relation, out ICollection<cF4SDHealthCardRawData.cHealthCardTable> invalidatedTables);

        event EventHandler<RelationEventArgs> CaseRelationsAdded;
        event EventHandler<SupportCaseDataEventArgs> SupportCaseDataCacheHasChanged;
    }
}