feat: extend and refactor feedback providing for role house manager
This commit is contained in:
+45
-13
@@ -8,6 +8,7 @@ use App\Repository\FeedbackRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: FeedbackRepository::class)]
|
||||
class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
@@ -33,23 +34,30 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
private ?Teamer $teamer = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $assignmentDestination = null;
|
||||
private ?string $destinationName;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $jobProfileName;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
||||
private ?\DateTimeImmutable $assignmentDate = null;
|
||||
private ?\DateTimeImmutable $assignmentDate;
|
||||
|
||||
#[ORM\Column]
|
||||
#[Assert\Count(min: 1, minMessage: 'Bitte gib eine Bewertung ab')]
|
||||
private array $ratings = [];
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $comment = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $commentPublic = false;
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $commentInternal = null;
|
||||
|
||||
public function __construct()
|
||||
public function __construct(Assignment $assignment)
|
||||
{
|
||||
$this->uuid = Uuid::v4();
|
||||
$this->destinationName = $assignment->getDestination()->getProduct();
|
||||
$this->assignmentDate = $assignment->getEffectiveDateFrom();
|
||||
$this->jobProfileName = $assignment->getJobProfile()->getName();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
@@ -86,14 +94,26 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAssignmentDestination(): ?string
|
||||
public function getDestination(): ?Destination
|
||||
{
|
||||
return $this->assignmentDestination;
|
||||
return $this->destination;
|
||||
}
|
||||
|
||||
public function setAssignmentDestination(string $assignmentDestination): static
|
||||
public function setDestination(?Destination $destination): static
|
||||
{
|
||||
$this->assignmentDestination = $assignmentDestination;
|
||||
$this->destination = $destination;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDestinationName(): ?string
|
||||
{
|
||||
return $this->destinationName;
|
||||
}
|
||||
|
||||
public function setDestinationName(string $destinationName): static
|
||||
{
|
||||
$this->destinationName = $destinationName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -110,6 +130,18 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getJobProfileName(): ?string
|
||||
{
|
||||
return $this->jobProfileName;
|
||||
}
|
||||
|
||||
public function setJobProfileName(?string $jobProfileName): static
|
||||
{
|
||||
$this->jobProfileName = $jobProfileName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRatings(): array
|
||||
{
|
||||
return $this->ratings;
|
||||
@@ -149,14 +181,14 @@ class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isCommentPublic(): ?bool
|
||||
public function getCommentInternal(): ?string
|
||||
{
|
||||
return $this->commentPublic;
|
||||
return $this->commentInternal;
|
||||
}
|
||||
|
||||
public function setCommentPublic(bool $commentPublic): static
|
||||
public function setCommentInternal(?string $commentInternal): static
|
||||
{
|
||||
$this->commentPublic = $commentPublic;
|
||||
$this->commentInternal = $commentInternal;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user