namespace ZB.MOM.WW.GalaxyRepository;

/// <summary>
///     One alarm-bearing attribute discovered by <c>GalaxyRepository.GetAlarmAttributesAsync</c>:
///     an attribute whose owning object configures an <c>AlarmExtension</c> primitive (the
///     same <c>is_alarm</c> detection used by
///     <see cref="GalaxyRepository.GetAttributesAsync"/>).
///     Used to build the subtag-fallback watch-list.
/// </summary>
public sealed class GalaxyAlarmAttributeRow
{
    /// <summary>
    ///     Gets the alarm-bearing attribute reference (e.g. <c>Tank01.Level.HiHi</c>),
    ///     matching the <c>full_tag_reference</c> projection of
    ///     <see cref="GalaxyRepository.GetAttributesAsync"/>.
    /// </summary>
    public string FullTagReference { get; init; } = string.Empty;

    /// <summary>
    ///     Gets the owning object reference (e.g. <c>Tank01</c>). This is the Galaxy
    ///     <c>tag_name</c> — the segment that precedes the first attribute dot in
    ///     <see cref="FullTagReference"/>.
    /// </summary>
    public string SourceObjectReference { get; init; } = string.Empty;

    /// <summary>
    ///     Gets the owning object's Galaxy area (e.g. <c>TestArea</c>) — the alarm group.
    ///     <para>
    ///     Resolved via <c>gobject.area_gobject_id</c> in <c>AlarmAttributesSql</c>. The
    ///     watch-list resolver composes the canonical <c>Galaxy!{area}.{reference}</c> from
    ///     this so the synthesized reference's group matches the native alarmmgr (wnwrap)
    ///     for reference parity. May be <see cref="string.Empty"/> when the object has no
    ///     area; the resolver then falls back to the configured area.
    ///     </para>
    /// </summary>
    public string Area { get; init; } = string.Empty;

    /// <summary>
    ///     Gets the writable ack-comment attribute address.
    ///     <para>
    ///     The Galaxy Repository schema does not expose an ack-comment subtag address
    ///     directly, so this is always <see cref="string.Empty"/> here. The watch-list
    ///     resolver (a later task) composes the concrete address from configuration plus
    ///     <see cref="SourceObjectReference"/> / <see cref="FullTagReference"/>.
    ///     </para>
    /// </summary>
    public string AckCommentSubtag { get; init; } = string.Empty;
}
