feat: extend job-profile and feedback entities for future statistics
This commit is contained in:
@@ -91,6 +91,9 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
#[ORM\ManyToMany(targetEntity: Teamer::class, mappedBy: 'bookmarks')]
|
||||
private Collection $teamers;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'assignment', targetEntity: Feedback::class)]
|
||||
private Collection $feedback;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
private ?User $owner = null;
|
||||
|
||||
@@ -109,6 +112,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
$this->applications = new ArrayCollection();
|
||||
$this->dispositions = new ArrayCollection();
|
||||
$this->teamers = new ArrayCollection();
|
||||
$this->feedback = new ArrayCollection();
|
||||
$this->benefits = "Anreise im E&P Reisebus\nUnterkunft\nVerpflegung\nSkipass\n";
|
||||
}
|
||||
|
||||
@@ -537,6 +541,30 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Feedback#>
|
||||
*/
|
||||
public function getFeedback(): Collection
|
||||
{
|
||||
return $this->feedback;
|
||||
}
|
||||
|
||||
public function addFeedback(Feedback $feedback): static
|
||||
{
|
||||
if (!$this->feedback->contains($feedback)) {
|
||||
$this->feedback->add($feedback);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeFeedback(Feedback $feedback): static
|
||||
{
|
||||
$this->feedback->removeElement($feedback);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOwner(): ?User
|
||||
{
|
||||
return $this->owner;
|
||||
|
||||
@@ -35,12 +35,18 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
#[Assert\NotNull(message: 'Bitte auswählen', groups: ['admin'])]
|
||||
private ?Teamer $teamer = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'feedback')]
|
||||
private ?Assignment $assignment = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $destinationName = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $jobProfileName = null;
|
||||
|
||||
#[ORM\Column(length: 32, nullable: true)]
|
||||
private ?string $jobProfileCategory = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $hotel = null;
|
||||
|
||||
@@ -90,6 +96,7 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
$jobProfile = $assignment->getJobProfile();
|
||||
|
||||
$instance
|
||||
->setAssignment($assignment)
|
||||
->setAssignmentDateFrom($assignment->getEffectiveDateFrom())
|
||||
->setAssignmentDateTo($assignment->getEffectiveDateTo())
|
||||
->setDestinationName($destination->getProduct())
|
||||
@@ -97,6 +104,7 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
->setHotelCode($destination->getHotelCode())
|
||||
->setHotelBusProId($destination->getHotelBusProId())
|
||||
->setJobProfileName($jobProfile->getName())
|
||||
->setJobProfileCategory($jobProfile->getCategory())
|
||||
;
|
||||
|
||||
return $instance;
|
||||
@@ -124,6 +132,18 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAssignment(): ?Assignment
|
||||
{
|
||||
return $this->assignment;
|
||||
}
|
||||
|
||||
public function setAssignment(?Assignment $assignment): static
|
||||
{
|
||||
$this->assignment = $assignment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTeamer(): ?Teamer
|
||||
{
|
||||
return $this->teamer;
|
||||
@@ -184,6 +204,18 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getJobProfileCategory(): ?string
|
||||
{
|
||||
return $this->jobProfileCategory;
|
||||
}
|
||||
|
||||
public function setJobProfileCategory(?string $jobProfileCategory): static
|
||||
{
|
||||
$this->jobProfileCategory = $jobProfileCategory;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHotel(): ?string
|
||||
{
|
||||
return $this->hotel;
|
||||
|
||||
@@ -22,7 +22,10 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
|
||||
public const CATEGORY_GUIDE = 'guide';
|
||||
public const CATEGORY_COURSE = 'course';
|
||||
public const CATEGORY_COURSE_SKI = 'course_ski';
|
||||
public const CATEGORY_COURSE_BOARD = 'course_board';
|
||||
public const CATEGORY_SERVICE = 'service';
|
||||
public const CATEGORY_EVENT_TEAM = 'event_team';
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
@@ -99,7 +102,10 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return match ($this->category) {
|
||||
static::CATEGORY_GUIDE => 'Reiseleitung',
|
||||
static::CATEGORY_COURSE => 'Kursleitung',
|
||||
static::CATEGORY_COURSE_SKI => 'Kursleitung Ski',
|
||||
static::CATEGORY_COURSE_BOARD => 'Kursleitung Board',
|
||||
static::CATEGORY_SERVICE => 'Serviceteam',
|
||||
static::CATEGORY_EVENT_TEAM => 'Eventteam',
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user