feat: private forum groups - Group/GroupMember models, group CRUD API, invite codes, private threads, groups UI pages
This commit is contained in:
+30
-1
@@ -35,6 +35,8 @@ model User {
|
||||
cashouts CashoutRequest[]
|
||||
halalBookmarks HalalBookmark[]
|
||||
halalUsage HalalUsage?
|
||||
ownedGroups Group[] @relation("GroupOwner")
|
||||
groupMemberships GroupMember[]
|
||||
forumThreads ForumThread[]
|
||||
forumPosts ForumPost[]
|
||||
chatHistory ChatHistory[]
|
||||
@@ -158,7 +160,34 @@ model ForumThread {
|
||||
shariahFlags String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
posts ForumPost[]
|
||||
posts ForumPost[]
|
||||
group Group? @relation(fields: [groupId], references: [id])
|
||||
groupId String?
|
||||
}
|
||||
|
||||
model Group {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
description String?
|
||||
ownerId String
|
||||
owner User @relation("GroupOwner", fields: [ownerId], references: [id])
|
||||
inviteCode String @unique
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
members GroupMember[]
|
||||
threads ForumThread[]
|
||||
}
|
||||
|
||||
model GroupMember {
|
||||
id String @id @default(cuid())
|
||||
groupId String
|
||||
group Group @relation(fields: [groupId], references: [id])
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
role String @default("member")
|
||||
joinedAt DateTime @default(now())
|
||||
|
||||
@@unique([groupId, userId])
|
||||
}
|
||||
|
||||
model ForumPost {
|
||||
|
||||
Reference in New Issue
Block a user