using System.ComponentModel.DataAnnotations; namespace LittleShop.Models; public class BotActivity { [Key] public Guid Id { get; set; } public Guid BotId { get; set; } [StringLength(256)] public string SessionIdentifier { get; set; } = string.Empty; // Hashed user ID [StringLength(100)] public string UserDisplayName { get; set; } = string.Empty; // e.g., "Merlin", "Anonymous User #123" [Required] [StringLength(50)] public string ActivityType { get; set; } = string.Empty; // e.g., "ViewProduct", "AddToCart", "Checkout", "Browse" [StringLength(500)] public string ActivityDescription { get; set; } = string.Empty; // e.g., "Viewing Red Widget", "Added 3x Blue Gadget to cart" public Guid? ProductId { get; set; } // Related product if applicable [StringLength(200)] public string ProductName { get; set; } = string.Empty; // Denormalized for performance public Guid? OrderId { get; set; } // Related order if applicable [StringLength(100)] public string CategoryName { get; set; } = string.Empty; // If browsing categories public decimal? Value { get; set; } // Monetary value if applicable (cart total, order amount) public int? Quantity { get; set; } // Quantity if applicable [StringLength(100)] public string Platform { get; set; } = "Telegram"; // Telegram, Discord, Web, etc. [StringLength(50)] public string DeviceType { get; set; } = string.Empty; // Mobile, Desktop, etc. [StringLength(100)] public string Location { get; set; } = string.Empty; // Country or region if available public DateTime Timestamp { get; set; } = DateTime.UtcNow; public string Metadata { get; set; } = "{}"; // JSON for additional flexible data // Navigation properties public virtual Bot Bot { get; set; } = null!; public virtual Product? Product { get; set; } public virtual Order? Order { get; set; } }