feat(clinic): enhance clinic listing with additional details and address information

- Updated the clinic API response to include new fields: title, phone, logo, images_clinic, doctors_count, city, state, 24_7, and field_working_days.
- Modified the ClinicController to fetch and include city and state information based on the clinic's address.
- Refactored the toListArray method in the Clinic entity to accept city and state parameters.
- Added a new method in the ClinicRepository to retrieve city and province names for each clinic based on their address.
This commit is contained in:
hamed
2026-06-18 15:03:36 +03:30
parent eb576b7d98
commit 4bb65c7502
5 changed files with 359 additions and 273 deletions
+5 -2
View File
@@ -211,7 +211,7 @@ class Clinic
];
}
public function toListArray(): array
public function toListArray(?string $city = null, ?string $state = null): array
{
return [
'id' => (string) $this->id,
@@ -226,10 +226,13 @@ class Clinic
'doctors_count' => $this->doctors->count(),
'is_active' => $this->isActive,
'created_at' => $this->createdAt,
'city' => $city,
'state' => $state,
'specialties' => array_map(fn(Specialty $s) => [
'uuid' => $s->getUuid(), 'id' => (string) $s->getId(), 'name' => $s->getName(),
], $this->specialties->toArray()),
'24_7' => $this->is247,
'24_7' => $this->is247,
'field_working_days' => $this->workingDays,
];
}
}