feat(admin): add internal notes to reports (#3510)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-17 05:50:33 +02:00
1 parent 2d8d130be1
commit 49a1ffabbe
30 files changed
+1138 -87

No files matched your search

@@ -0,0 +1,25 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {createStringType, SnowflakeStringType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
import {z} from 'zod';
export const ReportNoteRequest = z.object({
body: createStringType(1, 2000).describe('The internal note. Staff only'),
});
export type ReportNoteRequest = z.infer<typeof ReportNoteRequest>;
export const ReportNoteResponse = z.object({
note_id: SnowflakeStringType,
author_id: SnowflakeStringType,
body: z.string(),
created_at: z.string(),
});
export type ReportNoteResponse = z.infer<typeof ReportNoteResponse>;
export const ReportNoteListResponse = z.object({
notes: z.array(ReportNoteResponse).describe('The notes on the report, oldest first'),
});
export type ReportNoteListResponse = z.infer<typeof ReportNoteListResponse>;
@@ -12,6 +12,7 @@ import {ValidationErrorCodes} from '@fluxer/constants/src/ValidationErrorCodes';
import {ADMIN_ACL_COUNT, AdminAclType} from '@fluxer/schema/src/domains/admin/AdminAclType';
import {AdminArchiveResponseSchema} from '@fluxer/schema/src/domains/admin/AdminArchiveSchemas';
import {GuildAdminResponse} from '@fluxer/schema/src/domains/admin/AdminGuildSchemas';
import {ReportNoteResponse} from '@fluxer/schema/src/domains/admin/AdminReportNoteSchemas';
import {UserAdminResponseSchema} from '@fluxer/schema/src/domains/admin/AdminUserSchemas';
import {CaptchaConfigResponse, CaptchaConfigUpdateRequest} from '@fluxer/schema/src/domains/admin/CaptchaSchemas';
import {
@@ -1672,6 +1673,10 @@ export const ReportAdminResponseSchema = z.object({
.nullable()
.optional()
.describe('Why the report is held. Returned by the report detail only. Null when the report has no hold.'),
notes: z
.array(ReportNoteResponse)
.optional()
.describe('Internal staff notes on the report, oldest first. Returned by the report detail only.'),
reason: z.string().nullable().optional(),
reason_label: z.string().nullable().optional(),
reason_highest_priority: z.boolean().nullable().optional(),