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

namespace Hotline.Orders
{
    [Description("重办")]
    public class OrderRedo : CreationEntity
    {
        /// <summary>
        /// 工单ID
        /// </summary>
        public string OrderId { get; set; }

        public string? TimeLimit { get; set; }

        public int? TimeLimitCount { get; set; }

        public ETimeType? TimeLimitUnit { get; set; }

        /// <summary>
        /// 重办原因
        /// </summary>
        public EOrderRedoReason Reason { get; set; }

        /// <summary>
        /// 重办意见
        /// </summary>
        public string Opinion { get; set; }

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

        /// <summary>
        /// 重办部门code
        /// </summary>
        public string RedoOrgCode { get; set; }

        /// <summary>
        /// 重办部门名称
        /// </summary>
        public string RedoOrgName { get; set; }

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