namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications;

/// <summary>
/// Point-in-time operational metrics for the central notification outbox,
/// surfaced on the health dashboard.
/// </summary>
/// <param name="QueueDepth">Count of non-terminal rows (Pending + Retrying).</param>
/// <param name="StuckCount">
/// Count of non-terminal rows (Pending/Retrying) whose <c>CreatedAt</c> is older
/// than the supplied stuck cutoff.
/// </param>
/// <param name="ParkedCount">Count of rows in the Parked status.</param>
/// <param name="DeliveredLastInterval">
/// Count of Delivered rows whose <c>DeliveredAt</c> is at or after the supplied
/// "delivered since" timestamp.
/// </param>
/// <param name="OldestPendingAge">
/// Age of the oldest non-terminal row (<c>now - min(CreatedAt)</c>), or <c>null</c>
/// when there are no non-terminal rows.
/// </param>
public record NotificationKpiSnapshot(
    int QueueDepth,
    int StuckCount,
    int ParkedCount,
    int DeliveredLastInterval,
    TimeSpan? OldestPendingAge);
