feat: refactoring and cleanup

This commit is contained in:
Björn Fromme
2026-03-16 11:59:12 +01:00
parent 230c53875f
commit 8c8aae9a1e
41 changed files with 2591 additions and 2233 deletions
+19
View File
@@ -606,6 +606,25 @@ class TravelDataService
]);
}
/**
* Enriches travel data with fresh availability information from the API.
*
* Fetches cached availability data and patches it onto the travel object.
* Used by controllers to ensure availability data is up-to-date before
* rendering forms or processing submissions.
*
* @param Travel $travel The travel object to enrich
* @param bool $cached Whether to use cached availability data (default: true)
*/
public function enrichWithFreshAvailabilities(Travel $travel, bool $cached = true): void
{
$availabilities = $this->getAvailabilityData($travel->id, $cached);
if (null !== $availabilities) {
$this->patchAvailabilities($travel, $availabilities);
}
}
/**
* Enrich travel data with additional information.
*