using BO.Console.Commands.Base;
using Quadarax.Foundation.Core.QConsole;
using Quadarax.Foundation.Core.QConsole.Attributes;
using Quadarax.Foundation.Core.Value;

namespace BO.Console.Commands.User
{
    [CommandDefinition]
    internal class UserGetCommand : AbstractGetCommand
    {
        #region *** Constants ***
        private const string CS_CMD_USERGET_NAME = "user_get";
        private const string CS_CMD_USERGET_DESCR = "Get single user by specification.";
        #endregion

        #region *** Properties ***

        public override string Name => CS_CMD_USERGET_NAME;
        public override string Description => CS_CMD_USERGET_DESCR;

        #endregion

        #region *** Constructor ***
        public UserGetCommand(Engine engine) : base(engine)
        {
        }
        #endregion

        #region *** EXECUTE ***
        protected override Result OnExecute()
        {
            var user = Client.GetUserAsync(IdentificationType, IdentificationValue).Result;
            WriteDtoToConsole(user);
            return new Result();
        }
        #endregion

        #region *** Private operations ***
        #endregion
    }
}
