namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions;
///
/// Health snapshot a driver returns to the Core. Drives the status dashboard,
/// ServiceLevel computation, and Bad-quality fan-out decisions.
///
/// Current driver-instance state.
/// Timestamp of the most recent successful equipment read; null if never.
/// Most recent error message; null when state is Healthy.
public sealed record DriverHealth(
DriverState State,
DateTime? LastSuccessfulRead,
string? LastError);
/// Driver-instance lifecycle state.
public enum DriverState
{
/// Driver has not been initialized yet.
Unknown,
/// Driver is in the middle of or .
Initializing,
/// Driver is connected and serving data.
Healthy,
/// Driver is connected but reporting degraded data (e.g. some equipment unreachable, some tags Bad).
Degraded,
/// Driver lost connection to its data source; reconnecting in the background.
Reconnecting,
///
/// Driver hit an unrecoverable error and stopped trying.
/// Operator must reinitialize via Admin UI; nodes report Bad quality.
///
Faulted,
}