namespace ZB.MOM.WW.OtOpcUa.Server.Alarms;
///
/// Lifecycle transition for an alarm condition. Mirrors OPC UA Part 9 alarm states
/// simplified to the active / acknowledged / inactive triplet that every driver in
/// the repo exposes today.
///
public enum AlarmStateTransition
{
/// InAlarm flipped false → true. Default to unacknowledged.
Active,
/// Acked flipped false → true while the alarm is still active.
Acknowledged,
/// InAlarm flipped true → false.
Inactive,
}
///
/// One alarm-state transition raised by .
///
/// Stable identifier the caller registered the condition under (typically the driver's alarm full reference).
/// Which state the alarm transitioned to.
/// Latest known priority. 0 when no priority sub-attribute was registered or no value has been observed yet.
/// Latest known description text; null when not registered or not yet observed.
/// Server-clock UTC of the value change that produced this transition.
public sealed record AlarmConditionTransition(
string ConditionId,
AlarmStateTransition Transition,
int Priority,
string? Description,
DateTime AtUtc);
///
/// Read-only snapshot of an alarm condition's current state. Used for diagnostics
/// and dashboards; not part of the live transition stream.
///
public sealed record AlarmConditionSnapshot(
string ConditionId,
bool InAlarm,
bool Acked,
int Priority,
string? Description);