Feat: Add status to assignments to control applications

This commit is contained in:
Björn Fromme committed 2023-11-03 10:45:37 +01:00
1 parent 0d7f9afdfe
commit 49efa30e2a
5 files changed
+71 -1

No files matched your search

+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) {