feat: all-season assignments

This commit is contained in:
Björn Fromme authored and Björn Fromme committed 2026-09-26 12:13:16 +02:00
1 parent 675cec1b69
commit cf876ed224
119 files changed
+6194 -294

No files matched your search

+35 -1
View File
@@ -4,8 +4,10 @@ namespace App\Twig;
use App\BusProNet\DataProvider\CountryDataProvider;
use App\BusProNet\DataProvider\PickupDataProvider;
use App\Entity\SeasonAssignment;
use App\Entity\Teamer;
use App\Entity\Upload;
use App\Service\Season\SeasonAssignmentLabeler;
use App\Service\Teamer\PickupResolver;
use Carbon\CarbonImmutable;
use Symfony\Component\HttpFoundation\RequestStack;
@@ -23,11 +25,43 @@ class AppRuntime implements RuntimeExtensionInterface
private readonly CountryDataProvider $countries,
private readonly PickupDataProvider $pickups,
private readonly PickupResolver $pickupResolver,
private readonly SeasonAssignmentLabeler $seasonAssignmentLabeler,
private readonly string $environment,
) {
}
public function teamerStatusLabel(Teamer $teamer): string
public function seasonAssignmentLabel(SeasonAssignment $seasonAssignment): string
{
return $this->seasonAssignmentLabeler->label($seasonAssignment);
}
/**
* The house name for a stored hotel code. Only the code is stored, so every template that
* shows a house resolves it here rather than freezing a name into the record.
*/
public function houseLabel(?string $hotelCode): string
{
return $this->seasonAssignmentLabeler->houseLabel($hotelCode);
}
/**
* All-season is a flag on top of the status, not a status of its own - a teamer can be a
* Bestandsteamer:in and an all-season teamer at once. The general Teamübersicht is the only
* place that overlap is not otherwise visible, so the marker is appended there; the
* dedicated Saisonteamer list passes false, where repeating it on every row says nothing.
*/
public function teamerStatusLabel(Teamer $teamer, bool $includeAllSeason = true): string
{
$label = $this->baseTeamerStatusLabel($teamer);
if (true === $includeAllSeason && true === $teamer->isAllSeason()) {
return sprintf('%s · Saison', $label);
}
return $label;
}
private function baseTeamerStatusLabel(Teamer $teamer): string
{
$labelItems = [];
$user = $teamer->getUser();