Refactor code structure for improved readability and maintainability

This commit is contained in:
hamed
2026-07-12 09:54:44 +03:30
parent ca66b86cf9
commit 476d5bb80e
16 changed files with 1617 additions and 907 deletions
+10 -4
View File
@@ -399,6 +399,12 @@ class Doctor
return $this;
}
/** امتیاز فقط برای پروفایل claimed واقعی است؛ unclaimed/pending_transfer مقدار پیش‌فرض جعلی دارد. */
public function hasPublicRating(): bool
{
return $this->ownerStatus === 'claimed';
}
private function touch(): void
{
$this->updatedAt = time();
@@ -518,8 +524,8 @@ class Doctor
'id' => (string) $s->getId(),
'name' => $s->getName(),
], $this->specialties->toArray()),
'satisfaction' => (string) $this->doctorRatePercentage,
'point' => (string) $this->doctorRate,
'satisfaction' => $this->hasPublicRating() ? (string) $this->doctorRatePercentage : null,
'point' => $this->hasPublicRating() ? (string) $this->doctorRate : null,
'free_turn' => $sf['free_turn'],
'hours_of_work' => $sf['hours_of_work'],
'active' => $this->activeDoctorAppointment && $sf['has_schedule'],
@@ -554,8 +560,8 @@ class Doctor
'id' => (string) $ds->getId(),
'name' => $ds->getName(),
], $this->services->toArray()),
'satisfaction' => (string) $this->doctorRatePercentage,
'point' => (string) $this->doctorRate,
'satisfaction' => $this->hasPublicRating() ? (string) $this->doctorRatePercentage : null,
'point' => $this->hasPublicRating() ? (string) $this->doctorRate : null,
'owner_status' => $this->ownerStatus,
'free_turn' => $sf['free_turn'],
'hours_of_work' => $sf['hours_of_work'],