using Managing.Domain.Backtests;
using Managing.Domain.Bots;
using Managing.Domain.Candles;
using Managing.Domain.Users;
using Orleans;

namespace Managing.Application.Abstractions.Grains;

/// <summary>
/// Orleans grain interface for Backtest TradingBot operations.
/// This interface extends ITradingBotGrain with backtest-specific functionality.
/// </summary>
public interface IBacktestTradingBotGrain : IGrainWithGuidKey
{
    /// <summary>
    /// Runs a complete backtest following the exact pattern of GetBacktestingResult from Backtester.cs
    /// </summary>
    /// <param name="config">The trading bot configuration for this backtest</param>
    /// <param name="candles">The candles to use for backtesting</param>
    /// <param name="user">The user running the backtest (optional, required for saving)</param>
    /// <param name="save">Whether to save the backtest results</param>
    /// <param name="withCandles">Whether to include candles and indicators values in the response</param>
    /// <param name="requestId">The request ID to associate with this backtest</param>
    /// <param name="metadata">Additional metadata to associate with this backtest</param>
    /// <returns>The complete backtest result</returns>
    Task<LightBacktest> RunBacktestAsync(TradingBotConfig config, HashSet<Candle> candles, User user = null, bool save = false, bool withCandles = false, string requestId = null, object metadata = null);
}
