using Predictalytics.Application.Services;

namespace Predictalytics.Application.Interfaces;

/// <summary>
/// Captures periodic strategy-fingerprint snapshots (the history that drift detection #3 and
/// edge-freshness #5 build on) and reads drift off that history.
/// </summary>
public interface IFingerprintSnapshotService
{
    /// <summary>Capture a snapshot for every copy-relevant trader that has none in the last ~day. Returns the number captured.</summary>
    Task<int> CaptureDueAsync(CancellationToken ct = default);

    /// <summary>
    /// Compare the trader's latest snapshot to the newest one at least <paramref name="baselineDays"/>
    /// old. Returns null when there is not enough history to form a baseline.
    /// </summary>
    Task<FingerprintDriftResult?> GetDriftAsync(int traderId, int baselineDays = 14, CancellationToken ct = default);

    /// <summary>Every trader whose latest fingerprint has drifted from its baseline (for alerting).</summary>
    Task<IReadOnlyList<(int TraderId, FingerprintDriftResult Drift)>> GetDriftedTradersAsync(int baselineDays = 14, CancellationToken ct = default);
}
