tetssssss
This commit is contained in:
parent
6f07d70436
commit
8063e7bec9
28 changed files with 771 additions and 273 deletions
|
@ -4,9 +4,6 @@ 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;
|
||||
|
@ -14,19 +11,8 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||
#[Route(path: '/', name: 'app_index')]
|
||||
final class Index extends AbstractController
|
||||
{
|
||||
|
||||
public function __invoke(): Response
|
||||
{
|
||||
$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,
|
||||
]);
|
||||
return new Response('<h1>Hello World!</h1>');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue