Add scoring message

This commit is contained in:
2025-07-17 15:57:51 +07:00
parent da48ee37ba
commit e27b4c4a76
9 changed files with 224 additions and 46 deletions

View File

@@ -157,7 +157,8 @@ public class BacktestRepository : IBacktestRepository
MaxDrawdown = b.Statistics?.MaxDrawdown,
Fees = b.Fees,
SharpeRatio = b.Statistics?.SharpeRatio != null ? (double)b.Statistics.SharpeRatio : null,
Score = b.Score
Score = b.Score,
ScoreMessage = b.ScoreMessage ?? string.Empty
});
return (mappedBacktests, (int)totalCount);
@@ -284,7 +285,8 @@ public class BacktestRepository : IBacktestRepository
MaxDrawdown = b.Statistics?.MaxDrawdown,
Fees = b.Fees,
SharpeRatio = b.Statistics?.SharpeRatio != null ? (double)b.Statistics.SharpeRatio : null,
Score = b.Score
Score = b.Score,
ScoreMessage = b.ScoreMessage ?? string.Empty
});
return (mappedBacktests, (int)totalCount);

View File

@@ -29,6 +29,7 @@ namespace Managing.Infrastructure.Databases.MongoDb.Collections
[BsonRepresentation(BsonType.Decimal128)]
public decimal Fees { get; set; }
public double Score { get; set; }
public string ScoreMessage { get; set; } = string.Empty;
public string Identifier { get; set; }
public string RequestId { get; set; }
public string? Metadata { get; set; }

View File

@@ -150,6 +150,7 @@ public static class MongoMappers
StartDate = b.StartDate,
EndDate = b.EndDate,
Score = b.Score,
ScoreMessage = b.ScoreMessage ?? string.Empty,
RequestId = b.RequestId,
Metadata = string.IsNullOrEmpty(b.Metadata) ? null : JsonSerializer.Deserialize<object>(b.Metadata)
};
@@ -179,6 +180,7 @@ public static class MongoMappers
StartDate = result.StartDate,
EndDate = result.EndDate,
Score = result.Score,
ScoreMessage = result.ScoreMessage ?? string.Empty,
RequestId = result.RequestId,
Metadata = result.Metadata == null ? null : JsonSerializer.Serialize(result.Metadata)
};