using Hotline.Share.Enums.FlowEngine;
using XF.Utility.EnumExtensions;

namespace Hotline.Share.Dtos.FlowEngine.Definition
{
    public class DefinitionDto : UpdateDefinitionDto
    {
        public EDefinitionStatus Status { get; set; }
        public string StatusText => Status.GetDescription();

        /// <summary>
        /// 版本号
        /// </summary>
        public int Version { get; set; }

        public DateTime CreationTime { get; set; }
    }

    public class UpdateDefinitionDto : AddDefinitionDto
    {
        public string Id { get; set; }
    }

    public class AddDefinitionDto
    {
        /// <summary>
        /// 模板名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 模板编码(唯一索引)
        /// </summary>
        public string Code { get; set; }

        public string? Description { get; set; }

        /// <summary>
        /// 流程类型
        /// </summary>
        public EFlowType FlowType { get; set; }

        public List<StepDefineBasic> Steps { get; set; }

        public string ExternalData { get; set; }

        /// <summary>
        /// 是否显示主办对象
        /// </summary>
        public bool IsMainHandlerShow { get; set; }
    }

    //public class StepDefineDto : StepBasicDto
    //{
    //    public List<NextStepDefineDto> NextSteps { get; set; }
    //}

    //public class NextStepDefineDto
    //{
    //    public string Code { get; set; }

    //    /// <summary>
    //    /// 是否为返回的节点
    //    /// </summary>
    //    public bool IsPrevious { get; set; }
    //}
}
