Refactor BotController and BotService for improved bot management
- Cleaned up constructor parameters in BotController for better readability. - Enhanced StartCopyTradingCommand handling with improved formatting. - Updated bot deletion logic in BotService to delete associated positions and trigger agent summary updates. - Added new method in TradingService for deleting positions by initiator identifier. - Implemented error handling in StopBotCommandHandler to ensure agent summary updates do not disrupt bot stop operations.
This commit is contained in:
@@ -256,6 +256,11 @@ public class TradingService : ITradingService
|
||||
return await _tradingRepository.GetPositionsByInitiatorIdentifiersAsync(initiatorIdentifiers);
|
||||
}
|
||||
|
||||
public async Task DeletePositionsByInitiatorIdentifierAsync(Guid initiatorIdentifier)
|
||||
{
|
||||
await _tradingRepository.DeletePositionsByInitiatorIdentifierAsync(initiatorIdentifier);
|
||||
}
|
||||
|
||||
public async Task<decimal> GetGlobalPnLFromPositionsAsync()
|
||||
{
|
||||
return await _tradingRepository.GetGlobalPnLFromPositionsAsync();
|
||||
|
||||
Reference in New Issue
Block a user