using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using LittleShop.Enums; namespace LittleShop.Models; public class Bot { public Guid Id { get; set; } [Required] [StringLength(256)] public string BotKey { get; set; } = string.Empty; [Required] [StringLength(100)] public string Name { get; set; } = string.Empty; [StringLength(500)] public string Description { get; set; } = string.Empty; public BotType Type { get; set; } public BotStatus Status { get; set; } public string Settings { get; set; } = "{}"; // JSON storage public DateTime CreatedAt { get; set; } public DateTime? LastSeenAt { get; set; } public DateTime? LastConfigSyncAt { get; set; } public bool IsActive { get; set; } [StringLength(50)] public string Version { get; set; } = string.Empty; [StringLength(50)] public string IpAddress { get; set; } = string.Empty; [StringLength(100)] public string PlatformUsername { get; set; } = string.Empty; [StringLength(200)] public string PlatformDisplayName { get; set; } = string.Empty; [StringLength(100)] public string PlatformId { get; set; } = string.Empty; [StringLength(50)] public string PersonalityName { get; set; } = string.Empty; // Remote Discovery Fields /// /// IP address or hostname of the remote TeleBot instance /// [StringLength(255)] public string? RemoteAddress { get; set; } /// /// Port number for the remote TeleBot instance /// public int? RemotePort { get; set; } /// /// Timestamp of last successful discovery probe /// public DateTime? LastDiscoveryAt { get; set; } /// /// Discovery status: Local, Discovered, Initialized, Configured, Offline /// [StringLength(50)] public string DiscoveryStatus { get; set; } = "Local"; /// /// Instance ID returned by the remote TeleBot /// [StringLength(100)] public string? RemoteInstanceId { get; set; } // Navigation properties public virtual ICollection Metrics { get; set; } = new List(); public virtual ICollection Sessions { get; set; } = new List(); }