* #38 - wip * #38 - wip * #38 - fix * #38 - fix * #38 - fix * #38 - fix * Update resources/lang/pl.json Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl> * #38 - cr fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl>
This commit is contained in:
@@ -20,6 +20,12 @@ class HandleCreatedVacationRequest
|
||||
{
|
||||
$vacationRequest = $event->vacationRequest;
|
||||
|
||||
if ($vacationRequest->hasFlowSkipped()) {
|
||||
$this->stateManager->approve($vacationRequest);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->configRetriever->needsTechnicalApproval($vacationRequest->type)) {
|
||||
$this->stateManager->waitForTechnical($vacationRequest);
|
||||
|
||||
|
@@ -6,6 +6,7 @@ namespace Toby\Domain\Listeners;
|
||||
|
||||
use Toby\Domain\Events\VacationRequestCreated;
|
||||
use Toby\Domain\Notifications\VacationRequestCreatedNotification;
|
||||
use Toby\Domain\Notifications\VacationRequestCreatedOnEmployeeBehalf;
|
||||
|
||||
class SendCreatedVacationRequestNotification
|
||||
{
|
||||
@@ -15,6 +16,12 @@ class SendCreatedVacationRequestNotification
|
||||
|
||||
public function handle(VacationRequestCreated $event): void
|
||||
{
|
||||
$event->vacationRequest->user->notify(new VacationRequestCreatedNotification($event->vacationRequest));
|
||||
$vacationRequest = $event->vacationRequest;
|
||||
|
||||
if ($vacationRequest->creator->is($vacationRequest->user)) {
|
||||
$vacationRequest->user->notify(new VacationRequestCreatedNotification($vacationRequest));
|
||||
} else {
|
||||
$vacationRequest->user->notify(new VacationRequestCreatedOnEmployeeBehalf($vacationRequest));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user