feat: add CourtSession model and isOpenPlay field to Court
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -144,13 +144,15 @@ model Court {
|
||||
description String?
|
||||
features String[] @default([])
|
||||
displayOrder Int @default(0)
|
||||
isOpenPlay Boolean @default(false)
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
site Site @relation(fields: [siteId], references: [id], onDelete: Cascade)
|
||||
site Site @relation(fields: [siteId], references: [id], onDelete: Cascade)
|
||||
bookings Booking[]
|
||||
matches Match[]
|
||||
sessions CourtSession[]
|
||||
|
||||
@@index([siteId])
|
||||
@@index([status])
|
||||
@@ -215,6 +217,7 @@ model Client {
|
||||
payments Payment[]
|
||||
sales Sale[]
|
||||
inscriptions TournamentInscription[]
|
||||
courtSessions CourtSession[]
|
||||
|
||||
@@unique([organizationId, email])
|
||||
@@unique([organizationId, dni])
|
||||
@@ -544,3 +547,28 @@ model Match {
|
||||
@@index([round, position])
|
||||
@@index([scheduledAt])
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// COURT SESSIONS (Live Player Tracking)
|
||||
// =============================================================================
|
||||
|
||||
model CourtSession {
|
||||
id String @id @default(cuid())
|
||||
courtId String
|
||||
clientId String?
|
||||
walkInName String?
|
||||
startTime DateTime @default(now())
|
||||
endTime DateTime?
|
||||
isActive Boolean @default(true)
|
||||
notes String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
client Client? @relation(fields: [clientId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@index([courtId])
|
||||
@@index([clientId])
|
||||
@@index([isActive])
|
||||
@@index([startTime])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user