Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user