<?php

declare(strict_types=1);

namespace App\Entity\AccessWish;

use ApiPlatform\Metadata\ApiResource;
use App\Entity\Access\Access;
use App\Entity\Booking\Course;
use App\Entity\Education\Education;
use App\Entity\Education\EducationCurriculum;
use App\Entity\Education\EducationStudent;
use App\Entity\Education\EducationTiming;
// use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use App\Entity\Product\EquipmentList;
use App\Enum\OnlineRegistration\RegistrationStatusEnum;
use App\Enum\OnlineRegistration\WishRegistrationEnum;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * TODO: documenter.
 */
// #[Auditable]
#[ApiResource(operations: [])]
#[ORM\Entity]
class EducationStudentWish
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\Column(length: 50, enumType: WishRegistrationEnum::class)]
    private WishRegistrationEnum $wishRegistration;

    #[ORM\Column(length: 50, enumType: RegistrationStatusEnum::class)]
    private RegistrationStatusEnum $registrationStatus;

    #[ORM\ManyToOne(targetEntity: Education::class, cascade: ['persist'], inversedBy: 'educationWishes')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?Education $educationWish = null;

    #[ORM\ManyToOne(inversedBy: 'educationStudentWishes')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?AccessWish $accessWish = null;

    #[ORM\ManyToOne(inversedBy: 'educationStudentReregistrationsWishes')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?AccessWish $accessWishReregistrations = null;

    #[ORM\ManyToOne(targetEntity: EducationCurriculum::class, cascade: ['persist'], inversedBy: 'educationStudentWish')]
    private ?EducationCurriculum $educationCurriculum = null;

    #[ORM\ManyToOne]
    private ?EducationStudent $educationStudent = null;

    #[ORM\ManyToOne]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?EducationTiming $educationTiming = null;

    /** @var Collection<int, Access> */
    #[ORM\ManyToMany(targetEntity: Access::class, cascade: [], orphanRemoval: false)]
    protected Collection $teachers;

    #[ORM\ManyToOne(targetEntity: EquipmentList::class, cascade: [])]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    protected ?EquipmentList $speciality;

    #[ORM\ManyToOne(targetEntity: Course::class, cascade: [], inversedBy: 'educationStudentWishes')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    protected ?Course $course;

    public function __construct()
    {
        $this->teachers = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getWishRegistration(): ?WishRegistrationEnum
    {
        return $this->wishRegistration;
    }

    public function setWishRegistration(?WishRegistrationEnum $wishRegistration): void
    {
        $this->wishRegistration = $wishRegistration;
    }

    public function getRegistrationStatus(): ?RegistrationStatusEnum
    {
        return $this->registrationStatus;
    }

    public function setRegistrationStatus(?RegistrationStatusEnum $registrationStatus): void
    {
        $this->registrationStatus = $registrationStatus;
    }

    public function getEducationWish(): ?Education
    {
        return $this->educationWish;
    }

    public function setEducationWish(?Education $educationWish): self
    {
        $this->educationWish = $educationWish;

        return $this;
    }

    public function getAccessWish(): ?AccessWish
    {
        return $this->accessWish;
    }

    public function setAccessWish(?AccessWish $accessWish): self
    {
        $this->accessWish = $accessWish;

        return $this;
    }

    public function getAccessWishReregistrations(): ?AccessWish
    {
        return $this->accessWishReregistrations;
    }

    public function setAccessWishReregistrations(?AccessWish $accessWishReregistrations): self
    {
        $this->accessWishReregistrations = $accessWishReregistrations;

        return $this;
    }

    public function getEducationCurriculum(): ?EducationCurriculum
    {
        return $this->educationCurriculum;
    }

    public function setEducationCurriculum(?EducationCurriculum $educationCurriculum): self
    {
        $this->educationCurriculum = $educationCurriculum;

        return $this;
    }

    public function getEducationStudent(): ?EducationStudent
    {
        return $this->educationStudent;
    }

    public function setEducationStudent(?EducationStudent $educationStudent): self
    {
        $this->educationStudent = $educationStudent;

        return $this;
    }

    public function getEducationTiming(): ?EducationTiming
    {
        return $this->educationTiming;
    }

    public function setEducationTiming(?EducationTiming $educationTiming): self
    {
        $this->educationTiming = $educationTiming;

        return $this;
    }

    public function getTeachers(): Collection
    {
        return $this->teachers;
    }

    public function addTeacher(Access $teacher): self
    {
        if (!$this->teachers->contains($teacher)) {
            $this->teachers[] = $teacher;
        }

        return $this;
    }

    public function removeTeacher(Access $teacher): self
    {
        $this->teachers->removeElement($teacher);

        return $this;
    }

    public function getSpeciality(): EquipmentList
    {
        return $this->speciality;
    }

    public function setSpeciality(EquipmentList $speciality): self
    {
        $this->speciality = $speciality;

        return $this;
    }

    public function getCourse(): Course
    {
        return $this->course;
    }

    public function setCourse(Course $course): self
    {
        $this->course = $course;

        return $this;
    }
}
