using System;

namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host.Backend.Historian
{
    /// <summary>
    ///     OPC-UA-free representation of a single historical data point. The Host returns these
    ///     across the IPC boundary as <c>GalaxyDataValue</c>; the Proxy maps quality and value to
    ///     OPC UA <c>DataValue</c>. Raw MX quality byte is preserved so the Proxy can use the same
    ///     quality mapper it already uses for live reads.
    /// </summary>
    public sealed class HistorianSample
    {
        public object? Value { get; set; }

        /// <summary>Raw OPC DA quality byte from the historian SDK (low 8 bits of OpcQuality).</summary>
        public byte Quality { get; set; }

        public DateTime TimestampUtc { get; set; }
    }

    /// <summary>
    ///     Result of <see cref="IHistorianDataSource.ReadAggregateAsync"/>. When <see cref="Value"/> is
    ///     null the aggregate is unavailable for that bucket (Proxy maps to <c>BadNoData</c>).
    /// </summary>
    public sealed class HistorianAggregateSample
    {
        public double? Value { get; set; }
        public DateTime TimestampUtc { get; set; }
    }
}
