// PRE-GENERATED (design session). Contract between UI and the (future) real DB layer.
using System;
using System.Threading;
using System.Threading.Tasks;

namespace DansoriEQ.Core.Profiles;

public interface IProfileDbService
{
    /// <summary>Current DB snapshot for the manager popup.</summary>
    DbInfo GetInfo();

    /// <summary>Fetch latest sources, parse, upsert into SQLite. Reports progress to the UI.</summary>
    Task<DbInfo> UpdateAsync(IProgress<DbUpdateProgress>? progress = null, CancellationToken ct = default);

    /// <summary>Find a local profile matching a shared preset's target device (null = not found).</summary>
    ProfileRef? FindMatch(string name, string? brand, string type);
}

public sealed class DbUpdateProgress
{
    public string Message { get; set; } = "";
    public double Fraction { get; set; }   // 0..1
    public string? CurrentSource { get; set; }
}
