using ZB.MOM.WW.OtOpcUa.Commons.Types;
namespace ZB.MOM.WW.OtOpcUa.Commons.Messages.Redundancy;
public enum RedundancyRole { Primary, Secondary, Detached }
///
/// Snapshot of a single node's redundancy state. Aggregated by RedundancyStateActor
/// to compute fleet-wide ServiceLevel.
///
/// Canonical host:port id of the node this entry describes.
/// The node's redundancy role in the current snapshot.
/// Whether the node is the Akka cluster leader.
///
/// Whether the node is the driver Primary — the oldest Up member carrying the driver
/// role, which is where ClusterSingletonManager places singletons. Renamed from
/// IsRoleLeaderForDriver: it was derived from ClusterState.RoleLeader("driver"), the
/// lowest-addressed member, which diverges from the oldest after any node restart. The name
/// now describes what the value means rather than how it used to be computed.
///
/// When the snapshot was computed.
public sealed record NodeRedundancyState(
NodeId NodeId,
RedundancyRole Role,
bool IsClusterLeader,
bool IsDriverPrimary,
DateTime AsOfUtc);