Add suspendedAt column to teams

This commit is contained in:
Tom Moor
2023-11-22 21:35:04 -05:00
parent d3e0b19202
commit 3b01368677
6 changed files with 38 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ import {
Table,
Unique,
IsIn,
IsDate,
HasMany,
Scopes,
Is,
@@ -151,8 +152,19 @@ class Team extends ParanoidModel {
@Column(DataType.JSONB)
preferences: TeamPreferences | null;
@IsDate
@Column
suspendedAt: Date | null;
// getters
/**
* Returns whether the team has been suspended and is no longer accessible.
*/
get isSuspended(): boolean {
return !!this.suspendedAt;
}
/**
* Returns whether the team has email login enabled. For self-hosted installs
* this also considers whether SMTP connection details have been configured.

View File

@@ -227,7 +227,7 @@ class User extends ParanoidModel {
// getters
get isSuspended(): boolean {
return !!this.suspendedAt;
return !!this.suspendedAt || this.team?.isSuspended;
}
get isInvited() {