feat(Trades): refactor trades MQTT client and DTOs

This commit is contained in:
2026-08-09 21:01:42 +02:00
parent c74a4456af
commit e7427b7464
21 changed files with 3363 additions and 0 deletions
@@ -0,0 +1,43 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace FinlyticTrades.Entities;
[Table("trade_hourly_updates")]
[Index(nameof(TradeId), nameof(Timestamp))]
public class TradeHourlyUpdateEntity
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
public Guid TradeId { get; set; }
[ForeignKey(nameof(TradeId))]
public TradeEntity? Trade { get; set; }
[Required]
[MaxLength(30)]
public string Recommendation { get; set; } = "Hold"; // "Hold", "AdjustSL", "AdjustTP", "Close"
[Column(TypeName = "decimal(18,4)")]
public decimal CurrentPrice { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? SuggestedStopLoss { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? SuggestedTakeProfit { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal VixValue { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? FloatingPnlPercent { get; set; }
public string Reasoning { get; set; } = string.Empty;
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}