feat: categories for job profiles

addresses #8698w62ex
This commit is contained in:
Björn Fromme
2025-04-30 10:19:40 +02:00
parent 3646661fed
commit 6f42ef9f7d
5 changed files with 83 additions and 0 deletions
+30
View File
@@ -20,6 +20,10 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
use TimestampableEntity;
use SoftDeletableEntity;
public const CATEGORY_GUIDE = 'guide';
public const CATEGORY_COURSE = 'course';
public const CATEGORY_SERVICE = 'service';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
@@ -32,6 +36,10 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
#[Assert\NotBlank(message: 'Bitte gib die Bezeichnung an')]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
#[Assert\NotBlank(message: 'Bitte wähle die Kategorie')]
private ?string $category = null;
#[ORM\Column(type: Types::JSON)]
private array $requiredLicenses = [];
@@ -74,6 +82,28 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
return $this;
}
public function getCategory(): ?string
{
return $this->category;
}
public function setCategory(?string $category): static
{
$this->category = $category;
return $this;
}
public function getCategoryLabel(): ?string
{
return match ($this->category) {
static::CATEGORY_GUIDE => 'Reiseleitung',
static::CATEGORY_COURSE => 'Kursleitung',
static::CATEGORY_SERVICE => 'Serviceteam',
default => null,
};
}
public function getRequiredLicenses(): array
{
return $this->requiredLicenses;