namespace HoneyBox.Admin.Models.Common;

/// <summary>
/// 管理系统错误码定义
/// </summary>
public static class AdminErrorCodes
{
    #region Authentication (40001-40099)
    
    /// <summary>
    /// 无效的凭据
    /// </summary>
    public const int InvalidCredentials = 40001;
    
    /// <summary>
    /// 账户已禁用
    /// </summary>
    public const int AccountDisabled = 40002;
    
    /// <summary>
    /// 账户已锁定
    /// </summary>
    public const int AccountLocked = 40003;
    
    /// <summary>
    /// Token 已过期
    /// </summary>
    public const int TokenExpired = 40004;
    
    /// <summary>
    /// Token 无效
    /// </summary>
    public const int TokenInvalid = 40005;
    
    /// <summary>
    /// 验证码无效或已过期
    /// </summary>
    public const int CaptchaInvalid = 40006;
    
    /// <summary>
    /// 验证码已过期
    /// </summary>
    public const int CaptchaExpired = 40007;
    
    /// <summary>
    /// 验证码错误
    /// </summary>
    public const int CaptchaWrong = 40008;
    
    /// <summary>
    /// 无效的 RefreshToken
    /// </summary>
    public const int InvalidRefreshToken = 40009;
    
    /// <summary>
    /// RefreshToken 已过期
    /// </summary>
    public const int RefreshTokenExpired = 40010;
    
    /// <summary>
    /// RefreshToken 已被撤销
    /// </summary>
    public const int RefreshTokenRevoked = 40011;
    
    #endregion

    #region Authorization (40101-40199)
    
    /// <summary>
    /// 权限不足
    /// </summary>
    public const int PermissionDenied = 40101;
    
    /// <summary>
    /// 角色不存在
    /// </summary>
    public const int RoleNotFound = 40102;
    
    #endregion

    #region Validation (40201-40299)
    
    /// <summary>
    /// 参数无效
    /// </summary>
    public const int InvalidParameter = 40201;
    
    /// <summary>
    /// 用户名重复
    /// </summary>
    public const int DuplicateUsername = 40202;
    
    /// <summary>
    /// 角色编码重复
    /// </summary>
    public const int DuplicateRoleCode = 40203;
    
    /// <summary>
    /// 菜单存在子菜单
    /// </summary>
    public const int MenuHasChildren = 40204;
    
    /// <summary>
    /// 不能删除系统角色
    /// </summary>
    public const int CannotDeleteSystemRole = 40205;
    
    /// <summary>
    /// 不能删除最后一个超级管理员
    /// </summary>
    public const int CannotDeleteLastSuperAdmin = 40206;
    
    /// <summary>
    /// 部门存在子部门
    /// </summary>
    public const int DepartmentHasChildren = 40207;
    
    /// <summary>
    /// 部门存在用户
    /// </summary>
    public const int DepartmentHasUsers = 40208;
    
    /// <summary>
    /// 部门循环引用
    /// </summary>
    public const int DepartmentCircularReference = 40209;
    
    /// <summary>
    /// 部门编码重复
    /// </summary>
    public const int DuplicateDepartmentCode = 40210;
    
    #endregion

    #region Server (50001-50099)
    
    /// <summary>
    /// 内部服务器错误
    /// </summary>
    public const int InternalError = 50001;
    
    /// <summary>
    /// 数据库错误
    /// </summary>
    public const int DatabaseError = 50002;
    
    #endregion
}
