Table,
UpdatedAt
} from 'sequelize-typescript'
-import { throwIfNotValid } from '../utils'
-import { UserModel } from './user'
-import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
+import { MNotificationSettingFormattable } from '@server/types/models'
import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'
+import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
import { clearCacheByUserId } from '../../lib/oauth-model'
-import { MNotificationSettingFormattable } from '@server/types/models'
+import { throwIfNotValid } from '../utils'
+import { UserModel } from './user'
@Table({
tableName: 'userNotificationSetting',
@Column
commentMention: UserNotificationSettingValue
+ @AllowNull(false)
+ @Default(null)
+ @Is(
+ 'UserNotificationSettingAbuseStateChange',
+ value => throwIfNotValid(value, isUserNotificationSettingValid, 'abuseStateChange')
+ )
+ @Column
+ abuseStateChange: UserNotificationSettingValue
+
+ @AllowNull(false)
+ @Default(null)
+ @Is(
+ 'UserNotificationSettingAbuseNewMessage',
+ value => throwIfNotValid(value, isUserNotificationSettingValid, 'abuseNewMessage')
+ )
+ @Column
+ abuseNewMessage: UserNotificationSettingValue
+
@ForeignKey(() => UserModel)
@Column
userId: number
commentMention: this.commentMention,
newFollow: this.newFollow,
newInstanceFollower: this.newInstanceFollower,
- autoInstanceFollowing: this.autoInstanceFollowing
+ autoInstanceFollowing: this.autoInstanceFollowing,
+ abuseNewMessage: this.abuseNewMessage,
+ abuseStateChange: this.abuseStateChange
}
}
}