extend User entity with displayname and email confirmation

Add display_name (unique) and email_confirmed_at columns plus
matching getters, DTO fields, repo methods (findByDisplayName,
update), and migration. Existing auth tests updated to construct
User with the new params.
This commit is contained in:
Yisroel Baum 2026-05-06 22:03:19 +03:00
parent d547ec2c61
commit 298b8634ec
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
10 changed files with 131 additions and 15 deletions

View file

@ -3,14 +3,17 @@
namespace App\User;
use App\Shared\ValueObject\EmailAddress;
use DateTimeImmutable;
class User
{
public function __construct(
private int $id,
private EmailAddress $email,
private string $displayName,
private string $passwordHash,
private bool $isAdmin,
private ?DateTimeImmutable $emailConfirmedAt,
) {}
public function getId(): int
@ -23,6 +26,11 @@ class User
return $this->email;
}
public function getDisplayName(): string
{
return $this->displayName;
}
public function getPasswordHash(): string
{
return $this->passwordHash;
@ -32,4 +40,14 @@ class User
{
return $this->isAdmin;
}
public function getEmailConfirmedAt(): ?DateTimeImmutable
{
return $this->emailConfirmedAt;
}
public function isEmailConfirmed(): bool
{
return $this->emailConfirmedAt !== null;
}
}