feat(profile): enforce uniqueness of national_code across user profiles and update related error handling
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user