using MainShell.Filewritable;
using MXJM.FileWritable;
using System;

namespace MainShell.ProcessResult
{
    /// <summary>
    /// 记录当前流程的执行状态，用于断点恢复
    /// </summary>
    public class ProcessFlowState : JsonFileWritableBase
    {
        public override string Dir => Paths.ProcessResultDir;

        /// <summary>
        /// 顶层工作流名称 (例如 "AutoProduction")
        /// </summary>
        public string WorkflowName { get; set; }

        /// <summary>
        /// [新增] 父级活动/子流程名称 (例如 "SubstratePositionFlow")
        /// </summary>
        public string ParentActivityName { get; set; }

        /// <summary>
        /// 当前最底层的步骤名称 (例如 "MoveToMark1")
        /// </summary>
        public string CurrentActivityName { get; set; }

        /// <summary>
        /// 当前正在执行的步骤ID。
        /// </summary>
        public string CurrentStepId { get; set; }

        /// <summary>
        /// 下次恢复时优先执行的步骤ID。
        /// </summary>
        public string NextStepId { get; set; }

        public string Status { get; set; }
        public string ErrorMessage { get; set; }
        public DateTime LastUpdateTime { get; set; }
    }
}
