fix: called-off dispositions no longer block teamers
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user