using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 角色
    /// </summary>
    [Table("Roles")]
    public class Role
    {
        /// <summary>
        /// 数据ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 角色类型
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 说明
        /// </summary>
        [Column(TypeName = "varchar(255)")]
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 权限
        /// </summary>
        [Column(TypeName = "text")]
        public string Permission { get; set; } = string.Empty;

        /// <summary>
        /// 是否系统角色
        /// </summary>
        public bool IsSystemRole { get; set; }

        /// <summary>
        /// 角色用户数量
        /// </summary>
        public int Count { get; set; }

        /// <summary>
        /// 是否可用
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime? UpdateTime { get; set; }
    }
}
