using Predictalytics.Domain.Enums;

namespace Predictalytics.Domain.Entities;

/// <summary>
/// High-resolution analytics context for a specific trade.
/// Collected asynchronously after a trade is discovered to calculate Slippage and Edge.
/// Only collected for Watchlisted or high-scoring traders to conserve database space.
/// </summary>
public class TradeContext
{
    public long Id { get; set; }

    /// <summary>The ID of the parent trade.</summary>
    public long TradeId { get; set; }
    public Trade Trade { get; set; } = null!;

    /// <summary>The estimated mid-price of the asset roughly 1 minute before the trade execution.</summary>
    public decimal? PriceBefore1m { get; set; }

    /// <summary>The estimated mid-price of the asset roughly 1 minute after the trade execution.</summary>
    public decimal? PriceAfter1m { get; set; }

    /// <summary>The volume-weighted exact follower fill price 10 seconds after the trade execution (excluding the trader's own trades).</summary>
    public decimal? FollowerFillPrice10s { get; set; }

    /// <summary>The volume-weighted exact follower fill price 60 seconds after the trade execution (excluding the trader's own trades).</summary>
    public decimal? FollowerFillPrice60s { get; set; }

    /// <summary>Calculated slippage: execution price vs PriceBefore1m.</summary>
    public decimal? EstimatedSlippage { get; set; }

    /// <summary>Estimated order type based on fee or exact price matching.</summary>
    public OrderType EstimatedOrderType { get; set; } = OrderType.Unknown;
}
