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

/// <summary>
///     AdminUI → AdminOperationsActor: reconnect the driver actor's transport without
///     respawning the actor itself. Sends the actor back through its Reconnecting state —
///     fast, preserves in-memory state. The driver actor's supervisor performs the work.
/// </summary>
/// <param name="ClusterId">Cluster scope identifier (for audit).</param>
/// <param name="DriverInstanceId">The driver instance to reconnect.</param>
/// <param name="ActorByUserName">The authenticated admin user who triggered the reconnect.</param>
/// <param name="CorrelationId">Round-trip correlation token.</param>
public sealed record ReconnectDriver(
    string ClusterId,
    string DriverInstanceId,
    string ActorByUserName,
    Guid CorrelationId);

/// <summary>Reply for <see cref="ReconnectDriver"/>.</summary>
/// <param name="Ok">True iff the operation was dispatched without error.</param>
/// <param name="Message">Failure reason; null on success.</param>
/// <param name="CorrelationId">Echoes the request's correlation token.</param>
public sealed record ReconnectDriverResult(
    bool Ok,
    string? Message,
    Guid CorrelationId);
