using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Valg.EVA.Skanning.JobManagement.Startup.Data;
using Valg.EVA.Skanning.ServicesModel.ServiceContracts.Count.Read;
using Valg.EVA.Skanning.ServicesModel.ServiceContracts.Count.Write;
using Valg.EVA.Skanning.ServicesModel.ServiceContracts.CountResult.Write;

namespace Valg.EVA.Skanning.JobManagement.Startup
{
    public interface IJobManagementApplication
    {
        GenerateCountingResultResult CreateResult(CountingModel model);

        void LoadCountingAndTransfersInDatamodel();

        byte[] CreateResultFile(int countingId);

        Task TransferResultFileAsync(int countingId, int transferJobId);

        void ClearContentOfBoxCounting(BoxCountingDetailsModel boxCountingDetailsModel);

        void DeleteCounting(CountingModel model);

        void ResolveLockedBallots(BoxCountingDetailsModel boxCountingDetailsModel);
        
        void SetBoxAsEmpty(BoxCountingDetailsModel boxCountingDetailsModel);
        int GetLockedBallotsForBoxCounting(int boxCountingId);
        ReadOnlyCollection<DuplicateBallot> GetDuplicateBallots(int countingId);
        ResolveDuplicatesInCountingResult ResolveDuplicates(int countingId, string reportingUnit, BoxCountingToResolve[] boxCountingsToDelete, BoxCountingToResolve[] boxCountingsToKeep);
    }
}
