feat(server): support query overcapacity member count of workspace (#12050)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Workspace quota information now includes a new metric: the count of members exceeding seat capacity ("overcapacityMemberCount"), available in both numeric and human-readable formats.
  - The workspace quota display and related queries have been updated to show this new overcapacity member count alongside existing quota metrics.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
forehalo
2025-04-30 09:47:50 +00:00
parent 04531508cb
commit f1605e246b
7 changed files with 34 additions and 1 deletions

View File

@@ -289,6 +289,15 @@ export class WorkspaceUserModel extends BaseModel {
});
}
async insufficientSeatMemberCount(workspaceId: string) {
return this.db.workspaceUserRole.count({
where: {
workspaceId,
status: WorkspaceMemberStatus.NeedMoreSeat,
},
});
}
async getUserActiveRoles(
userId: string,
filter: { role?: WorkspaceRole } = {}