clickUpClient->isConfigured()) { $this->logger->warning('ClickUp is not configured, skipping task creation', [ 'bookingId' => $message->bookingId, ]); return; } $booking = $this->bookingRepository->find($message->bookingId); if (null === $booking) { // The booking is gone — a retry cannot bring it back. $this->logger->warning('Accommodation booking not found, skipping ClickUp task creation', [ 'bookingId' => $message->bookingId, ]); return; } $hotelCode = $booking->getAccommodation()?->getCalendarCode(); $dateFrom = $booking->getDateFrom(); $contactName = trim(trim((string) $booking->getFirstName()).' '.trim((string) $booking->getLastName())); if (null === $hotelCode || '' === $hotelCode || null === $dateFrom || '' === $contactName) { // A task named " 2026-08-20 " helps nobody, and no amount of retrying fills the gaps. $this->logger->warning('Accommodation booking lacks the data for a ClickUp task name, skipping', [ 'bookingId' => $message->bookingId, ]); return; } $name = sprintf('%s %s %s', $hotelCode, $dateFrom->format('Y-m-d'), $contactName); $taskId = $this->clickUpClient->createTaskFromTemplate($name); try { $this->clickUpClient->updateTaskStatus($taskId, self::TASK_STATUS); } catch (ClickUpException $e) { // Deliberately swallowed: letting this bubble would retry the whole handler and create // a second task in ClickUp. A task with the wrong status can be fixed by hand, a // duplicate task cannot be un-created. $this->logger->error('ClickUp task created but status update failed', [ 'bookingId' => $message->bookingId, 'taskId' => $taskId, 'status' => self::TASK_STATUS, 'error' => $e->getMessage(), ]); return; } $this->logger->info('Created ClickUp task for accommodation booking', [ 'bookingId' => $message->bookingId, 'taskId' => $taskId, ]); } }