using MessagePack;

namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Shared.Contracts;

[MessagePackObject]
public sealed class AlarmSubscribeRequest
{
    [Key(0)] public long SessionId { get; set; }
}

[MessagePackObject]
public sealed class GalaxyAlarmEvent
{
    [Key(0)] public string EventId { get; set; } = string.Empty;
    [Key(1)] public string ObjectTagName { get; set; } = string.Empty;
    [Key(2)] public string AlarmName { get; set; } = string.Empty;
    [Key(3)] public int Severity { get; set; }

    /// <summary>Per OPC UA Part 9 lifecycle: Active, Unacknowledged, Confirmed, Inactive, etc.</summary>
    [Key(4)] public string StateTransition { get; set; } = string.Empty;

    [Key(5)] public string Message { get; set; } = string.Empty;
    [Key(6)] public long UtcUnixMs { get; set; }
}

[MessagePackObject]
public sealed class AlarmAckRequest
{
    [Key(0)] public long SessionId { get; set; }
    [Key(1)] public string EventId { get; set; } = string.Empty;
    [Key(2)] public string Comment { get; set; } = string.Empty;
}
