using System.Text.Json.Serialization;
namespace AIStudio.Assistants.ModelComparison;
///
/// One of the two chats of a task of a comparison series, as the series keeps it beside the chat itself.
///
public sealed record ModelComparisonSeriesChat
{
///
/// The ID of the chat, which names its file in the folder of the series.
///
public Guid ChatId { get; set; }
///
/// When the first message of the chat was sent, in UTC, or null until the user is done with the chat. Not when the
/// task began: the user writes the first message only for the first chat, and the time it takes would count
/// against the model of that chat alone.
///
public DateTimeOffset? StartedAtUtc { get; set; }
///
/// When the user was done with the chat, in UTC, or null before.
///
public DateTimeOffset? FinishedAtUtc { get; set; }
///
/// How many messages the user wrote in the chat, the first one included.
///
public int UserMessageCount { get; set; }
///
/// How long the user worked in the chat, or null while it is not done.
///
[JsonIgnore]
public TimeSpan? Duration => this.StartedAtUtc is { } started && this.FinishedAtUtc is { } finished ? finished - started : null;
}