feat : ajout d'une date d'entrée pour les employés
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-03-12 11:23:09 +01:00
parent bf3f7b35a5
commit 9fe2397386
8 changed files with 116 additions and 3 deletions

View File

@@ -14,7 +14,9 @@ use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Context;
use Symfony\Component\Serializer\Attribute\Groups;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
#[ApiResource(
normalizationContext: ['groups' => ['employee:read', 'site:read']],
@@ -57,6 +59,11 @@ class Employee
#[Groups(['employee:read', 'employee:write'])]
private int $displayOrder = 0;
#[ORM\Column(type: 'date_immutable', nullable: true)]
#[Groups(['employee:read'])]
#[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])]
private ?DateTimeImmutable $entryDate = null;
#[ORM\Column(type: 'datetime_immutable')]
private DateTimeImmutable $createdAt;
@@ -166,6 +173,18 @@ class Employee
return $this;
}
public function getEntryDate(): ?DateTimeImmutable
{
return $this->entryDate;
}
public function setEntryDate(?DateTimeImmutable $entryDate): self
{
$this->entryDate = $entryDate;
return $this;
}
public function getContractNature(): ?string
{
return $this->contractNature;