using Hotline.Share.Dtos.File;
using Hotline.Share.Dtos.Settings;
using Hotline.Share.Enums.FlowEngine;

namespace Hotline.Share.Dtos.FlowEngine;

public class NextStepsDto
{
    /// <summary>
    /// 当前办理节点
    /// </summary>
    public string StepId { get; set; }

    // public IReadOnlyList<NextStepOption> Steps { get; set; }
    public DateTime? ExpiredTime { get; set; }

    /// <summary>
    /// 是否有否决按钮
    /// </summary>
    public bool CanReject { get; set; }

    /// <summary>
    /// 是否支持发起会签
    /// </summary>
    public bool CanStartCountersign { get; set; }

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

    /// <summary>
    /// 当前办理节点业务类型
    /// </summary>
    public EBusinessType CurrentStepBusinessType { get; set; }

    /// <summary>
    /// 模板配置节点类型
    /// </summary>
    public EStepType CurrentStepType { get; set; }

    /// <summary>
    /// 办理对象类型
    /// </summary>
    public EHandlerType CurrentHandlerType { get; set; }
    
    /// <summary>
    /// 当前办理节点部门等级(非部门等级办理时无效)
    /// </summary>
    public int? CurrentOrgLevel { get; set; }

    /// <summary>
    /// 当前节点标识
    /// </summary>
    public string CurrentTag { get; set; }

    /// <summary>
    /// 当前节点是否是会签结束节点
    /// </summary>
    public bool CurrentIsCountersignEndStep { get; set; }
    public bool CurrentIsTopCountersignEndStep { get; set; }

    /// <summary>
    /// 时间类型
    /// </summary>
    public IReadOnlyList<KeyValuePair<int, string>> TimeTypeOptions { get; set; }

    /// <summary>
    /// 临时保存的办理意见
    /// </summary>
    public string? Opinion { get; set; }

    /// <summary>
    /// 受理类容
    /// </summary>
    public string? Content { get; set; }
}

public class NextStepsDto<TSteps> : NextStepsDto
{
    public List<TSteps> Steps { get; set; }
}

public class NextStepsWithOpinionDto<TSteps> : NextStepsDto<TSteps>
{
    /// <summary>
    /// 宜宾需求：汇总节点办理前展示前一节点办理意见, 如果有临时保存就覆盖
    /// 自贡需求: 临时保存的办理意见
    /// </summary>
    public string? Opinion { get; set; }

    /// <summary>
    /// 自贡需求: 选择某一部门后会给对应部门领导发短信
    /// </summary>
    public IList<Kv>? LeaderSMS { get; set; }

    /// <summary>
    /// 市州转办信息
    /// </summary>
    public List<SystemDicDataOutDto>? TranspondCity { get; set; }

    /// <summary>
    /// 会签类型：null：非会签，0：中心会签，1：部门会签
    /// </summary>
    public ECounterSignType? CounterSignType { get; set; }

    /// <summary>
    /// 泸州需求 ：是否能修改延期时限
    /// </summary>
    public bool? IsAlterDay { get; set; }

	/// <summary>
	/// 宜宾需求：是否需要选择文件
	/// </summary>
	public bool? IsPickFile { get; set; }

	#region 随手拍
	/// <summary>
	/// 线索分类
	/// </summary>
	public List<Kv>? IndustryCase { get; set; }

    /// <summary>
    /// 补充奖励类型
    /// </summary>
    public IReadOnlyCollection<SystemDicDataOutDto>? SnapshotReplenishType { get; set; }

    /// <summary>
    /// 工单标注的 是否安全生产
    /// </summary>
    public bool IsSafetyDepartment { get; set; } = false;

    /// <summary>
    /// 政策文件
    /// </summary>
    public IList<FileJson>? DocumentFiles { get; set; }

    /// <summary>
    /// 合规类型
    /// </summary>
    public IEnumerable<KeyValuePair<int, string>>? CompliantType { get; set; }

    /// <summary>
    /// 部门是否存在安全隐患
    /// </summary>
    public bool? IsDangerDepartment { get; set; }


    #endregion
}

public class StepTempInDto
{
    /// <summary>
    /// 工单Id
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// 节点ID
    /// </summary>
    public string StepId { get; set; }

    /// <summary>
    /// 意见
    /// </summary>
    public string Opinion { get; set; }
}


