using SqlSugar;
using System.ComponentModel;
using XF.Domain.Repository;

namespace Hotline.Planlibrary;

/// <summary>
/// 预案分类
/// </summary>
[Description("预案分类")]
public class PlanType : FullStateEntity
{
    /// <summary>
    /// 类型名称
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 类型名称拼接(所有父级分类名称)
    /// <example>
    /// A类型/A.1类型/A.1.1类型
    /// </example>
    /// </summary>
    public string SpliceName { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    public bool IsEnable { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    public int Sort { get; set; }

    /// <summary>
    /// 父级ID
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public string? ParentId { get; set; }


    /// <summary>
    /// 旧系统类型id
    /// </summary>
    public int? OldTypeId { get; set; }

    /// <summary>
    /// 类型关联机构
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(PlanTypeOrg.TypeId))]
    public List<PlanTypeOrg> PlanTypeOrgs { get; set; }
}
