using Managing.Domain.Statistics;
using static Managing.Common.Enums;

namespace Managing.Application.Abstractions.Repositories;

public interface IAgentSummaryRepository
{
    Task<AgentSummary?> GetByUserIdAsync(int userId);
    Task<AgentSummary?> GetByAgentNameAsync(string agentName);
    Task<IEnumerable<AgentSummary>> GetAllAsync();
    Task InsertAsync(AgentSummary agentSummary);
    Task UpdateAsync(AgentSummary agentSummary);
    Task SaveOrUpdateAsync(AgentSummary agentSummary);

    /// <summary>
    /// Gets paginated agent summaries with sorting and filtering
    /// </summary>
    /// <param name="page">Page number (1-based)</param>
    /// <param name="pageSize">Number of items per page</param>
    /// <param name="sortBy">Field to sort by</param>
    /// <param name="sortOrder">Sort order (asc or desc)</param>
    /// <param name="agentNames">Optional list of agent names to filter by</param>
    /// <returns>Tuple containing the paginated results and total count</returns>
    Task<(IEnumerable<AgentSummary> Results, int TotalCount)> GetPaginatedAsync(
        int page,
        int pageSize,
        SortableFields sortBy,
        string sortOrder,
        IEnumerable<string>? agentNames = null);
    Task<IEnumerable<AgentSummary>> GetAllAgentWithRunningBots();
}