// PRE-GENERATED (design session). DB info DTOs surfaced by the DB manager popup.
using System;
using System.Collections.Generic;

namespace DansoriEQ.Core.Profiles;

/// <summary>Snapshot of the local profile database for the DB manager UI.</summary>
public sealed class DbInfo
{
    public int TotalProfiles { get; set; }
    public int IemCount { get; set; }
    public int HeadphoneCount { get; set; }
    public string DbPath { get; set; } = "";
    public long DbSizeBytes { get; set; }
    public int SchemaVersion { get; set; } = 1;
    public DateTimeOffset? LastUpdatedUtc { get; set; }
    public List<DbSourceInfo> Sources { get; set; } = new();
}

/// <summary>One measurement source that feeds the DB (see ARCHITECTURE §5 manifest).</summary>
public sealed class DbSourceInfo
{
    public string Name { get; set; } = "";
    public string License { get; set; } = "";
    public bool Distributable { get; set; }
    public string Url { get; set; } = "";
    public string? Commit { get; set; }
    public DateTimeOffset? UpdatedUtc { get; set; }
    public int ProfileCount { get; set; }
    public SourceStatus Status { get; set; } = SourceStatus.Unknown;

    // ---- display helpers (bound directly by the popup; keeps XAML converter-free) ----
    public string DistributableText => Distributable ? "배포 가능" : "배포 제한";
    public string StatusText => Status switch
    {
        SourceStatus.UpToDate        => "최신",
        SourceStatus.UpdateAvailable => "업데이트 있음",
        SourceStatus.Updating        => "업데이트 중…",
        SourceStatus.Error           => "오류",
        _                            => "확인 필요"
    };
}

public enum SourceStatus { Unknown, UpToDate, UpdateAvailable, Updating, Error }
