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:
@@ -58,6 +58,11 @@ class User extends Authenticatable
|
||||
return $this->hasMany(VacationRequest::class);
|
||||
}
|
||||
|
||||
public function createdVacationRequests(): HasMany
|
||||
{
|
||||
return $this->hasMany(VacationRequest::class, "creator_id");
|
||||
}
|
||||
|
||||
public function vacations(): HasMany
|
||||
{
|
||||
return $this->hasMany(Vacation::class);
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user