Add feedback

This commit is contained in:
Isaac 2022-04-27 00:15:12 +01:00
parent aa0a265dbf
commit d1bab9799d

View File

@ -73,6 +73,8 @@ model Category {
description String
discordCategory String @db.VarChar(19)
emoji String
enableFeedback Boolean @default(false)
feedback Feedback[]
guild Guild @relation(fields: [guildId], references: [id])
guildId String @db.VarChar(19)
id Int @id @default(autoincrement())
@ -91,6 +93,19 @@ model Category {
@@map("categories")
}
model Feedback {
category Category? @relation(fields: [categoryId], references: [id])
categoryId Int?
comment String? @db.VarChar(4000)
id Int @id @default(autoincrement())
rating Int
ticket Ticket @relation(fields: [ticketId], references: [id])
ticketId String @unique @db.VarChar(19)
user User? @relation(fields: [userId], references: [id])
userId String? @db.VarChar(19)
}
model Guild {
archive Boolean @default(true)
blocklist Json
@ -164,6 +179,8 @@ model Ticket {
createdAt DateTime @default(now())
createdBy User @relation(name: "TicketsCreatedByUser", fields: [createdById], references: [id])
createdById String @db.VarChar(19)
feedback Feedback?
feedbackId Int?
firstResponseAt DateTime?
deleted Boolean @default(false)
guild Guild @relation(fields: [guildId], references: [id])
@ -189,6 +206,7 @@ model Ticket {
model User {
createdAt DateTime @default(now())
feedback Feedback[]
id String @id @db.VarChar(19)
messageCount Int @default(0)
ticketsCreated Ticket[] @relation("TicketsCreatedByUser")