namespace ExperionCrawler.Core.Application.DTOs;

// ── Text-to-SQL DTOs ─────────────────────────────────────────────────────────

public class NaturalLanguageQueryDto
{
    public string Query { get; set; } = string.Empty;
}

public class SqlQueryDto
{
    public string Sql { get; set; } = string.Empty;
    public int? Limit { get; set; } = 1000;
}

public class AnalyzeRequestDto
{
    public List<string> TagNames { get; set; } = new();
    public DateTime? From { get; set; }
    public DateTime? To { get; set; }
    public string Interval { get; set; } = "5 min"; // time_bucket interval
}

public class SqlQueryResultDto
{
    public bool Success { get; set; }
    public string? Error { get; set; }
    public List<string> Columns { get; set; } = new();
    public List<Dictionary<string, object?>> Rows { get; set; } = new();
    public int TotalCount { get; set; }
}

public class TimeSeriesAnalysisDto
{
    public bool Success { get; set; }
    public string? Error { get; set; }
    public List<AnalysisTagResult> Tags { get; set; } = new();
}

public class AnalysisTagResult
{
    public string TagName { get; set; } = string.Empty;
    public double? Avg { get; set; }
    public double? Min { get; set; }
    public double? Max { get; set; }
    public double? First { get; set; }
    public double? Last { get; set; }
    public long PointCount { get; set; }
    public DateTime? From { get; set; }
    public DateTime? To { get; set; }
}
