using System;

namespace ZB.MOM.WW.MxGateway.Worker.MxAccess;

/// <summary>
///     Single alarm record as emitted by the wnwrapConsumer XML stream.
///     Field names match the captured XML schema (see
///     <c>docs/AlarmClientDiscovery.md</c> "Option A — captured" section).
///     Records are also produced by the subtag synthesis path when
///     <see cref="Degraded"/> is set.
/// </summary>
public sealed class MxAlarmSnapshotRecord
{
    /// <summary>Gets or sets the unique alarm identifier.</summary>
    public Guid AlarmGuid { get; set; }
    /// <summary>Gets or sets the UTC timestamp of the transition.</summary>
    public DateTime TransitionTimestampUtc { get; set; }
    /// <summary>Gets or sets the provider node name.</summary>
    public string ProviderNode { get; set; } = string.Empty;
    /// <summary>Gets or sets the provider name.</summary>
    public string ProviderName { get; set; } = string.Empty;
    /// <summary>Gets or sets the alarm group.</summary>
    public string Group { get; set; } = string.Empty;
    /// <summary>Gets or sets the tag name.</summary>
    public string TagName { get; set; } = string.Empty;
    /// <summary>Gets or sets the alarm type.</summary>
    public string Type { get; set; } = string.Empty;
    /// <summary>Gets or sets the alarm value.</summary>
    public string Value { get; set; } = string.Empty;
    /// <summary>Gets or sets the alarm limit.</summary>
    public string Limit { get; set; } = string.Empty;
    /// <summary>Gets or sets the alarm priority.</summary>
    public int Priority { get; set; }
    /// <summary>Gets or sets the alarm state.</summary>
    public MxAlarmStateKind State { get; set; }
    /// <summary>Gets or sets the operator node name.</summary>
    public string OperatorNode { get; set; } = string.Empty;
    /// <summary>Gets or sets the operator name.</summary>
    public string OperatorName { get; set; } = string.Empty;
    /// <summary>Gets or sets the alarm comment.</summary>
    public string AlarmComment { get; set; } = string.Empty;
    /// <summary>
    ///     Gets or sets a value indicating whether this record was synthesized
    ///     by the subtag-provider fallback rather than emitted by the native
    ///     alarmmgr (wnwrap) path. Default <see langword="false"/> preserves
    ///     parity for the alarmmgr path; the subtag fallback sets it to
    ///     <see langword="true"/>.
    /// </summary>
    public bool Degraded { get; set; }
}
