using System;

namespace Valg.EVA.Skanning.ServicesModel.ServiceContracts.Scan.Write
{
    public class BoxIsCompletelyScannedResult
    {
        private BoxIsCompletelyScannedResult(BoxIsCompletelyScannedOperationResult operationResult, Exception possibleException = null)
        {
            OperationResult = operationResult;
            PossibleException = possibleException;
        }

        public BoxIsCompletelyScannedOperationResult OperationResult { get; }
        public Exception PossibleException { get; }

        public static BoxIsCompletelyScannedResult BoxDeleted(Exception possibleException)
        {
            return new BoxIsCompletelyScannedResult(BoxIsCompletelyScannedOperationResult.BoxDeleted, possibleException);
        }

        public static BoxIsCompletelyScannedResult InterpretFailed(Exception possibleException)
        {
            return new BoxIsCompletelyScannedResult(BoxIsCompletelyScannedOperationResult.InterpretFailed, possibleException);
        }

        public static BoxIsCompletelyScannedResult Success()
        {
            return new BoxIsCompletelyScannedResult(BoxIsCompletelyScannedOperationResult.Success);
        }

        public static BoxIsCompletelyScannedResult DuplicateDetectionFailed(Exception possibleException)
        {
            return new BoxIsCompletelyScannedResult(BoxIsCompletelyScannedOperationResult.DuplicateDetectionFailed, possibleException);
        }
    }
}
