<?php

declare(strict_types=1);

namespace App\Controller;

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

#[Route(path: '/', name: 'app_index')]
final class Index extends AbstractController
{
    public function __construct(
        private readonly InventoryService $inventoryService,
    ) {}

    public function __invoke(): Response
    {
        $drinkStocks = $this->inventoryService->getAllDrinkTypesWithStockLevels();

        return $this->render('index.html.twig', [
            'drinkStocks' => $drinkStocks,
        ]);
    }
}
