2023-07-27 00:31:52 -05:00
|
|
|
/*
|
2024-02-13 09:59:27 -06:00
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 00:31:52 -05:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2019-04-07 07:50:36 -05:00
|
|
|
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
2023-09-19 21:33:36 -05:00
|
|
|
import { id } from './util/id.js';
|
2023-08-16 03:51:28 -05:00
|
|
|
import { MiUser } from './User.js';
|
2019-04-07 07:50:36 -05:00
|
|
|
|
2024-11-18 19:41:39 -06:00
|
|
|
export type AbuseReportResolveType = 'accept' | 'reject';
|
|
|
|
|
2023-08-16 03:51:28 -05:00
|
|
|
@Entity('abuse_user_report')
|
|
|
|
export class MiAbuseUserReport {
|
2019-04-07 07:50:36 -05:00
|
|
|
@PrimaryColumn(id())
|
|
|
|
public id: string;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column(id())
|
2023-08-16 03:51:28 -05:00
|
|
|
public targetUserId: MiUser['id'];
|
2019-04-07 07:50:36 -05:00
|
|
|
|
2023-08-16 03:51:28 -05:00
|
|
|
@ManyToOne(type => MiUser, {
|
2021-12-09 08:58:30 -06:00
|
|
|
onDelete: 'CASCADE',
|
2019-04-07 07:50:36 -05:00
|
|
|
})
|
|
|
|
@JoinColumn()
|
2023-08-16 03:51:28 -05:00
|
|
|
public targetUser: MiUser | null;
|
2019-04-07 07:50:36 -05:00
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column(id())
|
2023-08-16 03:51:28 -05:00
|
|
|
public reporterId: MiUser['id'];
|
2019-04-07 07:50:36 -05:00
|
|
|
|
2023-08-16 03:51:28 -05:00
|
|
|
@ManyToOne(type => MiUser, {
|
2021-12-09 08:58:30 -06:00
|
|
|
onDelete: 'CASCADE',
|
2019-04-07 07:50:36 -05:00
|
|
|
})
|
|
|
|
@JoinColumn()
|
2023-08-16 03:51:28 -05:00
|
|
|
public reporter: MiUser | null;
|
2019-04-07 07:50:36 -05:00
|
|
|
|
2020-10-19 05:29:04 -05:00
|
|
|
@Column({
|
|
|
|
...id(),
|
2021-12-09 08:58:30 -06:00
|
|
|
nullable: true,
|
2020-10-19 05:29:04 -05:00
|
|
|
})
|
2023-08-16 03:51:28 -05:00
|
|
|
public assigneeId: MiUser['id'] | null;
|
2020-10-19 05:29:04 -05:00
|
|
|
|
2023-08-16 03:51:28 -05:00
|
|
|
@ManyToOne(type => MiUser, {
|
2021-12-09 08:58:30 -06:00
|
|
|
onDelete: 'SET NULL',
|
2020-10-19 05:29:04 -05:00
|
|
|
})
|
|
|
|
@JoinColumn()
|
2023-08-16 03:51:28 -05:00
|
|
|
public assignee: MiUser | null;
|
2020-10-19 05:29:04 -05:00
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column('boolean', {
|
2021-12-09 08:58:30 -06:00
|
|
|
default: false,
|
2020-10-19 05:29:04 -05:00
|
|
|
})
|
|
|
|
public resolved: boolean;
|
|
|
|
|
2024-10-05 02:20:15 -05:00
|
|
|
/**
|
|
|
|
* リモートサーバーに転送したかどうか
|
|
|
|
*/
|
2022-01-20 12:06:38 -06:00
|
|
|
@Column('boolean', {
|
2022-09-17 13:27:08 -05:00
|
|
|
default: false,
|
2022-01-20 12:06:38 -06:00
|
|
|
})
|
|
|
|
public forwarded: boolean;
|
|
|
|
|
2019-04-07 07:50:36 -05:00
|
|
|
@Column('varchar', {
|
2020-10-19 05:29:04 -05:00
|
|
|
length: 2048,
|
2019-04-07 07:50:36 -05:00
|
|
|
})
|
|
|
|
public comment: string;
|
2020-10-19 05:29:04 -05:00
|
|
|
|
2024-10-05 02:20:15 -05:00
|
|
|
@Column('varchar', {
|
|
|
|
length: 8192, default: '',
|
|
|
|
})
|
|
|
|
public moderationNote: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* accept 是認 ... 通報内容が正当であり、肯定的に対応された
|
|
|
|
* reject 否認 ... 通報内容が正当でなく、否定的に対応された
|
|
|
|
* null ... その他
|
|
|
|
*/
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128, nullable: true,
|
|
|
|
})
|
2024-11-18 19:41:39 -06:00
|
|
|
public resolvedAs: AbuseReportResolveType | null;
|
2024-10-05 02:20:15 -05:00
|
|
|
|
2020-10-19 05:29:04 -05:00
|
|
|
//#region Denormalized fields
|
|
|
|
@Index()
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128, nullable: true,
|
2021-12-09 08:58:30 -06:00
|
|
|
comment: '[Denormalized]',
|
2020-10-19 05:29:04 -05:00
|
|
|
})
|
|
|
|
public targetUserHost: string | null;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128, nullable: true,
|
2021-12-09 08:58:30 -06:00
|
|
|
comment: '[Denormalized]',
|
2020-10-19 05:29:04 -05:00
|
|
|
})
|
|
|
|
public reporterHost: string | null;
|
|
|
|
//#endregion
|
2019-04-07 07:50:36 -05:00
|
|
|
}
|