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

namespace ZB.MOM.WW.OtOpcUa.AdminUI.Uns;

/// <summary>
/// Parameter object carrying the operator-editable fields for an equipment-bound Tag create or
/// update via the UNS tree. Tree tags always bind to an equipment (<c>FolderPath</c> stays
/// <c>null</c>), so the SystemPlatform/FolderPath branch from the legacy cluster-scoped page does
/// not apply here. Optional string fields that arrive whitespace-only are collapsed to <c>null</c>
/// by the service.
/// </summary>
/// <param name="TagId">Stable unique tag id; only honoured on create (immutable thereafter).</param>
/// <param name="Name">Tag display name; unique within the owning equipment.</param>
/// <param name="DriverInstanceId">The bound driver; must resolve to an Equipment-kind namespace in the equipment's cluster.</param>
/// <param name="DataType">OPC UA built-in type name (Boolean / Int32 / Float / etc.).</param>
/// <param name="AccessLevel">Tag-level OPC UA access baseline.</param>
/// <param name="WriteIdempotent">Whether writes are safe to retry.</param>
/// <param name="PollGroupId">Optional poll-group batching key; whitespace/empty collapses to <c>null</c>.</param>
/// <param name="TagConfig">Schemaless per-driver-type JSON config; validated for JSON well-formedness.</param>
public sealed record TagInput(
    string TagId,
    string Name,
    string DriverInstanceId,
    string DataType,
    TagAccessLevel AccessLevel,
    bool WriteIdempotent,
    string? PollGroupId,
    string TagConfig);
