namespace QuantEngine.Core.Interfaces;
///
/// Data collection repository (Dapper + PostgreSQL).
/// Higher-level abstraction over IDataCollectionStore for Web API consumers.
///
public interface ICollectionRepository
{
///
/// Save new collection run.
///
Task SaveRunAsync(CollectionRunRecord run);
///
/// Update run with completion status.
///
Task UpdateRunStatusAsync(string runId, string status, string? finishedAt = null, int? totalSnapshots = null, int? totalErrors = null);
///
/// Save collection snapshot.
///
Task SaveSnapshotAsync(CollectionSnapshotRecord snapshot);
///
/// Save collection error.
///
Task SaveErrorAsync(CollectionErrorRecord error);
///
/// Fetch recent collection runs for UI dashboard.
///
/// Number of runs to return (default: 20)
Task> GetRecentRunsAsync(int limit = 20);
///
/// Fetch snapshots for a specific run.
///
Task> GetRunSnapshotsAsync(string runId);
///
/// Fetch errors for a specific run.
///
/// Run ID
/// Max errors to return (default: 50)
Task> GetRunErrorsAsync(string runId, int limit = 50);
///
/// Get collection pipeline dashboard state for Web UI.
///
Task GetDashboardStateAsync();
///
/// Fetch latest snapshots for a ticker across all datasets.
///
Task> GetLatestSnapshotsForTickerAsync(string ticker, int limit = 10);
}