using ZB.MOM.WW.OtOpcUa.Configuration.Enums;

namespace ZB.MOM.WW.OtOpcUa.Configuration.Entities;

/// <summary>
///     Authenticates a <see cref="ClusterNode"/> to the central config DB.
///     Per decision #83 — credentials bind to NodeId, not ClusterId.
/// </summary>
public sealed class ClusterNodeCredential
{
    public Guid CredentialId { get; set; }

    public required string NodeId { get; set; }

    public required CredentialKind Kind { get; set; }

    /// <summary>Login name / cert thumbprint / SID / gMSA name.</summary>
    public required string Value { get; set; }

    public bool Enabled { get; set; } = true;

    public DateTime? RotatedAt { get; set; }

    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

    public required string CreatedBy { get; set; }

    public ClusterNode? Node { get; set; }
}
