Add Booking System

This commit is contained in:
nocnico
2025-09-18 21:49:03 +02:00
parent 715cb9ef53
commit a612cf9951
14 changed files with 1380 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
enum BOOKING_TYPE {
STATION
LST_01
LST_02
LST_03
LST_04
}
model Booking {
id String @id @default(uuid())
userId String @map(name: "user_id")
type BOOKING_TYPE
stationId Int? @map(name: "station_id")
startTime DateTime @map(name: "start_time")
endTime DateTime @map(name: "end_time")
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @updatedAt @map(name: "updated_at")
// Relations
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
station Station? @relation(fields: [stationId], references: [id], onDelete: Cascade)
@@index([startTime, endTime])
@@index([type, startTime, endTime])
@@map(name: "bookings")
}