Add sort agent by total volume and total balance
This commit is contained in:
@@ -484,7 +484,9 @@ public static class Enums
|
|||||||
Losses,
|
Losses,
|
||||||
AgentName,
|
AgentName,
|
||||||
CreatedAt,
|
CreatedAt,
|
||||||
UpdatedAt
|
UpdatedAt,
|
||||||
|
TotalVolume,
|
||||||
|
TotalBalance
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -210,6 +210,12 @@ public class AgentSummaryRepository : IAgentSummaryRepository
|
|||||||
SortableFields.UpdatedAt => isDescending
|
SortableFields.UpdatedAt => isDescending
|
||||||
? query.OrderByDescending(a => a.UpdatedAt)
|
? query.OrderByDescending(a => a.UpdatedAt)
|
||||||
: query.OrderBy(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
|
_ => isDescending
|
||||||
? query.OrderByDescending(a => a.TotalPnL) // Default to TotalPnL desc
|
? query.OrderByDescending(a => a.TotalPnL) // Default to TotalPnL desc
|
||||||
: query.OrderBy(a => a.TotalPnL)
|
: query.OrderBy(a => a.TotalPnL)
|
||||||
|
|||||||
Reference in New Issue
Block a user