feat : modification de la gestion des jours fériés
All checks were successful
Auto Tag Develop / tag (push) Successful in 6s
All checks were successful
Auto Tag Develop / tag (push) Successful in 6s
This commit is contained in:
@@ -92,6 +92,12 @@ class Employee
|
||||
#[Groups(['employee:write'])]
|
||||
private ?bool $isDriverInput = null;
|
||||
|
||||
/**
|
||||
* @var null|array<int, int> iso-day → minutes, write-only (propagated to EmployeeContractPeriod)
|
||||
*/
|
||||
#[Groups(['employee:write'])]
|
||||
private ?array $workDaysHoursInput = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->createdAt = new DateTimeImmutable();
|
||||
@@ -261,6 +267,34 @@ class Employee
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|array<int, int>
|
||||
*/
|
||||
public function getWorkDaysHoursInput(): ?array
|
||||
{
|
||||
return $this->workDaysHoursInput;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array<int|string, mixed> $workDaysHoursInput
|
||||
*/
|
||||
public function setWorkDaysHoursInput(?array $workDaysHoursInput): self
|
||||
{
|
||||
if (null === $workDaysHoursInput) {
|
||||
$this->workDaysHoursInput = null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
$normalized = [];
|
||||
foreach ($workDaysHoursInput as $key => $value) {
|
||||
$normalized[(int) $key] = (int) $value;
|
||||
}
|
||||
$this->workDaysHoursInput = $normalized;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[Groups(['employee:read'])]
|
||||
public function getHasActiveContract(): bool
|
||||
{
|
||||
@@ -358,6 +392,7 @@ class Employee
|
||||
periodId: $period->getId(),
|
||||
suspensions: $suspensionData,
|
||||
isDriver: $period->getIsDriver(),
|
||||
workDaysHours: $period->getWorkDaysHours(),
|
||||
);
|
||||
},
|
||||
$periods
|
||||
|
||||
Reference in New Issue
Block a user