using CommunityToolkit.Mvvm.ComponentModel;

namespace ZB.MOM.WW.OtOpcUa.Client.UI.ViewModels;

/// <summary>
///     Represents a single active subscription row.
/// </summary>
public partial class SubscriptionItemViewModel : ObservableObject
{
    [ObservableProperty] private string? _status;

    [ObservableProperty] private string? _timestamp;

    [ObservableProperty] private string? _value;

    /// <summary>Initializes a new subscription item with the specified node ID and interval.</summary>
    /// <param name="nodeId">The OPC UA NodeId to subscribe to.</param>
    /// <param name="intervalMs">The subscription interval in milliseconds.</param>
    public SubscriptionItemViewModel(string nodeId, int intervalMs)
    {
        NodeId = nodeId;
        IntervalMs = intervalMs;
    }

    /// <summary>The monitored NodeId.</summary>
    public string NodeId { get; }

    /// <summary>The subscription interval in milliseconds.</summary>
    public int IntervalMs { get; }
}