2023-07-26 22:31:52 -07:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2019-04-07 05:50:36 -07:00
|
|
|
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
2022-02-26 18:07:39 -08:00
|
|
|
import { id } from '../id.js';
|
2022-09-17 11:27:08 -07:00
|
|
|
import { User } from './User.js';
|
2019-04-07 05:50:36 -07:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class AbuseUserReport {
|
|
|
|
@PrimaryColumn(id())
|
|
|
|
public id: string;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column('timestamp with time zone', {
|
2021-12-09 06:58:30 -08:00
|
|
|
comment: 'The created date of the AbuseUserReport.',
|
2019-04-07 05:50:36 -07:00
|
|
|
})
|
|
|
|
public createdAt: Date;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column(id())
|
2020-10-19 03:29:04 -07:00
|
|
|
public targetUserId: User['id'];
|
2019-04-07 05:50:36 -07:00
|
|
|
|
|
|
|
@ManyToOne(type => User, {
|
2021-12-09 06:58:30 -08:00
|
|
|
onDelete: 'CASCADE',
|
2019-04-07 05:50:36 -07:00
|
|
|
})
|
|
|
|
@JoinColumn()
|
2020-10-19 03:29:04 -07:00
|
|
|
public targetUser: User | null;
|
2019-04-07 05:50:36 -07:00
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column(id())
|
|
|
|
public reporterId: User['id'];
|
|
|
|
|
|
|
|
@ManyToOne(type => User, {
|
2021-12-09 06:58:30 -08:00
|
|
|
onDelete: 'CASCADE',
|
2019-04-07 05:50:36 -07:00
|
|
|
})
|
|
|
|
@JoinColumn()
|
|
|
|
public reporter: User | null;
|
|
|
|
|
2020-10-19 03:29:04 -07:00
|
|
|
@Column({
|
|
|
|
...id(),
|
2021-12-09 06:58:30 -08:00
|
|
|
nullable: true,
|
2020-10-19 03:29:04 -07:00
|
|
|
})
|
|
|
|
public assigneeId: User['id'] | null;
|
|
|
|
|
|
|
|
@ManyToOne(type => User, {
|
2021-12-09 06:58:30 -08:00
|
|
|
onDelete: 'SET NULL',
|
2020-10-19 03:29:04 -07:00
|
|
|
})
|
|
|
|
@JoinColumn()
|
|
|
|
public assignee: User | null;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column('boolean', {
|
2021-12-09 06:58:30 -08:00
|
|
|
default: false,
|
2020-10-19 03:29:04 -07:00
|
|
|
})
|
|
|
|
public resolved: boolean;
|
|
|
|
|
2022-01-20 10:06:38 -08:00
|
|
|
@Column('boolean', {
|
2022-09-17 11:27:08 -07:00
|
|
|
default: false,
|
2022-01-20 10:06:38 -08:00
|
|
|
})
|
|
|
|
public forwarded: boolean;
|
|
|
|
|
2019-04-07 05:50:36 -07:00
|
|
|
@Column('varchar', {
|
2020-10-19 03:29:04 -07:00
|
|
|
length: 2048,
|
2019-04-07 05:50:36 -07:00
|
|
|
})
|
|
|
|
public comment: string;
|
2020-10-19 03:29:04 -07:00
|
|
|
|
|
|
|
//#region Denormalized fields
|
|
|
|
@Index()
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128, nullable: true,
|
2021-12-09 06:58:30 -08:00
|
|
|
comment: '[Denormalized]',
|
2020-10-19 03:29:04 -07:00
|
|
|
})
|
|
|
|
public targetUserHost: string | null;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128, nullable: true,
|
2021-12-09 06:58:30 -08:00
|
|
|
comment: '[Denormalized]',
|
2020-10-19 03:29:04 -07:00
|
|
|
})
|
|
|
|
public reporterHost: string | null;
|
|
|
|
//#endregion
|
2019-04-07 05:50:36 -07:00
|
|
|
}
|