using Valg.EVA.Skanning.Contracts.CommonEnums;
using Valg.EVA.Skanning.ServicesModel.ServiceContracts.Verification.Read;
using Valg.EVA.Skanning.ServicesModel.ServiceContracts.Verification.Write;

namespace Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.WriteModel
{
    public interface IWriteModelHub
    {
        void AddRenumberStrikeoutModification(int candidateIndex, int? renumber, bool? strikeout);
        void AddBallotNumberModification(BallotNumberModification modification);
        void AddPersonVoteModification(int candidateIndex, bool isVoteGiven, int? personVoteFieldId);
        void AddWriteInModification(IWriteInModification writeInModification);
        void AddStampValidityModification(StampValidityModification stampValidityModification);

        IRenumberStrikeoutModification[] GetLatestRenumberStrikeoutModifications();
        RejectionReasonModification GetLatestRejectionReasonModification();
        IWriteInModification[] GetLatestWriteInModifications();
                        
        bool HasAnyPersonVoteModificationsBeenMade { get; }
        bool HasAnyBallotNumberModificationsBeenMade { get; }
        bool HasAnyRejectionReasonModificationsBeenMade { get; }
        bool HasAnyStampValidityModificationsBeenMade { get; }
        bool HasAnyWriteInModificationsBeenMade { get; }
        RejectionReasonType RejectionReason { get; }
        bool IsRejected { get; }
        int? PageIndexRejectedOn { get; }
        bool AreThereAnyPersonVoteModificationsForThisCandidate(int candidateIndex);
                
        void Clear();
        void SetRejectionReason(RejectionReasonType reason, int? pageIndexRejected, bool isModification = true);
        void SetNotRejected(RejectionReasonType[] canCancelAnyOfTheseRejectionReasons);
        SaveBallotPaperVerificationsResult SaveBallotPaperForVerification(BallotPaper ballotPaper);
        bool RevokeBallotPaperSeenStatus(int ballotPaperConcurrencyToken, int id);
        void AddAffiliationNameModification(AffiliationNameModification affiliationNameModification);
    }
}
