using System;
using System.ComponentModel.DataAnnotations;

namespace LittleShop.Models;

public class BotSession
{
    public Guid Id { get; set; }
    
    [Required]
    public Guid BotId { get; set; }
    
    [Required]
    [StringLength(256)]
    public string SessionIdentifier { get; set; } = string.Empty; // Hashed user ID
    
    [StringLength(100)]
    public string Platform { get; set; } = string.Empty; // Telegram, Discord, etc.
    
    public DateTime StartedAt { get; set; }
    
    public DateTime LastActivityAt { get; set; }
    
    public DateTime? EndedAt { get; set; }
    
    public int OrderCount { get; set; }
    
    public int MessageCount { get; set; }
    
    public decimal TotalSpent { get; set; }
    
    [StringLength(50)]
    public string Language { get; set; } = "en";
    
    [StringLength(100)]
    public string Country { get; set; } = string.Empty;
    
    public bool IsAnonymous { get; set; }
    
    public string Metadata { get; set; } = "{}"; // JSON for additional session data
    
    // Navigation property
    public virtual Bot Bot { get; set; } = null!;
}