using TakeoutSaaS.Shared.Abstractions.Entities;

namespace TakeoutSaaS.Domain.Identity.Entities;

/// <summary>
/// 权限定义。
/// </summary>
public sealed class Permission : MultiTenantEntityBase
{
    /// <summary>
    /// 父级权限 ID，根节点为 0。
    /// </summary>
    public long ParentId { get; set; }

    /// <summary>
    /// 排序值，值越小越靠前。
    /// </summary>
    public int SortOrder { get; set; }

    /// <summary>
    /// 权限类型（group/leaf）。
    /// </summary>
    public string Type { get; set; } = "leaf";

    /// <summary>
    /// 权限名称。
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 权限编码（租户内唯一）。
    /// </summary>
    public string Code { get; set; } = string.Empty;

    /// <summary>
    /// 描述。
    /// </summary>
    public string? Description { get; set; }
}
