Implement event registration functionality: Add EventRegistration model to Prisma schema, enabling user event registrations. Enhance EventsPageSection component with registration checks, calendar view, and improved event display. Refactor event rendering logic to separate upcoming and past events, improving user experience.

This commit is contained in:
Julien Froidefond
2025-12-09 21:53:10 +01:00
parent 5ae6cde14e
commit 50a2eaf109
13 changed files with 2483 additions and 61 deletions

View File

@@ -44,6 +44,7 @@ model User {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
preferences UserPreferences?
eventRegistrations EventRegistration[]
@@index([score])
@@index([email])
@@ -75,11 +76,25 @@ model Event {
status EventStatus
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
registrations EventRegistration[]
@@index([status])
@@index([date])
}
model EventRegistration {
id String @id @default(cuid())
userId String
eventId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
@@unique([userId, eventId])
@@index([userId])
@@index([eventId])
}
model SitePreferences {
id String @id @default("global")
homeBackground String?