wip: booking process, refactor participant room assignment logic

This commit is contained in:
Björn Fromme
2025-07-22 08:52:13 +02:00
parent b3c633dccb
commit 2f5b855bae
16 changed files with 216 additions and 94 deletions
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace App\Form\Service;
use App\Form\ChoiceLoader\ParticipantRoomChoiceLoader;
use App\Form\DataAdapters\ParticipantDataAdapter;
use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface;
/**
* Factory service for creating ParticipantRoomChoiceLoader instances.
*
* This service provides a clean way to create choice loaders with proper
* dependency injection instead of manually instantiating factories in form types.
*/
class ParticipantRoomChoiceLoaderFactory
{
public function __construct(
private readonly ChoiceListFactoryInterface $choiceListFactory,
) {
}
/**
* Creates a ParticipantRoomChoiceLoader for the given participant and room data.
*/
public function createChoiceLoader(
ParticipantDataAdapter $adapter,
array $selectedRooms,
int $participantIndex,
): ParticipantRoomChoiceLoader {
return new ParticipantRoomChoiceLoader(
$this->choiceListFactory,
$adapter,
$selectedRooms,
$participantIndex
);
}
}