feat: implement user reporting system with dedicated module, service, controller, DTOs, and Prisma schema updates.

This commit is contained in:
pradeepkumar
2026-03-19 05:19:47 +05:30
parent 4d5a3fc36d
commit 76b7365dc3
9 changed files with 283 additions and 0 deletions

View File

@@ -156,6 +156,10 @@ model User {
subscriptions AgentSubscription[]
payments Payment[]
// Reports
reportsSubmitted UserReport[] @relation("ReportsSubmitted")
reportsReceived UserReport[] @relation("ReportsReceived")
@@index([email])
@@index([role])
@@index([status])
@@ -702,3 +706,34 @@ model Payment {
@@index([status])
@@map("payments")
}
// ============================================
// USER REPORTS
// ============================================
enum ReportStatus {
PENDING
REVIEWED
RESOLVED
DISMISSED
}
model UserReport {
id String @id @default(uuid())
reporterId String
reportedUserId String
conversationId String?
reason String
description String?
status ReportStatus @default(PENDING)
adminNotes String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
reporter User @relation("ReportsSubmitted", fields: [reporterId], references: [id], onDelete: Cascade)
reportedUser User @relation("ReportsReceived", fields: [reportedUserId], references: [id], onDelete: Cascade)
@@index([reporterId])
@@index([reportedUserId])
@@index([status])
@@map("user_reports")
}