feat: assignments with disabled formalities

addresses #869dnvm8c
This commit is contained in:
2026-08-26 16:15:55 +02:00
parent 5979988dcc
commit c33c1b6bf0
20 changed files with 720 additions and 67 deletions
+22
View File
@@ -4,7 +4,10 @@ declare(strict_types=1);
namespace App\Tests\Form;
use App\Entity\Application;
use App\Entity\Assignment;
use App\Entity\Disposition;
use App\Entity\Teamer;
use App\Form\AssignmentType;
use PHPUnit\Framework\TestCase;
@@ -63,6 +66,25 @@ class AssignmentTypeTest extends TestCase
$this->assertNotContains(Assignment::STATUS_CALLED_OFF, array_values(AssignmentType::statusChoices(null)));
}
public function testTheSkipFormalitiesFlagIsOpenOnANewAssignment(): void
{
$this->assertFalse(AssignmentType::isSkipFormalitiesLocked(null));
$this->assertFalse(AssignmentType::isSkipFormalitiesLocked(new Assignment()));
}
/**
* The flag decides which status a Disposition is created in, so once placements exist it
* can no longer be answered for them - a teamer confirmed without a contract, or one still
* being chased for a contract the assignment no longer wants.
*/
public function testTheSkipFormalitiesFlagIsFrozenOnceTeamersArePlaced(): void
{
$assignment = new Assignment();
$assignment->addDisposition(new Disposition(new Application($assignment, new Teamer())));
$this->assertTrue(AssignmentType::isSkipFormalitiesLocked($assignment));
}
/**
* @return array<int, string>
*/