feat: read BusProNet base data from the MyE&P API
This commit is contained in:
1 parent
1505f9b50b
commit
2e9328fc51
37 files changed
+2302
-148
No files matched your search
@@ -61,6 +61,22 @@ abstract class AbstractFilterHandler
|
||||
|
||||
abstract protected function saveFilterSettings(AbstractFilterDto $filterDto): void;
|
||||
|
||||
/**
|
||||
* Country filters used to be stored as the raw BusProNet abbreviations, which the
|
||||
* destination table has since moved off. A session written before that switch would
|
||||
* otherwise keep filtering for a value no destination carries any more.
|
||||
*/
|
||||
protected function toIsoCountry(?string $country): ?string
|
||||
{
|
||||
return match ($country) {
|
||||
'a' => 'at',
|
||||
'd' => 'de',
|
||||
'f' => 'fr',
|
||||
'i' => 'it',
|
||||
default => $country,
|
||||
};
|
||||
}
|
||||
|
||||
protected function getSession(): SessionInterface
|
||||
{
|
||||
return $this->requestStack->getSession();
|
||||
|
||||
@@ -49,7 +49,7 @@ class ApplicationFilterHandler extends AbstractFilterHandler
|
||||
$filterDto->setIncludePast((bool) $data['include_past']);
|
||||
}
|
||||
if (isset($data['country'])) {
|
||||
$filterDto->setCountry($data['country']);
|
||||
$filterDto->setCountry($this->toIsoCountry($data['country']));
|
||||
}
|
||||
if (isset($data['teamer_name'])) {
|
||||
$filterDto->setTeamerName($data['teamer_name']);
|
||||
|
||||
@@ -49,7 +49,7 @@ class AssignmentFilterHandler extends AbstractFilterHandler
|
||||
$filterDto->setIncludePast((bool) $data['include_past']);
|
||||
}
|
||||
if (isset($data['country'])) {
|
||||
$filterDto->setCountry($data['country']);
|
||||
$filterDto->setCountry($this->toIsoCountry($data['country']));
|
||||
}
|
||||
if (isset($data['teamer_name'])) {
|
||||
$filterDto->setTeamerName($data['teamer_name']);
|
||||
|
||||
Reference in new issue
Block a user