wip: refactor

This commit is contained in:
Björn Fromme
2025-07-24 10:03:02 +02:00
parent 955dbd2f05
commit 64d51c01b2
3 changed files with 93 additions and 3 deletions
+22 -2
View File
@@ -5,7 +5,7 @@ namespace App\Form\Model;
use App\BusProNet\Model\Travel;
use Symfony\Component\Validator\Constraints as Assert;
class BookingCreateDto
class BookingCreateDto implements BookingDtoInterface
{
public int $currentStep = 1;
@@ -21,7 +21,7 @@ class BookingCreateDto
#[Assert\Valid]
public array $participants = [];
public function __construct(public Travel $travelData, public int $hotelId)
public function __construct(public Travel $travel, public int $hotelId)
{
}
@@ -34,4 +34,24 @@ class BookingCreateDto
return 0 < $roomSelection->quantity;
});
}
public function getParticipants(): array
{
return $this->participants;
}
public function getTravel(): Travel
{
return $this->travel;
}
public function hasParticipant(int $index): bool
{
return isset($this->participants[$index]);
}
public function getParticipant(int $index): ?ParticipantDto
{
return $this->participants[$index] ?? null;
}
}