feat(appointment): update patient identification to use national code from profile and enhance appointment creation logic

This commit is contained in:
hamed
2026-07-15 18:46:56 +03:30
parent 0dc1ab949a
commit de6fe1bd56
8 changed files with 94 additions and 32 deletions
+4 -1
View File
@@ -4,6 +4,7 @@ namespace App\Tests\Appointment;
use App\Auth\Entity\User;
use App\Tests\ApiTestCase;
use App\UserProfile\Entity\UserProfile;
/**
* GET /api/v1/my/appointment/patient-lookup — mobile-first patient search used
@@ -32,7 +33,9 @@ class PatientLookupTest extends ApiTestCase
$nc = $this->nationalCode();
$patient = $this->createUser(['ROLE_USER'], $mobile);
$patient->setRealName('علی محمدی');
$patient->setNationalCode($nc);
$profile = new UserProfile($patient);
$profile->setNationalCode($nc);
$this->em->persist($profile);
$this->em->flush();
$res = $this->authJson('GET', '/api/v1/my/appointment/patient-lookup?mobile=' . $mobile, $this->booker());