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;
+9
View File
@@ -22,6 +22,15 @@ class JobProfileType extends AbstractType
->add('name', TextType::class, [
'label' => 'Bezeichnung',
])
->add('category', ChoiceType::class, [
'label' => 'Kategorie',
'placeholder' => 'bitte zuordnen...',
'choices' => [
'Reiseleitung' => JobProfile::CATEGORY_GUIDE,
'Kursleitung' => JobProfile::CATEGORY_COURSE,
'Serviceteam' => JobProfile::CATEGORY_SERVICE,
],
])
->add('requiredTrainings', EntityType::class, [
'label' => 'vorausgesetzte Fortbildung',
'required' => false,