Fix bot update with the tradingtype
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Managing.Api.Models.Requests;
|
||||
using Managing.Api.Models.Requests;
|
||||
using Managing.Api.Models.Responses;
|
||||
using Managing.Application.Abstractions;
|
||||
using Managing.Application.Abstractions.Services;
|
||||
@@ -544,6 +544,7 @@ public class BotController : BaseController
|
||||
StartupTime = item.StartupTime,
|
||||
Name = item.Name,
|
||||
Ticker = item.Ticker,
|
||||
TradingType = item.TradingType,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Managing.Api.Models.Requests;
|
||||
using Managing.Api.Models.Requests;
|
||||
using Managing.Api.Models.Responses;
|
||||
using Managing.Application.Abstractions;
|
||||
using Managing.Application.Abstractions.Grains;
|
||||
@@ -1032,6 +1032,7 @@ public class DataController : ControllerBase
|
||||
StartupTime = item.StartupTime,
|
||||
Name = item.Name,
|
||||
Ticker = item.Ticker,
|
||||
TradingType = item.TradingType,
|
||||
MasterAgentName = item.MasterBotUser?.AgentName,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1015,6 +1015,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
||||
Identifier = _state.State.Identifier,
|
||||
Name = _state.State.Config.Name,
|
||||
Ticker = _state.State.Config.Ticker,
|
||||
TradingType = _state.State.Config.TradingType,
|
||||
User = _state.State.User,
|
||||
Status = status,
|
||||
CreateDate = _state.State.CreateDate,
|
||||
@@ -1073,6 +1074,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
||||
Identifier = _state.State.Identifier,
|
||||
Name = _state.State.Config.Name,
|
||||
Ticker = _state.State.Config.Ticker,
|
||||
TradingType = _state.State.Config.TradingType,
|
||||
User = _state.State.User,
|
||||
Status = status,
|
||||
StartupTime = _state.State.StartupTime,
|
||||
|
||||
@@ -374,7 +374,8 @@ namespace Managing.Application.ManageBot
|
||||
|| existingBot.AccumulatedRunTimeSeconds != bot.AccumulatedRunTimeSeconds
|
||||
|| existingBot.LastStartTime != bot.LastStartTime
|
||||
|| existingBot.LastStopTime != bot.LastStopTime
|
||||
|| existingBot.Ticker != bot.Ticker)
|
||||
|| existingBot.Ticker != bot.Ticker
|
||||
|| existingBot.TradingType != bot.TradingType)
|
||||
{
|
||||
_tradingBotLogger.LogInformation("Update bot statistics for bot {BotId}",
|
||||
bot.Identifier);
|
||||
|
||||
@@ -65,6 +65,7 @@ public class PostgreSqlBotRepository : IBotRepository
|
||||
// Update the existing entity properties directly instead of creating a new one
|
||||
existingEntity.Name = bot.Name;
|
||||
existingEntity.Ticker = bot.Ticker;
|
||||
existingEntity.TradingType = bot.TradingType;
|
||||
existingEntity.Status = bot.Status;
|
||||
existingEntity.StartupTime = bot.StartupTime;
|
||||
existingEntity.TradeWins = bot.TradeWins;
|
||||
|
||||
@@ -638,6 +638,7 @@ export interface LightBacktestResponse {
|
||||
initialBalance: number;
|
||||
netPnl: number;
|
||||
positionCount: number;
|
||||
tradingType: TradingType;
|
||||
}
|
||||
|
||||
export interface PaginatedBacktestsResponse {
|
||||
|
||||
@@ -5137,6 +5137,7 @@ export interface LightBacktestResponse {
|
||||
initialBalance: number;
|
||||
netPnl: number;
|
||||
positionCount: number;
|
||||
tradingType: TradingType;
|
||||
}
|
||||
|
||||
export interface PaginatedBacktestsResponse {
|
||||
|
||||
@@ -638,6 +638,7 @@ export interface LightBacktestResponse {
|
||||
initialBalance: number;
|
||||
netPnl: number;
|
||||
positionCount: number;
|
||||
tradingType: TradingType;
|
||||
}
|
||||
|
||||
export interface PaginatedBacktestsResponse {
|
||||
|
||||
Reference in New Issue
Block a user