added standing orders in courses

This commit is contained in:
Rajpreet0 2026-06-27 16:50:10 +02:00
parent bb1937a452
commit 63e6e4dc5c
12 changed files with 600 additions and 100 deletions

View file

@ -125,6 +125,11 @@ model Course {
isStandingOrder Boolean @default(false)
frequency String? // daily, weekly, biweekly, monthly, custom
weekdays String[] // For custom frequency
weekdayTimings Json? // { "monday": { "timeFrom": "08:00", "timeTo": "09:00" }, ... }
endDate DateTime? // Required when isStandingOrder = true
parentCourseId String? // Null on template; set on every child instance
parentCourse Course? @relation("StandingOrderInstances", fields: [parentCourseId], references: [id], onDelete: Cascade)
children Course[] @relation("StandingOrderInstances")
status String @default("draft") // draft, published
createdBy String // Manager ID who created the course
businessId String?
@ -138,6 +143,8 @@ model Course {
@@index([date])
@@index([status])
@@index([businessId])
@@index([parentCourseId])
@@index([parentCourseId, date])
}
model Room {