feat(feedback): add user feedback/review system with admin management and hardened image upload validation

This commit is contained in:
Yusuf İpek
2026-02-24 16:05:11 +03:00
parent 4083651025
commit afa1529873
15 changed files with 1725 additions and 34 deletions
+55
View File
@@ -32,10 +32,30 @@ model User {
projectMemberships ProjectMember[]
notificationSetting NotificationSetting?
watchProgress WatchProgress[]
feedbackEntries UserFeedback[]
@@map("users")
}
enum FeedbackEntryType {
FEEDBACK
REVIEW
}
enum FeedbackCategory {
BUG
FEATURE
OTHER
}
enum FeedbackStatus {
NEW
IN_REVIEW
APPROVED
REJECTED
RESOLVED
}
enum DownloadEgressSource {
ORIGINAL
COMPRESSED
@@ -392,6 +412,41 @@ model ShareLink {
@@map("share_links")
}
model UserFeedback {
id String @id @default(cuid())
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
type FeedbackEntryType
category FeedbackCategory?
title String
message String @db.Text
screenshotUrl String?
screenshots UserFeedbackScreenshot[]
rating Int?
status FeedbackStatus @default(NEW)
allowShowcase Boolean @default(false)
showOnLanding Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId, createdAt(sort: Desc)])
@@index([type, createdAt(sort: Desc)])
@@index([status, createdAt(sort: Desc)])
@@index([showOnLanding, createdAt(sort: Desc)])
@@map("user_feedback")
}
model UserFeedbackScreenshot {
id String @id @default(cuid())
feedbackId String
feedback UserFeedback @relation(fields: [feedbackId], references: [id], onDelete: Cascade)
url String
createdAt DateTime @default(now())
@@index([feedbackId, createdAt(sort: Desc)])
@@map("user_feedback_screenshots")
}
enum SharePermission {
VIEW // Can only view
COMMENT // Can view and comment