feat(validation): enforce naming rules for doctors and clinics to prevent placeholders
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Auth\Entity\User;
|
||||
use App\DoctorService\Entity\DoctorService;
|
||||
use App\Location\Entity\City;
|
||||
use App\Location\Entity\Province;
|
||||
use App\Shared\Util\DisplayName;
|
||||
use App\Specialty\Entity\Specialty;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -142,6 +143,8 @@ class Doctor
|
||||
|
||||
public function __construct(User $user, string $name)
|
||||
{
|
||||
DisplayName::assertReal($name);
|
||||
|
||||
$this->uuid = Uuid::v4()->toRfc4122();
|
||||
$this->user = $user;
|
||||
$this->name = $name;
|
||||
@@ -273,6 +276,7 @@ class Doctor
|
||||
|
||||
public function setName(string $v): self
|
||||
{
|
||||
DisplayName::assertReal($v);
|
||||
$this->name = $v;
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user