Update agent stats

This commit is contained in:
2025-09-28 13:55:24 +07:00
parent 6e07bac6ae
commit a8d09c36b7
5 changed files with 37 additions and 20 deletions

View File

@@ -610,5 +610,20 @@ public class PostgreSqlTradingRepository : ITradingRepository
return PostgreSqlMappers.Map(scenario);
}
public async Task<IEnumerable<Position>> GetPositionByUserIdAsync(int userId)
{
var positions = await _context.Positions
.AsNoTracking()
.Include(p => p.User)
.Include(p => p.OpenTrade)
.Include(p => p.StopLossTrade)
.Include(p => p.TakeProfit1Trade)
.Include(p => p.TakeProfit2Trade)
.Where(p => p.UserId == userId)
.ToListAsync()
.ConfigureAwait(false);
return PostgreSqlMappers.Map(positions);
}
#endregion
}