using System;

namespace ZB.MOM.WW.OtOpcUa.Driver.Historian.Wonderware.Backend
{
    /// <summary>
    ///     Point-in-time state of a single historian cluster node. One entry per configured node
    ///     appears inside <see cref="HistorianHealthSnapshot"/>.
    /// </summary>
    public sealed class HistorianClusterNodeState
    {
        /// <summary>Gets or sets the node name.</summary>
        public string Name { get; set; } = "";

        /// <summary>Gets or sets a value indicating whether the node is healthy.</summary>
        public bool IsHealthy { get; set; }

        /// <summary>Gets or sets the time until the node exits cooldown mode.</summary>
        public DateTime? CooldownUntil { get; set; }

        /// <summary>Gets or sets the count of recent failures.</summary>
        public int FailureCount { get; set; }

        /// <summary>Gets or sets the last error message.</summary>
        public string? LastError { get; set; }

        /// <summary>Gets or sets the time of the last failure.</summary>
        public DateTime? LastFailureTime { get; set; }
    }
}
