using System; using System.ComponentModel.DataAnnotations; namespace LittleShop.Models; /// /// Tracks all contacts for each bot, enabling contact recovery and migration /// public class BotContact { [Key] public Guid Id { get; set; } // Bot Association [Required] public Guid BotId { get; set; } public virtual Bot Bot { get; set; } = null!; // Telegram User Information [Required] public long TelegramUserId { get; set; } [StringLength(100)] public string TelegramUsername { get; set; } = string.Empty; [Required] [StringLength(200)] public string DisplayName { get; set; } = string.Empty; [StringLength(50)] public string FirstName { get; set; } = string.Empty; [StringLength(50)] public string LastName { get; set; } = string.Empty; // Contact Metadata public DateTime FirstContactDate { get; set; } public DateTime LastContactDate { get; set; } public int TotalInteractions { get; set; } public string LastKnownLanguage { get; set; } = "en"; // Relationship Status public ContactStatus Status { get; set; } = ContactStatus.Active; public string? StatusReason { get; set; } // Customer Link (if they've made purchases) public Guid? CustomerId { get; set; } public virtual Customer? Customer { get; set; } // Recovery Information public bool IsRecovered { get; set; } = false; public Guid? RecoveredFromBotId { get; set; } public DateTime? RecoveredAt { get; set; } // Backup Metadata public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public bool IsActive { get; set; } = true; // Additional Contact Info (encrypted/hashed) [StringLength(500)] public string? EncryptedContactData { get; set; } // For storing additional contact methods // Preferences and Notes [StringLength(500)] public string? Preferences { get; set; } // JSON string of user preferences [StringLength(1000)] public string? Notes { get; set; } // Admin notes about this contact } public enum ContactStatus { Active, Inactive, Blocked, Migrated, Lost, Recovered }