using System.Text.Json.Serialization;

namespace Nalu.Web.Models;

public record ExtractionResponse
{
    [JsonPropertyName("obtained")]
    public bool Obtained { get; init; }

    [JsonPropertyName("extracted_value")]
    public string? ExtractedValue { get; init; }

    /// "high" | "medium" | "low"
    [JsonPropertyName("confidence")]
    public string Confidence { get; init; } = "low";

    [JsonPropertyName("certain")]
    public bool Certain { get; init; }

    [JsonPropertyName("suggestion_to_agent")]
    public string? SuggestionToAgent { get; init; }

    [JsonPropertyName("has_suggestion")]
    public bool HasSuggestion => SuggestionToAgent is not null;

    /// "scalar" = plain string value | "object" = JSON-as-string, parse before use | null = no value (obtained: false)
    [JsonPropertyName("value_format")]
    public string? ValueFormat { get; init; }
}
