feat: consider all dispositions when updating staffing status

This commit is contained in:
Björn Fromme
2024-10-28 11:33:25 +01:00
parent bb56554aa1
commit 49faa1eb25
+7 -3
View File
@@ -136,7 +136,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
public function updateStaffingStatus(): void
{
$confirmedDispositions = $this->getConfirmedDispositions();
$confirmedDispositions = $this->getValidDispositions();
$validApplications = $this->getValidApplications();
if ($this->availableDispositions === $confirmedDispositions->count()) {
@@ -448,10 +448,14 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
return $this;
}
public function getConfirmedDispositions(): Collection
public function getValidDispositions(): Collection
{
return $this->dispositions->filter(function (Disposition $disposition) {
return Disposition::STATUS_CONFIRMED === $disposition->getStatus();
return true === in_array($disposition->getStatus(), [
Disposition::STATUS_NEW,
Disposition::STATUS_CHECKING_CONTRACT,
Disposition::STATUS_CONFIRMED,
]);
});
}