feat(validation): enforce naming rules for doctors and clinics to prevent placeholders

This commit is contained in:
hamed
2026-07-19 08:38:11 +03:30
parent 44b89d7add
commit d780b5cbb6
9 changed files with 461 additions and 3 deletions
+3 -1
View File
@@ -6,6 +6,7 @@ use App\Auth\Entity\User;
use App\Doctor\Entity\Doctor;
use App\DoctorService\Entity\DoctorService;
use App\Insurance\Entity\Insurance;
use App\Shared\Util\DisplayName;
use App\Specialty\Entity\Specialty;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
@@ -166,7 +167,8 @@ class Clinic
public function getServices(): Collection { return $this->services; }
public function getInsurances(): Collection { return $this->insurances; }
public function setName(?string $v): self { $this->name = $v; $this->touch(); return $this; }
// null مجاز است (کلینیک تازه‌ساخته هنوز نام ندارد)؛ ولی نام آلوده رد می‌شود.
public function setName(?string $v): self { if ($v !== null) DisplayName::assertReal($v); $this->name = $v; $this->touch(); return $this; }
public function setInfo(?string $v): self { $this->info = $v; $this->touch(); return $this; }
public function setAddress(?string $v): self { $this->address = $v; $this->touch(); return $this; }
public function setTelephone(?string $v): self { $this->telephone = $v; $this->touch(); return $this; }