#120 - wip
This commit is contained in:
parent
4c5627c067
commit
2c86cd0269
@ -7,6 +7,7 @@ namespace Toby\Domain\Actions\VacationRequest;
|
||||
use Toby\Domain\Enums\Role;
|
||||
use Toby\Domain\Notifications\VacationRequestStatusChangedNotification;
|
||||
use Toby\Domain\VacationRequestStateManager;
|
||||
use Toby\Domain\VacationTypeConfigRetriever;
|
||||
use Toby\Eloquent\Models\User;
|
||||
use Toby\Eloquent\Models\VacationRequest;
|
||||
use Toby\Infrastructure\Jobs\SendVacationRequestDaysToGoogleCalendar;
|
||||
@ -15,16 +16,19 @@ class ApproveAction
|
||||
{
|
||||
public function __construct(
|
||||
protected VacationRequestStateManager $stateManager,
|
||||
protected VacationTypeConfigRetriever $configRetriever,
|
||||
) {}
|
||||
|
||||
public function execute(VacationRequest $vacationRequest, ?User $user = null): void
|
||||
{
|
||||
$this->stateManager->approve($vacationRequest, $user);
|
||||
|
||||
if ($this->configRetriever->isVacation($vacationRequest->type)) {
|
||||
SendVacationRequestDaysToGoogleCalendar::dispatch($vacationRequest);
|
||||
|
||||
$this->notify($vacationRequest);
|
||||
}
|
||||
}
|
||||
|
||||
protected function notify(VacationRequest $vacationRequest): void
|
||||
{
|
||||
|
@ -133,7 +133,7 @@
|
||||
as="template"
|
||||
:value="role"
|
||||
>
|
||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||
{{ role.label }}
|
||||
</span>
|
||||
@ -188,7 +188,7 @@
|
||||
as="template"
|
||||
:value="employmentForm"
|
||||
>
|
||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||
{{ employmentForm.label }}
|
||||
</span>
|
||||
|
@ -72,7 +72,7 @@
|
||||
as="template"
|
||||
:value="user"
|
||||
>
|
||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<div class="flex items-center">
|
||||
<img
|
||||
:src="user.avatar"
|
||||
@ -166,7 +166,7 @@
|
||||
as="template"
|
||||
:value="vacationType"
|
||||
>
|
||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||
<VacationType :type="vacationType.value" />
|
||||
</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user