diff --git a/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt b/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt index 7e9c7a8..78e2ee8 100644 --- a/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt +++ b/src/commonMain/kotlin/de/kif/common/ConstraintChecking.kt @@ -67,8 +67,8 @@ fun checkConstraints( } ConstraintType.NotOnDay -> { - val notOnDay = constraints.map { it.day == schedule.day } - if (notOnDay.any()) { + val notOnDay = constraints.map { it.day != schedule.day } + if (notOnDay.none()) { val dayList = constraints.mapNotNull { it.day }.distinct().sorted() errors += ConstraintError("Work group requires not days $dayList, but is on ${schedule.day}!") }