From 63398086b7c97ad68a77b4aa7fffda4c43f0ac80 Mon Sep 17 00:00:00 2001 From: maurine Date: Fri, 13 Mar 2026 12:17:36 +0100 Subject: [PATCH 1/2] creation de l'entite User --- .env | 1 + migrations/Version20260313104837.php | 34 +++++ src/Entity/User.php | 179 +++++++++++++++++++++++++++ src/Repository/UserRepository.php | 43 +++++++ 4 files changed, 257 insertions(+) create mode 100644 migrations/Version20260313104837.php create mode 100644 src/Entity/User.php create mode 100644 src/Repository/UserRepository.php diff --git a/.env b/.env index 54052e9..33625ce 100644 --- a/.env +++ b/.env @@ -3,6 +3,7 @@ APP_SECRET= APP_SHARE_DIR=var/share APP_VERSION=0.0.1 DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" +MESSENGER_TRANSPORT_DSN="doctrine://default" MAILER_DSN="smtp://localhost:1025" DEFAULT_URI="http://localhost:8000" KAZ_API_USER= diff --git a/migrations/Version20260313104837.php b/migrations/Version20260313104837.php new file mode 100644 index 0000000..79724c7 --- /dev/null +++ b/migrations/Version20260313104837.php @@ -0,0 +1,34 @@ +addSql('CREATE TABLE "user" (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, role VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, mail_quota VARCHAR(255) NOT NULL, mail_de_secours VARCHAR(255) NOT NULL, identifiant_kaz VARCHAR(255) NOT NULL, quota VARCHAR(255) NOT NULL, has_nextcloud_access BOOLEAN NOT NULL, nextcloud_quota VARCHAR(255) NOT NULL, has_mobilizon BOOLEAN NOT NULL, has_agora_access BOOLEAN NOT NULL, PRIMARY KEY (id))'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY (id))'); + $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0E3BD61CE16BA31DBBF396750 ON messenger_messages (queue_name, available_at, delivered_at, id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE "user"'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php new file mode 100644 index 0000000..4015628 --- /dev/null +++ b/src/Entity/User.php @@ -0,0 +1,179 @@ +id; + } + + public function setId(Uuid $id): static + { + $this->id = $id; + + return $this; + } + + public function getRole(): ?string + { + return $this->role; + } + + public function setRole(string $role): static + { + $this->role = $role; + + return $this; + } + + public function getMail(): ?string + { + return $this->mail; + } + + public function setMail(string $mail): static + { + $this->mail = $mail; + + return $this; + } + + public function getMailQuota(): ?string + { + return $this->mailQuota; + } + + public function setMailQuota(string $mailQuota): static + { + $this->mailQuota = $mailQuota; + + return $this; + } + + public function getMailDeSecours(): ?string + { + return $this->mailDeSecours; + } + + public function setMailDeSecours(string $mailDeSecours): static + { + $this->mailDeSecours = $mailDeSecours; + + return $this; + } + + public function getIdentifiantKaz(): ?string + { + return $this->identifiantKaz; + } + + public function setIdentifiantKaz(string $identifiantKaz): static + { + $this->identifiantKaz = $identifiantKaz; + + return $this; + } + + public function getQuota(): ?string + { + return $this->quota; + } + + public function setQuota(string $quota): static + { + $this->quota = $quota; + + return $this; + } + + public function hasNextcloudAccess(): ?bool + { + return $this->hasNextcloudAccess; + } + + public function setHasNextcloudAccess(bool $hasNextcloudAccess): static + { + $this->hasNextcloudAccess = $hasNextcloudAccess; + + return $this; + } + + public function getNextcloudQuota(): ?string + { + return $this->nextcloudQuota; + } + + public function setNextcloudQuota(string $nextcloudQuota): static + { + $this->nextcloudQuota = $nextcloudQuota; + + return $this; + } + + public function hasMobilizon(): ?bool + { + return $this->hasMobilizon; + } + + public function setHasMobilizon(bool $hasMobilizon): static + { + $this->hasMobilizon = $hasMobilizon; + + return $this; + } + + public function hasAgoraAccess(): ?bool + { + return $this->hasAgoraAccess; + } + + public function setHasAgoraAccess(bool $hasAgoraAccess): static + { + $this->hasAgoraAccess = $hasAgoraAccess; + + return $this; + } +} diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php new file mode 100644 index 0000000..b29153b --- /dev/null +++ b/src/Repository/UserRepository.php @@ -0,0 +1,43 @@ + + */ +class UserRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, User::class); + } + + // /** + // * @return User[] Returns an array of User objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('u') + // ->andWhere('u.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('u.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?User + // { + // return $this->createQueryBuilder('u') + // ->andWhere('u.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} From f87ed32f6f3a0184a9ff170bd3f5b0308e688812 Mon Sep 17 00:00:00 2001 From: maurine Date: Mon, 16 Mar 2026 10:16:31 +0100 Subject: [PATCH 2/2] Actualisation README Ajout de la documentation d'installation pour Tailwind --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dce1968..c1767a0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # Plateforme web pour les adhérents KAZ ## Objectif @@ -11,6 +10,7 @@ Cette application web permet aux adhérents de l'association KAZ de gérer leur ## Architecture technique - **Frontend** : [Twig](https://twig.symfony.com/) + [Tailwind CSS](https://tailwindcss.com/) +- **Documentation installation Tailwind** : [Plus d'infos ici](https://tailwindcss.com/docs/installation/framework-guides/symfony) - **Backend** : PHP 8.4 / [Symfony](https://symfony.com/) - **Base de données** : [PostgreSQL](https://www.postgresql.org/) - **Intégration** : Communication via API avec les outils de KAZ (notamment OpenLDAP).