1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-16 13:15:30 +02:00
Files
misskey/packages/backend/src/models/AbuseUserReport.ts
anatawa12 666f78e676 enable and fix no-unused-vars and no-async-promise-executor (#17070)
* dev: set --no-bail for lint task

* lint: enable no-async-promise-executor lint and fix them

* lint: enable no-unused-vars with allowing _ prefix

* lint: fix semi
2026-01-08 11:49:12 +09:00

99 lines
1.9 KiB
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from './util/id.js';
import { MiUser } from './User.js';
export type AbuseReportResolveType = 'accept' | 'reject';
@Entity('abuse_user_report')
export class MiAbuseUserReport {
@PrimaryColumn(id())
public id: string;
@Index()
@Column(id())
public targetUserId: MiUser['id'];
@ManyToOne(() => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
public targetUser: MiUser | null;
@Index()
@Column(id())
public reporterId: MiUser['id'];
@ManyToOne(() => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
public reporter: MiUser | null;
@Column({
...id(),
nullable: true,
})
public assigneeId: MiUser['id'] | null;
@ManyToOne(() => MiUser, {
onDelete: 'SET NULL',
})
@JoinColumn()
public assignee: MiUser | null;
@Index()
@Column('boolean', {
default: false,
})
public resolved: boolean;
/**
* リモートサーバーに転送したかどうか
*/
@Column('boolean', {
default: false,
})
public forwarded: boolean;
@Column('varchar', {
length: 2048,
})
public comment: string;
@Column('varchar', {
length: 8192, default: '',
})
public moderationNote: string;
/**
* accept 是認 ... 通報内容が正当であり、肯定的に対応された
* reject 否認 ... 通報内容が正当でなく、否定的に対応された
* null ... その他
*/
@Column('varchar', {
length: 128, nullable: true,
})
public resolvedAs: AbuseReportResolveType | null;
//#region Denormalized fields
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]',
})
public targetUserHost: string | null;
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]',
})
public reporterHost: string | null;
//#endregion
}