mirror of
https://github.com/Since-3/Kuma.git
synced 2026-10-12 21:41:17 +00:00
added booking process for a specific course via Link
This commit is contained in:
parent
97864cea4b
commit
95287e229d
10 changed files with 467 additions and 7 deletions
|
|
@ -32,6 +32,7 @@ model User {
|
|||
pbSrc String?
|
||||
isValid Boolean @default(false)
|
||||
trainings UserTraining[]
|
||||
courseBookings CourseBooking[]
|
||||
createdAt DateTime? @default(now())
|
||||
updatedAt DateTime? @updatedAt
|
||||
}
|
||||
|
|
@ -108,6 +109,7 @@ model Course {
|
|||
weekdays String[] // For custom frequency
|
||||
status String @default("draft") // draft, published
|
||||
createdBy String // Manager ID who created the course
|
||||
bookings CourseBooking[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
|
@ -118,4 +120,17 @@ model Room {
|
|||
createdBy String // Manager ID who created the room
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model CourseBooking {
|
||||
id String @id @default(uuid())
|
||||
courseId String
|
||||
userId String
|
||||
course Course @relation(fields: [courseId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([courseId, userId]) // Ein User kann sich nur einmal pro Kurs anmelden
|
||||
@@index([courseId])
|
||||
@@index([userId])
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue