feat: pending roles from crm to be confirmed by superadmins

This commit is contained in:
Björn Fromme committed 2026-08-10 12:26:21 +02:00
1 parent 681734533f
commit b01c2e84c7
26 files changed
+907 -150

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
namespace App\Config;
/**
* The houses the application works with, as configured by the "houses" parameter.
*
* Every house is identified by its hotel code and its name. Both are used to match
* destinations, but against different columns: the name matches destination.hotel
* (substring), the code matches destination.hotelCode (prefix or suffix, see
* App\Entity\User::hasHotelCodeMatch()). They therefore do not necessarily select the
* same destinations, which is why both are kept.
*/
class HouseCatalog
{
/**
* @param array<string, string> $houses hotel code => name
*/
public function __construct(private readonly array $houses)
{
}
/**
* Choices for filtering destinations by house name: label => name.
*
* @return array<string, string>
*/
public function getNameChoices(): array
{
$names = array_values($this->houses);
sort($names);
return array_combine($names, $names);
}
/**
* Choices for assigning hotel codes to a user: label => code.
*
* @return array<string, string>
*/
public function getCodeChoices(): array
{
$codes = $this->houses;
asort($codes);
return array_flip($codes);
}
public function getName(string $code): ?string
{
return $this->houses[$code] ?? null;
}
}