Refactor event status handling: Remove EventStatus enum from the Prisma schema and update related API routes and UI components to calculate event status dynamically based on event date. This change simplifies event management and enhances data integrity by ensuring status is always derived from the date.
This commit is contained in:
@@ -23,12 +23,6 @@ enum EventType {
|
||||
CODE_KATA
|
||||
}
|
||||
|
||||
enum EventStatus {
|
||||
UPCOMING
|
||||
LIVE
|
||||
PAST
|
||||
}
|
||||
|
||||
enum CharacterClass {
|
||||
WARRIOR
|
||||
MAGE
|
||||
@@ -89,7 +83,6 @@ model Event {
|
||||
name String
|
||||
description String
|
||||
type EventType
|
||||
status EventStatus
|
||||
room String?
|
||||
time String?
|
||||
maxPlaces Int?
|
||||
@@ -97,7 +90,6 @@ model Event {
|
||||
updatedAt DateTime @updatedAt
|
||||
registrations EventRegistration[]
|
||||
|
||||
@@index([status])
|
||||
@@index([date])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user