feat: implement user reporting system with dedicated module, service, controller, DTOs, and Prisma schema updates.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user