using Managing.Domain.Bots; using static Managing.Common.Enums; namespace Managing.Application.Abstractions.Repositories; public interface IBotRepository { Task InsertBotAsync(Bot bot); Task> GetBotsAsync(); Task UpdateBot(Bot bot); Task DeleteBot(Guid identifier); Task GetBotByIdentifierAsync(Guid identifier); Task> GetBotsByIdsAsync(IEnumerable identifiers); Task> GetBotsByUserIdAsync(int id); Task> GetBotsByStatusAsync(BotStatus status); Task GetBotByNameAsync(string name); Task GetBotByUserIdAndNameAsync(int userId, string name); /// /// Gets paginated bots with filtering and sorting /// /// Page number (1-based) /// Number of items per page /// Filter by status (optional) /// Filter by name (partial match, case-insensitive) /// Filter by ticker (partial match, case-insensitive) /// Filter by agent name (partial match, case-insensitive) /// Sort field /// Sort direction ("Asc" or "Desc") /// Whether to show only profitable bots (ROI > 0) /// Tuple containing the bots for the current page and total count Task<(IEnumerable Bots, int TotalCount)> GetBotsPaginatedAsync( int pageNumber, int pageSize, BotStatus? status = null, string? name = null, string? ticker = null, string? agentName = null, BotSortableColumn sortBy = BotSortableColumn.CreateDate, string sortDirection = "Desc", bool showOnlyProfitable = false); /// /// Gets the top performing bots by PnL from the specified statuses /// /// Bot statuses to include in the query /// Number of top performers to return (default: 3) /// Top performing bots ordered by PnL descending Task> GetTopBotsByPnLAsync(IEnumerable statuses, int count = 3); /// /// Gets the top performing bots by ROI from the specified statuses /// /// Bot statuses to include in the query /// Number of top performers to return (default: 3) /// Top performing bots ordered by ROI descending Task> GetTopBotsByRoiAsync(IEnumerable statuses, int count = 3); }