using Hotline.Share.Dtos.FlowEngine;
using Hotline.Share.Enums.Order;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XF.Domain.Repository;

namespace Hotline.Orders
{
	[Description("退回审批")]
	public class OrderSendBackAudit: FullStateEntity
	{
		/// <summary>
		/// 工单ID
		/// </summary>
		[SugarColumn(ColumnDescription = "工单ID")]
		public string OrderId { get; set; }

		/// <summary>
		/// 流程快照ID
		/// </summary>
		[SugarColumn(ColumnDescription = "流程快照ID")]
		public string? TraceId { get; set; }

		/// <summary>
		/// 状态
		/// </summary>
		[SugarColumn(ColumnDescription = "状态")]
		public ESendBackAuditState? State { get; set; }

		/// <summary>
		/// 工单状态
		/// </summary>
		public EOrderStatus? Status { get; set; }

		/// <summary>
		/// 退回原因
		/// </summary>
		[SugarColumn(ColumnDescription = "退回原因", ColumnDataType = "varchar(2000)")]
		public string? Content { get; set; }

		/// <summary>
		/// 审批意见
		/// </summary>
		[SugarColumn(ColumnDescription = "审批意见", ColumnDataType = "varchar(2000)")]
		public string? AuditContent { get; set; }

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

		/// <summary>
		/// 退回数据
		/// </summary>
		[SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
		public PreviousWorkflowDto SendBackData { get; set; }

		/// <summary>
		/// 审批人ID
		/// </summary>
		[SugarColumn(ColumnDescription = "审批人ID")]
		public string? AuditId { get; set; }

		[SugarColumn(ColumnDescription = "审批人")]
		public string? AuditUser { get; set; }

		/// <summary>
		/// 审批时间
		/// </summary>
		public DateTime? AuditTime { get; set; }

		/// <summary>
		/// 申请部门ID
		/// </summary>
		[SugarColumn(ColumnDescription = "申请部门ID")]
		public string? ApplyOrgId { get; set; }

		/// <summary>
		/// 申请部门名称
		/// </summary>
		[SugarColumn(ColumnDescription = "申请部门名称")]
		public string? ApplyOrgName { get; set; }

		/// <summary>
		/// 退回部门ID
		/// </summary>
		[SugarColumn(ColumnDescription = "退回部门ID")]
		public string SendBackOrgId { get; set; }

		/// <summary>
		/// 退回部门名称
		/// </summary>
		[SugarColumn(ColumnDescription = "退回部门名称")]
		public string SendBackOrgName { get; set; }

		/// <summary>
		/// 流程退回发起部门ID
		/// </summary>
		[SugarColumn(ColumnDescription = "流程退回发起部门ID")]
		public string WorkflowOrgId { get; set; }

		/// <summary>
		/// 流程退回发起用户ID
		/// </summary>
		[SugarColumn(ColumnDescription = "流程退回发起用户ID")]
		public string WorkflowUserId { get; set; }


		/// <summary>
		/// 流程退回发起用户角色ID
		/// </summary>
		[SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true, ColumnDescription = "流程退回发起用户角色ID")]
		public List<string> WorkflowRoleIds { get; set; }
	}
}
