using System;

namespace PolyTrader.Modules.ResolutionFarming.Models
{
    /// <summary>
    /// Abgeschlossener Farming-Trade (Tabelle rf_closed_trades) inkl. Fees und Redeem-Status.
    /// Das Modul schreibt zusätzlich einen generischen Core-Trade-Log-Eintrag (Dashboard).
    /// </summary>
    public class RfClosedTrade
    {
        public long Id { get; set; }              // DB-Autoincrement
        public int AccountId { get; set; }
        public bool IsDemo { get; set; }

        public string TokenId { get; set; } = string.Empty;
        public string MarketSlug { get; set; } = string.Empty;
        public string MarketQuestion { get; set; } = string.Empty;
        public string Outcome { get; set; } = string.Empty;
        public string Category { get; set; } = string.Empty;
        public string ClusterKey { get; set; } = string.Empty;

        public decimal EntryPrice { get; set; }
        public decimal ExitPrice { get; set; }
        public decimal Size { get; set; }
        public decimal RealizedPnl { get; set; }
        public decimal PnlPercent { get; set; }
        public decimal TotalFees { get; set; }

        public DateTime OpenedAt { get; set; }
        public DateTime ClosedAt { get; set; }
        public string ExitReason { get; set; } = string.Empty;

        /// <summary>"None", "Pending", "Redeemed", "Sold" (PreRedeem-Verkauf statt On-Chain-Redeem).</summary>
        public string RedeemStatus { get; set; } = "None";
    }
}
