feat: prevent selection of baby rooms without regular rooms
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Validator\Constraints;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
#[\Attribute]
|
||||
class RoomSelection extends Constraint
|
||||
{
|
||||
public const BABY_ROOM_CODE = 'Baby';
|
||||
|
||||
public string $noRoomSelectedMessage = 'Bitte mindestens ein Zimmer/Bett auswählen';
|
||||
public string $onlyBabyRoomsMessage = 'Baby-Zimmer können nur in Kombination mit regulären Zimmern gebucht werden.';
|
||||
|
||||
public function getTargets(): array|string
|
||||
{
|
||||
return static::CLASS_CONSTRAINT;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user