#152 - updated vacation stats

This commit is contained in:
2022-07-07 11:49:18 +02:00
parent 62c3c11ebf
commit cbe70315eb
3 changed files with 84 additions and 69 deletions

View File

@@ -103,6 +103,15 @@ class UserVacationStatsRetriever
return $limit ?? 0;
}
public function hasVacationDaysLimit(User $user, YearPeriod $yearPeriod): bool
{
$limit = $user->vacationLimits()
->whereBelongsTo($yearPeriod)
->first()?->days;
return $limit !== null;
}
protected function getLimitableVacationTypes(): Collection
{
$types = VacationType::all();