wip: improved booking summary

This commit is contained in:
Björn Fromme
2026-03-16 11:59:09 +01:00
parent 727ee9b014
commit 65a33922cf
11 changed files with 168 additions and 90 deletions
+16
View File
@@ -17,6 +17,9 @@ use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
*/
class Room
{
public const SELECTION_TYPE_BY_PAX = 'by_pax';
public const SELECTION_TYPE_BY_ROOM = 'by_room';
#[Groups(['api:list', 'api:single'])]
public ?int $id = null;
@@ -72,4 +75,17 @@ class Room
#[Groups(['booking'])]
public array $individualPrice = [];
/**
* Determines the selection type of the room based on its label.
*
* @return string Either self::SELECTION_TYPE_BY_PAX or self::SELECTION_TYPE_BY_ROOM
*/
public function getSelectionType(): string
{
if (1 === preg_match('/bett/i', $this->label)) {
return self::SELECTION_TYPE_BY_PAX;
}
return self::SELECTION_TYPE_BY_ROOM;
}
}