import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from '../id.js';
import { User } from './User.js';
@Entity()
export class AbuseUserReport {
@PrimaryColumn(id())
public id: string;
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the AbuseUserReport.',
})
public createdAt: Date;
@Column(id())
public targetUserId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE',
@JoinColumn()
public targetUser: User | null;
public reporterId: User['id'];
public reporter: User | null;
@Column({
...id(),
nullable: true,
public assigneeId: User['id'] | null;
onDelete: 'SET NULL',
public assignee: User | null;
@Column('boolean', {
default: false,
public resolved: boolean;
public forwarded: boolean;
@Column('varchar', {
length: 2048,
public comment: string;
//#region Denormalized fields
length: 128, nullable: true,
comment: '[Denormalized]',
public targetUserHost: string | null;
public reporterHost: string | null;
//#endregion
}