using NPin.Framework.SqlSugarCore.Abstractions.Data;
using NPin.Framework.Upms.Domain.Shared.Enums;
using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;

namespace NPin.Framework.Upms.Domain.Entities;

[SugarTable("Role", "角色表")]
public class RoleEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IEnabled
{
    [SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键")]
    public override Guid Id { get; protected set; }

    [SugarColumn(ColumnDescription = "角色代码")]
    public string Code { get; set; } = string.Empty;

    [SugarColumn(ColumnDescription = "角色名称")]
    public string Name { get; set; } = string.Empty;

    [SugarColumn(ColumnDescription = "角色数据权限范围")]
    public DataScopeEnum DataScope { get; set; } = DataScopeEnum.All;
    
    [SugarColumn(ColumnDescription = "描述")]
    public string? Remark { get; set; }

    public bool IsDeleted { get; }
    public DateTime CreationTime { get; } = DateTime.Now;
    public Guid? CreatorId { get; }
    public DateTime? LastModificationTime { get; }
    public Guid? LastModifierId { get; }
    public int OrderNum { get; set; }
    public bool IsEnabled { get; set; }
}