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

namespace Hotline.CallCenter.Tels;

/// <summary>
/// 分机组
/// </summary>
[Description("分机组")]
public class TelGroup : CreationEntity
{
    /// <summary>
    /// 分机组编号（讯时设备的groupId,1-50不可重复）
    /// </summary>
    [SugarColumn(ColumnDescription = "分机组编号")]
    public string No { get; set; }

    /// <summary>
    /// 分机组名称
    /// </summary>
    [SugarColumn(ColumnDescription = "分机组名称")]
    public string Name { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true)]
    public string? Remark { get; set; }

    /// <summary>
    /// 呼叫分配方式
    /// </summary>
    public EDistribution Distribution { get; set; } = EDistribution.Circular;

    /// <summary>
    /// 语音
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true)]
    public string? Voice { get; set; }

    /// <summary>
    /// 不开启IVR时默认接入的分组
    /// </summary>
    public bool IsDefault { get; set; }

    /// <summary>
    /// 组内分机
    /// </summary>
    [Navigate(typeof(TelTelGroup), nameof(TelTelGroup.TelGroupId), nameof(TelTelGroup.TelId))]
    public List<Tel> Tels { get; set; }
}