namespace ZB.MOM.WW.OtOpcUa.Commons.Messages.Admin;

/// <summary>
///     AdminUI → AdminOperationsActor request: probe one driver type's connection using
///     the supplied JSON config. Routed through <c>IAdminOperationsClient</c>; reply is
///     <see cref="TestDriverConnectResult"/>.
/// </summary>
/// <param name="DriverType">Must match an installed <c>IDriverProbe.DriverType</c>.</param>
/// <param name="ConfigJson">Driver config as JSON (same shape as <c>DriverInstance.DriverConfig</c>).</param>
/// <param name="TimeoutSeconds">Per-probe timeout; server clamps to [1, 60].</param>
/// <param name="CorrelationId">Round-trip correlation token.</param>
public sealed record TestDriverConnect(
    string DriverType,
    string ConfigJson,
    int TimeoutSeconds,
    Guid CorrelationId);

/// <summary>Reply for <see cref="TestDriverConnect"/>.</summary>
/// <param name="Ok">True iff the probe succeeded.</param>
/// <param name="Message">Failure reason; null on success.</param>
/// <param name="LatencyMs">Round-trip latency in milliseconds; null on failure or timeout.</param>
/// <param name="CorrelationId">Echoes the request's correlation token.</param>
public sealed record TestDriverConnectResult(
    bool Ok,
    string? Message,
    double? LatencyMs,
    Guid CorrelationId);
