From 533320fcacb6872b23dafc155fa8eae5101b11fc Mon Sep 17 00:00:00 2001 From: yisroel Date: Wed, 6 May 2026 15:00:49 +0300 Subject: [PATCH] add User entity, dto, repository interface User holds email (EmailAddress vo), passwordHash, isAdmin - tide keeps password and admin flag on the user row directly (no separate profile entity like youngstartup). UserRepository exposes find, findByEmail, create. CreateUserDto is readonly with explicit isAdmin (per shared.md no-default-args rule). --- backend/app/User/CreateUserDto.php | 14 ++++++++++++ backend/app/User/User.php | 35 +++++++++++++++++++++++++++++ backend/app/User/UserRepository.php | 14 ++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 backend/app/User/CreateUserDto.php create mode 100644 backend/app/User/User.php create mode 100644 backend/app/User/UserRepository.php diff --git a/backend/app/User/CreateUserDto.php b/backend/app/User/CreateUserDto.php new file mode 100644 index 0000000..7c353e5 --- /dev/null +++ b/backend/app/User/CreateUserDto.php @@ -0,0 +1,14 @@ +id; + } + + public function getEmail(): EmailAddress + { + return $this->email; + } + + public function getPasswordHash(): string + { + return $this->passwordHash; + } + + public function isAdmin(): bool + { + return $this->isAdmin; + } +} diff --git a/backend/app/User/UserRepository.php b/backend/app/User/UserRepository.php new file mode 100644 index 0000000..4805f3f --- /dev/null +++ b/backend/app/User/UserRepository.php @@ -0,0 +1,14 @@ +