<?php
declare(strict_types=1);

namespace App\Entity\Message;

use App\Entity\Access\Access;
use App\Entity\Organization\Organization;
use App\Enum\Message\ReportMessageStatusEnum;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;

/**
 * Classe ... qui ...
 */
#[ORM\MappedSuperclass]
class AbstractReport
{
    #[ORM\Column(type: 'date', nullable: true)]
    protected ?\DatetimeInterface $dateSend;

    #[ORM\Column(length: 255)]
    #[Assert\Choice(callback: [ReportMessageStatusEnum::class, 'toArray'], message: 'invalid-report-type')]
    protected string $status;

    #[ORM\ManyToOne(inversedBy: 'report')]
    protected ?Access $access;

    #[ORM\ManyToOne(inversedBy: 'report')]
    protected ?Organization $organization;

    public function getDateSend(): ?\DatetimeInterface
    {
        return $this->dateSend;
    }

    public function setDateSend(?\DatetimeInterface $dateSend): self
    {
        $this->dateSend = $dateSend;
        return $this;
    }

    public function getStatus(): string
    {
        return $this->status;
    }

    public function setStatus(string $status): self
    {
        $this->status = $status;
        return $this;
    }

    public function getAccess(): ?Access
    {
        return $this->access;
    }

    public function setAccess(?Access $access): self
    {
        $this->access = $access;
        return $this;
    }

    public function getOrganization(): ?Organization
    {
        return $this->organization;
    }

    public function setOrganization(?Organization $organization): self
    {
        $this->organization = $organization;
        return $this;
    }
}