src/Entity/Appointment.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AppointmentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=AppointmentRepository::class)
  8.  * @ORM\Table(name="appointments")
  9.  */
  10. class Appointment
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $patient;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $provider;
  28.     /**
  29.      * Relación con Horario
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\Horario")
  31.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  32.      */
  33.     private $horario;
  34.     /**
  35.      * @ORM\Column(type="string", length=30)
  36.      * @Assert\Choice(callback={"App\Enum\AppointmentStatus", "choices"})
  37.      */
  38.     private $status 'confirmada';
  39.     /**
  40.      * @ORM\Column(type="text", nullable=true)
  41.      */
  42.     private $notes;
  43.     /**
  44.      * @ORM\Column(type="datetime_immutable")
  45.      */
  46.     private $createdAt;
  47.     /**
  48.      * @ORM\Column(type="datetime_immutable", nullable=true)
  49.      */
  50.     private $updatedAt;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $cancelToken;
  55.        /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $reprogramToken;
  59.     /**
  60.      * @ORM\Column(type="string", length=100)
  61.      * @Assert\NotBlank(message="El tipo de estudio es obligatorio.")
  62.      */
  63.     private $tipoEstudio;
  64.     /**
  65.      * @ORM\Column(type="string", length=20)
  66.      */
  67.     private $paymentMethod;
  68.     /**
  69.      * @ORM\Column(type="string", length=20, nullable=true)
  70.      */
  71.     private $paymentStatus;
  72.     
  73.     /**
  74.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  75.      */
  76.     private $montoImagingPro;
  77.     public const PAYMENT_METHOD_IMAGIN_PRO 'imagin_pro';
  78.     public const PAYMENT_METHOD_CLINICA 'clinica';
  79.     public const PAYMENT_STATUS_PENDING 'pendiente';
  80.     public const PAYMENT_STATUS_PAID 'pagado';
  81.     public const PAYMENT_STATUS_CANCELLED 'cancelado';
  82.     public function __construct()
  83.     {
  84.         $this->createdAt = new \DateTimeImmutable();
  85.         $this->status 'confirmada';
  86.         $this->paymentStatus self::PAYMENT_STATUS_PENDING;
  87.     }
  88.     public function getId(): ?int
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getPatient()
  93.     {
  94.         return $this->patient;
  95.     }
  96.     public function setPatient($patient): self
  97.     {
  98.         $this->patient $patient;
  99.         return $this;
  100.     }
  101.     public function getProvider()
  102.     {
  103.         return $this->provider;
  104.     }
  105.     public function setProvider($provider): self
  106.     {
  107.         $this->provider $provider;
  108.         return $this;
  109.     }
  110.     public function getStatus(): string
  111.     {
  112.         return $this->status;
  113.     }
  114.     public function setStatus(string $status): self
  115.     {
  116.         $this->status $status;
  117.         return $this;
  118.     }
  119.     public function getNotes(): ?string
  120.     {
  121.         return $this->notes;
  122.     }
  123.     public function setNotes(?string $notes): self
  124.     {
  125.         $this->notes $notes;
  126.         return $this;
  127.     }
  128.     public function getCreatedAt(): ?\DateTimeImmutable
  129.     {
  130.         return $this->createdAt;
  131.     }
  132.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  133.     {
  134.         $this->createdAt $createdAt;
  135.         return $this;
  136.     }
  137.     public function getUpdatedAt(): ?\DateTimeImmutable
  138.     {
  139.         return $this->updatedAt;
  140.     }
  141.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  142.     {
  143.         $this->updatedAt $updatedAt;
  144.         return $this;
  145.     }
  146.     public function getHorario(): ?Horario
  147.     {
  148.         return $this->horario;
  149.     }
  150.     public function setHorario(?Horario $horario): self
  151.     {
  152.         $this->horario $horario;
  153.         return $this;
  154.     }
  155.     
  156.     public function getCancelToken()
  157.     {
  158.         return $this->cancelToken;
  159.     }
  160.     public function setCancelToken($cancelToken)
  161.     {
  162.         $this->cancelToken $cancelToken;
  163.         return $this;
  164.     }
  165.         
  166.     public function getReprogramToken()
  167.     {
  168.         return $this->reprogramToken;
  169.     }
  170.     public function setReprogramToken($reprogramToken)
  171.     {
  172.         $this->reprogramToken $reprogramToken;
  173.         return $this;
  174.     }
  175.     public function getTipoEstudio(): ?string
  176.     {
  177.         return $this->tipoEstudio;
  178.     }
  179.     public function setTipoEstudio(string $tipoEstudio): self
  180.     {
  181.         $this->tipoEstudio $tipoEstudio;
  182.         return $this;
  183.     }
  184. public function getPaymentMethod(): ?string
  185.     {
  186.         return $this->paymentMethod;
  187.     }
  188.     public function setPaymentMethod(string $paymentMethod): self
  189.     {
  190.         $this->paymentMethod $paymentMethod;
  191.         return $this;
  192.     }
  193.     public function getPaymentStatus(): ?string
  194.     {
  195.         return $this->paymentStatus;
  196.     }
  197.     public function setPaymentStatus(?string $paymentStatus): self
  198.     {
  199.         $this->paymentStatus $paymentStatus;
  200.         return $this;
  201.     }
  202.     public static function getPaymentMethods(): array
  203.     {
  204.         return [
  205.             'Imagin Pro' => self::PAYMENT_METHOD_IMAGIN_PRO,
  206.             'Clínica' => self::PAYMENT_METHOD_CLINICA,
  207.         ];
  208.     }
  209.     
  210.     public function getMontoImagingPro(): ?string
  211.     {
  212.         return $this->montoImagingPro;
  213.     }
  214.     
  215.     public function setMontoImagingPro(?string $monto): self
  216.     {
  217.         $this->montoImagingPro $monto;
  218.         return $this;
  219.     }
  220. }