feat: consider all dispositions when updating staffing status
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user