using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static Managing.Common.Enums;

namespace Managing.Infrastructure.Databases.PostgreSql.Entities;

[Table("Trades")]
public class TradeEntity
{
    [Key]
    public int Id { get; set; }
    
    public DateTime Date { get; set; }
    public TradeDirection Direction { get; set; }
    public TradeStatus Status { get; set; }
    public TradeType TradeType { get; set; }
    public Ticker Ticker { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal Fee { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal Quantity { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal Price { get; set; }
    
    [Column(TypeName = "decimal(18,8)")]
    public decimal Leverage { get; set; }
    
    [MaxLength(255)]
    public string? ExchangeOrderId { get; set; }
    
    [Column(TypeName = "text")]
    public string? Message { get; set; }
    
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
} 