using Hotline.FlowEngine.Workflows;
using Hotline.Settings;
using Hotline.Share.Enums.KnowledgeBase;
using Hotline.Users;
using SqlSugar;
using System.ComponentModel;
using XF.Domain.Repository;

namespace Hotline.KnowledgeBase
{
    /// <summary>
    /// 知识审核
    /// </summary>
    [Description("知识审核")]
    public class KnowledgeWorkFlow : WorkflowEntity
    {
        /// <summary>
        /// 知识ID
        /// </summary>
        public string KnowledgeId { get; set; }

        /// <summary>
        /// 操作类型，新增、删除、编辑
        /// </summary>
        public EKnowledgeApplyType WorkflowModuleStatus { get; set; }

        /// <summary>
        /// 审批状态
        /// </summary>
        public EKnowledgeWorkFlowStatus WorkFlowApplyStatus { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? HandleTime { get; set; }

        /// <summary>
        /// 实际办理意见（办理中...or 最终办理意见）
        /// </summary>
        [SugarColumn(ColumnDataType = "text")]
        public string? ActualOpinion { get; set; } 

		/// <summary>
		/// 知识信息
		/// </summary>
		[Navigate(NavigateType.OneToOne, nameof(KnowledgeId))]//一对一 
        public Knowledge Knowledge { get; set; }

        /// <summary>
        /// 流程信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(WorkflowId))]//一对一 
        public Workflow Workflow { get; set; }

        /// <summary>
        /// 部门
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(CreatorOrgId))]//一对一 
        public SystemOrganize SystemOrganize { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(CreatorId))]//一对一 
        public User User { get; set; }

        /// <summary>
        /// 是否可以办理
        /// </summary>
        [SqlSugar.SugarColumn(IsIgnore = true)]
        public bool CanHandle { get; set; }
    }
}
