using System;
using Valg.EVA.Skanning.ServicesModel.ServiceContracts.Count.Read;

namespace Valg.EVA.Skanning.ServicesModel.ServiceContracts.Verification.Read
{
    public class GetNextBallotPaperToVerifyResult
    {
        public static readonly GetNextBallotPaperToVerifyResult NoBallotPaperWasFoundResult = new GetNextBallotPaperToVerifyResult(true);

        private GetNextBallotPaperToVerifyResult(bool noBallotPaperWasFound)
        {
            NoBallotPaperWasFound = noBallotPaperWasFound;
        }

        public GetNextBallotPaperToVerifyResult(BallotPaper ballotPaperToVerify, Counting counting, int totalToVerification)
        {
            this.Counting = counting;
            TotalToVerification = totalToVerification;
            BallotPaperToVerify = ballotPaperToVerify;
            NoBallotPaperWasFound = false;
        }

        public GetNextBallotPaperToVerifyResult(Exception exception) 
        {
            Exception = exception;
            Failure = true;
        }

        public bool? NoBallotPaperWasFound { get; private set; }
        public BallotPaper BallotPaperToVerify { get; private set; }
        public bool Failure { get; private set; }
        public Exception Exception { get; private set; }
        public Counting Counting { get; }
        public int TotalToVerification { get; private set; }
    }
}
