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:
2025-11-23 15:30:11 +07:00
parent 9c8ab71736
commit 411fc41bef
8 changed files with 558 additions and 13 deletions

View File

@@ -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();