Add sort agent by total volume and total balance

This commit is contained in:
2025-09-15 18:02:52 +07:00
parent 63bc7bbe59
commit c516c272fd
2 changed files with 9 additions and 1 deletions

View File

@@ -484,7 +484,9 @@ public static class Enums
Losses,
AgentName,
CreatedAt,
UpdatedAt
UpdatedAt,
TotalVolume,
TotalBalance
}
/// <summary>

View File

@@ -210,6 +210,12 @@ public class AgentSummaryRepository : IAgentSummaryRepository
SortableFields.UpdatedAt => isDescending
? query.OrderByDescending(a => a.UpdatedAt)
: query.OrderBy(a => a.UpdatedAt),
SortableFields.TotalVolume => isDescending
? query.OrderByDescending(a => a.TotalVolume)
: query.OrderBy(a => a.TotalVolume),
SortableFields.TotalBalance => isDescending
? query.OrderByDescending(a => a.TotalBalance)
: query.OrderBy(a => a.TotalBalance),
_ => isDescending
? query.OrderByDescending(a => a.TotalPnL) // Default to TotalPnL desc
: query.OrderBy(a => a.TotalPnL)