feat : first commit

This commit is contained in:
2026-02-03 18:04:06 +01:00
parent 43b0364a5a
commit a5dcd5e3e9
101 changed files with 29976 additions and 96 deletions

72
src/Entity/Employee.php Normal file
View File

@@ -0,0 +1,72 @@
<?php
declare(strict_types=1);
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
#[ApiResource(normalizationContext: ['groups' => ['employee:read']])]
#[ORM\Entity]
#[ORM\Table(name: 'employees')]
class Employee
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
#[Groups(['absence:read', 'employee:read'])]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 100)]
#[Groups(['absence:read', 'employee:read'])]
private string $firstName = '';
#[ORM\Column(type: 'string', length: 100)]
#[Groups(['absence:read', 'employee:read'])]
private string $lastName = '';
#[ORM\Column(type: 'datetime_immutable')]
private DateTimeImmutable $createdAt;
public function __construct()
{
$this->createdAt = new DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getFirstName(): string
{
return $this->firstName;
}
public function setFirstName(string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): string
{
return $this->lastName;
}
public function setLastName(string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getCreatedAt(): DateTimeImmutable
{
return $this->createdAt;
}
}