fix: assign correct status colors, link items in timeline
This commit is contained in:
+25
-15
@@ -10,7 +10,8 @@ class TimelineItem
|
||||
public const TYPE_ASSIGNMENT = 'assignment';
|
||||
public const TYPE_DISPOSITION = 'disposition';
|
||||
|
||||
private ?int $dispositionId = null;
|
||||
private ?string $assignmentUuid = null;
|
||||
private ?string $dispositionUuid = null;
|
||||
private ?\DateTimeImmutable $dateFrom = null;
|
||||
private ?\DateTimeImmutable $dateTo = null;
|
||||
private ?string $status = null;
|
||||
@@ -19,7 +20,7 @@ class TimelineItem
|
||||
private ?string $teamerName = null;
|
||||
private ?string $teamerUuid = null;
|
||||
|
||||
public function __construct(private readonly int $assignmentId, private readonly string $type)
|
||||
public function __construct(private readonly string $type)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -28,12 +29,13 @@ class TimelineItem
|
||||
$dateFrom = $assignment->getDestination()->getDateFrom();
|
||||
$dateTo = $assignment->getDestination()->getDateTo();
|
||||
|
||||
return (new static($assignment->getId(), static::TYPE_ASSIGNMENT))
|
||||
return (new static(static::TYPE_ASSIGNMENT))
|
||||
->setAssignmentUuid($assignment->getUuid())
|
||||
->setDateFrom($dateFrom)
|
||||
->setDateTo($dateTo)
|
||||
->setJobProfile($assignment->getJobProfile()->getName())
|
||||
->setDateRange(sprintf('%s - %s', $dateFrom->format('d.m.Y'), $dateTo->format('d.m.Y')))
|
||||
->setStatus($assignment->getStatus());
|
||||
->setStatus($assignment->getStatus())
|
||||
;
|
||||
}
|
||||
|
||||
@@ -44,8 +46,9 @@ class TimelineItem
|
||||
$dateFrom = $assignment->getDestination()->getDateFrom();
|
||||
$dateTo = $assignment->getDestination()->getDateTo();
|
||||
|
||||
return (new static($assignment->getId(), static::TYPE_DISPOSITION))
|
||||
->setDispositionId($disposition->getId())
|
||||
return (new static(static::TYPE_DISPOSITION))
|
||||
->setAssignmentUuid($assignment->getUuid())
|
||||
->setDispositionUuid($disposition->getUuid())
|
||||
->setDateFrom($dateFrom)
|
||||
->setDateTo($dateTo)
|
||||
->setJobProfile($assignment->getJobProfile()->getName())
|
||||
@@ -56,24 +59,31 @@ class TimelineItem
|
||||
;
|
||||
}
|
||||
|
||||
public function getAssignmentId(): int
|
||||
{
|
||||
return $this->assignmentId;
|
||||
}
|
||||
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function getDispositionId(): ?int
|
||||
public function getAssignmentUuid(): ?string
|
||||
{
|
||||
return $this->dispositionId;
|
||||
return $this->assignmentUuid;
|
||||
}
|
||||
|
||||
public function setDispositionId(?int $dispositionId): static
|
||||
public function setAssignmentUuid(?string $assignmentUuid): static
|
||||
{
|
||||
$this->dispositionId = $dispositionId;
|
||||
$this->assignmentUuid = $assignmentUuid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDispositionUuid(): ?string
|
||||
{
|
||||
return $this->dispositionUuid;
|
||||
}
|
||||
|
||||
public function setDispositionUuid(?string $dispositionUuid): static
|
||||
{
|
||||
$this->dispositionUuid = $dispositionUuid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user