Merge branch 'main' into #43-vacation-summary-for-employee

# Conflicts:
#	app/Infrastructure/Http/Controllers/HolidayController.php
#	app/Infrastructure/Http/Controllers/VacationLimitController.php
#	app/Infrastructure/Http/Controllers/VacationRequestController.php
#	composer.lock
#	resources/js/Pages/Holidays/Index.vue
#	resources/js/Pages/VacationRequest/Create.vue
This commit is contained in:
Adrian Hopek
2022-03-02 10:01:14 +01:00
51 changed files with 1993 additions and 1401 deletions

View File

@@ -27,16 +27,29 @@ class VacationRequestRequest extends FormRequest
public function data(): array
{
$from = $this->get("from");
return [
"user_id" => $this->get("user"),
"type" => $this->get("type"),
"from" => $from,
"from" => $this->get("from"),
"to" => $this->get("to"),
"year_period_id" => YearPeriod::findByYear(Carbon::create($from)->year)->id,
"year_period_id" => $this->yearPeriod()->id,
"comment" => $this->get("comment"),
"flow_skipped" => $this->boolean("flowSkipped"),
];
}
public function yearPeriod(): YearPeriod
{
return YearPeriod::findByYear(Carbon::create($this->get("from"))->year);
}
public function createsOnBehalfOfEmployee(): bool
{
return $this->user()->id !== $this->get("user");
}
public function wantsSkipFlow(): bool
{
return $this->boolean("flowSkipped");
}
}