<?php
declare(strict_types=1);

namespace App\Entity\Access;

use App\Repository\Access\FunctionTypeRepository;
//use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Enum des fonctions que peuvent occuper un Access au sein d'une Organization
 *
 */
//#[Auditable]
#[ORM\Entity(repositoryClass: FunctionTypeRepository::class)]
class FunctionType
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column]
    #[Assert\Choice(callback: ['\App\Enum\Access\TypeFunctionEnum', 'toArray'], message: 'invalid-function-type')]
    private string $functionType;

    #[ORM\Column]
    #[Assert\Choice(callback: ['\App\Enum\Access\FunctionEnum', 'toArray'], message: 'invalid-function')]
    private string $mission;

    #[ORM\Column]
    #[Assert\Choice(callback: ['\App\Enum\Access\RoleEnum', 'toArray'], message: 'invalid-role')]
    private string $roleByDefault;

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

    public function getFunctionType(): string
    {
        return $this->functionType;
    }

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

    public function getMission(): string
    {
        return $this->mission;
    }

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

    public function getRoleByDefault(): string
    {
        return $this->roleByDefault;
    }

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