feat: filter timeline by date range and hotels

This commit is contained in:
Björn Fromme
2025-03-21 11:52:29 +01:00
parent 9ffada111c
commit 06c32fd597
14 changed files with 316 additions and 28 deletions
@@ -2,9 +2,9 @@
namespace App\Controller\Administrative\Assignment;
use App\Model\AssignmentFilterDto;
use App\Repository\AssignmentRepository;
use App\Service\Assignment\TimelineService;
use App\Service\Common\TimelineFilterHandler;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@@ -14,7 +14,8 @@ class TimelineController extends AbstractController
{
public function __construct(
private readonly AssignmentRepository $assignmentRepository,
private readonly TimelineService $timelineService
private readonly TimelineService $timelineService,
private readonly TimelineFilterHandler $filterHandler
) {
}
@@ -23,12 +24,9 @@ class TimelineController extends AbstractController
public function index(): Response
{
$period = $this->timelineService->getActiveWindow();
$filterDto = new AssignmentFilterDto();
$filterDto
->setDateFrom($period->first()->toDateTimeImmutable())
->setDateTo($period->last()->toDateTimeImmutable())
->setIncludePast(true)
;
$this->filterHandler->setPeriod($period);
$filterDto = $this->filterHandler->getFilterSettings();
$assignments = $this
->assignmentRepository
@@ -40,6 +38,7 @@ class TimelineController extends AbstractController
return $this->render('administrative/assignment/timeline.html.twig', [
'data' => $timelineData,
'period' => $period,
'filterDto' => $filterDto,
]);
}
}