fix: called-off dispositions no longer block teamers

This commit is contained in:
Björn Fromme
2026-08-26 09:11:27 +02:00
committed by fromme
parent cc280907e5
commit f3eae5462d
8 changed files with 186 additions and 20 deletions
+18
View File
@@ -497,6 +497,24 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
});
}
/**
* Deliberately skips called-off dispositions: once a teamer has been called off - by themselves
* or by the office - the assignment is open for them again, so the teamer views have to offer
* the application instead of reporting them as staffed.
*/
public function getActiveDispositionByTeamer(Teamer $teamer): ?Disposition
{
$dispositions = $this->getActiveDispositions()->filter(function (Disposition $disposition) use ($teamer) {
return $disposition->getTeamer() === $teamer;
});
if (0 === count($dispositions)) {
return null;
}
return $dispositions->first();
}
public function getActiveDispositions(): Collection
{
return $this->dispositions->filter(function (Disposition $disposition) {