#38 - vacation request by administrative approver (#57)

* #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:
Adrian Hopek
2022-02-22 11:02:36 +01:00
committed by GitHub
parent 39b464388c
commit 17cdee38e0
16 changed files with 346 additions and 14 deletions

View File

@@ -22,7 +22,9 @@ use Toby\Domain\Enums\VacationType;
* @property Carbon $from
* @property Carbon $to
* @property string $comment
* @property bool $flow_skipped
* @property User $user
* @property User $creator
* @property YearPeriod $yearPeriod
* @property Collection $activities
* @property Collection $vacations
@@ -47,6 +49,11 @@ class VacationRequest extends Model
return $this->belongsTo(User::class);
}
public function creator(): BelongsTo
{
return $this->belongsTo(User::class, "creator_id");
}
public function yearPeriod(): BelongsTo
{
return $this->belongsTo(YearPeriod::class);
@@ -69,6 +76,11 @@ class VacationRequest extends Model
$this->save();
}
public function hasFlowSkipped(): bool
{
return $this->flow_skipped;
}
public function scopeStates(Builder $query, array $states): Builder
{
return $query->whereIn("state", $states);