using System;

namespace Valg.EVA.Skanning.ServicesModel.ServiceContracts.CountResult.Write
{
    public class GenerateCountingResultResult
    {
        public GenerateCountingResultResult(int transferJobId, bool lockingOfCountingSucceeded, bool generationOfResultSetSucceeded, Exception exception)
        {
            TransferJobId = transferJobId;
            Exception = exception;
            GenerationOfResultSetSucceeded = generationOfResultSetSucceeded;
            LockingOfCountingSucceeded = lockingOfCountingSucceeded;
        }

        public int TransferJobId { get; private set; }
        public bool LockingOfCountingSucceeded { get; private set; }
        public bool GenerationOfResultSetSucceeded { get; private set; }
        public Exception Exception { get; private set; }

        public bool HasFailed
        {
            get { return !LockingOfCountingSucceeded || !GenerationOfResultSetSucceeded; }
        }
    }
}
