feat: add clinic status management with active/inactive toggle and update related API endpoints
This commit is contained in:
@@ -64,6 +64,9 @@ class Clinic
|
||||
#[ORM\Column(name: 'representation_id', type: 'integer', nullable: true)]
|
||||
private ?int $representationId = null;
|
||||
|
||||
#[ORM\Column(name: 'is_active', type: 'boolean')]
|
||||
private bool $isActive = true;
|
||||
|
||||
#[ORM\Column(name: 'images_clinic', type: 'json', nullable: true)]
|
||||
private ?array $imagesClinic = null;
|
||||
|
||||
@@ -134,6 +137,7 @@ class Clinic
|
||||
public function getCityId(): ?int { return $this->cityId; }
|
||||
public function getProvinceId(): ?int { return $this->provinceId; }
|
||||
public function getRepresentationId(): ?int { return $this->representationId; }
|
||||
public function isActive(): bool { return $this->isActive; }
|
||||
public function getImagesClinic(): ?array { return $this->imagesClinic; }
|
||||
public function getClinicLogo(): ?string { return $this->clinicLogo; }
|
||||
public function getCreatedAt(): int { return $this->createdAt; }
|
||||
@@ -154,6 +158,7 @@ class Clinic
|
||||
public function setCityId(?int $v): self { $this->cityId = $v; $this->touch(); return $this; }
|
||||
public function setProvinceId(?int $v): self { $this->provinceId = $v; $this->touch(); return $this; }
|
||||
public function setRepresentationId(?int $v): self { $this->representationId = $v; $this->touch(); return $this; }
|
||||
public function setIsActive(bool $v): self { $this->isActive = $v; $this->touch(); return $this; }
|
||||
public function setImagesClinic(?array $v): self { $this->imagesClinic = $v; $this->touch(); return $this; }
|
||||
public function setClinicLogo(?string $v): self { $this->clinicLogo = $v; $this->touch(); return $this; }
|
||||
|
||||
@@ -164,7 +169,11 @@ class Clinic
|
||||
return [
|
||||
'id' => (string) $this->id,
|
||||
'uuid' => $this->uuid,
|
||||
'name' => $this->name,
|
||||
'title' => $this->name,
|
||||
'is_active' => $this->isActive,
|
||||
'phone' => $this->telephone,
|
||||
'logo' => $this->clinicLogo,
|
||||
'images_clinic' => $this->imagesClinic ?? [],
|
||||
'clinic_logo' => $this->clinicLogo,
|
||||
'phone_number' => $this->telephone,
|
||||
@@ -202,14 +211,19 @@ class Clinic
|
||||
return [
|
||||
'id' => (string) $this->id,
|
||||
'uuid' => $this->uuid,
|
||||
'name' => $this->name,
|
||||
'title' => $this->name,
|
||||
'images_clinic' => $this->imagesClinic ?? [],
|
||||
'clinic_logo' => $this->clinicLogo ?? [],
|
||||
'phone' => $this->telephone,
|
||||
'phone_number' => $this->telephone,
|
||||
'logo' => $this->clinicLogo,
|
||||
'clinic_logo' => $this->clinicLogo,
|
||||
'images_clinic' => $this->imagesClinic ?? [],
|
||||
'doctors_count' => $this->doctors->count(),
|
||||
'is_active' => $this->isActive,
|
||||
'created_at' => $this->createdAt,
|
||||
'specialties' => array_map(fn(Specialty $s) => [
|
||||
'uuid' => $s->getUuid(), 'id' => (string) $s->getId(), 'name' => $s->getName(),
|
||||
], $this->specialties->toArray()),
|
||||
'doctors' => $this->doctors->count(),
|
||||
'24_7' => $this->is247,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user