Merge branch 'main' into states

# Conflicts:
#	app/Domain/CalendarGenerator.php
#	app/Domain/VacationRequestStateManager.php
#	app/Eloquent/Models/VacationRequest.php
#	app/Eloquent/Observers/VacationRequestObserver.php
#	composer.json
#	composer.lock
#	tests/Feature/VacationRequestTest.php
This commit is contained in:
Adrian Hopek
2022-02-24 09:38:50 +01:00
52 changed files with 2572 additions and 155 deletions

View File

@@ -23,7 +23,9 @@ use Toby\Domain\States\VacationRequest\VacationRequestState;
* @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
@@ -49,6 +51,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);
@@ -80,6 +87,11 @@ class VacationRequest extends Model
->where("to", ">=", $vacationRequest->from);
}
public function hasFlowSkipped(): bool
{
return $this->flow_skipped;
}
protected static function newFactory(): VacationRequestFactory
{
return VacationRequestFactory::new();