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

namespace Hotline.Orders;

/// <summary>
/// 记录每次回访信息 用作【回访量统计】
/// </summary>
[Description("工单回访记录")]
public class OrderVisitRecord : CreationEntity
{
    /// <summary>
    /// 工单编码（冗余）
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 工单ID
    /// </summary>
    public string OrderId { get; set; }

    [Navigate(NavigateType.OneToOne, nameof(OrderId))]
    public Order Order { get; set; }

    /// <summary>
    /// 回访方式
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public EVisitType? VisitType { get; set; }

    /// <summary>
    /// 回访人
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public string? EmployeeId { get; set; }

    /// <summary>
    /// 回访人（对象）
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(EmployeeId))]
    public User? Employee { get; set; }

    /// <summary>
    /// 回访时间
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public DateTime? VisitTime { get; set; }
}