-import * as Sequelize from 'sequelize'
-
-import { CONFIG } from '../../initializers'
-import { isVideoAbuseReasonValid } from '../../helpers'
-
-import { addMethodsToModel, getSort } from '../utils'
-import {
- VideoAbuseInstance,
- VideoAbuseAttributes,
-
- VideoAbuseMethods
-} from './video-abuse-interface'
-import { VideoAbuseObject } from '../../../shared/models/activitypub/objects/video-abuse-object'
-
-let VideoAbuse: Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes>
-let toFormattedJSON: VideoAbuseMethods.ToFormattedJSON
-let listForApi: VideoAbuseMethods.ListForApi
-let toActivityPubObject: VideoAbuseMethods.ToActivityPubObject
-
-export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
- VideoAbuse = sequelize.define<VideoAbuseInstance, VideoAbuseAttributes>('VideoAbuse',
+import { AfterCreate, AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'
+import { VideoAbuseObject } from '../../../shared/models/activitypub/objects'
+import { VideoAbuse } from '../../../shared/models/videos'
+import { isVideoAbuseReasonValid } from '../../helpers/custom-validators/videos'
+import { Emailer } from '../../lib/emailer'
+import { AccountModel } from '../account/account'
+import { getSort, throwIfNotValid } from '../utils'
+import { VideoModel } from './video'
+
+@Table({
+ tableName: 'videoAbuse',
+ indexes: [