fix: filter selectable services by participant's age

This commit is contained in:
Björn Fromme
2025-09-10 15:25:30 +02:00
parent 7b25fbf28b
commit 297becf7a0
5 changed files with 59 additions and 5 deletions
+6
View File
@@ -79,4 +79,10 @@ class Service
#[Groups(['api:single', 'api:list'])]
public ?string $direction = null;
#[Groups(['api:single', 'api:list'])]
public ?int $ageFrom = null;
#[Groups(['api:single', 'api:list'])]
public ?int $ageTo = null;
}
+2
View File
@@ -203,6 +203,8 @@ class TravelLoader extends AbstractLoader
$service->price = $this
->stringToFloat($this->getStringOrNullValue($serviceNode->filterXPath('//preis')));
$service->status = $this->getStringOrNullValue($serviceNode->filterXPath('//status'));
$service->ageFrom = $this->getIntOrNullValue($serviceNode->filterXPath('//altervon'));
$service->ageTo = $this->getIntOrNullValue($serviceNode->filterXPath('//alterbis'));
$additionalServices[$serviceId] = $service;
});
@@ -34,6 +34,9 @@ class ServicesParser extends AbstractParser
$service->direction = $node->attr('richtung');
}
$service->ageFrom = $this->getIntOrNullValue($node->filterXPath('//altervon'));
$service->ageTo = $this->getIntOrNullValue($node->filterXPath('//alterbis'));
$services[$service->id] = $service;
});