82 lines
2.2 KiB
Plaintext
82 lines
2.2 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
username String @unique
|
|
password String
|
|
createdAt DateTime @default(now())
|
|
}
|
|
|
|
model Branch {
|
|
id String @id @default(uuid())
|
|
name String
|
|
address String?
|
|
phone String?
|
|
instructors Instructor[] // Implicit many-to-many
|
|
classes DanceClass[]
|
|
lessons Lesson[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Instructor {
|
|
id String @id @default(uuid())
|
|
name String
|
|
bio String?
|
|
phone String?
|
|
branches Branch[] // Implicit many-to-many
|
|
classes DanceClass[]
|
|
lessons Lesson[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model DanceClass {
|
|
id String @id @default(uuid())
|
|
name String
|
|
description String?
|
|
branchId String
|
|
branch Branch @relation(fields: [branchId], references: [id])
|
|
instructorId String?
|
|
instructor Instructor? @relation(fields: [instructorId], references: [id])
|
|
lessons Lesson[]
|
|
fees Fee[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Lesson {
|
|
id String @id @default(uuid())
|
|
name String? // Optional name e.g. "Special Workshop"
|
|
startTime DateTime
|
|
endTime DateTime
|
|
type String // GROUP, PRIVATE
|
|
branchId String
|
|
branch Branch @relation(fields: [branchId], references: [id])
|
|
instructorId String
|
|
instructor Instructor @relation(fields: [instructorId], references: [id])
|
|
classId String?
|
|
class DanceClass? @relation(fields: [classId], references: [id])
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Fee {
|
|
id String @id @default(uuid())
|
|
name String
|
|
amount Float
|
|
currency String @default("TRY")
|
|
type String // MONTHLY, PER_LESSON, PACKAGE
|
|
classId String?
|
|
class DanceClass? @relation(fields: [classId], references: [id])
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|