testitest

This commit is contained in:
lubiana 2025-06-08 21:22:26 +02:00
parent 43ca79f650
commit 66c4c1fe4f
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
30 changed files with 4443 additions and 184 deletions

View file

@ -4,7 +4,9 @@ declare(strict_types=1);
namespace App\Controller;
use App\Enum\StockState;
use App\Service\InventoryService;
use App\ValueObject\DrinkStock;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@ -20,8 +22,14 @@ final class Index extends AbstractController
{
$drinkStocks = $this->inventoryService->getAllDrinkTypesWithStockLevels();
$low = array_filter(
$drinkStocks,
fn (DrinkStock $stock): bool => $stock->stock === StockState::LOW || $stock->stock === StockState::CRITICAL,
);
return $this->render('index.html.twig', [
'drinkStocks' => $drinkStocks,
'low' => $low
]);
}
}