namespace ZB.MOM.WW.OtOpcUa.Driver.Mqtt;

/// <summary>
///     The <c>TagConfig</c> JSON key names that make up an MQTT tag's <b>address</b>, in the two shapes
///     the driver binds by: a single <see cref="Topic"/> (Plain) or the
///     <see cref="GroupId"/>/<see cref="EdgeNodeId"/>/<see cref="DeviceId"/>/<see cref="MetricName"/>
///     tuple (Sparkplug B).
/// </summary>
/// <remarks>
///     <para>
///         These exist because the address is produced in one place and consumed in another, and the
///         two used to agree only by coincidence: the AdminUI browse-commit mapper writes the blob,
///         <see cref="MqttTagDefinitionFactory"/> reads it, and a key-name drift between them is not a
///         compile error — it is a tag that deploys clean, resolves to nothing, and reports
///         <c>BadNodeIdUnknown</c> at runtime with no authoring-time signal at all. Single-sourcing
///         the names makes that drift impossible rather than merely unlikely.
///     </para>
///     <para>
///         <b>Address keys only.</b> The behavioural keys (<c>payloadFormat</c>, <c>jsonPath</c>,
///         <c>dataType</c>, <c>qos</c>, <c>retainSeed</c>) are deliberately not here — nothing produces
///         them from a browse, so they carry no cross-component drift risk.
///     </para>
/// </remarks>
public static class MqttTagConfigKeys
{
    /// <summary>The concrete MQTT topic a Plain-mode tag subscribes to.</summary>
    public const string Topic = "topic";

    /// <summary>The Sparkplug group id — the first segment of the tag's binding tuple.</summary>
    public const string GroupId = "groupId";

    /// <summary>The Sparkplug edge-node id.</summary>
    public const string EdgeNodeId = "edgeNodeId";

    /// <summary>The Sparkplug device id; absent for a metric published by the edge node itself.</summary>
    public const string DeviceId = "deviceId";

    /// <summary>The Sparkplug metric's stable name — the tag's binding key across rebirths.</summary>
    public const string MetricName = "metricName";
}
