using Hotline.Identity.Accounts;
using Hotline.Share.Enums.User;
using SqlSugar;
using XF.Domain.Repository;

namespace Hotline.Identity.Roles
{
    [SugarIndex("unique_role_name", nameof(Role.Name), OrderByType.Desc, true)]
    public class Role : FullStateEntity
    {
        public string Name { get; set; }

        public string ClientId { get; set; }

        public string DisplayName { get; set; }

        public int?  OldRoleId { get; set; }

		[SugarColumn(IsNullable = true)]
        public string? Description { get; set; }


        [Navigate(typeof(AccountRole), nameof(AccountRole.RoleId), nameof(AccountRole.AccountId))]
        public List<Account> Accounts { get; set; }

        /// <summary>
        /// 角色类型
        /// </summary>
        public ERoleType? RoleType { get; set; }
    }
}
