using Managing.Domain.Statistics;

namespace Managing.Application.Abstractions.Services;

public interface IAgentService
{
    Task<AgentBalanceHistory> GetAgentBalances(string agentName, DateTime start, DateTime? end = null);
    Task<AgentBalanceHistory> GetAgentBalancesByUserId(int userId, DateTime start, DateTime? end = null);
    
    Task SaveOrUpdateAgentSummary(AgentSummary agentSummary);
    
    Task<IEnumerable<AgentSummary>> GetAllAgentSummaries();
    Task<IEnumerable<string>> GetAllOnlineAgents();
    
    /// <summary>
    /// Updates only the agent name for a specific user's agent summary
    /// </summary>
    /// <param name="userId">The user ID</param>
    /// <param name="agentName">The new agent name</param>
    Task UpdateAgentSummaryNameAsync(int userId, string agentName);
    
    /// <summary>
    /// Gets the total count of agents
    /// </summary>
    /// <returns>Total number of agents</returns>
    Task<int> GetTotalAgentCount();
    
    /// <summary>
    /// Increments the backtest count for a specific user's agent summary
    /// </summary>
    /// <param name="userId">The user ID</param>
    Task IncrementBacktestCountAsync(int userId);
}