feat(profile): enforce uniqueness of national_code across user profiles and update related error handling

This commit is contained in:
hamed
2026-06-24 11:52:13 +03:30
parent 3eb82ffa7d
commit 650e36bce2
9 changed files with 247 additions and 7 deletions
@@ -24,6 +24,11 @@ class UserProfileRepository extends ServiceEntityRepository
return $this->findOneBy(['uuid' => $uuid]);
}
public function findOneByNationalCode(string $nationalCode): ?UserProfile
{
return $this->findOneBy(['nationalCode' => $nationalCode]);
}
public function save(UserProfile $profile, bool $flush = true): void
{
$this->getEntityManager()->persist($profile);