using System.Text.Json.Serialization;

namespace QuantEngine.Application.Services;

/// <summary>
/// 컬렉션 실행 결과 — Python collect_to_sqlite() 반환값 대응
/// </summary>
public class CollectionRunResult
{
    [JsonPropertyName("run_id")]
    public string RunId { get; set; } = string.Empty;

    [JsonPropertyName("status")]
    public string Status { get; set; } = "RUNNING";

    [JsonPropertyName("started_at")]
    public string? StartedAt { get; set; }

    [JsonPropertyName("finished_at")]
    public string? FinishedAt { get; set; }

    [JsonPropertyName("success_count")]
    public int SuccessCount { get; set; }

    [JsonPropertyName("error_count")]
    public int ErrorCount { get; set; }

    [JsonPropertyName("error_message")]
    public string? ErrorMessage { get; set; }

    [JsonPropertyName("source_counts")]
    public Dictionary<string, int> SourceCounts { get; set; } = new();

    [JsonPropertyName("rows")]
    public List<Dictionary<string, object>> Rows { get; set; } = new();

    [JsonPropertyName("errors")]
    public List<Dictionary<string, object>> Errors { get; set; } = new();
}
