using CareFusion.Lib.StorageSystem.Input;
using CareFusion.Lib.StorageSystem.Stock;
using System;

namespace CareFusion.Lib.StorageSystem.EventArguments
{
    /// <summary>
    /// The PackInputFinished event arguments.
    /// </summary>
    public class PackInputFinishedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PackInputFinishedEventArgs"/> class.
        /// </summary>
        /// <param name="sender">Object instance which raised the event.</param>
        /// <param name="source">The identifier of the according input request source that has been finished.</param>
        /// <param name="inputRequestId">The identifier of the according input request that has been finished.</param>
        /// <param name="result">The result of the input request that has been finished.</param>
        /// <param name="articles">List of articles with the packs that were stored.</param>
        public PackInputFinishedEventArgs(int source, int inputRequestId, InputResult result, IArticle[] articles)
        {
            Source = source;
            InputRequestId = inputRequestId;
            Result = result;
            Articles = articles;
        }

        /// <summary>
        /// Gets the identifier of the according input request source that has been finished.
        /// </summary>
        public int Source { get; }

        /// <summary>
        /// Gets the identifier of the according input request that has been finished.
        /// </summary>
        public int InputRequestId { get; }

        /// <summary>
        /// Gets the result of the input request that has been finished.
        /// </summary>
        public InputResult Result { get; }

        /// <summary>
        /// Gets the information of the articles and the packs that were dispensed.
        /// </summary>
        public IArticle[] Articles { get; }
    }
}
