using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;

namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Scripts;

/// <summary>
/// Alarm context exposed to on-trigger scripts via <c>Alarm</c>. Lets scripts
/// branch on the firing severity — e.g., page on-call for HiHi/LoLo but only
/// email the day shift for Hi/Lo. Always present when an on-trigger script
/// runs; <see cref="Level"/> is <see cref="AlarmLevel.None"/> for binary
/// trigger types.
/// </summary>
public sealed class AlarmContext
{
    /// <summary>Name of the alarm that fired.</summary>
    public string Name { get; init; } = string.Empty;
    /// <summary>Severity level of the alarm; <see cref="AlarmLevel.None"/> for binary trigger types.</summary>
    public AlarmLevel Level { get; init; } = AlarmLevel.None;
    /// <summary>Operator-assigned priority of the alarm.</summary>
    public int Priority { get; init; }

    /// <summary>
    /// Per-band operator message configured on the HiLo alarm, or empty for
    /// binary trigger types and bands without a message.
    /// </summary>
    public string Message { get; init; } = string.Empty;
}
