using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using static Managing.Common.Enums; namespace Managing.Infrastructure.Databases.PostgreSql.Entities; [Table("MoneyManagements")] public class MoneyManagementEntity { [Key] public int Id { get; set; } [Required] [MaxLength(255)] public string Name { get; set; } [Required] public Timeframe Timeframe { get; set; } [Required] [Column(TypeName = "decimal(18,8)")] public decimal StopLoss { get; set; } [Required] [Column(TypeName = "decimal(18,8)")] public decimal TakeProfit { get; set; } [Required] [Column(TypeName = "decimal(18,8)")] public decimal Leverage { get; set; } [MaxLength(255)] public string? UserName { get; set; } public int? UserId { get; set; } // Navigation properties [ForeignKey("UserId")] public UserEntity? User { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; }