namespace AIStudio.Assistants.BeyondFactsLab;
///
/// A preparation in the list of the BeyondFacts Lab, also when it cannot be opened.
///
/// The ID of the preparation.
/// The name to show; empty when even the name cannot be read.
/// When the preparation was changed last.
/// Whether the preparation can be opened.
/// The preparation, when it can be opened.
public sealed record BflProjectEntry(Guid ProjectId, string Name, DateTimeOffset ModifiedAtUtc, BflProjectLoadStatus Status, BflProject? Project)
{
///
/// Gets whether the preparation can be opened.
///
public bool IsAvailable => this.Status is BflProjectLoadStatus.AVAILABLE && this.Project is not null;
///
/// Creates the entry of a preparation which can be opened.
///
/// The preparation.
public static BflProjectEntry FromProject(BflProject project) => new(project.ProjectId, project.Name, project.ModifiedAtUtc, BflProjectLoadStatus.AVAILABLE, project);
}