using System;
using System.Collections.Generic;
namespace Wino.Core.Domain.Models.Connectivity;
///
/// Represents the health status of an IMAP connection pool.
///
public class ConnectionPoolHealth
{
///
/// Gets or sets the total number of connections in the pool (including IDLE).
///
public int TotalConnections { get; set; }
///
/// Gets or sets the number of connections available for use.
///
public int AvailableConnections { get; set; }
///
/// Gets or sets the number of connections currently in use.
///
public int InUseConnections { get; set; }
///
/// Gets or sets the number of connections that have failed and need reconnection.
///
public int FailedConnections { get; set; }
///
/// Gets or sets the number of connections currently reconnecting.
///
public int ReconnectingConnections { get; set; }
///
/// Gets or sets whether the dedicated IDLE connection is active and listening.
///
public bool IdleConnectionActive { get; set; }
///
/// Gets or sets the timestamp of the last health check.
///
public DateTime LastHealthCheck { get; set; }
///
/// Gets or sets recent issues encountered by the pool.
///
public List RecentIssues { get; set; } = [];
///
/// Gets whether the pool is healthy (has minimum required connections).
///
public bool IsHealthy => AvailableConnections >= 1 && FailedConnections == 0;
///
/// Gets a summary of the pool health.
///
public string Summary => $"Total: {TotalConnections}, Available: {AvailableConnections}, InUse: {InUseConnections}, Failed: {FailedConnections}, IDLE: {(IdleConnectionActive ? "Active" : "Inactive")}";
}