wip: improved booking summary
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user