#120 - wip
This commit is contained in:
@@ -18,6 +18,7 @@ enum VacationType: string
|
||||
case TimeInLieu = "time_in_lieu";
|
||||
case Sick = "sick_vacation";
|
||||
case Absence = "absence";
|
||||
case HomeOffice = "home_office";
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
|
@@ -15,6 +15,7 @@ class VacationTypeConfigRetriever
|
||||
public const KEY_BILLABLE = "billable";
|
||||
public const KEY_HAS_LIMIT = "has_limit";
|
||||
public const KEY_AVAILABLE_FOR = "available_for";
|
||||
public const KEY_IS_VACATION = "is_vacation";
|
||||
|
||||
public function __construct(
|
||||
protected Repository $config,
|
||||
@@ -40,6 +41,11 @@ class VacationTypeConfigRetriever
|
||||
return $this->getConfigFor($type)[static::KEY_HAS_LIMIT];
|
||||
}
|
||||
|
||||
public function isVacation(VacationType $type): bool
|
||||
{
|
||||
return $this->getConfigFor($type)[static::KEY_IS_VACATION];
|
||||
}
|
||||
|
||||
public function isAvailableFor(VacationType $type, EmploymentForm $employmentForm): bool
|
||||
{
|
||||
return in_array($employmentForm, $this->getConfigFor($type)[static::KEY_AVAILABLE_FOR], true);
|
||||
|
Reference in New Issue
Block a user