<?php
namespace App\Entity;
use App\Repository\AppointmentRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AppointmentRepository::class)]
class Appointment implements AppointmentInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'appointments')]
#[ORM\JoinColumn(nullable: false)]
private ?Patient $client = null;
#[ORM\ManyToOne(inversedBy: 'appointments')]
private ?Doctor $doctor = null;
#[ORM\Column(length: 100)]
private ?string $status = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $acceptedAt = null;
#[ORM\Column(length: 10)]
private ?string $passcode = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $startDate = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column(length: 100)]
private ?string $uniqueId = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 100, nullable: true)]
private ?string $meetingId = null;
#[ORM\ManyToOne(inversedBy: 'appointments')]
#[ORM\JoinColumn(nullable: false)]
private ?TimeSlot $timeSlot = null;
#[ORM\Column(nullable: true)]
private ?int $duration = null;
public function getId(): ?int
{
return $this->id;
}
public function getClient(): ?Patient
{
return $this->client;
}
public function setClient(?Patient $client): self
{
$this->client = $client;
return $this;
}
public function getDoctor(): ?Doctor
{
return $this->doctor;
}
public function setDoctor(?Doctor $doctor): self
{
$this->doctor = $doctor;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
public function getAcceptedAt(): ?\DateTimeImmutable
{
return $this->acceptedAt;
}
public function setAcceptedAt(?\DateTimeImmutable $acceptedAt): self
{
$this->acceptedAt = $acceptedAt;
return $this;
}
public function getPasscode(): ?string
{
return $this->passcode;
}
public function setPasscode(string $passcode): self
{
$this->passcode = $passcode;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUniqueId(): ?string
{
return $this->uniqueId;
}
public function setUniqueId(string $uniqueId): static
{
$this->uniqueId = $uniqueId;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getMeetingId(): ?string
{
return $this->meetingId;
}
public function setMeetingId(?string $meetingId): static
{
$this->meetingId = $meetingId;
return $this;
}
public function getTimeSlot(): ?TimeSlot
{
return $this->timeSlot;
}
public function setTimeSlot(?TimeSlot $timeSlot): static
{
$this->timeSlot = $timeSlot;
return $this;
}
public function getDuration(): ?int
{
return $this->duration;
}
public function setDuration(?int $duration): static
{
$this->duration = $duration;
return $this;
}
public function isPending(): bool
{
return self::STATUS_PENDING == $this->getStatus();
}
public function isCancelled(): bool
{
return self::STATUS_CANCELLED == $this->getStatus();
}
public function isAccepted(): bool
{
return self::STATUS_ACCEPTED == $this->getStatus();
}
}