namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Kpi;

/// <summary>
/// Supplies the system-wide pending Audit Log backlog for the
/// <c>backlogTotal</c> KPI history sample ("KPI History &amp; Trends").
/// </summary>
/// <remarks>
/// <para>
/// The append-only Audit Log repository leaves <c>AuditLogKpiSnapshot.BacklogTotal</c>
/// at zero — the backlog is not a central-table count but the sum of the latest
/// per-site <c>SiteAuditBacklog.PendingCount</c> health reports, which live only in
/// the in-memory central health aggregator. The live Health-dashboard "Audit" tile
/// already fills this in (<c>AuditLogQueryService.GetKpiSnapshotAsync</c>); this seam
/// lets the KPI <em>history</em> sample source read the same aggregate instead of
/// persisting a hardwired zero.
/// </para>
/// <para>
/// Best-effort: sites that have not yet reported (or whose reporter is disabled)
/// contribute zero — a missing snapshot is treated as "unknown, count as nothing",
/// mirroring the live tile. Central-only: registered on the central node where the
/// health aggregator lives; sites and unit tests leave it unregistered so the
/// sample source falls back to the snapshot's own <c>BacklogTotal</c>.
/// </para>
/// </remarks>
public interface IAuditBacklogProvider
{
    /// <summary>
    /// Returns the current total pending (not-yet-forwarded) Audit Log backlog,
    /// summed across every site's latest health report. Never negative; zero when
    /// no site is reporting a backlog.
    /// </summary>
    /// <returns>The system-wide pending Audit Log backlog count.</returns>
    long GetPendingBacklogTotal();
}
