using System.ComponentModel;
using Hotline.Share.Enums.CallCenter;
using SqlSugar;
using XF.Domain.Entities;
using XF.Domain.Repository;

namespace Hotline.CallCenter.Tels;

/// <summary>
/// ip电话（分机）
/// </summary>
[Description("ip电话（分机）")]
public class Tel : CreationSoftDeleteEntity
{
    //todo 唯一
    /// <summary>
    /// 分机号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 上线IP
    /// </summary>
    public string? RegisterIP { get; set; }

    /// <summary>
    /// 分机线路编号
    /// </summary>
    public string? LineId { get; set; }

    /// <summary>
    /// 分机状态
    /// </summary>
    public ETelStatus TelStatus { get; set; }

    [Navigate(typeof(TelTelGroup), nameof(TelTelGroup.TelId), nameof(TelTelGroup.TelGroupId))]
    public List<TelGroup> Groups { get; set; }
}

public class TelTelGroup : ITable
{
    /// <summary>
    /// 分机Id
    /// </summary>
    [SugarColumn(IsPrimaryKey = true)]
    public string TelId { get; set; }

    /// <summary>
    /// 分机组Id
    /// </summary>
    [SugarColumn(IsPrimaryKey = true)]
    public string TelGroupId { get; set; }
}