using Managing.Common;
using Managing.Domain.Trades;

namespace Managing.Api.Models.Responses
{
    /// <summary>
    /// Detailed information about a user's deployed strategy
    /// </summary>
    public class UserStrategyDetailsViewModel
    {
        /// <summary>
        /// Name of the deployed strategy
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Current state of the strategy (RUNNING, STOPPED, UNUSED)
        /// </summary>
        public Enums.BotStatus State { get; set; }

        /// <summary>
        /// Total profit or loss generated by the strategy in USD
        /// </summary>
        public decimal PnL { get; set; }

        /// <summary>
        /// Return on investment percentage
        /// </summary>
        public decimal ROIPercentage { get; set; }

        /// <summary>
        /// Return on investment percentage in the last 24 hours
        /// </summary>
        public decimal ROILast24H { get; set; }

        /// <summary>
        /// Date and time when the strategy was started
        /// </summary>
        public DateTime Runtime { get; set; }

        /// <summary>
        /// Average percentage of successful trades
        /// </summary>
        public int WinRate { get; set; }

        /// <summary>
        /// Total trading volume for all trades
        /// </summary>
        public decimal TotalVolumeTraded { get; set; }

        /// <summary>
        /// Trading volume in the last 24 hours
        /// </summary>
        public decimal VolumeLast24H { get; set; }

        /// <summary>
        /// Number of winning trades
        /// </summary>
        public int Wins { get; set; }

        /// <summary>
        /// Number of losing trades
        /// </summary>
        public int Losses { get; set; }

        /// <summary>
        /// Dictionary of all positions executed by this strategy, keyed by position identifier
        /// </summary>
        public List<Position> Positions { get; set; } = new List<Position>();

        public Guid Identifier { get; set; }

        public Dictionary<DateTime, decimal> WalletBalances { get; set; } = new Dictionary<DateTime, decimal>();
    }
}