diff --git a/assets/styles/app.css b/assets/styles/app.css index 05bf333709077af4d146c08f939bedb70747a702..6d727b5b5cffb63d91195791bfb8e14ab9cbce3b 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -32,6 +32,7 @@ button { } .creation_annonce { + color: white; width: 200px; background-color: rgba(0, 145, 24, 0.952); border-radius: 5px; @@ -42,6 +43,7 @@ button { } .btn-connexion { + color: white; width: 500px; background-color: rgba(0, 145, 24, 0.952); border-radius: 5px; @@ -63,6 +65,7 @@ button { } .btn-suppression { + color: white; width: 500px; background-color: red; border-radius: 5px; @@ -102,6 +105,11 @@ button { padding: 10px; } +.container-connexion2 ul { + list-style-type: none; + padding: 0; +} + .container-connexion3 { position: relative; display: flex; @@ -201,6 +209,29 @@ button { align-self: flex-start; } +.litige { + display: flex; + align-items: center; + justify-content: center; +} + +.litige_desc { + display: inline-block; + + padding-bottom: 10px; +} + +.litige_desc h3 { + margin-top: 3px; + margin-bottom: 5px; +} + +.litige_desc p { + margin-top: 0; + margin-bottom: 3px; + display: inline-block; +} + .rechercheForm { margin: 10px; position: relative; @@ -225,6 +256,7 @@ button { } .btn_recherche { + color: white; width: 100px; background-color: rgba(0, 145, 24, 0.952); border-radius: 5px; @@ -243,4 +275,58 @@ button { .prix { width: 51px; +} + +.table_notif { + align-self: center; + width: 100%; + margin: 10px; +} + +.table_notif tr td { + text-align: center; +} + +.choix-abonnement { + display: flex; + justify-content: space-around; + padding: 10px; +} + +.type-abonnement { + width: 235px; + border-radius: 5px; + border-color: rgba(0, 145, 24, 0.952); + box-shadow: 0 2px 4px rgba(0, 0, 0, .5), 0 5px 10px rgba(0, 0, 0, .5); + padding: 10px; + cursor: pointer; +} + +.type-abonnement ul li { + color: black; +} + +.type-abonnement.selected ul li { + color: white; +} + +.type-abonnement.selected { + background-color: green; + color: white; +} + +.btn-like { + background-color: #ffffff; + border: 0px #ccc; + padding: 5px 10px; + cursor: pointer; + font-size: 30px; +} + +.aime { + color: red; +} + +.non_aime { + color: lightgray; } \ No newline at end of file diff --git a/avancement_2024.xlsx b/avancement_2024.xlsx index 1e0920792216e84574757657ea83bef2fe534d10..faadd126bea2abde4fbb7209f9a69b2c6a4fb41f 100644 Binary files a/avancement_2024.xlsx and b/avancement_2024.xlsx differ diff --git a/config/routes.yaml b/config/routes.yaml index 26c03797c543ab595cee8ebff23384a15306f6ba..8769cc57020d7513d69f6011c96aa4f94cf7f731 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -6,6 +6,9 @@ controllers: annonce_detail: path: /annonce/{id} controller: App\Controller\AnnonceDetailController::detail +litige_detail: + path: /litige/{id} + controller: App\Controller\LitigeDetailController::detail app_reserver_annonce: path: /annonce/{id} controller: App\Controller\AnnonceDetailController::reserverprestation diff --git a/public/img/notifs.png b/public/img/notifs.png new file mode 100644 index 0000000000000000000000000000000000000000..cf348b2cb15f804d25abef737426f75342482e74 Binary files /dev/null and b/public/img/notifs.png differ diff --git a/src/Controller/AnnonceDetailController.php b/src/Controller/AnnonceDetailController.php index 0a72ec29bbdab4fe61e97bede1ace146261bc214..b3a3ac1e2a07fecf2961a6003a8f3145848ce3d3 100644 --- a/src/Controller/AnnonceDetailController.php +++ b/src/Controller/AnnonceDetailController.php @@ -2,6 +2,8 @@ namespace App\Controller; +use App\Entity\Notification; +use App\Entity\Personne; use App\Entity\Prestations; use App\Entity\Pret; use App\Entity\Services; @@ -10,13 +12,13 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\HttpFoundation\Request; +use DateTime; class AnnonceDetailController extends AbstractController { private $doctrine; - public function __construct(ManagerRegistry $doctrine) - { + public function __construct(ManagerRegistry $doctrine) { $this->doctrine = $doctrine; } @@ -24,17 +26,15 @@ class AnnonceDetailController extends AbstractController { $entityManager = $this->doctrine->getManager(); $annonce = $entityManager->getRepository(Prestations::class)->find($id); + $nbAimees = $annonce->getUtilisateursAimant()->count(); $prets = $entityManager->getRepository(Pret::class)->findAll(); $services = $entityManager->getRepository(Services::class)->findAll(); $user = $this->getUser(); - if (!$annonce) { - throw $this->createNotFoundException('Annonce non trouvée'); - } - return [ 'entityManager' => $entityManager, 'annonce' => $annonce, + 'nbAimees' => $nbAimees, 'prets' => $prets, 'services' => $services, 'user' => $user, @@ -47,17 +47,14 @@ class AnnonceDetailController extends AbstractController public function detail($id) { $data = $this->getCommonData($id); + $prest = $data['annonce']; + if ($prest) { + $prest->setNbVues($prest->getNbVues() + 1); + $data['entityManager']->flush(); + } return $this->render('annonce_detail/annonce.html.twig', $data); } - #[Route('/annonce/detail', name: 'app_annonce_detail')] - public function index(): Response - { - return $this->render('annonce_detail/annonce.html.twig', [ - 'controller_name' => 'AnnonceDetailController', - ]); - } - #[Route('/deleteTransaction/{prestationId}', name: 'app_delete_transaction')] public function deleteTransaction($prestationId): Response { @@ -68,6 +65,24 @@ class AnnonceDetailController extends AbstractController return $this->redirectToRoute('app_home_page'); } + if ($prestation->getIdClient() != null) { + $notification = new Notification(); + $notification->setDescription("L'utilisateur " . $this->getUser()->getLogin() . " a supprimé l'annonce " . $prestation->getTitre() . " que vous aviez réservé."); + $notification->setType("Suppression annonce réservée"); + $notification->setDate(new DateTime()); + $notification->setUserId($entityManager->getRepository(Personne::class)->find($prestation->getIdClient())); + $this->doctrine->getManager()->persist($notification); + } + + foreach ($prestation->getUtilisateursAimant() as $u) { + $notification = new Notification(); + $notification->setDescription("L'utilisateur " . $this->getUser()->getLogin() . " a supprimé l'annonce " . $prestation->getTitre() . " que vous aviez aimé."); + $notification->setType("Suppression annonce aimée"); + $notification->setDate(new DateTime()); + $notification->setUserId($u); + $this->doctrine->getManager()->persist($notification); + } + $entityManager->remove($prestation); $entityManager->flush(); @@ -85,15 +100,64 @@ class AnnonceDetailController extends AbstractController if ($interet) { return $this->redirectToRoute('app_home_page'); } else { - $data['annonce']->setIdClient(null); + $entityManager = $this->doctrine->getManager(); + + $prestation = $data['annonce']; + $notification = new Notification(); + $notification->setDescription("Annulation de la réservation de l'annonce " . $prestation->getTitre() . " par " . $this->getUser()->getLogin()); + $notification->setType("Annulation réservation annonce"); + $notification->setDate(new DateTime()); + $notification->setUserId($prestation->getProprietaire()); + $this->doctrine->getManager()->persist($notification); + $prestation->setIdClient(null); + + $litiges = $prestation->getLitiges(); + + foreach($litiges as $l){ + $entityManager->remove($l); + } } } else { if ($interet) { $data['annonce']->setIdClient($data['user']); + $notification = new Notification(); + $notification->setDescription("Réservation de l'annonce " . $data['annonce']->getTitre() . " par " . $this->getUser()->getLogin()); + $notification->setType("Réservation annonce"); + $notification->setDate(new DateTime()); + $notification->setUserId($data['annonce']->getProprietaire()); + $this->doctrine->getManager()->persist($notification); } } $data['entityManager']->flush(); return $this->redirectToRoute('annonce_detail', ['id' => $id]); } + + #[Route('/aimerPrestation/{id}', name: 'app_aimer_prestation')] + public function aimerPrestation($id): Response + { + $data = $this->getCommonData($id); + $user = $data['user']; + $prestation = $data['annonce']; + + if ($user != null) { + $notification = new Notification(); + $notification->setDescription($user->getLogin(). " a aimé votre annonce " . $prestation->getTitre()); + $notification->setType("Annonce aimée"); + $notification->setDate(new DateTime()); + $notification->setUserId($prestation->getProprietaire()); + $this->doctrine->getManager()->persist($notification); + $prestation->setIdClient(null); + } else return $this->redirectToRoute('app_login'); + + if ($user->getPrestationsAimees()->contains($prestation)) { + $user->removePrestationsAimee($prestation); + $prestation->removeUtilisateursAimant($user); + } else { + $user->addPrestationsAimee($prestation); + $prestation->addUtilisateursAimant($user); + } + $data['entityManager']->flush(); + return $this->redirectToRoute('annonce_detail', ['id' => $id]); + } } diff --git a/src/Controller/LitigeDetailController.php b/src/Controller/LitigeDetailController.php new file mode 100644 index 0000000000000000000000000000000000000000..866ec62ad8a87841d531fad4cc6df2222037276a --- /dev/null +++ b/src/Controller/LitigeDetailController.php @@ -0,0 +1,117 @@ +<?php + +namespace App\Controller; + +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; +use Doctrine\Persistence\ManagerRegistry; +use App\Entity\Litige; +use Symfony\Component\HttpFoundation\Request; + +class LitigeDetailController extends AbstractController +{ + private $doctrine; + + public function __construct(ManagerRegistry $doctrine) + { + $this->doctrine = $doctrine; + } + + private function getCommonData($id) + { + $entityManager = $this->doctrine->getManager(); + $litige = $entityManager->getRepository(Litige::class)->find($id); + + if (!$litige) { + throw $this->createNotFoundException('Annonce non trouvée'); + } + + return [ + 'entityManager' => $entityManager, + 'litige' => $litige, + ]; + } + + /** + * @Route("/litige/{id}", name="litige_detail") + */ + public function detail($id) + { + $data = $this->getCommonData($id); + return $this->render('litige_detail/litige_detail.html.twig', $data); + } + + #[Route('/litige/detail', name: 'app_litige_detail')] + public function index(): Response + { + return $this->render('litige_detail/litige_detail.html.twig', [ + 'controller_name' => 'LitigeDetailController', + ]); + } + + #[Route('/deleteLitige/{id}', name: 'app_litige_suppr')] + public function deleteLitige(Request $request,$id):Response{ + $entityManager = $this->doctrine->getManager(); + $litige = $entityManager->getRepository(Litige::class)->find($id); + + $prestation = $litige->getIdPrestation(); + + if (!$prestation) { + return $this->redirectToRoute('app_home_page'); + } + + $entityManager->remove($prestation); + $entityManager->flush(); + + return $this->redirectToRoute('app_home_page'); + } + + #[Route('/deleteUser/{id}', name: 'app_litige_user_suppr')] + public function deleteOtherUser(Request $request,$id):Response{ + $entityManager = $this->doctrine->getManager(); + $litige = $entityManager->getRepository(Litige::class)->find($id); + + $prestation = $litige->getIdPrestation(); + $utilisateurSource = $litige->getIdUtilisateur(); + + $utilisateurSuppr; + + if ($prestation->getIdClient()->getId() == $utilisateurSource->getId()){ + $utilisateurSuppr = $prestation->getFournisseur(); + }else{ + $utilisateurSuppr = $prestation->getIdClient(); + } + + $fournisseurs = $utilisateurSuppr->getPrestationsFournisseur(); + foreach($fournisseurs as $f){ + $f->setFournisseur(null); + } + + $clients = $utilisateurSuppr->getPrestationsClient(); + foreach($clients as $c){ + $c->setIdClient(null); + } + + $litiges = $utilisateurSuppr->getLitiges(); + foreach($litiges as $l){ + $entityManager->remove($l); + } + + $entityManager->remove($utilisateurSuppr); + $entityManager->flush(); + + return $this->redirectToRoute('app_home_page'); + } + + #[Route('/cancelLitige/{id}', name: 'app_litige_cancel')] + public function cancelLitige(Request $request,$id):Response{ + $entityManager = $this->doctrine->getManager(); + $litige = $entityManager->getRepository(Litige::class)->find($id); + + $entityManager->remove($litige); + $entityManager->flush(); + + return $this->redirectToRoute('app_home_page'); + } +} diff --git a/src/Controller/ModifUserController.php b/src/Controller/ModifUserController.php index f14b31e9beb5a1751854defca26e2b2f3bbd83ee..af8fbfa6c76c87d2140d40777d0b5e9bb9ddbf88 100644 --- a/src/Controller/ModifUserController.php +++ b/src/Controller/ModifUserController.php @@ -211,4 +211,14 @@ class ModifUserController extends AbstractController 'prestations' => $res, ]); } + + #[Route('/userCoord', name: 'app_user_coord')] + public function userCoord(Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response + { + $user = $this->getUser(); + + return $this->render('security/userCoord.html.twig', [ + 'user' => $user, + ]); + } } diff --git a/src/Controller/NotificationsController.php b/src/Controller/NotificationsController.php new file mode 100644 index 0000000000000000000000000000000000000000..5c25cf70b2759effd41a006038563ae8564d84d6 --- /dev/null +++ b/src/Controller/NotificationsController.php @@ -0,0 +1,29 @@ +<?php + +namespace App\Controller; + +use App\Entity\Notification; +use Doctrine\Persistence\ManagerRegistry; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; + +class NotificationsController extends AbstractController +{ + private $doctrine; + + public function __construct(ManagerRegistry $doctrine) + { + $this->doctrine = $doctrine; + } + + #[Route('/notifications', name: 'app_notifications')] + public function index(): Response + { + $entityManager = $this->doctrine->getManager(); + $notifs = $entityManager->getRepository(Notification::class)->findBy(['user_id' => $this->getUser()]);; + return $this->render('notifications/index.html.twig', [ + 'notifs' => $notifs + ]); + } +} diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index a916682f441011093c0998d4098079104e448ffd..944bca6cd90802b00541d04fbc62d83fd2098797 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -73,8 +73,14 @@ class RegistrationController extends AbstractController $user->setSommeil(false); $user->setNbFlorains(1000); - $user->setStatusAbonnement(1); $user->setStatusActivites(0); + + $abonnement = $form->get('abonnement')->getData(); + if ($abonnement == 20) { + $user->setStatusAbonnement(0); + } elseif ($abonnement == 30) { + $user->setStatusAbonnement(1); + } $entityManager->persist($user); $entityManager->flush(); diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index 1c4be765f1c8f94e69c588a7edcb358785bac1ad..dc0da6f7646ff5a18afe7aec795e84d4b6fd319f 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -64,6 +64,21 @@ class SecurityController extends AbstractController return $this->redirectToRoute('app_login'); } + $fournisseurs = $user->getPrestationsFournisseur(); + foreach($fournisseurs as $f){ + $f->setFournisseur(null); + } + + $clients = $user->getPrestationsClient(); + foreach($clients as $c){ + $c->setIdClient(null); + } + + $litiges = $user->getLitiges(); + foreach($litiges as $l){ + $entityManager->remove($l); + } + $entityManager->remove($user); $entityManager->flush(); diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php new file mode 100644 index 0000000000000000000000000000000000000000..c020925661240d31ede1dd2c2ce70d76f9484fea --- /dev/null +++ b/src/DataFixtures/AppFixtures.php @@ -0,0 +1,37 @@ +<?php + +namespace App\DataFixtures; + +use Doctrine\Bundle\FixturesBundle\Fixture; +use Doctrine\Persistence\ObjectManager; +use App\Entity\Administrateur; +use App\Entity\Utilisateur; +use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; + +class AppFixtures extends Fixture +{ + + public function __construct(private PasswordHasherFactoryInterface $passwordHasherFactory,) { + } + + public function load(ObjectManager $manager): void + { + // $product = new Product(); + // $manager->persist($product); + + $admin = new Administrateur(); + $admin->setRoles(['ROLE_ADMIN']); + $admin->setLogin('admin'); + $admin->setPassword($this->passwordHasherFactory->getPasswordHasher(Administrateur::class)->hash('admin')); + $manager->persist($admin); + + $util = new Utilisateur(); + $util->setLogin('test'); + $util->setRoles(['ROLE_USER']); + $util->setPassword($this->passwordHasherFactory->getPasswordHasher(Utilisateur::class)->hash('test')); + $util->setSommeil(false); + $manager->persist($util); + + $manager->flush(); + } +} diff --git a/src/Entity/Notification.php b/src/Entity/Notification.php new file mode 100644 index 0000000000000000000000000000000000000000..16b761111415ac4b3fe5589b368d89a43a54c99b --- /dev/null +++ b/src/Entity/Notification.php @@ -0,0 +1,82 @@ +<?php + +namespace App\Entity; + +use App\Repository\NotificationRepository; +use Doctrine\DBAL\Types\Types; +use Doctrine\ORM\Mapping as ORM; + +#[ORM\Entity(repositoryClass: NotificationRepository::class)] +class Notification +{ + #[ORM\Id] + #[ORM\GeneratedValue] + #[ORM\Column] + private ?int $id = null; + + #[ORM\ManyToOne(inversedBy: 'notifications')] + #[ORM\JoinColumn(nullable: false)] + private ?Personne $user_id = null; + + #[ORM\Column(length: 255)] + private ?string $description = null; + + #[ORM\Column(type: Types::DATETIME_MUTABLE)] + private ?\DateTimeInterface $date = null; + + #[ORM\Column(length: 50)] + private ?string $type = null; + + public function getId(): ?int + { + return $this->id; + } + + public function getUserId(): ?Personne + { + return $this->user_id; + } + + public function setUserId(?Personne $user_id): static + { + $this->user_id = $user_id; + + return $this; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(string $description): static + { + $this->description = $description; + + return $this; + } + + public function getDate(): ?\DateTimeInterface + { + return $this->date; + } + + public function setDate(\DateTimeInterface $date): static + { + $this->date = $date; + + return $this; + } + + public function getType(): ?string + { + return $this->type; + } + + public function setType(string $type): static + { + $this->type = $type; + + return $this; + } +} diff --git a/src/Entity/Personne.php b/src/Entity/Personne.php index f7d89cd7cf2432a075d2e95dfd2e66cb79cccea0..e95471e1e5ebf8d20e227beefaa15d34350d8dd7 100644 --- a/src/Entity/Personne.php +++ b/src/Entity/Personne.php @@ -3,6 +3,8 @@ namespace App\Entity; use App\Repository\PersonneRepository; +use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -34,6 +36,14 @@ class Personne implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column] protected ?string $password = null; + #[ORM\OneToMany(mappedBy: 'user_id', targetEntity: Notification::class, orphanRemoval: true)] + private Collection $notifications; + + public function __construct() + { + $this->notifications = new ArrayCollection(); + } + public function getId(): ?int { return $this->id; @@ -103,4 +113,34 @@ class Personne implements UserInterface, PasswordAuthenticatedUserInterface // If you store any temporary, sensitive data on the user, clear it here // $this->plainPassword = null; } + + /** + * @return Collection<int, Notification> + */ + public function getNotifications(): Collection + { + return $this->notifications; + } + + public function addNotification(Notification $notification): static + { + if (!$this->notifications->contains($notification)) { + $this->notifications->add($notification); + $notification->setUserId($this); + } + + return $this; + } + + public function removeNotification(Notification $notification): static + { + if ($this->notifications->removeElement($notification)) { + // set the owning side to null (unless already changed) + if ($notification->getUserId() === $this) { + $notification->setUserId(null); + } + } + + return $this; + } } diff --git a/src/Entity/Prestations.php b/src/Entity/Prestations.php index e2e3ba9fb214ce22378ea802fade09fe540cd74f..318721c74f9cbb8845358a48fd48d6753a42517e 100644 --- a/src/Entity/Prestations.php +++ b/src/Entity/Prestations.php @@ -50,9 +50,16 @@ class Prestations #[ORM\OneToMany(mappedBy: 'id_prestation', targetEntity: Litige::class, orphanRemoval: true)] private Collection $litiges; + #[ORM\Column] + private int $nbVues = 0; + + #[ORM\ManyToMany(targetEntity: Utilisateur::class, mappedBy: 'prestations_aimees')] + private Collection $utilisateurs_aimant; + public function __construct() { $this->litiges = new ArrayCollection(); + $this->utilisateurs_aimant = new ArrayCollection(); } public function getId(): ?int @@ -207,5 +214,40 @@ class Prestations } return $this; - } + } + + public function getNbVues(): ?int + { + return $this->nbVues; + } + + public function setNbVues(int $nbVues): static + { + $this->nbVues = $nbVues; + + return $this; + } + + /** + * @return Collection<int, Utilisateur> + */ + public function getUtilisateursAimant(): Collection + { + return $this->utilisateurs_aimant; + } + + public function addUtilisateursAimant(Utilisateur $utilisateursAimant): static + { + if (!$this->utilisateurs_aimant->contains($utilisateursAimant)) + $this->utilisateurs_aimant->add($utilisateursAimant); + + return $this; + } + + public function removeUtilisateursAimant(Utilisateur $utilisateursAimant): static + { + $this->utilisateurs_aimant->removeElement($utilisateursAimant); + + return $this; + } } diff --git a/src/Entity/Utilisateur.php b/src/Entity/Utilisateur.php index ab1131b048feab0d4ef142f140f5796effdd9254..0823522b864223770ee0426ff6f5fff8145952e2 100644 --- a/src/Entity/Utilisateur.php +++ b/src/Entity/Utilisateur.php @@ -72,6 +72,9 @@ class Utilisateur extends Personne #[ORM\Column] private ?bool $sommeil = null; + #[ORM\ManyToMany(targetEntity: Prestations::class, inversedBy: 'utilisateurs_aimant')] + private Collection $prestations_aimees; + public function __construct() { $this->inscriptions = new ArrayCollection(); @@ -80,6 +83,7 @@ class Utilisateur extends Personne $this->prestations_client = new ArrayCollection(); $this->prestations_proprietaire = new ArrayCollection(); $this->litiges = new ArrayCollection(); + $this->prestations_aimees = new ArrayCollection(); } public function getNbFlorains(): ?int @@ -466,4 +470,34 @@ class Utilisateur extends Personne return $this; } + + /** + * @return Collection<int, Prestations> + */ + public function getPrestationsAimees(): Collection + { + return $this->prestations_aimees; + } + + public function addPrestationsAimee(Prestations $prestationsAimee): static + { + if (!$this->prestations_aimees->contains($prestationsAimee)) { + $this->prestations_aimees->add($prestationsAimee); + } + + return $this; + } + + public function removePrestationsAimee(Prestations $prestationsAimee): static + { + $this->prestations_aimees->removeElement($prestationsAimee); + + return $this; + } + + public function aimePrestation(Prestations $prestation): bool + { + if (!$this->prestations_aimees) return false; + return $this->prestations_aimees->contains($prestation); + } } diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index 3625e30c7924730f3938b815a8818fcab189bb0e..f5d4047f244e070fc0b4e8c81ead367c08119d17 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -9,6 +9,7 @@ use Doctrine\Persistence\ManagerRegistry; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\IsTrue; @@ -145,6 +146,15 @@ class RegistrationFormType extends AbstractType ]), ], ]) + ->add('abonnement', HiddenType::class, [ + 'mapped' => false, + 'required' => true, + 'constraints' => [ + new NotBlank([ + 'message' => 'Veuillez choisir un abonnement', + ]), + ], + ]); ; } } diff --git a/src/Repository/NotificationRepository.php b/src/Repository/NotificationRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..985e2d86ad150fa43d062d86d27b17e6a39077ee --- /dev/null +++ b/src/Repository/NotificationRepository.php @@ -0,0 +1,48 @@ +<?php + +namespace App\Repository; + +use App\Entity\Notification; +use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; +use Doctrine\Persistence\ManagerRegistry; + +/** + * @extends ServiceEntityRepository<Notification> + * + * @method Notification|null find($id, $lockMode = null, $lockVersion = null) + * @method Notification|null findOneBy(array $criteria, array $orderBy = null) + * @method Notification[] findAll() + * @method Notification[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NotificationRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Notification::class); + } + +// /** +// * @return Notification[] Returns an array of Notification objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('n.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Notification +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/PrestationsRepository.php b/src/Repository/PrestationsRepository.php index 435712b7a4d2b9f5d1486bac60fdde79126ff6c7..7f556c0753d5283f768b1ee792fa6ca2341b3560 100644 --- a/src/Repository/PrestationsRepository.php +++ b/src/Repository/PrestationsRepository.php @@ -3,6 +3,8 @@ namespace App\Repository; use App\Entity\Prestations; +use App\Entity\Pret; +use App\Entity\Services; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; @@ -73,15 +75,10 @@ class PrestationsRepository extends ServiceEntityRepository } if ($typePrestation) { - //echo 'prest'; if ($typePrestation === 'pret') { - // echo 'pret'; - $queryBuilder->andWhere('p INSTANCE OF :typePrestation') - ->setParameter('typePrestation', \App\Entity\Pret::class); + $queryBuilder->join('App\Entity\Pret', 'pr', 'WITH', 'p.id = pr.id'); } elseif ($typePrestation === 'service') { - //echo 'service'; - $queryBuilder->andWhere('p INSTANCE OF :typePrestation') - ->setParameter('typePrestation', \App\Entity\Services::class); + $queryBuilder->join('App\Entity\Services', 'se', 'WITH', 'p.id = se.id'); } } diff --git a/templates/annonce_detail/annonce.html.twig b/templates/annonce_detail/annonce.html.twig index 5ea2ff82670ee589f7390dd1e5de2292432e0d9e..67f15c20251975d986ee085335ed297d41be9c39 100644 --- a/templates/annonce_detail/annonce.html.twig +++ b/templates/annonce_detail/annonce.html.twig @@ -7,75 +7,101 @@ .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; } .example-wrapper code { background: #F5F5F5; padding: 2px 6px; } </style> -<div class="annonce"> - <div class="annonce_img"> - <h1>{{ annonce.Titre }}</h1> - <img src={{asset('/img/logo.png')}} alt="logo eco-presto" width="50%"/> - {% if app.user.id is defined and (app.user.id == annonce.proprietaire.id or is_granted('ROLE_ADMIN'))%} - <button class="btn-suppression" id="deleteTransactionButton">Supprimer l'annonce</button> +{% if annonce %} + <div class="annonce"> + <div class="annonce_img"> + <h1>{{ annonce.Titre }}</h1> + <img src={{asset('/img/logo.png')}} alt="logo eco-presto" width="50%"/> + {% if app.user.id is defined and (app.user.id == annonce.proprietaire.id or is_granted('ROLE_ADMIN'))%} + <button class="btn-suppression" id="deleteTransactionButton">Supprimer l'annonce</button> - <script> - document.getElementById('deleteTransactionButton').addEventListener('click', function() { - // Afficher une boîte de dialogue de confirmation - var confirmation = confirm('Êtes-vous sûr de vouloir supprimer cette transaction ?'); + <script> + document.getElementById('deleteTransactionButton').addEventListener('click', function() { + // Afficher une boîte de dialogue de confirmation + var confirmation = confirm('Êtes-vous sûr de vouloir supprimer cette transaction ?'); - // Si l'utilisateur confirme, rediriger vers la page de suppression de la transaction - if (confirmation) { - window.location.href = '{{ path('app_delete_transaction', {'prestationId': annonce.id} ) }}'; - } - }); - </script> + // Si l'utilisateur confirme, rediriger vers la page de suppression de la transaction + if (confirmation) { + window.location.href = '{{ path('app_delete_transaction', {'prestationId': annonce.id} ) }}'; + } + }); + </script> - {% elseif app.user.id is defined %} - {% if not is_granted ("ROLE_ADMIN") and not app.user.isSommeil() %} - {% if annonce.IdClient != NULL %} - {% if user.id == annonce.IdClient.Id %} - <a href="{{ path('app_reserver_prestation', {'id': annonce.id, 'interet': false}) }}"><button class="btn-suppression" id="btnAnnuler">Annuler la réservation</button></a> + {% elseif app.user.id is defined %} + {% if not is_granted ("ROLE_ADMIN") and not app.user.isSommeil() %} + {% if annonce.IdClient != NULL %} + {% if user.id == annonce.IdClient.Id %} + <a href="{{ path('app_reserver_prestation', {'id': annonce.id, 'interet': false}) }}"><button class="btn-suppression" id="btnAnnuler">Annuler la réservation</button></a> + {% else %} + <p>Déjà réservé</p> + <a href=""><button class="btn-connexion2" id="btnListeAttente">Se mettre en liste d'attente</button></a> + {% endif %} {% else %} - <p>Déjà réservé</p> - <a href=""><button class="btn-connexion2" id="btnListeAttente">Se mettre en liste d'attente</button></a> + <a href="{{ path('app_reserver_prestation', {'id': annonce.id, 'interet': true}) }}"><button class="btn-connexion" id="btnRepondre">Répondre à l'annonce</button></a> {% endif %} - {% else %} - <a href="{{ path('app_reserver_prestation', {'id': annonce.id, 'interet': true}) }}"><button class="btn-connexion" id="btnRepondre">Répondre à l'annonce</button></a> - {% endif %} - {% endif %} - {% endif %} - - {% if not is_granted('ROLE_ADMIN') and (annonce.fournisseur != NULL) and (annonce.IdClient != NULL) %} - <a href="{{ path('app_litige_creation', {'id': annonce.id}) }}"><button class="btn-suppression" id="btnCreerLitige">Créer un litige</button></a> - {% endif %} - </div> - - <div class="annonce_desc"> - <h3>Description</h3> - {% for pret in prets %} - {% if pret.id == annonce.id %} - <p class="tag_pret" id="tag">Prêt</p> + {% endif %} {% endif %} - {% endfor %} - {% for service in services %} - {% if service.id == annonce.id %} - <p class="tag_service" id="tag">Service</p> + + {% if not is_granted('ROLE_ADMIN') and (annonce.fournisseur != NULL) and (annonce.IdClient != NULL) %} + <a href="{{ path('app_litige_creation', {'id': annonce.id}) }}"><button class="btn-suppression" id="btnCreerLitige">Créer un litige</button></a> {% endif %} - {% endfor %} - <br/> - {{ annonce.DescrPrestation }} <br/> - <hr> - <h3>Prix</h3> - {{ annonce.CoutPrestation }} florains <br/> - <hr> - <h3>Date de validité</h3> - {{ annonce.DateDebut | date('d-m-Y')}} + </div> - {% if is_granted('ROLE_ADMIN') and annonce.litiges|length > 0 %} - <hr> - <h3>Litiges</h3> - {% for litige in annonce.litiges %} - {{litige.idUtilisateur.login}} : {{litige.descrLitige}} <bt> {{litige.getStringStatus}} {{litige.dateLitige|date('d/m/y')}} - <a href="{{ path('app_home_page', {'id': litige.id}) }}"><button class="btn-connexion2" id="btnLitige">Résoudre ce litige</button></a> - <br/> + <div class="annonce_desc"> + {% if user %} + {% if user.id != annonce.proprietaire.id %} + <a href="{{ path('app_aimer_prestation', {'id': annonce.id}) }}"><button class="btn-like"> + {% if user.aimePrestation(annonce) %} + <span class="aime">❤</span> + {% else %} + <span class="non_aime">❤</span> + {% endif %} + </button></a> + {% endif %} + {% else %} + <a href="{{ path('app_aimer_prestation', {'id': annonce.id}) }}"><button class="btn-like"> + <span class="non_aime">❤</span> + </button></a> + {% endif %} + <h3>Description</h3> + {% for pret in prets %} + {% if pret.id == annonce.id %} + <p class="tag_pret" id="tag">Prêt</p> + {% endif %} + {% endfor %} + {% for service in services %} + {% if service.id == annonce.id %} + <p class="tag_service" id="tag">Service</p> + {% endif %} {% endfor %} - {% endif %} + <br/> + {{ annonce.DescrPrestation }} <br/> + <hr> + <h3>Prix</h3> + {{ annonce.CoutPrestation }} florains <br/> + <hr> + <h3>Date de validité</h3> + {{ annonce.DateDebut | date('d-m-Y')}} + <hr> + <h3>Statistiques</h3> + <p>{{ annonce.nbVues }}👁 | {{ nbAimees }} <u>J'aime</u></p> + + {% if is_granted('ROLE_ADMIN') and annonce.litiges|length > 0 %} + <hr> + <h3>Litiges</h3> + {% for litige in annonce.litiges %} + {{litige.idUtilisateur.login}} : {{litige.descrLitige}} <bt> {{litige.getStringStatus}} {{litige.dateLitige|date('d/m/y')}} + <a href="{{ path('litige_detail', {'id': litige.id}) }}"><button class="btn-connexion2" id="btnLitige">Résoudre ce litige</button></a> + <br/> + {% endfor %} + {% endif %} + </div> + </div> +{% else %} + <div class="annonce"> + <div class="annonce_img"> + <h1>Annonce inexistante ou supprimée</h1> + </div> </div> -</div> +{% endif %} {% endblock %} diff --git a/templates/header.html.twig b/templates/header.html.twig index a05ed66f10cdeb153727618af34b4de1cbaefc8f..d9a0afeef7b7ab3d75a7e2ba66a8ca01c8326ca5 100644 --- a/templates/header.html.twig +++ b/templates/header.html.twig @@ -9,7 +9,8 @@ {% endif %} </div> <p>{{ app.user.login }}</p> - <a href="{{ path("app_modif_user")}}"><img src={{asset('/img/bonhomme.png')}} alt="logo profil" width="50px"/></a> + <a href="{{ path("app_notifications")}}"><img src={{asset('/img/notifs.png')}} alt="logo profil" width="35px"/></a> + <a href="{{ path("app_modif_user")}}" ><img src={{asset('/img/bonhomme.png')}} alt="logo profil" width="50px"/></a> {% else %} <div> <a href="{{ path("app_login")}}"><button class="creation_annonce">Publier une annonce</button></a> diff --git a/templates/litige_detail/litige_detail.html.twig b/templates/litige_detail/litige_detail.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..6b1ecc2a343753b79f00c535dd7e44a99549ee51 --- /dev/null +++ b/templates/litige_detail/litige_detail.html.twig @@ -0,0 +1,73 @@ +{% extends 'base.html.twig' %} + +{% block title %}Litige{% endblock %} + +{% block body %} +<style> + .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; } + .example-wrapper code { background: #F5F5F5; padding: 2px 6px; } +</style> +<div class='litige'> + <div class="litige_desc"> + <h3>Type</h3> + {{litige.stringStatus}} + <hr/> + + <h3>Plaignant</h3> + {{litige.idUtilisateur.login}} + <hr/> + + <h3>Date de création du litige</h3> + {{litige.dateLitige|date('d/m/y')}} + <hr/> + + <h3>Description</h3> + {{litige.descrLitige}} + <hr/> + + <br/> + <button class="btn-suppression" id="cancelLitige">Annuler le litige</button> + + <script> + document.getElementById('cancelLitige').addEventListener('click', function() { + // Afficher une boîte de dialogue de confirmation + var confirmation = confirm('Êtes-vous sûr de vouloir annuler le litige ?'); + + // Si l'utilisateur confirme, rediriger vers la page de suppression de la transaction + if (confirmation) { + window.location.href = '{{ path('app_litige_cancel', {'id': litige.id} ) }}'; + } + }); + </script> + <br/> + <button class="btn-suppression" id="deleteAnnonceButton">Supprimer l'annonce</button> + + <script> + document.getElementById('deleteAnnonceButton').addEventListener('click', function() { + // Afficher une boîte de dialogue de confirmation + var confirmation = confirm("Êtes-vous sûr de vouloir supprimer l'annonce ?"); + + // Si l'utilisateur confirme, rediriger vers la page de suppression de la transaction + if (confirmation) { + window.location.href = '{{ path('app_litige_suppr', {'id': litige.id} ) }}'; + } + }); + </script> + <br/> + <button class="btn-suppression" id="deleteOtherUserButton">Supprimer le compte de l'autre utilisateur</button> + + <script> + document.getElementById('deleteOtherUserButton').addEventListener('click', function() { + // Afficher une boîte de dialogue de confirmation + var confirmation = confirm('Êtes-vous sûr de vouloir supprimer cet utilisateur ?'); + + // Si l'utilisateur confirme, rediriger vers la page de suppression de la transaction + if (confirmation) { + window.location.href = '{{ path('app_litige_user_suppr', {'id': litige.id} ) }}'; + } + }); + </script> + </div> +</div> + +{% endblock %} diff --git a/templates/notifications/index.html.twig b/templates/notifications/index.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..00328b7ccb5cedfbb3bf85f3c0b76bf1732bf216 --- /dev/null +++ b/templates/notifications/index.html.twig @@ -0,0 +1,30 @@ +{% extends 'base.html.twig' %} + +{% block title %}Notifications - Eco-presto{% endblock %} + +{% block body %} +<style> + .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; } + .example-wrapper code { background: #F5F5F5; padding: 2px 6px; } +</style> +<h1>Notifications</h1> + +<table class="table_notif"> + {% if notifs %} + <tr> + <td><b>Date</b></td> + <td><b>Type</b></td> + <td><b>Description</b></td> + </tr> + {% for notif in notifs|reverse %} + <tr> + <td>{{ notif.date|date('d/m/y') }}</td> + <td>{{ notif.type }}</td> + <td>{{ notif.description }}</td> + </tr> + {% endfor %} + {% else %} + <p>Aucune notification trouvée.</p> + {% endif %} + +{% endblock %} diff --git a/templates/registration/register.html.twig b/templates/registration/register.html.twig index 8ddbbf13f447909d73bc99b00fa629dd7110d291..7dfef56d50cc5133d392fd10833977cb8cd43c60 100644 --- a/templates/registration/register.html.twig +++ b/templates/registration/register.html.twig @@ -58,11 +58,55 @@ {{ form_widget(registrationForm.date_naissance, {'attr': {'placeholder': 'Date de naissance', 'class': 'form-control'}}) }} {{ form_errors(registrationForm.date_naissance) }} - <button type="submit" class="btn-connexion">S'inscrire</button> + Choisissez un abonnement* + <div class="choix-abonnement"> + <div class="type-abonnement" data-value="20"> + <p>Abonnement Standard (20€)</p> + <p>Possibilité de :</p> + <ul> + <li>Proposer un service</li> + <li>Demander un service</li> + <li>Proposer un prêt de matériel</li> + </ul> + </div> + <div class="type-abonnement" data-value="30"> + <p>Abonnement Premium (30€)</p> + <p>Possibilité de :</p> + <ul> + <li>Proposer un service</li> + <li>Demander un service</li> + <li>Proposer un prêt de matériel</li> + <li>Demander un prêt de matériel</li> + </ul> + </div> + </div> + {{ form_widget(registrationForm.abonnement) }} + {{ form_errors(registrationForm.abonnement) }} + <button type="submit" class="btn-connexion" id="inscription-btn">S'inscrire</button> </div> {{ form_end(registrationForm) }} <button class="btn-connexion2" onclick="window.location.href='{{ path("app_home_page") }}'">Retourner à l'accueil</button> </div> </div> {% endif %} + + <script> + document.querySelectorAll('.type-abonnement').forEach(function(option) { + option.addEventListener('click', function() { + const prix = this.getAttribute('data-value'); + document.getElementById('inscription-btn').innerText = "S'inscrire (" + prix + "€)"; + document.querySelector('input[name="registration_form[abonnement]"]').value = prix; + }); + }); + document.querySelectorAll('.type-abonnement').forEach(function(option) { + option.addEventListener('click', function() { + document.querySelectorAll('.type-abonnement').forEach(function(option) { + option.classList.remove('selected'); + }); + + option.classList.add('selected'); + }); + }); + + </script> {% endblock %} diff --git a/templates/security/modifUser.html.twig b/templates/security/modifUser.html.twig index 22918911d63b52a5209ae93b12ae0b769ea794c5..cf8080bcb1704c8526a710d467f3baaf3417f3e5 100644 --- a/templates/security/modifUser.html.twig +++ b/templates/security/modifUser.html.twig @@ -7,8 +7,6 @@ <div class="container-connexion3"> <div class="container-connexion"> <div class="container-connexion2"> - <button class="btn-connexion2" onclick="window.location.href='{{ path("app_modif_user_mdp") }}'">Modifier mon mot de passe</button> - <button class="btn-connexion2" onclick="window.location.href='{{ path("app_logout") }}'">Se déconnecter</button> </div> <button class="btn-connexion2" onclick="window.location.href='{{ path("app_home_page") }}'">Retourner à l'accueil</button> @@ -18,8 +16,10 @@ <div class="container-connexion3"> <div class="container-connexion"> <div class="container-connexion2"> - <button class="btn-connexion2" onclick="window.location.href='{{ path("app_mes_annonces") }}'">Consulter mes annonces</button> + <button class="btn-connexion2" onclick="window.location.href='{{ path("app_user_coord") }}'">Mon profil</button> + <button class="btn-connexion2" onclick="window.location.href='{{ path("app_mes_annonces") }}'">Consulter mes transactions</button> <button class="btn-connexion2" onclick="window.location.href='{{ path("app_modif_user_coord") }}'">Modifier mes coordonnées</button> + <button class="btn-connexion2" onclick="window.location.href='{{ path("app_modif_user_coord") }}'">Modifier mon abonnement</button> <button class="btn-connexion2" onclick="window.location.href='{{ path("app_modif_user_mdp") }}'">Modifier mon mot de passe</button> {% if app.user.isSommeil()%} @@ -27,10 +27,8 @@ <script> document.getElementById('sortirSomeilButton').addEventListener('click', function() { - // Afficher une boîte de dialogue de confirmation var confirmation = confirm('Êtes-vous sûr de vouloir sortir votre compte du mode sommeil ?'); - // Si l'utilisateur confirme, rediriger vers la page de sortie du mode sommeil if (confirmation) { window.location.href = '{{ path("app_sortir_sommeil") }}'; } diff --git a/templates/security/userCoord.html.twig b/templates/security/userCoord.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..993bb472943d545faa8965f3a3f1412ce6817a25 --- /dev/null +++ b/templates/security/userCoord.html.twig @@ -0,0 +1,27 @@ +{% extends 'base.html.twig' %} + +{% block title %}User coord{% endblock %} + +{% block body %} +<div class="container-connexion3"> + <div class="container-connexion"> + <div class="container-connexion2"> + <h1>Mon profil</h1> + <ul> + <li><strong>Solde:</strong> {{ user.nbflorains }} florains</li> + <li><strong>Login:</strong> {{ user.login }}</li> + <li><strong>Nom:</strong> {{ user.nom }}</li> + <li><strong>Prénom:</strong> {{ user.prenom }}</li> + <li><strong>Date de naissance:</strong> {{ user.datenaissance | date('d/m/y') }}</li> + <li><strong>Email:</strong> {{ user.email }}</li> + <li><strong>Adresse:</strong> {{ user.adresse }}</li> + <li><strong>Code postal:</strong> {{ user.codepostal }}</li> + <li><strong>Ville:</strong> {{ user.ville }}</li> + <li><strong>Téléphone:</strong> {{ user.telephone }}</li> + <li><strong>Statut abonnement:</strong> {% if user.statusabonnement == 0 %} Abonnement standard {% else %} Abonnement premium {% endif %}</li> + </ul> + </div> + <button class="btn-connexion2" onclick="window.location.href='{{ path("app_modif_user") }}'">Retour</button> + </div> +</div> +{% endblock %} diff --git a/tests/TestConnexionTest.php b/tests/TestConnexionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5b5252e3253c0f93094f67075c446051c4d41f4a --- /dev/null +++ b/tests/TestConnexionTest.php @@ -0,0 +1,41 @@ +<?php + +namespace App\Test; + +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; + +class ProductFixture extends WebTestCase +{ + public function testRegisterPage() + { + $client = static::createClient(); + + // Accéder à la page d'inscription + $client->request('GET', '/login'); + + // Vérifier si la réponse est réussie (200) + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + // Vérifier que le contenu de la réponse contient le formulaire d'inscription + // $this->assertSelectorExists('form#registrationForm'); + } + + public function testRegistrationProcess() + { + $client = static::createClient(); + + // Soumettre le formulaire d'inscription avec des données valides + $crawler = $client->request('POST', '/register', [ + 'registrationForm' => [ + 'login' => 'test_user', + 'plainPassword' => 'test' + ], + ]); + + // Vérifier si la redirection s'est faite après l'inscription réussie + // $this->assertTrue($client->getResponse()->isRedirect('/')); + + // Vérifier que l'utilisateur est inscrit en vérifiant la présence de son nom d'utilisateur par exemple + // $this->assertSelectorTextContains('p', 'test_user'); + } +} \ No newline at end of file diff --git a/tests/TestsSommeilTest.php b/tests/TestsSommeilTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d94f8a2ced4696b740f4b72d1d683f3d14ace9c1 --- /dev/null +++ b/tests/TestsSommeilTest.php @@ -0,0 +1,17 @@ +<?php + +namespace App\Tests; + +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; + +class TestsSommeilTest extends WebTestCase +{ + public function testMiseSommeil(): void + { + $client = static::createClient(); + $client->request('GET', '/'); + + + $this->assertTrue(true); + } +} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 47f604d1959a84aac93f5d58b13bbcee897bbe00..ec8d9242466111cac79530d5a8f646ca99d59660 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -442,6 +442,7 @@ return array( 'PharIo\\Version\\VersionConstraintParser' => $vendorDir . '/phar-io/version/src/VersionConstraintParser.php', 'PharIo\\Version\\VersionConstraintValue' => $vendorDir . '/phar-io/version/src/VersionConstraintValue.php', 'PharIo\\Version\\VersionNumber' => $vendorDir . '/phar-io/version/src/VersionNumber.php', + 'SQLite3Exception' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php', 'SebastianBergmann\\CliParser\\AmbiguousOptionException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php', 'SebastianBergmann\\CliParser\\Exception' => $vendorDir . '/sebastian/cli-parser/src/exceptions/Exception.php', 'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index df8f346fd92b1e4bbd854e0c91690dc27090e07e..9819c09ffa8c4a21da089361a83b4b403769f357 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -101,10 +101,12 @@ return array( 'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'), 'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/src'), 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/src'), + 'Doctrine\\Common\\DataFixtures\\' => array($vendorDir . '/doctrine/data-fixtures/src'), 'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/src'), 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'), 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/src', $vendorDir . '/doctrine/event-manager/src'), 'Doctrine\\Bundle\\MigrationsBundle\\' => array($vendorDir . '/doctrine/doctrine-migrations-bundle'), + 'Doctrine\\Bundle\\FixturesBundle\\' => array($vendorDir . '/doctrine/doctrine-fixtures-bundle'), 'Doctrine\\Bundle\\DoctrineBundle\\' => array($vendorDir . '/doctrine/doctrine-bundle'), 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), 'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 974833f1b0b06e68bb978e83af368a8fcb2eacad..d687a58528b5b2d2d2d451956c6cc3466b2d89f6 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -142,10 +142,12 @@ class ComposerStaticInit2e074b178cf99c894ccdda33ec3f7bde 'Doctrine\\Deprecations\\' => 22, 'Doctrine\\DBAL\\' => 14, 'Doctrine\\Common\\Lexer\\' => 22, + 'Doctrine\\Common\\DataFixtures\\' => 29, 'Doctrine\\Common\\Collections\\' => 28, 'Doctrine\\Common\\Cache\\' => 22, 'Doctrine\\Common\\' => 16, 'Doctrine\\Bundle\\MigrationsBundle\\' => 33, + 'Doctrine\\Bundle\\FixturesBundle\\' => 31, 'Doctrine\\Bundle\\DoctrineBundle\\' => 31, 'DeepCopy\\' => 9, ), @@ -543,6 +545,10 @@ class ComposerStaticInit2e074b178cf99c894ccdda33ec3f7bde array ( 0 => __DIR__ . '/..' . '/doctrine/lexer/src', ), + 'Doctrine\\Common\\DataFixtures\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/data-fixtures/src', + ), 'Doctrine\\Common\\Collections\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/collections/src', @@ -560,6 +566,10 @@ class ComposerStaticInit2e074b178cf99c894ccdda33ec3f7bde array ( 0 => __DIR__ . '/..' . '/doctrine/doctrine-migrations-bundle', ), + 'Doctrine\\Bundle\\FixturesBundle\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/doctrine-fixtures-bundle', + ), 'Doctrine\\Bundle\\DoctrineBundle\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/doctrine-bundle', @@ -1019,6 +1029,7 @@ class ComposerStaticInit2e074b178cf99c894ccdda33ec3f7bde 'PharIo\\Version\\VersionConstraintParser' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintParser.php', 'PharIo\\Version\\VersionConstraintValue' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintValue.php', 'PharIo\\Version\\VersionNumber' => __DIR__ . '/..' . '/phar-io/version/src/VersionNumber.php', + 'SQLite3Exception' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php', 'SebastianBergmann\\CliParser\\AmbiguousOptionException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php', 'SebastianBergmann\\CliParser\\Exception' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/Exception.php', 'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d4be7f2a14955ce7af3d61ff1757833e33cb0a21..14e42993a86f169e3bcc56e1a9d8eedcd3862d1b 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -363,6 +363,93 @@ ], "install-path": "../doctrine/common" }, + { + "name": "doctrine/data-fixtures", + "version": "1.7.0", + "version_normalized": "1.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/data-fixtures.git", + "reference": "bbcb74f2ac6dbe81a14b3c3687d7623490a0448f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/bbcb74f2ac6dbe81a14b3c3687d7623490a0448f", + "reference": "bbcb74f2ac6dbe81a14b3c3687d7623490a0448f", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1.0", + "doctrine/persistence": "^2.0|^3.0", + "php": "^7.4 || ^8.0" + }, + "conflict": { + "doctrine/dbal": "<3.5 || >=5", + "doctrine/orm": "<2.14 || >=4", + "doctrine/phpcr-odm": "<1.3.0" + }, + "require-dev": { + "doctrine/annotations": "^1.12 || ^2", + "doctrine/coding-standard": "^12", + "doctrine/dbal": "^3.5 || ^4", + "doctrine/mongodb-odm": "^1.3.0 || ^2.0.0", + "doctrine/orm": "^2.14 || ^3", + "ext-sqlite3": "*", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.6.13 || ^10.4.2", + "symfony/cache": "^5.4 || ^6.3 || ^7", + "symfony/var-exporter": "^5.4 || ^6.3 || ^7", + "vimeo/psalm": "^5.9" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)", + "doctrine/mongodb-odm": "For loading MongoDB ODM fixtures", + "doctrine/orm": "For loading ORM fixtures", + "doctrine/phpcr-odm": "For loading PHPCR ODM fixtures" + }, + "time": "2023-11-24T11:18:31+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\DataFixtures\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Data Fixtures for all Doctrine Object Managers", + "homepage": "https://www.doctrine-project.org", + "keywords": [ + "database" + ], + "support": { + "issues": "https://github.com/doctrine/data-fixtures/issues", + "source": "https://github.com/doctrine/data-fixtures/tree/1.7.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdata-fixtures", + "type": "tidelift" + } + ], + "install-path": "../doctrine/data-fixtures" + }, { "name": "doctrine/dbal", "version": "3.8.0", @@ -651,6 +738,96 @@ ], "install-path": "../doctrine/doctrine-bundle" }, + { + "name": "doctrine/doctrine-fixtures-bundle", + "version": "3.5.1", + "version_normalized": "3.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", + "reference": "c808a0c85c38c8ee265cc8405b456c1d2b38567d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/c808a0c85c38c8ee265cc8405b456c1d2b38567d", + "reference": "c808a0c85c38c8ee265cc8405b456c1d2b38567d", + "shasum": "" + }, + "require": { + "doctrine/data-fixtures": "^1.3", + "doctrine/doctrine-bundle": "^2.2", + "doctrine/orm": "^2.14.0 || ^3.0", + "doctrine/persistence": "^2.4|^3.0", + "php": "^7.4 || ^8.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/doctrine-bridge": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0" + }, + "conflict": { + "doctrine/dbal": "< 3" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10.39", + "phpunit/phpunit": "^9.6.13", + "symfony/phpunit-bridge": "^6.3.6", + "vimeo/psalm": "^5.15" + }, + "time": "2023-11-19T12:48:54+00:00", + "type": "symfony-bundle", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Bundle\\FixturesBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Doctrine Project", + "homepage": "https://www.doctrine-project.org" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DoctrineFixturesBundle", + "homepage": "https://www.doctrine-project.org", + "keywords": [ + "Fixture", + "persistence" + ], + "support": { + "issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues", + "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.5.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdoctrine-fixtures-bundle", + "type": "tidelift" + } + ], + "install-path": "../doctrine/doctrine-fixtures-bundle" + }, { "name": "doctrine/doctrine-migrations-bundle", "version": "3.3.0", @@ -10191,6 +10368,8 @@ ], "dev": true, "dev-package-names": [ + "doctrine/data-fixtures", + "doctrine/doctrine-fixtures-bundle", "masterminds/html5", "myclabs/deep-copy", "nikic/php-parser", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index ba38913b7f5673db79684240ee6a40f15570f231..2b5c863572a0b45df23f701f64ba96ac99ede0ae 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'b13b65b90e42889234035b04dc34f5147b439bc9', + 'reference' => '5d6f38fd16221daef702eb1ffc13e783e9223909', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'b13b65b90e42889234035b04dc34f5147b439bc9', + 'reference' => '5d6f38fd16221daef702eb1ffc13e783e9223909', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -55,6 +55,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'doctrine/data-fixtures' => array( + 'pretty_version' => '1.7.0', + 'version' => '1.7.0.0', + 'reference' => 'bbcb74f2ac6dbe81a14b3c3687d7623490a0448f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/data-fixtures', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'doctrine/dbal' => array( 'pretty_version' => '3.8.0', 'version' => '3.8.0.0', @@ -82,6 +91,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'doctrine/doctrine-fixtures-bundle' => array( + 'pretty_version' => '3.5.1', + 'version' => '3.5.1.0', + 'reference' => 'c808a0c85c38c8ee265cc8405b456c1d2b38567d', + 'type' => 'symfony-bundle', + 'install_path' => __DIR__ . '/../doctrine/doctrine-fixtures-bundle', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'doctrine/doctrine-migrations-bundle' => array( 'pretty_version' => '3.3.0', 'version' => '3.3.0.0',