using Hotline.Share.Dtos.File;
using Hotline.Share.Enums.Order;
using SqlSugar;
using System.ComponentModel;
using XF.Domain.Repository;

namespace Hotline.Orders
{
    /// <summary>
    /// 工单退回
    /// </summary>
	[Description("工单退回")]
    public class OrderSendBack : FullStateEntity
    {
        public string OrderId { get; set; }

        /// <summary>
        /// 默认操作类型 服务工单退回 0
        /// </summary>
        public int Handle { get; set; } = 0;

        /// <summary>
        /// 申请原因
        /// </summary>
        [SugarColumn(ColumnDescription = "申请原因", ColumnDataType = "text")]
        public string? Content { get; set; }

        /// <summary>
        /// 省上退回反馈结果
        /// </summary>
        public int? Result { get; set; }

        /// <summary>
        /// 省上退回反馈
        /// </summary>
        [SugarColumn(ColumnDescription = "退回反馈", ColumnDataType = "text")]
        public string? Reason { get; set; }

        /// <summary>
        /// 审核人
        /// </summary>
        public string? AuditName { get; set; }

        /// <summary>
        /// 审核部门
        /// </summary>
        public string? AuditOrgName { get; set; }

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

        /// <summary>
        /// 审核意见
        /// </summary>
        [SugarColumn(ColumnDescription = "审核意见", ColumnDataType = "text")]
        public string? AuditOpinion { get; set; }

        /// <summary>
        ///  审核结果  0  待审核  1 审核通过  2 审核不通过
        /// </summary>
        public int State { get; set; }

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

        /// <summary>
        /// 退回目的地
        /// </summary>
        public ESendBackDestination Destination { get; set; }

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