Clean namings and namespace
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using Managing.Application.Abstractions.Models;
|
||||
using Managing.Domain.Accounts;
|
||||
using Managing.Domain.Bots;
|
||||
using Managing.Domain.Trades;
|
||||
@@ -24,7 +23,7 @@ public interface ILiveTradingBotGrain : IGrainWithGuidKey
|
||||
/// <summary>
|
||||
/// Gets comprehensive bot data including positions, signals, and performance metrics
|
||||
/// </summary>
|
||||
Task<TradingBotResponse> GetBotDataAsync();
|
||||
Task<LiveTradingBotModel> GetBotDataAsync();
|
||||
|
||||
Task CreateAsync(TradingBotConfig config, User user);
|
||||
Task StartAsync();
|
||||
@@ -35,7 +34,7 @@ public interface ILiveTradingBotGrain : IGrainWithGuidKey
|
||||
Task<TradingBotConfig> GetConfiguration();
|
||||
Task<Position> ClosePositionAsync(Guid positionId);
|
||||
Task RestartAsync();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the bot and cleans up all associated resources
|
||||
/// </summary>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Managing.Common\Managing.Common.csproj" />
|
||||
<ProjectReference Include="..\Managing.Domain\Managing.Domain.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Managing.Common\Managing.Common.csproj"/>
|
||||
<ProjectReference Include="..\Managing.Domain\Managing.Domain.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" Version="9.2.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" Version="9.2.1"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
using Managing.Domain.Bots;
|
||||
using Managing.Domain.Indicators;
|
||||
using Managing.Domain.Trades;
|
||||
using Orleans;
|
||||
using static Managing.Common.Enums;
|
||||
|
||||
namespace Managing.Application.Abstractions.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Response model for trading bot data.
|
||||
/// Used to return comprehensive bot information via Orleans grains.
|
||||
/// </summary>
|
||||
[GenerateSerializer]
|
||||
public class TradingBotResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Bot identifier
|
||||
/// </summary>
|
||||
[Id(0)]
|
||||
public Guid Identifier { get; set; } = Guid.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Bot display name
|
||||
/// </summary>
|
||||
[Id(1)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Current bot status
|
||||
/// </summary>
|
||||
[Id(2)]
|
||||
public BotStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bot configuration
|
||||
/// </summary>
|
||||
[Id(3)]
|
||||
public TradingBotConfig Config { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Trading positions dictionary, keyed by position identifier
|
||||
/// </summary>
|
||||
[Id(4)]
|
||||
public Dictionary<Guid, Position> Positions { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Trading signals dictionary, keyed by signal identifier
|
||||
/// </summary>
|
||||
[Id(5)]
|
||||
public Dictionary<string, LightSignal> Signals { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Wallet balance history
|
||||
/// </summary>
|
||||
[Id(6)]
|
||||
public Dictionary<DateTime, decimal> WalletBalances { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Current profit and loss
|
||||
/// </summary>
|
||||
[Id(7)]
|
||||
public decimal ProfitAndLoss { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Win rate percentage
|
||||
/// </summary>
|
||||
[Id(8)]
|
||||
public int WinRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Execution count
|
||||
/// </summary>
|
||||
[Id(9)]
|
||||
public long ExecutionCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Startup time
|
||||
/// </summary>
|
||||
[Id(10)]
|
||||
public DateTime StartupTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creation date
|
||||
/// </summary>
|
||||
[Id(11)]
|
||||
public DateTime CreateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Current balance
|
||||
/// </summary>
|
||||
[Id(12)]
|
||||
public decimal CurrentBalance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of active positions
|
||||
/// </summary>
|
||||
[Id(13)]
|
||||
public int ActivePositionsCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Last execution time
|
||||
/// </summary>
|
||||
[Id(14)]
|
||||
public DateTime LastExecution { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Managing.Application.Abstractions.Services;
|
||||
|
||||
public interface IAgentService
|
||||
{
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using Managing.Domain.MoneyManagements;
|
||||
using Managing.Domain.Users;
|
||||
|
||||
namespace Managing.Application.Abstractions
|
||||
namespace Managing.Application.Abstractions.Services
|
||||
{
|
||||
public interface IMoneyManagementService
|
||||
{
|
||||
@@ -12,4 +12,4 @@ namespace Managing.Application.Abstractions
|
||||
Task<bool> DeleteMoneyManagement(User user, string name);
|
||||
Task<bool> DeleteMoneyManagements(User user);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using static Managing.Common.Enums;
|
||||
|
||||
namespace Managing.Application.Abstractions.Services;
|
||||
|
||||
public interface IPricesService
|
||||
{
|
||||
Task UpdatePrice(TradingExchanges exchange, Ticker ticker, Timeframe timeframe);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Managing.Domain.Workers;
|
||||
using static Managing.Common.Enums;
|
||||
|
||||
namespace Managing.Application.Abstractions.Services;
|
||||
|
||||
public interface IWorkerService
|
||||
{
|
||||
Task DisableWorker(WorkerType workerType);
|
||||
Task EnableWorker(WorkerType workerType);
|
||||
Task<Worker> GetWorker(WorkerType workerType);
|
||||
Task<IEnumerable<Worker>> GetWorkers();
|
||||
Task InsertWorker(WorkerType workerType, TimeSpan delay);
|
||||
Task<bool> ToggleWorker(WorkerType workerType);
|
||||
Task UpdateWorker(WorkerType workerType, int executionCount);
|
||||
}
|
||||
Reference in New Issue
Block a user