feat: offer the questionnaire for placements ended within a rolling window

This commit is contained in:
fromme committed 2026-11-10 09:23:23 +01:00
1 parent 9d0cdd7f52
commit 3c34cfa76a
8 files changed
+65 -55

No files matched your search

@@ -25,8 +25,6 @@ class DispositionRepositoryQuestionnaireTest extends KernelTestCase
{
use QuestionnaireFixturesTrait;
private const string GO_LIVE = '2026-01-01';
private EntityManagerInterface $entityManager;
private DispositionRepository $repository;
@@ -123,6 +121,13 @@ class DispositionRepositoryQuestionnaireTest extends KernelTestCase
$this->assertSame([['disposition' => $disposition, 'draft' => false]], $this->pending());
}
public function testAnAssignmentEndingOnTheWindowsFirstDayIsPending(): void
{
$this->escort(dateTo: 'today -30 days');
$this->assertCount(1, $this->pending());
}
public function testAnAssignmentEndingTodayIsPending(): void
{
$this->escort(dateTo: 'today');
@@ -149,7 +154,7 @@ class DispositionRepositoryQuestionnaireTest extends KernelTestCase
{
return [
'not over yet' => [static fn (Disposition $d) => $d->getAssignment()->getDestination()->setDateTo(new \DateTimeImmutable('tomorrow'))],
'ended before go-live' => [static fn (Disposition $d) => $d->getAssignment()->getDestination()->setDateTo(new \DateTimeImmutable('2025-12-31'))],
'ended before the window' => [static fn (Disposition $d) => $d->getAssignment()->getDestination()->setDateTo(new \DateTimeImmutable('today -31 days'))],
'skip formalities' => [static fn (Disposition $d) => $d->getAssignment()->setSkipFormalities(true)],
'called off' => [static fn (Disposition $d) => $d->setStatus(Disposition::STATUS_CALLED_OFF)],
'assignment called off' => [static fn (Disposition $d) => $d->getAssignment()->setStatus(Assignment::STATUS_CALLED_OFF)],
@@ -172,6 +177,6 @@ class DispositionRepositoryQuestionnaireTest extends KernelTestCase
{
$this->entityManager->flush();
return $this->repository->findPendingQuestionnaireByTeamer($this->teamer, new \DateTimeImmutable(self::GO_LIVE));
return $this->repository->findPendingQuestionnaireByTeamer($this->teamer, QuestionnaireCatalog::windowStart(30));
}
}