diff --git a/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt b/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt index 8f3071c..e0f9bf1 100644 --- a/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt +++ b/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt @@ -56,6 +56,17 @@ fun checkConstraints( } } + for (s in against) { + if ( + schedule != s && + schedule.room.id == s.room.id && + start < s.getAbsoluteEndTime() && + s.getAbsoluteStartTime() < end + ) { + errors += ConstraintError("Work group cannot be at same time with ${s.workGroup.name} at the same room ${schedule.room.name}!") + } + } + for ((type, constraints) in schedule.workGroup.constraints.groupBy { it.type }) { when (type) { ConstraintType.OnlyOnDay -> {