feat: categories for job profiles
addresses #8698w62ex
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user