* tsp-info endpoint added

* different collector services are now implemented
This commit is contained in:
Dávid Danyi
2017-09-05 19:15:17 +02:00
parent 88527e4ff1
commit efc6e7b0c4
16 changed files with 855 additions and 63 deletions

View File

@@ -234,6 +234,9 @@ class KanbanBoard implements \JsonSerializable
*/
private function updatedAtReverseSort(array $toSort): array
{
$toSort = array_filter($toSort, function(KanbanEntry $item){
return $item->getAssignee() != null;
});
usort($toSort, function(KanbanEntry $a, KanbanEntry $b){
return $b->getUpdatedAt() <=> $a->getUpdatedAt();
});

View File

@@ -0,0 +1,114 @@
<?php
namespace App\Entity;
class TrProgress implements \JsonSerializable
{
/**
* @var string
*/
private $eriref;
/**
* @var string
*/
private $heading;
/**
* @var string
*/
private $prio;
/**
* @var int
*/
private $lastProgress;
/**
* @return string
*/
public function getEriref(): string
{
return $this->eriref;
}
/**
* @param string $eriref
* @return TrProgress
*/
public function setEriref(string $eriref): TrProgress
{
$this->eriref = $eriref;
return $this;
}
/**
* @return string
*/
public function getHeading(): string
{
return $this->heading;
}
/**
* @param string $heading
* @return TrProgress
*/
public function setHeading(string $heading): TrProgress
{
$this->heading = $heading;
return $this;
}
/**
* @return string
*/
public function getPrio(): string
{
return $this->prio;
}
/**
* @param string $prio
* @return TrProgress
*/
public function setPrio(string $prio): TrProgress
{
$this->prio = $prio;
return $this;
}
/**
* @return int
*/
public function getLastProgress(): int
{
return $this->lastProgress;
}
/**
* @param int $lastProgress
* @return TrProgress
*/
public function setLastProgress(int $lastProgress): TrProgress
{
$this->lastProgress = $lastProgress;
return $this;
}
/**
* @return array
*/
function jsonSerialize()
{
return [
'eriref' => $this->getEriref(),
'heading' => $this->getHeading(),
'prio' => $this->getPrio(),
'lastProgress' => $this->getLastProgress(),
];
}
}

View File

@@ -0,0 +1,94 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
class VacationDay implements \JsonSerializable
{
/**
* @var int
*/
private $day;
/**
* @var string[]|ArrayCollection
*/
private $signums;
public function __construct()
{
$this->signums = new ArrayCollection();
}
/**
* @return int
*/
public function getDay(): int
{
return $this->day;
}
/**
* @param int $day
* @return VacationDay
*/
public function setDay(int $day): VacationDay
{
$this->day = $day;
return $this;
}
/**
* @return ArrayCollection|string[]
*/
public function getSignums()
{
return $this->signums;
}
/**
* @param ArrayCollection|string[] $signums
* @return VacationDay
*/
public function setSignums($signums): VacationDay
{
$this->signums = $signums;
return $this;
}
/**
* @param string $signum
* @return VacationDay
*/
public function addSignum(string $signum): VacationDay
{
if(!$this->signums->contains($signum)) {
$this->signums->add($signum);
}
return $this;
}
/**
* @param string $signum
* @return VacationDay
*/
public function removeSignum(string $signum): VacationDay
{
if($this->signums->contains($signum)) {
$this->signums->removeElement($signum);
}
return $this;
}
/**
* @return array
*/
function jsonSerialize()
{
return [
'day' => $this->getDay(),
'signums' => $this->getSignums()->getValues(),
];
}
}