feat: create ClickUp task after confirming accommodation booking

This commit is contained in:
Björn Fromme
2026-08-20 17:56:29 +02:00
parent 0a1683667f
commit 7c5f6dd5ef
18 changed files with 535 additions and 48 deletions
@@ -6,11 +6,13 @@ namespace App\Controller\Admin\AccommodationBooking;
use App\Entity\Groups\AccommodationBooking;
use App\Htmx\HxRedirectResponse;
use App\Message\CreateClickUpBookingTaskMessage;
use App\Service\AccommodationBookingService;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
@@ -19,6 +21,7 @@ class ConfirmController extends AbstractController
{
public function __construct(
private readonly AccommodationBookingService $bookingService,
private readonly MessageBusInterface $messageBus,
private readonly LoggerInterface $logger,
) {
}
@@ -53,6 +56,9 @@ class ConfirmController extends AbstractController
'id' => $booking->getId(),
]);
// Creating the ClickUp task takes seconds, so it must not hang off this request.
$this->messageBus->dispatch(new CreateClickUpBookingTaskMessage((int) $booking->getId()));
return new HxRedirectResponse($this->generateUrl('app_admin_accommodationbooking_show', ['id' => $booking->getId()]));
}