#38 - cr fix
This commit is contained in:
@@ -20,7 +20,7 @@ class HandleCreatedVacationRequest
|
||||
{
|
||||
$vacationRequest = $event->vacationRequest;
|
||||
|
||||
if ($vacationRequest->shouldSkipFlow()) {
|
||||
if ($vacationRequest->hasFlowSkipped()) {
|
||||
$this->stateManager->approve($vacationRequest);
|
||||
|
||||
return;
|
||||
|
@@ -19,9 +19,9 @@ class SendCreatedVacationRequestNotification
|
||||
$vacationRequest = $event->vacationRequest;
|
||||
|
||||
if ($vacationRequest->creator->is($vacationRequest->user)) {
|
||||
$event->vacationRequest->user->notify(new VacationRequestCreatedNotification($event->vacationRequest));
|
||||
$vacationRequest->user->notify(new VacationRequestCreatedNotification($vacationRequest));
|
||||
} else {
|
||||
$event->vacationRequest->user->notify(new VacationRequestCreatedOnEmployeeBehalf($event->vacationRequest));
|
||||
$vacationRequest->user->notify(new VacationRequestCreatedOnEmployeeBehalf($vacationRequest));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ use Toby\Domain\Enums\VacationType;
|
||||
* @property Carbon $from
|
||||
* @property Carbon $to
|
||||
* @property string $comment
|
||||
* @property boolean $skip_flow
|
||||
* @property bool $flow_skipped
|
||||
* @property User $user
|
||||
* @property User $creator
|
||||
* @property YearPeriod $yearPeriod
|
||||
@@ -76,9 +76,9 @@ class VacationRequest extends Model
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function shouldSkipFlow(): bool
|
||||
public function hasFlowSkipped(): bool
|
||||
{
|
||||
return $this->skip_flow;
|
||||
return $this->flow_skipped;
|
||||
}
|
||||
|
||||
public function scopeStates(Builder $query, array $states): Builder
|
||||
|
@@ -20,7 +20,7 @@ class VacationRequestRequest extends FormRequest
|
||||
"type" => ["required", new Enum(VacationType::class)],
|
||||
"from" => ["required", "date_format:Y-m-d", new YearPeriodExists()],
|
||||
"to" => ["required", "date_format:Y-m-d", new YearPeriodExists()],
|
||||
"skipFlow" => ["nullable", "boolean"],
|
||||
"flowSkipped" => ["nullable", "boolean"],
|
||||
"comment" => ["nullable"],
|
||||
];
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class VacationRequestRequest extends FormRequest
|
||||
"to" => $this->get("to"),
|
||||
"year_period_id" => YearPeriod::findByYear(Carbon::create($from)->year)->id,
|
||||
"comment" => $this->get("comment"),
|
||||
"skip_flow" => $this->boolean("skipFlow"),
|
||||
"flow_skipped" => $this->boolean("flowSkipped"),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user