Add PositionCount property to Backtest models and responses
- Introduced PositionCount to Backtest, LightBacktest, and their respective response models. - Updated BacktestController and BacktestExecutor to include PositionCount in responses. - Modified database schema to accommodate new PositionCount field in relevant entities.
This commit is contained in:
1729
src/Managing.Infrastructure.Database/Migrations/20251118131323_AddPositionCountToBacktests.Designer.cs
generated
Normal file
1729
src/Managing.Infrastructure.Database/Migrations/20251118131323_AddPositionCountToBacktests.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Managing.Infrastructure.Databases.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPositionCountToBacktests : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PositionCount",
|
||||
table: "Backtests",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PositionCount",
|
||||
table: "Backtests");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,6 +217,9 @@ namespace Managing.Infrastructure.Databases.Migrations
|
||||
b.Property<decimal>("NetPnl")
|
||||
.HasColumnType("decimal(18,8)");
|
||||
|
||||
b.Property<int>("PositionCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("PositionsJson")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
@@ -128,4 +128,7 @@ public class BacktestEntity
|
||||
[Required]
|
||||
[Column(TypeName = "decimal(18,8)")]
|
||||
public decimal NetPnl { get; set; }
|
||||
|
||||
[Required]
|
||||
public int PositionCount { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user