using System;
using System.Collections.Generic;

namespace NT8.Core.Analytics
{
    /// <summary>
    /// Base report model.
    /// </summary>
    public class Report
    {
        public string ReportName { get; set; }
        public DateTime GeneratedAtUtc { get; set; }
        public PerformanceMetrics SummaryMetrics { get; set; }

        public Report()
        {
            GeneratedAtUtc = DateTime.UtcNow;
            SummaryMetrics = new PerformanceMetrics();
        }
    }

    /// <summary>
    /// Daily report.
    /// </summary>
    public class DailyReport : Report
    {
        public DateTime Date { get; set; }
        public Dictionary<string, double> GradePnL { get; set; }

        public DailyReport()
        {
            ReportName = "Daily";
            GradePnL = new Dictionary<string, double>();
        }
    }

    /// <summary>
    /// Weekly report.
    /// </summary>
    public class WeeklyReport : Report
    {
        public DateTime WeekStart { get; set; }
        public DateTime WeekEnd { get; set; }
        public Dictionary<string, double> StrategyPnL { get; set; }

        public WeeklyReport()
        {
            ReportName = "Weekly";
            StrategyPnL = new Dictionary<string, double>();
        }
    }

    /// <summary>
    /// Monthly report.
    /// </summary>
    public class MonthlyReport : Report
    {
        public int Year { get; set; }
        public int Month { get; set; }
        public Dictionary<string, double> SymbolPnL { get; set; }

        public MonthlyReport()
        {
            ReportName = "Monthly";
            SymbolPnL = new Dictionary<string, double>();
        }
    }

    /// <summary>
    /// Trade blotter representation.
    /// </summary>
    public class TradeBlotterReport
    {
        public DateTime GeneratedAtUtc { get; set; }
        public List<TradeRecord> Trades { get; set; }

        public TradeBlotterReport()
        {
            GeneratedAtUtc = DateTime.UtcNow;
            Trades = new List<TradeRecord>();
        }
    }

    /// <summary>
    /// Equity curve point series.
    /// </summary>
    public class EquityCurve
    {
        public List<EquityPoint> Points { get; set; }

        public EquityCurve()
        {
            Points = new List<EquityPoint>();
        }
    }

    /// <summary>
    /// Equity point model.
    /// </summary>
    public class EquityPoint
    {
        public DateTime Time { get; set; }
        public double Equity { get; set; }
        public double Drawdown { get; set; }
    }

    /// <summary>
    /// Sort direction.
    /// </summary>
    public enum SortDirection
    {
        Asc,
        Desc
    }
}
