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
{
	/// <summary>
	/// 工单自动延期
	/// </summary>
	[Description("工单自动延期")]
	public class OrderDelayAutomatic : CreationEntity
	{
		/// <summary>
		/// 工单Id
		/// </summary>
		public string OrderId { get; set; }

		/// <summary>
		/// 流程Id
		/// </summary>
		public string WorkflowId { get; set; }

		public string Title { get; set; }

		public string No { get; set; }

		/// <summary>
		/// 交办时间(中心交部门办理时间)
		/// </summary>
		[SugarColumn(ColumnDescription = "交办时间")]
		public DateTime? CenterToOrgTime { get; set; }

		/// <summary>
		/// 超期时间（期满时间）
		/// </summary>
		[SugarColumn(ColumnDescription = "超期时间")]
		public DateTime? ExpiredTime { get; set; }

		/// <summary>
		/// 受理类型代码
		/// </summary>
		[SugarColumn(ColumnDescription = "受理类型代码")]
		public string? AcceptTypeCode { get; set; }

		/// <summary>
		/// 延期后超期时间（期满时间）
		/// </summary>
		[SugarColumn(ColumnDescription = "延期后超期时间")]
		public DateTime? DelayExpiredTime { get; set; }

		/// <summary>
		/// 记录类型
		/// </summary>
		public EOrderDelayAutomaticType Type { get; set; }

		/// <summary>
		/// 记录状态
		/// </summary>
		public EOrderDelayAutomaticStatus Status { get; set; }

		/// <summary>
		/// 处理时间
		/// </summary>
		public DateTime ProcessedTime { get; set; }


		[SqlSugar.SugarColumn(IsEnableUpdateVersionValidation = true)]
		public Guid Ver { get; set; }
	}


	public enum EOrderDelayAutomaticStatus
	{
		/// <summary>
		/// 待处理
		/// </summary>
		Pending = 0,

		/// <summary>
		/// 处理中
		/// </summary>
		BeingProcessed = 1,

		/// <summary>
		/// 已处理
		/// </summary>
		Processed = 2,
	}

	public enum EOrderDelayAutomaticType	
	{
		/// <summary>
		/// 自动延期
		/// </summary>
		Automatic = 0,
		/// <summary>
		/// 延期短信
		/// </summary>
		Sms = 1,
	}
}
