using ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient;

namespace ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.IntegrationTests;

/// <summary>
///     Driver-side configuration + well-known opc-plc node identifiers that the smoke
///     tests address. Node IDs are stable across opc-plc releases — the simulator
///     guarantees the same <c>ns=3;s=...</c> names shipped since v1.0. If a release
///     bump breaks these, the fixture's pinned image tag needs a coordinated bump.
/// </summary>
public static class OpcPlcProfile
{
    /// <summary>opc-plc monotonically-increasing UInt32; ticks once per second under default opts.</summary>
    public const string StepUp = "ns=3;s=StepUp";

    /// <summary>opc-plc random Int32 node; new value ~every 100ms.</summary>
    public const string RandomSignedInt32 = "ns=3;s=RandomSignedInt32";

    /// <summary>opc-plc alternating boolean; flips every second.</summary>
    public const string AlternatingBoolean = "ns=3;s=AlternatingBoolean";

    /// <summary>opc-plc fast uint node — ticks every 100ms. Used for subscription-cadence tests.</summary>
    public const string FastUInt1 = "ns=3;s=FastUInt1";

    public static OpcUaClientDriverOptions BuildOptions(string endpointUrl) => new()
    {
        EndpointUrl = endpointUrl,
        SecurityPolicy = OpcUaSecurityPolicy.None,
        SecurityMode = OpcUaSecurityMode.None,
        AuthType = OpcUaAuthType.Anonymous,
        // opc-plc auto-accepts client certs (--aa) but we still present one; trust the
        // server's cert back since the simulator regenerates it each container spin-up
        // and there's no meaningful chain to validate against.
        AutoAcceptCertificates = true,
        Timeout = TimeSpan.FromSeconds(10),
        SessionTimeout = TimeSpan.FromSeconds(30),
    };
}
