<?php

namespace App\Controller;

use App\Dto\Contact\ContactType;
use App\Dto\Contact\DtoContact;
use App\Entity\Account;
use App\Entity\AccountResetPasswordRequest;
use App\Form\RequestPasswordConfirmType;
use App\Form\RequestPasswordRequestType;
use App\Repository\Ag\MainRepository;
use App\Service\Mailer\Mailer;
use App\Service\ResetPassword\Event\ResetPasswordConfirmEvent;
use App\Service\ResetPassword\Event\ResetPasswordEvent;
use Doctrine\ORM\EntityManagerInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Twig\Environment;

class DocumentController extends AbstractController
{

    #[Route(path: '/documents', name: 'app_doc', options: ['sitemap' => false], methods: ['GET','POST'])]
    public function index(MainRepository $mainRepository): Response
    {
        return $this->render('doc.twig',[
            'ag_ordinaire' => $mainRepository->findBy(['isSigned'=>true,'type'=>'Ordinaire'],['agDateAt'=>'DESC']),
            'ag_extraordinaire' => $mainRepository->findBy(['isSigned'=>true,'type'=>'Extraordinaire'],['agDateAt'=>'DESC']),
        ]);
    }
}
