add orderstuff

This commit is contained in:
lubiana 2025-06-14 22:43:27 +02:00
parent 51fb951b2b
commit d7a61f6d0e
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
9 changed files with 209 additions and 10 deletions

View file

@ -6,6 +6,7 @@ namespace App\Controller;
use App\Repository\DrinkTypeRepository;
use App\Service\DrinkType\FilterLowStockDrinks;
use App\Service\OrderService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@ -15,13 +16,16 @@ final class Index extends AbstractController
{
public function __invoke(
DrinkTypeRepository $drinkTypeRepository,
FilterLowStockDrinks $filterLowStockDrinks
FilterLowStockDrinks $filterLowStockDrinks,
OrderService $orderService,
): Response {
$wanted = $drinkTypeRepository->findWanted();
$lowStock = $filterLowStockDrinks($wanted);
$orders = $orderService->getActiveOrders();
return $this->render('index.html.twig', [
'drinkTypes' => $lowStock,
'lowStock' => $lowStock,
'orders' => $orders,
]);
}