using Managing.Domain.Statistics; using static Managing.Common.Enums; namespace Managing.Application.Abstractions.Repositories; public interface IAgentSummaryRepository { Task GetByUserIdAsync(int userId); Task GetByAgentNameAsync(string agentName); Task> GetAllAsync(); Task InsertAsync(AgentSummary agentSummary); Task UpdateAsync(AgentSummary agentSummary); Task SaveOrUpdateAsync(AgentSummary agentSummary); /// /// Gets paginated agent summaries with sorting and filtering /// /// Page number (1-based) /// Number of items per page /// Field to sort by /// Sort order (asc or desc) /// Optional list of agent names to filter by /// Tuple containing the paginated results and total count Task<(IEnumerable Results, int TotalCount)> GetPaginatedAsync( int page, int pageSize, SortableFields sortBy, string sortOrder, IEnumerable? agentNames = null); Task> GetAllAgentWithRunningBots(); /// /// Updates only the agent name for a specific user's agent summary /// /// The user ID /// The new agent name Task UpdateAgentNameAsync(int userId, string agentName); /// /// Gets the total count of agents /// /// Total number of agents Task GetTotalAgentCount(); /// /// Increments the backtest count for a specific user's agent summary /// /// The user ID Task IncrementBacktestCountAsync(int userId); /// /// Updates the total balance for a specific user's agent summary /// /// The user ID /// The new total balance value Task UpdateTotalBalanceAsync(int userId, decimal totalBalance); }