using System;

namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host.Backend.MxAccess;

/// <summary>Value-timestamp-quality triplet — port of v1 <c>Vtq</c>.</summary>
public readonly struct Vtq
{
    public object? Value { get; }
    public DateTime TimestampUtc { get; }
    public byte Quality { get; }

    public Vtq(object? value, DateTime timestampUtc, byte quality)
    {
        Value = value;
        TimestampUtc = timestampUtc;
        Quality = quality;
    }

    /// <summary>OPC DA Good = 192.</summary>
    public static Vtq Good(object? v) => new(v, DateTime.UtcNow, 192);

    /// <summary>OPC DA Bad = 0.</summary>
    public static Vtq Bad() => new(null, DateTime.UtcNow, 0);
}
