Feat: Add status to assignments to control applications

This commit is contained in:
Björn Fromme
2023-11-03 10:45:37 +01:00
parent 0d7f9afdfe
commit 49efa30e2a
5 changed files with 71 additions and 1 deletions
+5
View File
@@ -43,6 +43,11 @@ class AssignmentVoter extends Voter
/** @var Assignment $assignment */
$assignment = $subject;
// Only allow applications to open assignments
if (Assignment::STATUS_CLOSED === $assignment->getStatus()) {
return false;
}
// Only allow applications on empty slots
$availableSlots = (int) $assignment->getAvailableDispositions();
if (0 < $availableSlots) {