feat: feedback statistics

addresses #869bgtz2d
This commit is contained in:
Björn Fromme
2025-12-23 14:54:27 +01:00
parent 2fb4fd750b
commit cdfd172a1e
16 changed files with 745 additions and 4 deletions
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace App\Service\Common;
use App\Model\AbstractFilterDto;
use App\Model\FeedbackStatisticsFilterDto;
class FeedbackStatisticsFilterHandler extends AbstractFilterHandler
{
protected string $namespace = 'filter:feedback_statistics';
protected string $modelClass = FeedbackStatisticsFilterDto::class;
public function getFilterSettings(): FeedbackStatisticsFilterDto
{
$filterDto = new $this->modelClass();
if (null === $data = $this->getSession()->get($this->namespace)) {
return $filterDto;
}
if (isset($data['date_from'])) {
$filterDto->setDateFrom($data['date_from']);
}
if (isset($data['date_to'])) {
$filterDto->setDateTo($data['date_to']);
}
return $filterDto;
}
protected function saveFilterSettings(AbstractFilterDto $filterDto): void
{
/* @var FeedbackStatisticsFilterDto $filterDto */
$this->getSession()->set($this->namespace, [
'date_from' => $filterDto->getDateFrom(),
'date_to' => $filterDto->getDateTo(),
]);
}
}