feat : ajout du nouveau système de contrat et ajout de filtre d'impression
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Enum\ContractNature;
|
||||
use App\Repository\EmployeeContractPeriodRepository;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -19,7 +20,7 @@ class EmployeeContractPeriod
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Employee::class)]
|
||||
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'contractPeriods')]
|
||||
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
||||
private ?Employee $employee = null;
|
||||
|
||||
@@ -33,6 +34,9 @@ class EmployeeContractPeriod
|
||||
#[ORM\Column(type: 'date_immutable', nullable: true)]
|
||||
private ?DateTimeImmutable $endDate = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 20, options: ['default' => ContractNature::CDI->value])]
|
||||
private string $contractNature = ContractNature::CDI->value;
|
||||
|
||||
#[ORM\Column(type: 'datetime_immutable')]
|
||||
private DateTimeImmutable $createdAt;
|
||||
|
||||
@@ -95,6 +99,24 @@ class EmployeeContractPeriod
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getContractNature(): string
|
||||
{
|
||||
return $this->contractNature;
|
||||
}
|
||||
|
||||
public function getContractNatureEnum(): ContractNature
|
||||
{
|
||||
return ContractNature::tryFrom($this->contractNature) ?? ContractNature::CDI;
|
||||
}
|
||||
|
||||
public function setContractNature(ContractNature|string $contractNature): self
|
||||
{
|
||||
$value = $contractNature instanceof ContractNature ? $contractNature->value : $contractNature;
|
||||
$this->contractNature = ContractNature::tryFrom($value)?->value ?? ContractNature::CDI->value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
|
||||
Reference in New Issue
Block a user