generated from nhcarrigan/template
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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user