using Hotline.FlowEngine.Workflows;
using Hotline.Share.Dtos.File;
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.Order;
using XF.Domain.Repository;

namespace Hotline.Orders
{
	[Description("工单终止")]
	public class OrderTerminate : WorkflowEntity
	{
		/// <summary>
		/// 工单id
		/// </summary>
		[SugarColumn(ColumnDescription = "工单id")]
		public string OrderId { get; set; }

		/// <summary>
		/// 工单编号
		/// </summary>
		[SugarColumn(ColumnDescription = "工单编号")]
		public string No { get; set; }

		/// <summary>
		/// 终止状态
		/// </summary>
		[SugarColumn(ColumnDescription = "终止状态")]
		public ETerminateStatus? Status { get; set; }

		/// <summary>
		/// 重提终止
		/// </summary>
		[SugarColumn(ColumnDescription = "重提终止",DefaultValue ="f")]
		public bool IsRecommit { get; set; }

		/// <summary>
		/// 终止理由
		/// </summary>
		[SugarColumn(ColumnDescription = "终止理由", ColumnDataType = "text")]
		public string? Content { get; set; }

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

		/// <summary>
		/// 工单
		/// </summary>
		[Navigate(NavigateType.OneToOne, nameof(OrderId))]
		public Order Order { get; set; }

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

}
