From 674edc5351f7a6634cbcb91ec695c95a5b04bec3 Mon Sep 17 00:00:00 2001
From: Julian PEREZ-RAMIREZ <julian.perez-ramirez@imt-atlantique.net>
Date: Sun, 23 Feb 2025 15:51:39 +0100
Subject: [PATCH] creating first version of db without relationships

---
 README.md                                     |  14 ++
 web_app/migrations/Version20250221203107.php  |  31 ----
 web_app/migrations/Version20250223144640.php  |  41 +++++
 web_app/src/Entity/Item.php                   | 102 ++++++++++++
 web_app/src/Entity/Product.php                |  50 ------
 web_app/src/Entity/Purchase.php               | 117 ++++++++++++++
 web_app/src/Entity/User.php                   | 148 ++++++++++++++++++
 web_app/src/Entity/WishList.php               | 103 ++++++++++++
 web_app/src/Entity/WishListItem.php           |  50 ++++++
 web_app/src/Entity/WishListMember.php         |  95 +++++++++++
 web_app/src/Enum/UserRole.php                 |  19 +++
 web_app/src/Repository/ItemRepository.php     |  43 +++++
 ...tRepository.php => PurchaseRepository.php} |  12 +-
 web_app/src/Repository/UserRepository.php     |  43 +++++
 .../src/Repository/WishListItemRepository.php |  43 +++++
 .../Repository/WishListMemberRepository.php   |  43 +++++
 web_app/src/Repository/WishListRepository.php |  43 +++++
 17 files changed, 910 insertions(+), 87 deletions(-)
 delete mode 100644 web_app/migrations/Version20250221203107.php
 create mode 100644 web_app/migrations/Version20250223144640.php
 create mode 100644 web_app/src/Entity/Item.php
 delete mode 100644 web_app/src/Entity/Product.php
 create mode 100644 web_app/src/Entity/Purchase.php
 create mode 100644 web_app/src/Entity/User.php
 create mode 100644 web_app/src/Entity/WishList.php
 create mode 100644 web_app/src/Entity/WishListItem.php
 create mode 100644 web_app/src/Entity/WishListMember.php
 create mode 100644 web_app/src/Enum/UserRole.php
 create mode 100644 web_app/src/Repository/ItemRepository.php
 rename web_app/src/Repository/{ProductRepository.php => PurchaseRepository.php} (74%)
 create mode 100644 web_app/src/Repository/UserRepository.php
 create mode 100644 web_app/src/Repository/WishListItemRepository.php
 create mode 100644 web_app/src/Repository/WishListMemberRepository.php
 create mode 100644 web_app/src/Repository/WishListRepository.php

diff --git a/README.md b/README.md
index 84a9d0e..80897c0 100644
--- a/README.md
+++ b/README.md
@@ -12,5 +12,19 @@ composer require --dev symfony/maker-bundle
 php bin/console doctrine:database:create
 php bin/console make:migration
 php bin/console doctrine:migrations:migrate
+```
+
+Create an entity
+```
+docker exec -it symfony_app php bin/console make:entity
+```
 
+Create migration file to apply in the dp
+```
+docker exec -it symfony_app php bin/console make:migration
+```
+
+Apply the migration file in the db
+```
+docker exec -it symfony_app php bin/console doctrine:migrations:migrate
 ```
\ No newline at end of file
diff --git a/web_app/migrations/Version20250221203107.php b/web_app/migrations/Version20250221203107.php
deleted file mode 100644
index 10602e8..0000000
--- a/web_app/migrations/Version20250221203107.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace DoctrineMigrations;
-
-use Doctrine\DBAL\Schema\Schema;
-use Doctrine\Migrations\AbstractMigration;
-
-/**
- * Auto-generated Migration: Please modify to your needs!
- */
-final class Version20250221203107 extends AbstractMigration
-{
-    public function getDescription(): string
-    {
-        return '';
-    }
-
-    public function up(Schema $schema): void
-    {
-        // this up() migration is auto-generated, please modify it to your needs
-        $this->addSql('CREATE TABLE product (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
-    }
-
-    public function down(Schema $schema): void
-    {
-        // this down() migration is auto-generated, please modify it to your needs
-        $this->addSql('DROP TABLE product');
-    }
-}
diff --git a/web_app/migrations/Version20250223144640.php b/web_app/migrations/Version20250223144640.php
new file mode 100644
index 0000000..a3abef2
--- /dev/null
+++ b/web_app/migrations/Version20250223144640.php
@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+
+namespace DoctrineMigrations;
+
+use Doctrine\DBAL\Schema\Schema;
+use Doctrine\Migrations\AbstractMigration;
+
+/**
+ * Auto-generated Migration: Please modify to your needs!
+ */
+final class Version20250223144640 extends AbstractMigration
+{
+    public function getDescription(): string
+    {
+        return '';
+    }
+
+    public function up(Schema $schema): void
+    {
+        // this up() migration is auto-generated, please modify it to your needs
+        $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, purchase_url VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
+        $this->addSql('CREATE TABLE purchase (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, wishlist_id INT NOT NULL, item_id INT NOT NULL, url_proof VARCHAR(255) DEFAULT NULL, message VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
+        $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, user_name VARCHAR(255) DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, surname VARCHAR(255) DEFAULT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, is_blocked TINYINT(1) DEFAULT NULL, role VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
+        $this->addSql('CREATE TABLE wish_list (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, name VARCHAR(255) NOT NULL, expiration_date DATETIME DEFAULT NULL, is_active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
+        $this->addSql('CREATE TABLE wish_list_item (id INT AUTO_INCREMENT NOT NULL, wishlist_id INT NOT NULL, item_id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
+        $this->addSql('CREATE TABLE wish_list_member (id INT AUTO_INCREMENT NOT NULL, wishlist_id INT NOT NULL, user_id INT NOT NULL, can_edit TINYINT(1) NOT NULL, is_accepted TINYINT(1) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
+    }
+
+    public function down(Schema $schema): void
+    {
+        // this down() migration is auto-generated, please modify it to your needs
+        $this->addSql('DROP TABLE item');
+        $this->addSql('DROP TABLE purchase');
+        $this->addSql('DROP TABLE user');
+        $this->addSql('DROP TABLE wish_list');
+        $this->addSql('DROP TABLE wish_list_item');
+        $this->addSql('DROP TABLE wish_list_member');
+    }
+}
diff --git a/web_app/src/Entity/Item.php b/web_app/src/Entity/Item.php
new file mode 100644
index 0000000..2f8bea5
--- /dev/null
+++ b/web_app/src/Entity/Item.php
@@ -0,0 +1,102 @@
+<?php
+
+namespace App\Entity;
+
+use App\Repository\ItemRepository;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ORM\Entity(repositoryClass: ItemRepository::class)]
+class Item
+{
+    #[ORM\Id]
+    #[ORM\GeneratedValue]
+    #[ORM\Column]
+    private ?int $id = null;
+
+    #[ORM\Column(length: 255)]
+    private ?string $title = null;
+
+    #[ORM\Column(length: 255, nullable: true)]
+    private ?string $description = null;
+
+    #[ORM\Column]
+    private ?float $price = null;
+
+    #[ORM\Column(length: 255, nullable: true)]
+    private ?string $purchase_url = null;
+
+    #[ORM\Column]
+    private ?\DateTimeImmutable $created_at = null;
+
+    public function getId(): ?int
+    {
+        return $this->id;
+    }
+
+    public function setId(int $id): static
+    {
+        $this->id = $id;
+
+        return $this;
+    }
+
+    public function getTitle(): ?string
+    {
+        return $this->title;
+    }
+
+    public function setTitle(string $title): static
+    {
+        $this->title = $title;
+
+        return $this;
+    }
+
+    public function getDescription(): ?string
+    {
+        return $this->description;
+    }
+
+    public function setDescription(?string $description): static
+    {
+        $this->description = $description;
+
+        return $this;
+    }
+
+    public function getPrice(): ?float
+    {
+        return $this->price;
+    }
+
+    public function setPrice(float $price): static
+    {
+        $this->price = $price;
+
+        return $this;
+    }
+
+    public function getPurchaseUrl(): ?string
+    {
+        return $this->purchase_url;
+    }
+
+    public function setPurchaseUrl(?string $purchase_url): static
+    {
+        $this->purchase_url = $purchase_url;
+
+        return $this;
+    }
+
+    public function getCreatedAt(): ?\DateTimeImmutable
+    {
+        return $this->created_at;
+    }
+
+    public function setCreatedAt(\DateTimeImmutable $created_at): static
+    {
+        $this->created_at = $created_at;
+
+        return $this;
+    }
+}
diff --git a/web_app/src/Entity/Product.php b/web_app/src/Entity/Product.php
deleted file mode 100644
index b78a233..0000000
--- a/web_app/src/Entity/Product.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-namespace App\Entity;
-
-use App\Repository\ProductRepository;
-use Doctrine\ORM\Mapping as ORM;
-
-#[ORM\Entity(repositoryClass: ProductRepository::class)]
-class Product
-{
-    #[ORM\Id]
-    #[ORM\GeneratedValue]
-    #[ORM\Column]
-    private ?int $id = null;
-
-    #[ORM\Column(length: 255)]
-    private ?string $name = null;
-
-    #[ORM\Column]
-    private ?float $price = null;
-
-    public function getId(): ?int
-    {
-        return $this->id;
-    }
-
-    public function getName(): ?string
-    {
-        return $this->name;
-    }
-
-    public function setName(string $name): static
-    {
-        $this->name = $name;
-
-        return $this;
-    }
-
-    public function getPrice(): ?float
-    {
-        return $this->price;
-    }
-
-    public function setPrice(float $price): static
-    {
-        $this->price = $price;
-
-        return $this;
-    }
-}
diff --git a/web_app/src/Entity/Purchase.php b/web_app/src/Entity/Purchase.php
new file mode 100644
index 0000000..14a31b9
--- /dev/null
+++ b/web_app/src/Entity/Purchase.php
@@ -0,0 +1,117 @@
+<?php
+
+namespace App\Entity;
+
+use App\Repository\PurchaseRepository;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ORM\Entity(repositoryClass: PurchaseRepository::class)]
+class Purchase
+{
+    #[ORM\Id]
+    #[ORM\GeneratedValue]
+    #[ORM\Column]
+    private ?int $id = null;
+
+    #[ORM\Column]
+    private ?int $user_id = null;
+
+    #[ORM\Column]
+    private ?int $wishlist_id = null;
+
+    #[ORM\Column]
+    private ?int $item_id = null;
+
+    #[ORM\Column(length: 255, nullable: true)]
+    private ?string $url_proof = null;
+
+    #[ORM\Column(length: 255, nullable: true)]
+    private ?string $message = null;
+
+    #[ORM\Column]
+    private ?\DateTimeImmutable $created_at = null;
+
+    public function getId(): ?int
+    {
+        return $this->id;
+    }
+
+    public function setId(int $id): static
+    {
+        $this->id = $id;
+
+        return $this;
+    }
+
+    public function getUserId(): ?int
+    {
+        return $this->user_id;
+    }
+
+    public function setUserId(int $user_id): static
+    {
+        $this->user_id = $user_id;
+
+        return $this;
+    }
+
+    public function getWishlistId(): ?int
+    {
+        return $this->wishlist_id;
+    }
+
+    public function setWishlistId(int $wishlist_id): static
+    {
+        $this->wishlist_id = $wishlist_id;
+
+        return $this;
+    }
+
+    public function getItemId(): ?int
+    {
+        return $this->item_id;
+    }
+
+    public function setItemId(int $item_id): static
+    {
+        $this->item_id = $item_id;
+
+        return $this;
+    }
+
+    public function getUrlProof(): ?string
+    {
+        return $this->url_proof;
+    }
+
+    public function setUrlProof(?string $url_proof): static
+    {
+        $this->url_proof = $url_proof;
+
+        return $this;
+    }
+
+    public function getMessage(): ?string
+    {
+        return $this->message;
+    }
+
+    public function setMessage(?string $message): static
+    {
+        $this->message = $message;
+
+        return $this;
+    }
+
+    public function getCreatedAt(): ?\DateTimeImmutable
+    {
+        return $this->created_at;
+    }
+
+    public function setCreatedAt(\DateTimeImmutable $created_at): static
+    {
+        $this->created_at = $created_at;
+
+        return $this;
+    }
+}
diff --git a/web_app/src/Entity/User.php b/web_app/src/Entity/User.php
new file mode 100644
index 0000000..f3427be
--- /dev/null
+++ b/web_app/src/Entity/User.php
@@ -0,0 +1,148 @@
+<?php
+
+namespace App\Entity;
+
+use App\Enum\UserRole;
+use App\Repository\UserRepository;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ORM\Entity(repositoryClass: UserRepository::class)]
+class User
+{
+    #[ORM\Id]
+    #[ORM\GeneratedValue]
+    #[ORM\Column]
+    private ?int $id = null;
+
+    #[ORM\Column(length: 255, nullable: true)]
+    private ?string $user_name = null;
+
+    #[ORM\Column(length: 255, nullable: true)]
+    private ?string $name = null;
+
+    #[ORM\Column(length: 255, nullable: true)]
+    private ?string $surname = null;
+
+    #[ORM\Column(length: 255)]
+    private ?string $email = null;
+
+    #[ORM\Column(length: 255)]
+    private ?string $password = null;
+
+    #[ORM\Column(nullable: true)]
+    private ?bool $is_blocked = null;
+
+    #[ORM\Column(enumType: UserRole::class)]
+    private ?UserRole $role = null;
+
+    #[ORM\Column]
+    private ?\DateTimeImmutable $created_at = null;
+
+    public function getId(): ?int
+    {
+        return $this->id;
+    }
+
+    public function setId(int $id): static
+    {
+        $this->id = $id;
+
+        return $this;
+    }
+
+    public function getUserName(): ?string
+    {
+        return $this->user_name;
+    }
+
+    public function setUserName(?string $user_name): static
+    {
+        $this->user_name = $user_name;
+
+        return $this;
+    }
+
+    public function getName(): ?string
+    {
+        return $this->name;
+    }
+
+    public function setName(?string $name): static
+    {
+        $this->name = $name;
+
+        return $this;
+    }
+
+    public function getSurname(): ?string
+    {
+        return $this->surname;
+    }
+
+    public function setSurname(?string $surname): static
+    {
+        $this->surname = $surname;
+
+        return $this;
+    }
+
+    public function getEmail(): ?string
+    {
+        return $this->email;
+    }
+
+    public function setEmail(string $email): static
+    {
+        $this->email = $email;
+
+        return $this;
+    }
+
+    public function getPassword(): ?string
+    {
+        return $this->password;
+    }
+
+    public function setPassword(string $password): static
+    {
+        $this->password = $password;
+
+        return $this;
+    }
+
+    public function isBlocked(): ?bool
+    {
+        return $this->is_blocked;
+    }
+
+    public function setIsBlocked(?bool $is_blocked): static
+    {
+        $this->is_blocked = $is_blocked;
+
+        return $this;
+    }
+
+    public function getRole(): ?UserRole
+    {
+        return $this->role;
+    }
+
+    public function setRole(UserRole $role): static
+    {
+        $this->role = $role;
+
+        return $this;
+    }
+
+    public function getCreatedAt(): ?\DateTimeImmutable
+    {
+        return $this->created_at;
+    }
+
+    public function setCreatedAt(\DateTimeImmutable $created_at): static
+    {
+        $this->created_at = $created_at;
+
+        return $this;
+    }
+}
diff --git a/web_app/src/Entity/WishList.php b/web_app/src/Entity/WishList.php
new file mode 100644
index 0000000..3ed0aa8
--- /dev/null
+++ b/web_app/src/Entity/WishList.php
@@ -0,0 +1,103 @@
+<?php
+
+namespace App\Entity;
+
+use App\Repository\WishListRepository;
+use Doctrine\DBAL\Types\Types;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ORM\Entity(repositoryClass: WishListRepository::class)]
+class WishList
+{
+    #[ORM\Id]
+    #[ORM\GeneratedValue]
+    #[ORM\Column]
+    private ?int $id = null;
+
+    #[ORM\Column]
+    private ?int $user_id = null;
+
+    #[ORM\Column(length: 255)]
+    private ?string $name = null;
+
+    #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
+    private ?\DateTimeInterface $expiration_date = null;
+
+    #[ORM\Column]
+    private ?bool $is_active = null;
+
+    #[ORM\Column]
+    private ?\DateTimeImmutable $created_at = null;
+
+    public function getId(): ?int
+    {
+        return $this->id;
+    }
+
+    public function setId(int $id): static
+    {
+        $this->id = $id;
+
+        return $this;
+    }
+
+    public function getUserId(): ?int
+    {
+        return $this->user_id;
+    }
+
+    public function setUserId(int $user_id): static
+    {
+        $this->user_id = $user_id;
+
+        return $this;
+    }
+
+    public function getName(): ?string
+    {
+        return $this->name;
+    }
+
+    public function setName(string $name): static
+    {
+        $this->name = $name;
+
+        return $this;
+    }
+
+    public function getExpirationDate(): ?\DateTimeInterface
+    {
+        return $this->expiration_date;
+    }
+
+    public function setExpirationDate(?\DateTimeInterface $expiration_date): static
+    {
+        $this->expiration_date = $expiration_date;
+
+        return $this;
+    }
+
+    public function isActive(): ?bool
+    {
+        return $this->is_active;
+    }
+
+    public function setIsActive(bool $is_active): static
+    {
+        $this->is_active = $is_active;
+
+        return $this;
+    }
+
+    public function getCreatedAt(): ?\DateTimeImmutable
+    {
+        return $this->created_at;
+    }
+
+    public function setCreatedAt(\DateTimeImmutable $created_at): static
+    {
+        $this->created_at = $created_at;
+
+        return $this;
+    }
+}
diff --git a/web_app/src/Entity/WishListItem.php b/web_app/src/Entity/WishListItem.php
new file mode 100644
index 0000000..e83f9d9
--- /dev/null
+++ b/web_app/src/Entity/WishListItem.php
@@ -0,0 +1,50 @@
+<?php
+
+namespace App\Entity;
+
+use App\Repository\WishListItemRepository;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ORM\Entity(repositoryClass: WishListItemRepository::class)]
+class WishListItem
+{
+    #[ORM\Id]
+    #[ORM\GeneratedValue]
+    #[ORM\Column]
+    private ?int $id = null;
+
+    #[ORM\Column]
+    private ?int $wishlist_id = null;
+
+    #[ORM\Column]
+    private ?int $item_id = null;
+
+    public function getId(): ?int
+    {
+        return $this->id;
+    }
+
+    public function getWishlistId(): ?int
+    {
+        return $this->wishlist_id;
+    }
+
+    public function setWishlistId(int $wishlist_id): static
+    {
+        $this->wishlist_id = $wishlist_id;
+
+        return $this;
+    }
+
+    public function getItemId(): ?int
+    {
+        return $this->item_id;
+    }
+
+    public function setItemId(int $item_id): static
+    {
+        $this->item_id = $item_id;
+
+        return $this;
+    }
+}
diff --git a/web_app/src/Entity/WishListMember.php b/web_app/src/Entity/WishListMember.php
new file mode 100644
index 0000000..ee4e53f
--- /dev/null
+++ b/web_app/src/Entity/WishListMember.php
@@ -0,0 +1,95 @@
+<?php
+
+namespace App\Entity;
+
+use App\Repository\WishListMemberRepository;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ORM\Entity(repositoryClass: WishListMemberRepository::class)]
+class WishListMember
+{
+    #[ORM\Id]
+    #[ORM\GeneratedValue]
+    #[ORM\Column]
+    private ?int $id = null;
+
+    #[ORM\Column]
+    private ?int $wishlist_id = null;
+
+    #[ORM\Column]
+    private ?int $user_id = null;
+
+    #[ORM\Column]
+    private ?bool $can_edit = null;
+
+    #[ORM\Column(nullable: true)]
+    private ?bool $is_accepted = null;
+
+    #[ORM\Column]
+    private ?\DateTimeImmutable $created_at = null;
+
+    public function getId(): ?int
+    {
+        return $this->id;
+    }
+
+    public function getWishlistId(): ?int
+    {
+        return $this->wishlist_id;
+    }
+
+    public function setWishlistId(int $wishlist_id): static
+    {
+        $this->wishlist_id = $wishlist_id;
+
+        return $this;
+    }
+
+    public function getUserId(): ?int
+    {
+        return $this->user_id;
+    }
+
+    public function setUserId(int $user_id): static
+    {
+        $this->user_id = $user_id;
+
+        return $this;
+    }
+
+    public function isCanEdit(): ?bool
+    {
+        return $this->can_edit;
+    }
+
+    public function setCanEdit(bool $can_edit): static
+    {
+        $this->can_edit = $can_edit;
+
+        return $this;
+    }
+
+    public function isAccepted(): ?bool
+    {
+        return $this->is_accepted;
+    }
+
+    public function setIsAccepted(?bool $is_accepted): static
+    {
+        $this->is_accepted = $is_accepted;
+
+        return $this;
+    }
+
+    public function getCreatedAt(): ?\DateTimeImmutable
+    {
+        return $this->created_at;
+    }
+
+    public function setCreatedAt(\DateTimeImmutable $created_at): static
+    {
+        $this->created_at = $created_at;
+
+        return $this;
+    }
+}
diff --git a/web_app/src/Enum/UserRole.php b/web_app/src/Enum/UserRole.php
new file mode 100644
index 0000000..4b04056
--- /dev/null
+++ b/web_app/src/Enum/UserRole.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Enum;
+
+enum UserRole: string
+{
+    case ADMIN = 'admin';
+    case USER = 'user';
+
+    public function label(): string
+    {
+        return match($this) {
+            self::ADMIN => 'Administrator',
+            self::USER => 'Regular User'
+        };
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/web_app/src/Repository/ItemRepository.php b/web_app/src/Repository/ItemRepository.php
new file mode 100644
index 0000000..229f406
--- /dev/null
+++ b/web_app/src/Repository/ItemRepository.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Repository;
+
+use App\Entity\Item;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+
+/**
+ * @extends ServiceEntityRepository<Item>
+ */
+class ItemRepository extends ServiceEntityRepository
+{
+    public function __construct(ManagerRegistry $registry)
+    {
+        parent::__construct($registry, Item::class);
+    }
+
+    //    /**
+    //     * @return Item[] Returns an array of Item objects
+    //     */
+    //    public function findByExampleField($value): array
+    //    {
+    //        return $this->createQueryBuilder('i')
+    //            ->andWhere('i.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->orderBy('i.id', 'ASC')
+    //            ->setMaxResults(10)
+    //            ->getQuery()
+    //            ->getResult()
+    //        ;
+    //    }
+
+    //    public function findOneBySomeField($value): ?Item
+    //    {
+    //        return $this->createQueryBuilder('i')
+    //            ->andWhere('i.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->getQuery()
+    //            ->getOneOrNullResult()
+    //        ;
+    //    }
+}
diff --git a/web_app/src/Repository/ProductRepository.php b/web_app/src/Repository/PurchaseRepository.php
similarity index 74%
rename from web_app/src/Repository/ProductRepository.php
rename to web_app/src/Repository/PurchaseRepository.php
index 9564bc1..6f189b3 100644
--- a/web_app/src/Repository/ProductRepository.php
+++ b/web_app/src/Repository/PurchaseRepository.php
@@ -2,22 +2,22 @@
 
 namespace App\Repository;
 
-use App\Entity\Product;
+use App\Entity\Purchase;
 use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
 use Doctrine\Persistence\ManagerRegistry;
 
 /**
- * @extends ServiceEntityRepository<Product>
+ * @extends ServiceEntityRepository<Purchase>
  */
-class ProductRepository extends ServiceEntityRepository
+class PurchaseRepository extends ServiceEntityRepository
 {
     public function __construct(ManagerRegistry $registry)
     {
-        parent::__construct($registry, Product::class);
+        parent::__construct($registry, Purchase::class);
     }
 
     //    /**
-    //     * @return Product[] Returns an array of Product objects
+    //     * @return Purchase[] Returns an array of Purchase objects
     //     */
     //    public function findByExampleField($value): array
     //    {
@@ -31,7 +31,7 @@ class ProductRepository extends ServiceEntityRepository
     //        ;
     //    }
 
-    //    public function findOneBySomeField($value): ?Product
+    //    public function findOneBySomeField($value): ?Purchase
     //    {
     //        return $this->createQueryBuilder('p')
     //            ->andWhere('p.exampleField = :val')
diff --git a/web_app/src/Repository/UserRepository.php b/web_app/src/Repository/UserRepository.php
new file mode 100644
index 0000000..b29153b
--- /dev/null
+++ b/web_app/src/Repository/UserRepository.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Repository;
+
+use App\Entity\User;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+
+/**
+ * @extends ServiceEntityRepository<User>
+ */
+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()
+    //        ;
+    //    }
+}
diff --git a/web_app/src/Repository/WishListItemRepository.php b/web_app/src/Repository/WishListItemRepository.php
new file mode 100644
index 0000000..1b7d0ff
--- /dev/null
+++ b/web_app/src/Repository/WishListItemRepository.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Repository;
+
+use App\Entity\WishListItem;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+
+/**
+ * @extends ServiceEntityRepository<WishListItem>
+ */
+class WishListItemRepository extends ServiceEntityRepository
+{
+    public function __construct(ManagerRegistry $registry)
+    {
+        parent::__construct($registry, WishListItem::class);
+    }
+
+    //    /**
+    //     * @return WishListItem[] Returns an array of WishListItem objects
+    //     */
+    //    public function findByExampleField($value): array
+    //    {
+    //        return $this->createQueryBuilder('w')
+    //            ->andWhere('w.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->orderBy('w.id', 'ASC')
+    //            ->setMaxResults(10)
+    //            ->getQuery()
+    //            ->getResult()
+    //        ;
+    //    }
+
+    //    public function findOneBySomeField($value): ?WishListItem
+    //    {
+    //        return $this->createQueryBuilder('w')
+    //            ->andWhere('w.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->getQuery()
+    //            ->getOneOrNullResult()
+    //        ;
+    //    }
+}
diff --git a/web_app/src/Repository/WishListMemberRepository.php b/web_app/src/Repository/WishListMemberRepository.php
new file mode 100644
index 0000000..cd0e76f
--- /dev/null
+++ b/web_app/src/Repository/WishListMemberRepository.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Repository;
+
+use App\Entity\WishListMember;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+
+/**
+ * @extends ServiceEntityRepository<WishListMember>
+ */
+class WishListMemberRepository extends ServiceEntityRepository
+{
+    public function __construct(ManagerRegistry $registry)
+    {
+        parent::__construct($registry, WishListMember::class);
+    }
+
+    //    /**
+    //     * @return WishListMember[] Returns an array of WishListMember objects
+    //     */
+    //    public function findByExampleField($value): array
+    //    {
+    //        return $this->createQueryBuilder('w')
+    //            ->andWhere('w.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->orderBy('w.id', 'ASC')
+    //            ->setMaxResults(10)
+    //            ->getQuery()
+    //            ->getResult()
+    //        ;
+    //    }
+
+    //    public function findOneBySomeField($value): ?WishListMember
+    //    {
+    //        return $this->createQueryBuilder('w')
+    //            ->andWhere('w.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->getQuery()
+    //            ->getOneOrNullResult()
+    //        ;
+    //    }
+}
diff --git a/web_app/src/Repository/WishListRepository.php b/web_app/src/Repository/WishListRepository.php
new file mode 100644
index 0000000..846c543
--- /dev/null
+++ b/web_app/src/Repository/WishListRepository.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Repository;
+
+use App\Entity\WishList;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+
+/**
+ * @extends ServiceEntityRepository<WishList>
+ */
+class WishListRepository extends ServiceEntityRepository
+{
+    public function __construct(ManagerRegistry $registry)
+    {
+        parent::__construct($registry, WishList::class);
+    }
+
+    //    /**
+    //     * @return WishList[] Returns an array of WishList objects
+    //     */
+    //    public function findByExampleField($value): array
+    //    {
+    //        return $this->createQueryBuilder('w')
+    //            ->andWhere('w.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->orderBy('w.id', 'ASC')
+    //            ->setMaxResults(10)
+    //            ->getQuery()
+    //            ->getResult()
+    //        ;
+    //    }
+
+    //    public function findOneBySomeField($value): ?WishList
+    //    {
+    //        return $this->createQueryBuilder('w')
+    //            ->andWhere('w.exampleField = :val')
+    //            ->setParameter('val', $value)
+    //            ->getQuery()
+    //            ->getOneOrNullResult()
+    //        ;
+    //    }
+}
-- 
GitLab