Added booking logs to keep track of cancelled bookings and no shows

This commit is contained in:
Jose Selesan
2026-05-06 16:54:48 -03:00
parent bb48d9c164
commit 41a217e8a9
13 changed files with 232 additions and 34 deletions

View File

@@ -12,6 +12,7 @@ enum CourtBookingStatus {
CONFIRMED
CANCELLED
COMPLETED
NOSHOW
}
model Sport {
@@ -94,3 +95,20 @@ model CourtBooking {
@@index([bookingDate])
@@map("court_bookings")
}
model CourtBookingLog {
id String @id @db.Uuid
bookingCode String @map("booking_code") @db.VarChar(8)
courtId String @map("court_id") @db.Uuid
bookingDate DateTime @map("booking_date") @db.Date
startTime String @map("start_time") @db.VarChar(5)
endTime String @map("end_time") @db.VarChar(5)
previousStatus CourtBookingStatus @map("previous_status")
newStatus CourtBookingStatus @map("new_status")
customerName String @map("customer_name") @db.VarChar(120)
customerPhone String @map("customer_phone") @db.VarChar(30)
changedAt DateTime @default(now()) @map("changed_at")
@@map("court_booking_logs")
@@index([courtId, newStatus])
}