using System.Text.Json.Serialization;

namespace NexusReader.Application.DTOs.AI;

public record KeyConcept(
    [property: JsonPropertyName("title")] string Title,
    [property: JsonPropertyName("description")] string Description
);

public record QuizQuestion(
    [property: JsonPropertyName("question")] string Question,
    [property: JsonPropertyName("options")] List<string> Options,
    [property: JsonPropertyName("correct_index")] int CorrectIndex
);

public record KnowledgeUnitDto(string Id, string Type, string Content, Dictionary<string, object>? Metadata = null);
public record KnowledgeLinkDto(string Source, string Target, string Relation);

public record KnowledgePacket
{
    [JsonPropertyName("concepts")] public List<KeyConcept> Concepts { get; init; } = new();
    [JsonPropertyName("quizzes")] public List<QuizQuestion> Quizzes { get; init; } = new();
    [JsonPropertyName("units")] public List<KnowledgeUnitDto> Units { get; init; } = new();
    [JsonPropertyName("links")] public List<KnowledgeLinkDto> Links { get; init; } = new();
    [JsonPropertyName("graph")] public NexusReader.Application.Queries.Graph.GraphDataDto? Graph { get; init; }
    [JsonPropertyName("summary")] public string? Summary { get; init; }
}
