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

namespace Hotline.Orders;

/// <summary>
/// 临时待发布
/// </summary>
[Description("临时待发布")]
[SugarIndex("index_publish_orderId", nameof(OrderPublish.OrderId), OrderByType.Asc)]
public class OrderPublishTemp : FullStateEntity
{
    public string OrderId { get; set; }

    /// <summary>
    /// 工单编码（冗余）
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 发布范围
    /// </summary>
    public bool PublishState { get; set; }

    /// <summary>
    /// 整理标题
    /// </summary>
    public string ArrangeTitle { get; set; }

    /// <summary>
    /// 整理内容
    /// </summary>
    [SugarColumn(ColumnDataType = "text")]
    public string ArrangeContent { get; set; }

    /// <summary>
    /// 整理结果
    /// </summary>
    [SugarColumn(ColumnDataType = "text")]
    public string ArrangeOpinion { get; set; }

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

    #region 省工单使用字段

    /// <summary>
    /// 省是否公开
    /// </summary>
    public bool? ProPublishState { get; set; }

    /// <summary>
    /// 反馈电话
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public string? FeedBackPhone { get; set; }

    /// <summary>
    /// 不公开原因
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public string? NoPubReason { get; set; }

    /// <summary>
    /// 是否联系
    /// </summary>
    public bool? IsContact { get; set; }

    /// <summary>
    /// 是否评价
    /// </summary>
    public bool? IsVisited { get; set; }

    /// <summary>
    /// 网民评价
    /// </summary>
    [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
    public Kv? NetizenEvaluate { get; set; }

    /// <summary>
    /// 评价内容
    /// </summary>
    public string? EvaluateContent { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 答复口径
    /// </summary>
    [SugarColumn(ColumnDataType = "text", IsNullable = true)]
    public string? AnswerContent { get; set; }
    #endregion

    public bool? Resolve { get; set; }
}