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

/// <summary>UNS level-3 segment. Generation-versioned.</summary>
public sealed class UnsArea
{
    /// <summary>Gets or sets the unique row identifier.</summary>
    public Guid UnsAreaRowId { get; set; }

    /// <summary>Gets or sets the UNS area identifier.</summary>
    public required string UnsAreaId { get; set; }

    /// <summary>Gets or sets the cluster identifier.</summary>
    public required string ClusterId { get; set; }

    /// <summary>UNS level 3 segment: matches <c>^[a-z0-9-]{1,32}$</c> OR equals literal <c>_default</c>.</summary>
    public required string Name { get; set; }

    /// <summary>Gets or sets optional notes for the area.</summary>
    public string? Notes { get; set; }

    /// <summary>Optimistic concurrency token for last-write-wins detection in the v2 live-edit model.</summary>
    public byte[] RowVersion { get; set; } = Array.Empty<byte>();

    /// <summary>Gets or sets the associated server cluster.</summary>
    public ServerCluster? Cluster { get; set; }
}
