feat: implement profile reporting system with admin review

Added comprehensive profile reporting system to allow users to report
inappropriate profiles and admins to review reports.

Features:
- User can report profiles with predefined reasons + custom details
- Duplicate prevention (one pending report per profile per user)
- Rate limiting (5 pending reports maximum per user)
- Admin dashboard to view and filter reports (All, Pending, Reviewed, etc.)
- Admin review modal to update status and add review notes
- Report button on profile page (only visible when viewing others)
- Font Awesome icons for better UI consistency

Database changes:
- New ProfileReport model with ReportReason/ReportStatus enums
- User relations for reports (reportsMade, reportsReceived, reportsReviewed)
- Indices for efficient querying
This commit is contained in:
2026-02-19 18:33:58 -08:00
committed by Naomi Carrigan
parent 5eec4c7640
commit d797d38ddd
9 changed files with 2056 additions and 6 deletions
+60
View File
@@ -0,0 +1,60 @@
export enum ReportReason {
INAPPROPRIATE_CONTENT = "INAPPROPRIATE_CONTENT",
HARASSMENT = "HARASSMENT",
SPAM = "SPAM",
IMPERSONATION = "IMPERSONATION",
OFFENSIVE_NAME = "OFFENSIVE_NAME",
MALICIOUS_LINKS = "MALICIOUS_LINKS",
OTHER = "OTHER",
}
export enum ReportStatus {
PENDING = "PENDING",
REVIEWED = "REVIEWED",
DISMISSED = "DISMISSED",
ACTION_TAKEN = "ACTION_TAKEN",
}
export interface ProfileReport {
id: string;
reportedUserId: string;
reporterId: string;
reason: ReportReason;
details: string;
status: ReportStatus;
reviewedBy?: string;
reviewNotes?: string;
createdAt: Date;
updatedAt: Date;
}
export interface ProfileReportWithUsers extends ProfileReport {
reportedUser: {
id: string;
username: string;
displayName?: string;
avatar?: string;
};
reporter: {
id: string;
username: string;
displayName?: string;
avatar?: string;
};
reviewer?: {
id: string;
username: string;
displayName?: string;
};
}
export interface CreateReportDto {
reportedUserId: string;
reason: ReportReason;
details: string;
}
export interface UpdateReportDto {
status: ReportStatus;
reviewNotes?: string;
}