using Codex.Dal.Enums;

namespace Codex.Dal.QueryProviders;

/// <summary>
/// Agent execution list item for dynamic queries with pagination, filtering, and sorting support
/// </summary>
public record ListAgentExecutionsQueryItem
{
    /// <summary>Unique execution identifier</summary>
    public Guid Id { get; init; }

    /// <summary>Agent identifier</summary>
    public Guid AgentId { get; init; }

    /// <summary>Agent name</summary>
    public string AgentName { get; init; } = string.Empty;

    /// <summary>Conversation identifier (if part of a conversation)</summary>
    public Guid? ConversationId { get; init; }

    /// <summary>User prompt (truncated for list view)</summary>
    public string UserPrompt { get; init; } = string.Empty;

    /// <summary>Execution status</summary>
    public ExecutionStatus Status { get; init; }

    /// <summary>Execution start timestamp</summary>
    public DateTime StartedAt { get; init; }

    /// <summary>Execution completion timestamp</summary>
    public DateTime? CompletedAt { get; init; }

    /// <summary>Input tokens consumed</summary>
    public int InputTokens { get; init; }

    /// <summary>Output tokens generated</summary>
    public int OutputTokens { get; init; }

    /// <summary>Estimated cost in USD</summary>
    public decimal EstimatedCost { get; init; }

    /// <summary>Number of messages in execution</summary>
    public int MessageCount { get; init; }

    /// <summary>Error message if failed</summary>
    public string? ErrorMessage { get; init; }
}
