<?php

namespace App\EventLog\Framework\Controller;

use App\Base\Service\Broadcaster;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

final class EventLogController extends AbstractController
{
    public function __construct(
        private readonly Broadcaster $broadcaster,
    ) {}

    #[Route('/alert', name: 'app_alert')]
    public function index(): Response
    {
        $this->broadcaster->alert(
            'Added to queue',
            'This is a testy test!'
        );

        return $this->json([
            'Success' => 'Published'
        ]);
    }
}
