namespace OTSSignsOrchestrator.Core.Models.DTOs;

/// <summary>
/// Represents a single log line from a Docker service.
/// Parsed from <c>docker service logs --timestamps</c> output.
/// </summary>
public class ServiceLogEntry
{
    /// <summary>UTC timestamp of the log entry (from Docker).</summary>
    public DateTimeOffset Timestamp { get; set; }

    /// <summary>Service/replica identifier (e.g. "acm-cms-stack_acm-web.1.abc123").</summary>
    public string Source { get; set; } = string.Empty;

    /// <summary>The log message text.</summary>
    public string Message { get; set; } = string.Empty;

    /// <summary>Short service name without the stack prefix (e.g. "acm-web").</summary>
    public string ServiceName { get; set; } = string.Empty;

    /// <summary>Formatted display string for binding: "[timestamp] source | message".</summary>
    public string DisplayLine =>
        $"[{Timestamp:HH:mm:ss}] {Source} | {Message}";
}
