using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quadarax.Foundation.Core.Attributes;
using Quadarax.Foundation.Core.Exceptions;

namespace qdr.fnd.core.pqueue.Exceptions
{
    public class PSQueueValidationException: CodeException<PSQueueValidationException.ErrorCodes>
    {
        #region *** Error Codes ***

        public enum ErrorCodes : int
        {
            [ErrorMessage("Queue item validation: Owner value is required.")]
            OwnerRequired = 7000,
            [ErrorMessage("Queue item validation: OwnerRef value is required.")]
            OwnerRefRequired = 7001,
            [ErrorMessage("Queue item validation: ProcessProvider value is required.")]
            ProcessProviderRequired = 7002,
            [ErrorMessage("Queue item validation: ProcessProvider '{0}' type cannot be resolved.")]
            ProcessProviderCannotResolve = 7003,
            [ErrorMessage("Queue item validation: InitialAttempt must be bigger than zero.")]
            InitialAttemptMustBePositive = 7004,
            [ErrorMessage("Queue item validation: Status must be specified when isTransient flag is set to False..")]
            InvalidStatusTransientCombination = 7005,
            [ErrorMessage("ForceStart: Cannot force start due forbidden status '{0}' for this operation.")]
            InvalidStatusForForceStart = 7006,
            [ErrorMessage("ForceStop: Cannot force stop due forbidden status '{0}' for this operation.")]
            InvalidStatusForForceStop = 7007,
            [ErrorMessage("ForceStop: Cannot pause due forbidden status '{0}' for this operation.")]
            InvalidStatusForPause = 7008,
            [ErrorMessage("StatusTransition: Invalid status transition from '{0}' to '{1}'. Allowed transition for status '{0}' are follows: {2}")]
            InvalidStatusTransition = 7010,
            
        }
        #endregion
        #region *** Constructors ***
        /// <inheritdoc />
        public PSQueueValidationException(ErrorCodes code, Exception innerException) : base(code, innerException)
        {
        }

        /// <inheritdoc />
        public PSQueueValidationException(ErrorCodes code) : base(code)
        {
        }

        /// <inheritdoc />
        public PSQueueValidationException(ErrorCodes code, params object[] messageArguments) : base(code, messageArguments)
        {
        }

        /// <inheritdoc />
        public PSQueueValidationException(ErrorCodes code, Exception innerException, params object[] messageArguments) : base(code, innerException, messageArguments)
        {
        }
        #endregion
    }
}
