namespace ZB.MOM.WW.OtOpcUa.Commons.Messages.Logging;

/// <summary>
/// One line of script log output published on the cluster <c>script-logs</c> DPS topic.
/// Emitted by VirtualTagActor + ScriptedAlarmActor when their hosted scripts call into
/// the runtime's logging facade; consumed by <c>ScriptLogSignalRBridge</c> for live
/// browser tail-style viewing.
/// </summary>
/// <param name="ScriptId">The Script row this entry came from (matches <c>Script.ScriptId</c>).</param>
/// <param name="Level">"Trace" / "Debug" / "Information" / "Warning" / "Error" / "Critical" — Serilog levels.</param>
/// <param name="Message">Operator-facing log message; template tokens already resolved.</param>
/// <param name="TimestampUtc">When the script emitted the entry.</param>
/// <param name="VirtualTagId">VirtualTag context, if logged from a virtual tag evaluation. Null otherwise.</param>
/// <param name="AlarmId">ScriptedAlarm context, if logged from an alarm predicate. Null otherwise.</param>
/// <param name="EquipmentId">Equipment scope, if the script ran in a per-equipment context. Null for fleet-wide scripts.</param>
public sealed record ScriptLogEntry(
    string ScriptId,
    string Level,
    string Message,
    DateTime TimestampUtc,
    string? VirtualTagId,
    string? AlarmId,
    string? EquipmentId);
