fix: correctly apply due dates for contract and invoice upload reminders

This commit is contained in:
Björn Fromme
2026-08-17 11:55:02 +02:00
parent 3e08965e48
commit 489aafed3e
22 changed files with 732 additions and 156 deletions
@@ -8,7 +8,7 @@ use App\Entity\Application;
use App\Entity\Assignment;
use App\Entity\Teamer;
use App\Repository\ApplicationRepository;
use Carbon\CarbonPeriod;
use Carbon\CarbonPeriodImmutable;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
@@ -55,7 +55,7 @@ class ApplicationRepositoryTest extends KernelTestCase
public function testOverlappingQueryBindsThePeriodBoundaries(): void
{
$teamer = new Teamer();
$period = new CarbonPeriod('2025-01-10', '2025-01-20');
$period = new CarbonPeriodImmutable('2025-01-10', '2025-01-20');
$query = $this->createOverlappingQuery($teamer, $period);
@@ -66,7 +66,7 @@ class ApplicationRepositoryTest extends KernelTestCase
$this->assertSame('2025-01-20', $query->getParameter('dateTo')->getValue()->format('Y-m-d'));
}
private function createOverlappingQuery(?Teamer $teamer = null, ?CarbonPeriod $period = null): Query
private function createOverlappingQuery(?Teamer $teamer = null, ?CarbonPeriodImmutable $period = null): Query
{
/** @var EntityManagerInterface $entityManager */
$entityManager = static::getContainer()->get(EntityManagerInterface::class);
@@ -76,7 +76,7 @@ class ApplicationRepositoryTest extends KernelTestCase
return $repository->getOverlappingForTeamerQuery(
$teamer ?? new Teamer(),
$period ?? new CarbonPeriod('2025-01-10', '2025-01-20')
$period ?? new CarbonPeriodImmutable('2025-01-10', '2025-01-20')
);
}
}