using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Managing.Common; using Microsoft.EntityFrameworkCore; using static Managing.Common.Enums; namespace Managing.Infrastructure.Databases.PostgreSql.Entities; [Table("Users")] [Index(nameof(Name), IsUnique = true)] public class UserEntity { [Key] public int Id { get; set; } [Required] [MaxLength(255)] public required string Name { get; set; } [MaxLength(255)] public string? AgentName { get; set; } public string? AvatarUrl { get; set; } public string? TelegramChannel { get; set; } public string? OwnerWalletAddress { get; set; } public DateTimeOffset? LastConnectionDate { get; set; } public bool IsAdmin { get; set; } // User Settings [Column(TypeName = "decimal(18,8)")] public decimal? LowEthAmountAlert { get; set; } public bool EnableAutoswap { get; set; } = false; [Column(TypeName = "decimal(18,8)")] public decimal? AutoswapAmount { get; set; } public int? MaxWaitingTimeForPositionToGetFilledSeconds { get; set; } [Column(TypeName = "decimal(18,8)")] public decimal? MaxTxnGasFeePerPosition { get; set; } public bool IsGmxEnabled { get; set; } = false; public Confidence? MinimumConfidence { get; set; } // Navigation properties public virtual ICollection Accounts { get; set; } = new List(); }