diff --git a/src/Managing.Api/Controllers/DataController.cs b/src/Managing.Api/Controllers/DataController.cs
index 76e50af5..4477877a 100644
--- a/src/Managing.Api/Controllers/DataController.cs
+++ b/src/Managing.Api/Controllers/DataController.cs
@@ -662,35 +662,6 @@ public class DataController : ControllerBase
return Ok(balances);
}
- ///
- /// Retrieves a paginated list of the best performing agents based on their total value
- ///
- /// The start date for calculating agent performance
- /// Optional end date for calculating agent performance (defaults to current time)
- /// Page number (defaults to 1)
- /// Number of items per page (defaults to 10)
- /// A paginated list of agent balances and total count
- [HttpGet("GetBestAgents")]
- public async Task> GetBestAgents(
- DateTime startDate,
- DateTime? endDate = null,
- int page = 1,
- int pageSize = 10)
- {
- var (agents, totalCount) = await _agentService.GetBestAgents(startDate, endDate, page, pageSize);
-
- var response = new BestAgentsResponse
- {
- Agents = agents,
- TotalCount = totalCount,
- CurrentPage = page,
- PageSize = pageSize,
- TotalPages = (int)Math.Ceiling(totalCount / (double)pageSize)
- };
-
- return Ok(response);
- }
-
///
/// Retrieves an array of online agent names
///
diff --git a/src/Managing.Application.Abstractions/Repositories/IAgentBalanceRepository.cs b/src/Managing.Application.Abstractions/Repositories/IAgentBalanceRepository.cs
index a1bd8d85..69365ba1 100644
--- a/src/Managing.Application.Abstractions/Repositories/IAgentBalanceRepository.cs
+++ b/src/Managing.Application.Abstractions/Repositories/IAgentBalanceRepository.cs
@@ -6,7 +6,4 @@ public interface IAgentBalanceRepository
{
void InsertAgentBalance(AgentBalance balance);
Task> GetAgentBalancesByUserId(int userId, DateTime start, DateTime? end = null);
-
- Task<(IList result, int totalCount)> GetAllAgentBalancesWithHistory(DateTime start,
- DateTime? end);
}
\ No newline at end of file
diff --git a/src/Managing.Application.Abstractions/Services/IAgentService.cs b/src/Managing.Application.Abstractions/Services/IAgentService.cs
index 4ca1ee0d..a395d010 100644
--- a/src/Managing.Application.Abstractions/Services/IAgentService.cs
+++ b/src/Managing.Application.Abstractions/Services/IAgentService.cs
@@ -7,10 +7,6 @@ public interface IAgentService
Task GetAgentBalances(string agentName, DateTime start, DateTime? end = null);
Task GetAgentBalancesByUserId(int userId, DateTime start, DateTime? end = null);
- Task<(IList Agents, int TotalCount)> GetBestAgents(DateTime start, DateTime? end = null,
- int page = 1,
- int pageSize = 10);
-
Task SaveOrUpdateAgentSummary(AgentSummary agentSummary);
Task> GetAllAgentSummaries();
diff --git a/src/Managing.Application/Agents/AgentService.cs b/src/Managing.Application/Agents/AgentService.cs
index 311f6d4a..f5d7a9be 100644
--- a/src/Managing.Application/Agents/AgentService.cs
+++ b/src/Managing.Application/Agents/AgentService.cs
@@ -90,45 +90,6 @@ public class AgentService : IAgentService
return result;
}
- public async Task<(IList Agents, int TotalCount)> GetBestAgents(
- DateTime start,
- DateTime? end = null,
- int page = 1,
- int pageSize = 10)
- {
- var effectiveEnd = end ?? DateTime.UtcNow;
- string cacheKey = $"BestAgents_{start:yyyyMMdd}_{effectiveEnd:yyyyMMdd}";
-
- // Check if the results are already cached
- var cachedResult = _cacheService.GetValue<(IList, int)>(cacheKey);
-
- if (cachedResult != default)
- {
- // Apply pagination to cached results
- var (cachedAgents, cachedTotalCount) = cachedResult;
- var paginatedAgents = cachedAgents
- .Skip((page - 1) * pageSize)
- .Take(pageSize)
- .ToList();
- return (paginatedAgents, cachedTotalCount);
- }
-
- // Get all agents with their balance history
- var (fetchedAgents, fetchedTotalCount) =
- await _agentBalanceRepository.GetAllAgentBalancesWithHistory(start, end);
-
- // Cache all results for 5 minutes
- _cacheService.SaveValue(cacheKey, (fetchedAgents, fetchedTotalCount), TimeSpan.FromMinutes(5));
-
- // Apply pagination
- var result = fetchedAgents
- .Skip((page - 1) * pageSize)
- .Take(pageSize)
- .ToList();
-
- return (result, fetchedTotalCount);
- }
-
public async Task SaveOrUpdateAgentSummary(AgentSummary agentSummary)
{
try