using Hotline.Orders;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hotline.Share.Dtos.File;
using Hotline.Share.Enums.KnowledgeBase;
using XF.Domain.Repository;

namespace Hotline.KnowledgeBase
{
	[Description("知识库纠错")]
	public class KnowledgeCorrection : FullStateEntity
	{
		/// <summary>
		/// 知识库ID
		/// </summary>
		[SugarColumn(ColumnDescription = "知识库ID")]
		public string KnowledgeId {  get; set; }

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


		/// <summary>
		/// 纠错内容
		/// </summary>
		[SugarColumn(ColumnDescription = "纠错内容", ColumnDataType = "text")]
		public string? Content { get; set; }

		/// <summary>
		/// 答复人名称
		/// </summary>
		[SugarColumn(ColumnDescription = "答复人名称")]
		public string? ReplyUserName {  get; set; }

		/// <summary>
		/// 答复时间
		/// </summary>
		[SugarColumn(ColumnDescription = "答复时间")]
		public DateTime? ReplyTime { get; set; }

		/// <summary>
		/// 答复内容
		/// </summary>
		[SugarColumn(ColumnDescription = "纠错内容", ColumnDataType = "text")]
		public string? ReplyContent { get; set; }

		/// <summary>
		/// 答复状态
		/// </summary>
		[SugarColumn(ColumnDescription = "答复状态")]
		public ECorrectionState State { get; set; } =  ECorrectionState.Unanswered;

		[SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
		public List<FileJson>? FileJson { get; set; }

	}
}
