using System;

namespace SHH.ProcessLaunchers
{
    /// <summary>
    /// 进程信息快照 (用于 UI 数据绑定)
    /// </summary>
    public class ProcessInfoSnapshot
    {
        /// <summary>唯一标识 (例如: "Streamer_01")</summary>
        public string Id { get; set; } = string.Empty;

        // <summary>
        /// 通用名称/类别 (例如: "视频取流服务")
        /// <para>用于 UI 分组或显示图标</para>
        public string DisplayName { get; set; } = string.Empty;

        /// <summary>详细描述 (例如: "西门 1 号机位")</summary>
        public string Description { get; set; } = string.Empty;

        /// <summary>操作系统进程 ID (运行中才有)</summary>
        public int? Pid { get; set; }

        /// <summary>当前生命周期状态</summary>
        public ProcessStatus Status { get; set; }

        /// <summary>最近一次启动时间</summary>
        public DateTime? LastStartTime { get; set; }

        /// <summary>最近一次退出时间</summary>
        public DateTime? LastExitTime { get; set; }

        /// <summary>当前连续失败次数 (用于熔断判定)</summary>
        public int ConsecutiveFailures { get; set; }

        /// <summary>预计下次尝试启动的时间 (用于 UI 显示倒计时)</summary>
        public DateTime? NextRetryTime { get; set; }

        /// <summary>附加状态信息 (如熔断倒计时文本)</summary>
        public string Message { get; set; } = string.Empty;
    }
}