feat: Nambahin feature notifikasi

This commit is contained in:
Rafi Athallah
2026-06-23 14:51:31 +07:00
parent 24a3ec7fd0
commit 0e9498a2d0
14 changed files with 1185 additions and 11 deletions
+19
View File
@@ -27,6 +27,7 @@ model Admin {
professional_bio String? @db.Text
projects Project[]
notifications Notification[]
@@map("admin")
}
@@ -195,6 +196,7 @@ model User {
project_members ProjectMember[]
task_submissions TaskSubmission[]
certificates Certificate[]
notifications Notification[]
@@index([email])
@@map("user")
@@ -347,3 +349,20 @@ model Certificate {
@@index([id_user], map: "certificate_id_user_foreign")
@@map("certificate")
}
model Notification {
id Int @id @default(autoincrement())
id_user Int? // For interns
id_admin Int? // For mentors/admins
title String @db.VarChar(255)
message String @db.Text
is_read Boolean @default(false)
created_at DateTime @default(now())
user User? @relation(fields: [id_user], references: [id], onDelete: Cascade)
admin Admin? @relation(fields: [id_admin], references: [id], onDelete: Cascade)
@@index([id_user])
@@index([id_admin])
@@map("notification")
}