add orderstuff
This commit is contained in:
parent
51fb951b2b
commit
d7a61f6d0e
9 changed files with 209 additions and 10 deletions
|
@ -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,
|
||||
]);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue