implement SignupUser use case

validates email present + format (wraps EmailAddress vo's
InvalidArgumentException as BadRequest), password present +
>= 8 chars, then ensures email not already registered. hashes
password through injected PasswordHasher and persists via
UserRepository->create with isAdmin=false (admins are seeder-
only per plan). throws DomainException on duplicate email so
the controller layer can map it to 409. all 18 tests pass.
This commit is contained in:
yisroel 2026-05-06 15:13:26 +03:00
parent fefc992431
commit a108b29d19
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,11 @@
<?php
namespace App\User\UseCases\SignupUser;
class SignupUserRequest
{
public function __construct(
public ?string $email,
public ?string $password,
) {}
}