namespace Codex.Dal.Entities;

/// <summary>
/// Represents a conversation grouping multiple messages together.
/// Provides conversation-level metadata and tracking.
/// </summary>
public class Conversation
{
    /// <summary>
    /// Unique identifier for the conversation
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// Title or summary of the conversation (can be auto-generated from first message)
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// Brief summary of the conversation topic or purpose
    /// </summary>
    public string? Summary { get; set; }

    /// <summary>
    /// When the conversation was started
    /// </summary>
    public DateTime StartedAt { get; set; } = DateTime.UtcNow;

    /// <summary>
    /// When the last message was added to this conversation
    /// </summary>
    public DateTime LastMessageAt { get; set; } = DateTime.UtcNow;

    /// <summary>
    /// Whether this conversation is currently active
    /// </summary>
    public bool IsActive { get; set; } = true;

    /// <summary>
    /// Total number of messages in this conversation
    /// </summary>
    public int MessageCount { get; set; } = 0;

    // Navigation properties
    /// <summary>
    /// All messages in this conversation
    /// </summary>
    public ICollection<ConversationMessage> Messages { get; set; } = new List<ConversationMessage>();

    /// <summary>
    /// Agent executions that are part of this conversation
    /// </summary>
    public ICollection<AgentExecution> Executions { get; set; } = new List<AgentExecution>();
}
