Update the position count and initiator
This commit is contained in:
@@ -11,6 +11,7 @@ using Managing.Domain.MoneyManagements;
|
||||
using Managing.Domain.Statistics;
|
||||
using Managing.Domain.Trades;
|
||||
using Managing.Domain.Users;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
@@ -300,12 +301,14 @@ namespace Managing.Infrastructure.Messengers.Discord
|
||||
var exchangeService = (IExchangeService)_services.GetService(typeof(IExchangeService));
|
||||
var accountService = (IAccountService)_services.GetService(typeof(IAccountService));
|
||||
var tradingService = (ITradingService)_services.GetService(typeof(ITradingService));
|
||||
var scopeFactory = (IServiceScopeFactory)_services.GetService(typeof(IServiceScopeFactory));
|
||||
|
||||
await component.RespondAsync("Alright, let met few seconds to close this position");
|
||||
var position = await tradingService.GetPositionByIdentifierAsync(Guid.Parse(parameters[1]));
|
||||
var command = new ClosePositionCommand(position);
|
||||
var result =
|
||||
await new ClosePositionCommandHandler(exchangeService, accountService, tradingService).Handle(command);
|
||||
await new ClosePositionCommandHandler(exchangeService, accountService, tradingService, scopeFactory)
|
||||
.Handle(command);
|
||||
var fields = new List<EmbedFieldBuilder>()
|
||||
{
|
||||
new EmbedFieldBuilder
|
||||
|
||||
Reference in New Issue
Block a user