Refactor code structure for improved readability and maintainability

This commit is contained in:
hamed
2026-07-23 15:47:17 +03:30
parent a0a2eb1799
commit f00ed23f00
14 changed files with 1406 additions and 1351 deletions
+4 -1
View File
@@ -38,6 +38,7 @@ class BillingController extends BaseController
private readonly InsuranceRepository $insuranceRepo,
private readonly ClaimStatusLogRepository $statusLogRepo,
private readonly PatientRecordScopeResolver $scopeResolver,
private readonly \App\UserProfile\Repository\UserProfileRepository $profileRepo,
) {}
/**
@@ -237,12 +238,14 @@ class BillingController extends BaseController
$result = $this->invoiceService->patientInvoiceList($entityType, $entityId, $record->getId(), $page, $limit);
$patient = $record->getUser();
// کد ملی روی پروفایل ذخیره می‌شود؛ users.national_code برای بیمارِ ساخته‌شده در نوبت‌دهی خالی است.
$nationalCode = $this->profileRepo->findByUser($patient)?->getNationalCode() ?? $patient->getNationalCode();
return $this->success([
'patient' => [
'uuid' => $record->getUuid(),
'name' => $patient->getRealName(),
'national_code' => $patient->getNationalCode(),
'national_code' => $nationalCode,
],
'data' => $result['items'],
'summary' => $result['summary'],