<?php
declare(strict_types=1);
namespace App\Controller\Doc;
use App\Entity\Security\UserInterface;
use App\Service\Doc\DocApiService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\Response;
class DocController extends AbstractController
{
public function __construct(
private DocApiService $docApiService,
private ParameterBagInterface $parameterBag,
) {
}
public function index(): Response
{
return $this->render('Doc/index.html.twig');
}
public function architecturalDrivers(): Response
{
return $this->render('Doc/architectural-drivers.html.twig');
}
public function cartAndOrder(): Response
{
return $this->render('Doc/orders-workflow.html.twig');
}
public function orders(): Response
{
return $this->render('Doc/States/orders.html.twig');
}
public function payment(): Response
{
return $this->render('Doc/States/payment.html.twig');
}
public function multiplePayments(): Response
{
return $this->render('Doc/multiple-payments.html.twig');
}
public function checkout(): Response
{
return $this->render('Doc/States/checkout.html.twig');
}
public function authorization(): Response
{
$tokenDuration = UserInterface::TOKEN_LIFE_TIME / 60;
$refreshTokenDuration = UserInterface::REFRESH_TOKEN_LIFE_TIME / 60;
$rateLimiterLimit = $this->parameterBag->get('rate_limiter_limit');
$rateLimiterInterval = $this->parameterBag->get('rate_limiter_interval');
return $this->render('Doc/authorization.html.twig', compact('tokenDuration', 'refreshTokenDuration', 'rateLimiterLimit', 'rateLimiterInterval'));
}
public function access(?string $section): Response
{
$apis = $this->docApiService->getApis($section);
return $this->render('Doc/access.html.twig', compact('apis', 'section'));
}
public function error(?string $section): Response
{
$apis = $this->docApiService->getApis($section);
return $this->render('Doc/error.html.twig', compact('apis', 'section'));
}
}