feat(clinic): enhance clinic detail response with location map and additional fields
This commit is contained in:
@@ -169,7 +169,7 @@ class Clinic
|
||||
|
||||
private function touch(): void { $this->updatedAt = time(); }
|
||||
|
||||
public function toDetailArray(array $provinceData = [], array $cityData = []): array
|
||||
public function toDetailArray(array $provinceData = [], array $cityData = [], ?array $map = null): array
|
||||
{
|
||||
return [
|
||||
'id' => (string) $this->id,
|
||||
@@ -202,7 +202,7 @@ class Clinic
|
||||
'city' => $cityData ? [$cityData] : [],
|
||||
'state' => $provinceData ? [$provinceData] : [],
|
||||
'location' => $this->address,
|
||||
'map' => [
|
||||
'map' => $map ?? [
|
||||
'latitude' => $this->latitude !== null ? (string) $this->latitude : null,
|
||||
'longitude' => $this->longitude !== null ? (string) $this->longitude : null,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user