* #120 - wip * #120 - add icon to home office * #120 - wip * #120 - wip * #120 - wip * #120 - wip * #120 - wip * #120 - ui fixes * #120 - fix * #120 - fix * #120 - fix * #120 - fix * #120 - translation fix * #120 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
This commit is contained in:
parent
cc981b02b4
commit
c95d08c861
@ -7,6 +7,7 @@ namespace Toby\Domain\Actions\VacationRequest;
|
|||||||
use Toby\Domain\Enums\Role;
|
use Toby\Domain\Enums\Role;
|
||||||
use Toby\Domain\Notifications\VacationRequestStatusChangedNotification;
|
use Toby\Domain\Notifications\VacationRequestStatusChangedNotification;
|
||||||
use Toby\Domain\VacationRequestStateManager;
|
use Toby\Domain\VacationRequestStateManager;
|
||||||
|
use Toby\Domain\VacationTypeConfigRetriever;
|
||||||
use Toby\Eloquent\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
use Toby\Infrastructure\Jobs\SendVacationRequestDaysToGoogleCalendar;
|
use Toby\Infrastructure\Jobs\SendVacationRequestDaysToGoogleCalendar;
|
||||||
@ -15,15 +16,18 @@ class ApproveAction
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected VacationRequestStateManager $stateManager,
|
protected VacationRequestStateManager $stateManager,
|
||||||
|
protected VacationTypeConfigRetriever $configRetriever,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function execute(VacationRequest $vacationRequest, ?User $user = null): void
|
public function execute(VacationRequest $vacationRequest, ?User $user = null): void
|
||||||
{
|
{
|
||||||
$this->stateManager->approve($vacationRequest, $user);
|
$this->stateManager->approve($vacationRequest, $user);
|
||||||
|
|
||||||
SendVacationRequestDaysToGoogleCalendar::dispatch($vacationRequest);
|
if ($this->configRetriever->isVacation($vacationRequest->type)) {
|
||||||
|
SendVacationRequestDaysToGoogleCalendar::dispatch($vacationRequest);
|
||||||
|
|
||||||
$this->notify($vacationRequest);
|
$this->notify($vacationRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function notify(VacationRequest $vacationRequest): void
|
protected function notify(VacationRequest $vacationRequest): void
|
||||||
|
@ -7,6 +7,7 @@ namespace Toby\Domain\Actions\VacationRequest;
|
|||||||
use Toby\Domain\Enums\Role;
|
use Toby\Domain\Enums\Role;
|
||||||
use Toby\Domain\Notifications\VacationRequestStatusChangedNotification;
|
use Toby\Domain\Notifications\VacationRequestStatusChangedNotification;
|
||||||
use Toby\Domain\VacationRequestStateManager;
|
use Toby\Domain\VacationRequestStateManager;
|
||||||
|
use Toby\Domain\VacationTypeConfigRetriever;
|
||||||
use Toby\Eloquent\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
use Toby\Infrastructure\Jobs\ClearVacationRequestDaysInGoogleCalendar;
|
use Toby\Infrastructure\Jobs\ClearVacationRequestDaysInGoogleCalendar;
|
||||||
@ -15,6 +16,7 @@ class CancelAction
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected VacationRequestStateManager $stateManager,
|
protected VacationRequestStateManager $stateManager,
|
||||||
|
protected VacationTypeConfigRetriever $configRetriever,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function execute(VacationRequest $vacationRequest, User $user): void
|
public function execute(VacationRequest $vacationRequest, User $user): void
|
||||||
@ -23,7 +25,9 @@ class CancelAction
|
|||||||
|
|
||||||
ClearVacationRequestDaysInGoogleCalendar::dispatch($vacationRequest);
|
ClearVacationRequestDaysInGoogleCalendar::dispatch($vacationRequest);
|
||||||
|
|
||||||
$this->notify($vacationRequest);
|
if ($this->configRetriever->isVacation($vacationRequest->type)) {
|
||||||
|
$this->notify($vacationRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function notify(VacationRequest $vacationRequest): void
|
protected function notify(VacationRequest $vacationRequest): void
|
||||||
|
@ -32,7 +32,10 @@ class CreateAction
|
|||||||
{
|
{
|
||||||
$vacationRequest = $this->createVacationRequest($data, $creator);
|
$vacationRequest = $this->createVacationRequest($data, $creator);
|
||||||
$this->handleCreatedVacationRequest($vacationRequest);
|
$this->handleCreatedVacationRequest($vacationRequest);
|
||||||
$this->notify($vacationRequest);
|
|
||||||
|
if ($this->configRetriever->isVacation($vacationRequest->type)) {
|
||||||
|
$this->notify($vacationRequest);
|
||||||
|
}
|
||||||
|
|
||||||
return $vacationRequest;
|
return $vacationRequest;
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,12 @@ class WaitForAdminApprovalAction
|
|||||||
{
|
{
|
||||||
$this->stateManager->waitForAdministrative($vacationRequest);
|
$this->stateManager->waitForAdministrative($vacationRequest);
|
||||||
|
|
||||||
$this->waitForAdminApprovers($vacationRequest);
|
if ($this->configRetriever->isVacation($vacationRequest->type)) {
|
||||||
|
$this->notifyAdminApprovers($vacationRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function waitForAdminApprovers(VacationRequest $vacationRequest): void
|
protected function notifyAdminApprovers(VacationRequest $vacationRequest): void
|
||||||
{
|
{
|
||||||
$users = User::query()
|
$users = User::query()
|
||||||
->whereIn("role", [Role::AdministrativeApprover, Role::Administrator])
|
->whereIn("role", [Role::AdministrativeApprover, Role::Administrator])
|
||||||
|
@ -23,7 +23,9 @@ class WaitForTechApprovalAction
|
|||||||
{
|
{
|
||||||
$this->stateManager->waitForTechnical($vacationRequest);
|
$this->stateManager->waitForTechnical($vacationRequest);
|
||||||
|
|
||||||
$this->notifyTechApprovers($vacationRequest);
|
if ($this->configRetriever->isVacation($vacationRequest->type)) {
|
||||||
|
$this->notifyTechApprovers($vacationRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function notifyTechApprovers(VacationRequest $vacationRequest): void
|
protected function notifyTechApprovers(VacationRequest $vacationRequest): void
|
||||||
|
@ -18,6 +18,7 @@ enum VacationType: string
|
|||||||
case TimeInLieu = "time_in_lieu";
|
case TimeInLieu = "time_in_lieu";
|
||||||
case Sick = "sick_vacation";
|
case Sick = "sick_vacation";
|
||||||
case Absence = "absence";
|
case Absence = "absence";
|
||||||
|
case HomeOffice = "home_office";
|
||||||
|
|
||||||
public function label(): string
|
public function label(): string
|
||||||
{
|
{
|
||||||
|
@ -34,10 +34,10 @@ class UserVacationStatsRetriever
|
|||||||
public function getUsedVacationDaysByMonth(User $user, YearPeriod $yearPeriod): Collection
|
public function getUsedVacationDaysByMonth(User $user, YearPeriod $yearPeriod): Collection
|
||||||
{
|
{
|
||||||
return $user->vacations()
|
return $user->vacations()
|
||||||
|
->whereBelongsTo($yearPeriod)
|
||||||
->whereRelation(
|
->whereRelation(
|
||||||
"vacationRequest",
|
"vacationRequest",
|
||||||
fn(Builder $query): Builder => $query
|
fn(Builder $query): Builder => $query
|
||||||
->whereBelongsTo($yearPeriod)
|
|
||||||
->whereIn("type", $this->getLimitableVacationTypes())
|
->whereIn("type", $this->getLimitableVacationTypes())
|
||||||
->states(VacationRequestStatesRetriever::successStates()),
|
->states(VacationRequestStatesRetriever::successStates()),
|
||||||
)
|
)
|
||||||
@ -69,11 +69,21 @@ class UserVacationStatsRetriever
|
|||||||
"vacationRequest",
|
"vacationRequest",
|
||||||
fn(Builder $query): Builder => $query
|
fn(Builder $query): Builder => $query
|
||||||
->whereIn("type", $this->getNotLimitableVacationTypes())
|
->whereIn("type", $this->getNotLimitableVacationTypes())
|
||||||
|
->whereNot("type", VacationType::HomeOffice)
|
||||||
->states(VacationRequestStatesRetriever::successStates()),
|
->states(VacationRequestStatesRetriever::successStates()),
|
||||||
)
|
)
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHomeOfficeDays(User $user, YearPeriod $yearPeriod): int
|
||||||
|
{
|
||||||
|
return $user
|
||||||
|
->vacations()
|
||||||
|
->whereBelongsTo($yearPeriod)
|
||||||
|
->whereRelation("vacationRequest", "type", VacationType::HomeOffice)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
public function getRemainingVacationDays(User $user, YearPeriod $yearPeriod): int
|
public function getRemainingVacationDays(User $user, YearPeriod $yearPeriod): int
|
||||||
{
|
{
|
||||||
$limit = $this->getVacationDaysLimit($user, $yearPeriod);
|
$limit = $this->getVacationDaysLimit($user, $yearPeriod);
|
||||||
|
@ -15,6 +15,7 @@ class VacationTypeConfigRetriever
|
|||||||
public const KEY_BILLABLE = "billable";
|
public const KEY_BILLABLE = "billable";
|
||||||
public const KEY_HAS_LIMIT = "has_limit";
|
public const KEY_HAS_LIMIT = "has_limit";
|
||||||
public const KEY_AVAILABLE_FOR = "available_for";
|
public const KEY_AVAILABLE_FOR = "available_for";
|
||||||
|
public const KEY_IS_VACATION = "is_vacation";
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected Repository $config,
|
protected Repository $config,
|
||||||
@ -40,6 +41,11 @@ class VacationTypeConfigRetriever
|
|||||||
return $this->getConfigFor($type)[static::KEY_HAS_LIMIT];
|
return $this->getConfigFor($type)[static::KEY_HAS_LIMIT];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isVacation(VacationType $type): bool
|
||||||
|
{
|
||||||
|
return $this->getConfigFor($type)[static::KEY_IS_VACATION];
|
||||||
|
}
|
||||||
|
|
||||||
public function isAvailableFor(VacationType $type, EmploymentForm $employmentForm): bool
|
public function isAvailableFor(VacationType $type, EmploymentForm $employmentForm): bool
|
||||||
{
|
{
|
||||||
return in_array($employmentForm, $this->getConfigFor($type)[static::KEY_AVAILABLE_FOR], true);
|
return in_array($employmentForm, $this->getConfigFor($type)[static::KEY_AVAILABLE_FOR], true);
|
||||||
|
31
app/Domain/Validation/Rules/VacationTypeCanBeSelected.php
Normal file
31
app/Domain/Validation/Rules/VacationTypeCanBeSelected.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Toby\Domain\Validation\Rules;
|
||||||
|
|
||||||
|
use Toby\Domain\Enums\VacationType;
|
||||||
|
use Toby\Domain\VacationTypeConfigRetriever;
|
||||||
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
|
|
||||||
|
class VacationTypeCanBeSelected implements VacationRequestRule
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
protected VacationTypeConfigRetriever $configRetriever,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function check(VacationRequest $vacationRequest): bool
|
||||||
|
{
|
||||||
|
$employmentForm = $vacationRequest->user->profile->employment_form;
|
||||||
|
|
||||||
|
$availableTypes = VacationType::all()
|
||||||
|
->filter(fn(VacationType $type) => $this->configRetriever->isAvailableFor($type, $employmentForm));
|
||||||
|
|
||||||
|
return $availableTypes->contains($vacationRequest->type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function errorMessage(): string
|
||||||
|
{
|
||||||
|
return __("You cannot create vacation request of this type.");
|
||||||
|
}
|
||||||
|
}
|
@ -12,6 +12,7 @@ use Toby\Domain\Validation\Rules\NoApprovedVacationRequestsInRange;
|
|||||||
use Toby\Domain\Validation\Rules\NoPendingVacationRequestInRange;
|
use Toby\Domain\Validation\Rules\NoPendingVacationRequestInRange;
|
||||||
use Toby\Domain\Validation\Rules\VacationRangeIsInTheSameYearRule;
|
use Toby\Domain\Validation\Rules\VacationRangeIsInTheSameYearRule;
|
||||||
use Toby\Domain\Validation\Rules\VacationRequestRule;
|
use Toby\Domain\Validation\Rules\VacationRequestRule;
|
||||||
|
use Toby\Domain\Validation\Rules\VacationTypeCanBeSelected;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
|
|
||||||
class VacationRequestValidator
|
class VacationRequestValidator
|
||||||
@ -19,6 +20,7 @@ class VacationRequestValidator
|
|||||||
protected array $rules = [
|
protected array $rules = [
|
||||||
VacationRangeIsInTheSameYearRule::class,
|
VacationRangeIsInTheSameYearRule::class,
|
||||||
MinimumOneVacationDayRule::class,
|
MinimumOneVacationDayRule::class,
|
||||||
|
VacationTypeCanBeSelected::class,
|
||||||
DoesNotExceedLimitRule::class,
|
DoesNotExceedLimitRule::class,
|
||||||
NoPendingVacationRequestInRange::class,
|
NoPendingVacationRequestInRange::class,
|
||||||
NoApprovedVacationRequestsInRange::class,
|
NoApprovedVacationRequestsInRange::class,
|
||||||
|
@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
use Toby\Domain\VacationRequestStatesRetriever;
|
use Toby\Domain\VacationRequestStatesRetriever;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,4 +59,12 @@ class Vacation extends Model
|
|||||||
fn(Builder $query): Builder => $query->states(VacationRequestStatesRetriever::pendingStates()),
|
fn(Builder $query): Builder => $query->states(VacationRequestStatesRetriever::pendingStates()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeWhereTypes(Builder $query, Collection $types): Builder
|
||||||
|
{
|
||||||
|
return $query->whereRelation(
|
||||||
|
"vacationRequest",
|
||||||
|
fn(Builder $query): Builder => $query->whereIn("type", $types),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,16 @@ namespace Toby\Infrastructure\Http\Controllers;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
|
use Toby\Domain\Enums\VacationType;
|
||||||
use Toby\Domain\UserVacationStatsRetriever;
|
use Toby\Domain\UserVacationStatsRetriever;
|
||||||
use Toby\Domain\VacationRequestStatesRetriever;
|
use Toby\Domain\VacationRequestStatesRetriever;
|
||||||
|
use Toby\Domain\VacationTypeConfigRetriever;
|
||||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Eloquent\Models\Vacation;
|
use Toby\Eloquent\Models\Vacation;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
use Toby\Infrastructure\Http\Resources\AbsenceResource;
|
|
||||||
use Toby\Infrastructure\Http\Resources\HolidayResource;
|
use Toby\Infrastructure\Http\Resources\HolidayResource;
|
||||||
use Toby\Infrastructure\Http\Resources\VacationRequestResource;
|
use Toby\Infrastructure\Http\Resources\VacationRequestResource;
|
||||||
|
use Toby\Infrastructure\Http\Resources\VacationResource;
|
||||||
|
|
||||||
class DashboardController extends Controller
|
class DashboardController extends Controller
|
||||||
{
|
{
|
||||||
@ -22,6 +24,7 @@ class DashboardController extends Controller
|
|||||||
Request $request,
|
Request $request,
|
||||||
YearPeriodRetriever $yearPeriodRetriever,
|
YearPeriodRetriever $yearPeriodRetriever,
|
||||||
UserVacationStatsRetriever $vacationStatsRetriever,
|
UserVacationStatsRetriever $vacationStatsRetriever,
|
||||||
|
VacationTypeConfigRetriever $configRetriever,
|
||||||
): Response {
|
): Response {
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
$now = Carbon::now();
|
$now = Carbon::now();
|
||||||
@ -31,6 +34,14 @@ class DashboardController extends Controller
|
|||||||
->with(["user", "vacationRequest"])
|
->with(["user", "vacationRequest"])
|
||||||
->whereDate("date", $now)
|
->whereDate("date", $now)
|
||||||
->approved()
|
->approved()
|
||||||
|
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => $configRetriever->isVacation($type)))
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$remoteDays = Vacation::query()
|
||||||
|
->with(["user", "vacationRequest"])
|
||||||
|
->whereDate("date", $now)
|
||||||
|
->approved()
|
||||||
|
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => !$configRetriever->isVacation($type)))
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
if ($user->can("listAll", VacationRequest::class)) {
|
if ($user->can("listAll", VacationRequest::class)) {
|
||||||
@ -57,11 +68,13 @@ class DashboardController extends Controller
|
|||||||
$limit = $vacationStatsRetriever->getVacationDaysLimit($user, $yearPeriod);
|
$limit = $vacationStatsRetriever->getVacationDaysLimit($user, $yearPeriod);
|
||||||
$used = $vacationStatsRetriever->getUsedVacationDays($user, $yearPeriod);
|
$used = $vacationStatsRetriever->getUsedVacationDays($user, $yearPeriod);
|
||||||
$pending = $vacationStatsRetriever->getPendingVacationDays($user, $yearPeriod);
|
$pending = $vacationStatsRetriever->getPendingVacationDays($user, $yearPeriod);
|
||||||
|
$homeOffice = $vacationStatsRetriever->getHomeOfficeDays($user, $yearPeriod);
|
||||||
$other = $vacationStatsRetriever->getOtherApprovedVacationDays($user, $yearPeriod);
|
$other = $vacationStatsRetriever->getOtherApprovedVacationDays($user, $yearPeriod);
|
||||||
$remaining = $limit - $used - $pending;
|
$remaining = $limit - $used - $pending;
|
||||||
|
|
||||||
return inertia("Dashboard", [
|
return inertia("Dashboard", [
|
||||||
"absences" => AbsenceResource::collection($absences),
|
"absences" => VacationResource::collection($absences),
|
||||||
|
"remoteDays" => VacationResource::collection($remoteDays),
|
||||||
"vacationRequests" => VacationRequestResource::collection($vacationRequests),
|
"vacationRequests" => VacationRequestResource::collection($vacationRequests),
|
||||||
"holidays" => HolidayResource::collection($holidays),
|
"holidays" => HolidayResource::collection($holidays),
|
||||||
"stats" => [
|
"stats" => [
|
||||||
@ -69,6 +82,7 @@ class DashboardController extends Controller
|
|||||||
"remaining" => $remaining,
|
"remaining" => $remaining,
|
||||||
"used" => $used,
|
"used" => $used,
|
||||||
"pending" => $pending,
|
"pending" => $pending,
|
||||||
|
"homeOffice" => $homeOffice,
|
||||||
"other" => $other,
|
"other" => $other,
|
||||||
],
|
],
|
||||||
"can" => [
|
"can" => [
|
||||||
|
@ -35,7 +35,8 @@ class TimesheetController extends Controller
|
|||||||
|
|
||||||
$types = VacationType::all()
|
$types = VacationType::all()
|
||||||
->filter(
|
->filter(
|
||||||
fn(VacationType $type) => $configRetriever->isAvailableFor($type, EmploymentForm::EmploymentContract),
|
fn(VacationType $type) => $configRetriever->isAvailableFor($type, EmploymentForm::EmploymentContract)
|
||||||
|
&& $configRetriever->isVacation($type),
|
||||||
);
|
);
|
||||||
|
|
||||||
$filename = "{$carbonMonth->translatedFormat("F Y")}.xlsx";
|
$filename = "{$carbonMonth->translatedFormat("F Y")}.xlsx";
|
||||||
|
@ -11,7 +11,7 @@ use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
|||||||
use Toby\Eloquent\Models\VacationLimit;
|
use Toby\Eloquent\Models\VacationLimit;
|
||||||
use Toby\Eloquent\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
use Toby\Infrastructure\Http\Requests\VacationLimitRequest;
|
use Toby\Infrastructure\Http\Requests\VacationLimitRequest;
|
||||||
use Toby\Infrastructure\Http\Resources\SimpleUserResource;
|
use Toby\Infrastructure\Http\Resources\UserResource;
|
||||||
|
|
||||||
class VacationLimitController extends Controller
|
class VacationLimitController extends Controller
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ class VacationLimitController extends Controller
|
|||||||
|
|
||||||
$limitsResource = $limits->map(fn(VacationLimit $limit) => [
|
$limitsResource = $limits->map(fn(VacationLimit $limit) => [
|
||||||
"id" => $limit->id,
|
"id" => $limit->id,
|
||||||
"user" => new SimpleUserResource($limit->user),
|
"user" => new UserResource($limit->user),
|
||||||
"hasVacation" => $limit->hasVacation(),
|
"hasVacation" => $limit->hasVacation(),
|
||||||
"days" => $limit->days,
|
"days" => $limit->days,
|
||||||
"remainingLastYear" => $previousYearPeriod
|
"remainingLastYear" => $previousYearPeriod
|
||||||
|
@ -12,6 +12,7 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Http\Response as LaravelResponse;
|
use Illuminate\Http\Response as LaravelResponse;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
||||||
use Toby\Domain\Actions\VacationRequest\AcceptAsAdministrativeAction;
|
use Toby\Domain\Actions\VacationRequest\AcceptAsAdministrativeAction;
|
||||||
use Toby\Domain\Actions\VacationRequest\AcceptAsTechnicalAction;
|
use Toby\Domain\Actions\VacationRequest\AcceptAsTechnicalAction;
|
||||||
use Toby\Domain\Actions\VacationRequest\CancelAction;
|
use Toby\Domain\Actions\VacationRequest\CancelAction;
|
||||||
@ -23,6 +24,7 @@ use Toby\Domain\States\VacationRequest\AcceptedByTechnical;
|
|||||||
use Toby\Domain\States\VacationRequest\Cancelled;
|
use Toby\Domain\States\VacationRequest\Cancelled;
|
||||||
use Toby\Domain\States\VacationRequest\Rejected;
|
use Toby\Domain\States\VacationRequest\Rejected;
|
||||||
use Toby\Domain\VacationRequestStatesRetriever;
|
use Toby\Domain\VacationRequestStatesRetriever;
|
||||||
|
use Toby\Domain\VacationTypeConfigRetriever;
|
||||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Eloquent\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
@ -148,8 +150,14 @@ class VacationRequestController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @throws AuthorizationException
|
* @throws AuthorizationException
|
||||||
*/
|
*/
|
||||||
public function download(VacationRequest $vacationRequest): LaravelResponse
|
public function download(
|
||||||
{
|
VacationRequest $vacationRequest,
|
||||||
|
VacationTypeConfigRetriever $configRetriever,
|
||||||
|
): LaravelResponse {
|
||||||
|
if (!$configRetriever->isVacation($vacationRequest->type)) {
|
||||||
|
return abort(SymfonyResponse::HTTP_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
$this->authorize("show", $vacationRequest);
|
$this->authorize("show", $vacationRequest);
|
||||||
|
|
||||||
$pdf = PDF::loadView("pdf.vacation-request", [
|
$pdf = PDF::loadView("pdf.vacation-request", [
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Toby\Infrastructure\Http\Resources;
|
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
|
||||||
|
|
||||||
class AbsenceResource extends JsonResource
|
|
||||||
{
|
|
||||||
public static $wrap = null;
|
|
||||||
|
|
||||||
public function toArray($request): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
"id" => $this->id,
|
|
||||||
"user" => new SimpleUserResource($this->user),
|
|
||||||
"date" => $this->date->toDisplayString(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,10 +5,19 @@ declare(strict_types=1);
|
|||||||
namespace Toby\Infrastructure\Http\Resources;
|
namespace Toby\Infrastructure\Http\Resources;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
use Toby\Domain\VacationTypeConfigRetriever;
|
||||||
|
|
||||||
class VacationRequestResource extends JsonResource
|
class VacationRequestResource extends JsonResource
|
||||||
{
|
{
|
||||||
public static $wrap = null;
|
public static $wrap = null;
|
||||||
|
protected VacationTypeConfigRetriever $configRetriever;
|
||||||
|
|
||||||
|
public function __construct($resource)
|
||||||
|
{
|
||||||
|
parent::__construct($resource);
|
||||||
|
|
||||||
|
$this->configRetriever = app(VacationTypeConfigRetriever::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function toArray($request): array
|
public function toArray($request): array
|
||||||
{
|
{
|
||||||
@ -17,6 +26,7 @@ class VacationRequestResource extends JsonResource
|
|||||||
"name" => $this->name,
|
"name" => $this->name,
|
||||||
"user" => new SimpleUserResource($this->user),
|
"user" => new SimpleUserResource($this->user),
|
||||||
"type" => $this->type,
|
"type" => $this->type,
|
||||||
|
"isVacation" => $this->configRetriever->isVacation($this->type),
|
||||||
"state" => $this->state,
|
"state" => $this->state,
|
||||||
"from" => $this->from->toDisplayString(),
|
"from" => $this->from->toDisplayString(),
|
||||||
"to" => $this->to->toDisplayString(),
|
"to" => $this->to->toDisplayString(),
|
||||||
|
@ -14,6 +14,7 @@ class VacationResource extends JsonResource
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
"id" => $this->id,
|
"id" => $this->id,
|
||||||
|
"user" => new SimpleUserResource($this->user),
|
||||||
"displayDate" => $this->date->toDisplayString(),
|
"displayDate" => $this->date->toDisplayString(),
|
||||||
"date" => $this->date->toDateString(),
|
"date" => $this->date->toDateString(),
|
||||||
];
|
];
|
||||||
|
@ -15,6 +15,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::OnRequest->value => [
|
VacationType::OnRequest->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
@ -24,6 +25,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::TimeInLieu->value => [
|
VacationType::TimeInLieu->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => false,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => false,
|
||||||
@ -33,6 +35,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::Sick->value => [
|
VacationType::Sick->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => false,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => false,
|
||||||
@ -42,6 +45,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::Unpaid->value => [
|
VacationType::Unpaid->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
@ -51,6 +55,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::Special->value => [
|
VacationType::Special->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
@ -60,6 +65,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::Childcare->value => [
|
VacationType::Childcare->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
@ -69,6 +75,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::Training->value => [
|
VacationType::Training->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
@ -78,6 +85,18 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
|
VacationType::Volunteering->value => [
|
||||||
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
|
VacationTypeConfigRetriever::KEY_ADMINISTRATIVE_APPROVAL => true,
|
||||||
|
VacationTypeConfigRetriever::KEY_BILLABLE => true,
|
||||||
|
VacationTypeConfigRetriever::KEY_HAS_LIMIT => false,
|
||||||
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
|
EmploymentForm::EmploymentContract,
|
||||||
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
],
|
],
|
||||||
VacationType::Volunteering->value => [
|
VacationType::Volunteering->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
@ -87,15 +106,7 @@ return [
|
|||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
EmploymentForm::EmploymentContract,
|
EmploymentForm::EmploymentContract,
|
||||||
],
|
],
|
||||||
],
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
VacationType::Volunteering->value => [
|
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
|
||||||
VacationTypeConfigRetriever::KEY_ADMINISTRATIVE_APPROVAL => true,
|
|
||||||
VacationTypeConfigRetriever::KEY_BILLABLE => true,
|
|
||||||
VacationTypeConfigRetriever::KEY_HAS_LIMIT => false,
|
|
||||||
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
|
||||||
EmploymentForm::EmploymentContract,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
VacationType::Absence->value => [
|
VacationType::Absence->value => [
|
||||||
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => true,
|
||||||
@ -107,5 +118,19 @@ return [
|
|||||||
EmploymentForm::B2bContract,
|
EmploymentForm::B2bContract,
|
||||||
EmploymentForm::BoardMemberContract,
|
EmploymentForm::BoardMemberContract,
|
||||||
],
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => true,
|
||||||
|
],
|
||||||
|
VacationType::HomeOffice->value => [
|
||||||
|
VacationTypeConfigRetriever::KEY_TECHNICAL_APPROVAL => false,
|
||||||
|
VacationTypeConfigRetriever::KEY_ADMINISTRATIVE_APPROVAL => false,
|
||||||
|
VacationTypeConfigRetriever::KEY_BILLABLE => true,
|
||||||
|
VacationTypeConfigRetriever::KEY_HAS_LIMIT => false,
|
||||||
|
VacationTypeConfigRetriever::KEY_AVAILABLE_FOR => [
|
||||||
|
EmploymentForm::EmploymentContract,
|
||||||
|
EmploymentForm::CommissionContract,
|
||||||
|
EmploymentForm::B2bContract,
|
||||||
|
EmploymentForm::BoardMemberContract,
|
||||||
|
],
|
||||||
|
VacationTypeConfigRetriever::KEY_IS_VACATION => false,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -8,6 +8,7 @@ import HandHeartOutlineIcon from 'vue-material-design-icons/HandHeartOutline.vue
|
|||||||
import CalendarCheckIcon from 'vue-material-design-icons/CalendarCheck.vue'
|
import CalendarCheckIcon from 'vue-material-design-icons/CalendarCheck.vue'
|
||||||
import MedicalBagIcon from 'vue-material-design-icons/MedicalBag.vue'
|
import MedicalBagIcon from 'vue-material-design-icons/MedicalBag.vue'
|
||||||
import CalendarRemoveIcon from 'vue-material-design-icons/CalendarRemove.vue'
|
import CalendarRemoveIcon from 'vue-material-design-icons/CalendarRemove.vue'
|
||||||
|
import LaptopIcon from 'vue-material-design-icons/Laptop.vue'
|
||||||
|
|
||||||
const types = [
|
const types = [
|
||||||
{
|
{
|
||||||
@ -80,6 +81,13 @@ const types = [
|
|||||||
color: 'text-cyan-500',
|
color: 'text-cyan-500',
|
||||||
border: 'border-cyan-500',
|
border: 'border-cyan-500',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: 'Praca zdalna',
|
||||||
|
value: 'home_office',
|
||||||
|
icon: LaptopIcon,
|
||||||
|
color: 'text-fuchsia-500',
|
||||||
|
border: 'border-fuchsia-500',
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export default function useVacationTypeInfo() {
|
export default function useVacationTypeInfo() {
|
||||||
|
@ -15,9 +15,13 @@
|
|||||||
:requests="vacationRequests.data"
|
:requests="vacationRequests.data"
|
||||||
/>
|
/>
|
||||||
<AbsenceList
|
<AbsenceList
|
||||||
v-if="years.current.year === years.selected.year"
|
v-if="years.current.year === years.selected.year && absences.data.length"
|
||||||
:absences="absences.data"
|
:absences="absences.data"
|
||||||
/>
|
/>
|
||||||
|
<HomeOfficeList
|
||||||
|
v-if="years.current.year === years.selected.year && remoteDays.data.length"
|
||||||
|
:remote-days="remoteDays.data"
|
||||||
|
/>
|
||||||
<UpcomingHolidays
|
<UpcomingHolidays
|
||||||
v-if="years.current.year === years.selected.year"
|
v-if="years.current.year === years.selected.year"
|
||||||
:holidays="holidays.data"
|
:holidays="holidays.data"
|
||||||
@ -30,6 +34,7 @@
|
|||||||
import Welcome from '@/Shared/Widgets/Welcome'
|
import Welcome from '@/Shared/Widgets/Welcome'
|
||||||
import VacationStats from '@/Shared/Widgets/VacationStats'
|
import VacationStats from '@/Shared/Widgets/VacationStats'
|
||||||
import AbsenceList from '@/Shared/Widgets/AbsenceList'
|
import AbsenceList from '@/Shared/Widgets/AbsenceList'
|
||||||
|
import HomeOfficeList from '@/Shared/Widgets/HomeOfficeList'
|
||||||
import UpcomingHolidays from '@/Shared/Widgets/UpcomingHolidays'
|
import UpcomingHolidays from '@/Shared/Widgets/UpcomingHolidays'
|
||||||
import UserVacationRequests from '@/Shared/Widgets/UserVacationRequests'
|
import UserVacationRequests from '@/Shared/Widgets/UserVacationRequests'
|
||||||
import PendingVacationRequests from '@/Shared/Widgets/PendingVacationRequests'
|
import PendingVacationRequests from '@/Shared/Widgets/PendingVacationRequests'
|
||||||
@ -37,6 +42,7 @@ import PendingVacationRequests from '@/Shared/Widgets/PendingVacationRequests'
|
|||||||
defineProps({
|
defineProps({
|
||||||
auth: Object,
|
auth: Object,
|
||||||
absences: Object,
|
absences: Object,
|
||||||
|
remoteDays: Object,
|
||||||
vacationRequests: Object,
|
vacationRequests: Object,
|
||||||
holidays: Object,
|
holidays: Object,
|
||||||
can: Object,
|
can: Object,
|
||||||
|
@ -133,14 +133,14 @@
|
|||||||
as="template"
|
as="template"
|
||||||
:value="role"
|
:value="role"
|
||||||
>
|
>
|
||||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||||
{{ role.label }}
|
{{ role.label }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
@ -188,14 +188,14 @@
|
|||||||
as="template"
|
as="template"
|
||||||
:value="employmentForm"
|
:value="employmentForm"
|
||||||
>
|
>
|
||||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||||
{{ employmentForm.label }}
|
{{ employmentForm.label }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -136,7 +136,7 @@
|
|||||||
:value="role"
|
:value="role"
|
||||||
>
|
>
|
||||||
<li
|
<li
|
||||||
:class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||||
>
|
>
|
||||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||||
{{ role.label }}
|
{{ role.label }}
|
||||||
@ -144,7 +144,7 @@
|
|||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
@ -194,7 +194,7 @@
|
|||||||
:value="employmentForm"
|
:value="employmentForm"
|
||||||
>
|
>
|
||||||
<li
|
<li
|
||||||
:class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||||
>
|
>
|
||||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||||
{{ employmentForm.label }}
|
{{ employmentForm.label }}
|
||||||
@ -202,7 +202,7 @@
|
|||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
as="template"
|
as="template"
|
||||||
:value="user"
|
:value="user"
|
||||||
>
|
>
|
||||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img
|
<img
|
||||||
:src="user.avatar"
|
:src="user.avatar"
|
||||||
@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
@ -142,7 +142,9 @@
|
|||||||
:class="{ 'border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500': form.errors.type, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.type }"
|
:class="{ 'border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500': form.errors.type, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.type }"
|
||||||
>
|
>
|
||||||
<template v-if="form.vacationType">
|
<template v-if="form.vacationType">
|
||||||
<span class="block truncate">{{ form.vacationType.label }}</span>
|
<span class="block truncate">
|
||||||
|
<VacationType :type="form.vacationType.value" />
|
||||||
|
</span>
|
||||||
<span class="flex absolute inset-y-0 right-0 items-center pr-2 pointer-events-none">
|
<span class="flex absolute inset-y-0 right-0 items-center pr-2 pointer-events-none">
|
||||||
<SelectorIcon class="w-5 h-5 text-gray-400" />
|
<SelectorIcon class="w-5 h-5 text-gray-400" />
|
||||||
</span>
|
</span>
|
||||||
@ -164,14 +166,14 @@
|
|||||||
as="template"
|
as="template"
|
||||||
:value="vacationType"
|
:value="vacationType"
|
||||||
>
|
>
|
||||||
<li :class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
<li :class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']">
|
||||||
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
<span :class="[selected ? 'font-semibold' : 'font-normal', 'block truncate']">
|
||||||
{{ vacationType.label }}
|
<VacationType :type="vacationType.value" />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
@ -331,6 +333,7 @@ import { reactive, ref, watch } from 'vue'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import useCurrentYearPeriodInfo from '@/Composables/yearPeriodInfo'
|
import useCurrentYearPeriodInfo from '@/Composables/yearPeriodInfo'
|
||||||
import VacationChart from '@/Shared/VacationChart'
|
import VacationChart from '@/Shared/VacationChart'
|
||||||
|
import VacationType from '@/Shared/VacationType'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
auth: Object,
|
auth: Object,
|
||||||
|
@ -70,13 +70,13 @@
|
|||||||
:value="status"
|
:value="status"
|
||||||
>
|
>
|
||||||
<li
|
<li
|
||||||
:class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default truncate select-none relative py-2 pl-3 pr-9']"
|
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default truncate select-none relative py-2 pl-3 pr-9']"
|
||||||
>
|
>
|
||||||
{{ status.name }}
|
{{ status.name }}
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
:value="null"
|
:value="null"
|
||||||
>
|
>
|
||||||
<li
|
<li
|
||||||
:class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||||
>
|
>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
Wszyscy
|
Wszyscy
|
||||||
@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="form.user === null"
|
v-if="form.user === null"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
@ -83,7 +83,7 @@
|
|||||||
:value="user"
|
:value="user"
|
||||||
>
|
>
|
||||||
<li
|
<li
|
||||||
:class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||||
>
|
>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img
|
<img
|
||||||
@ -98,7 +98,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
v-if="form.user?.id === user.id"
|
v-if="form.user?.id === user.id"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
@ -143,13 +143,13 @@
|
|||||||
:value="status"
|
:value="status"
|
||||||
>
|
>
|
||||||
<li
|
<li
|
||||||
:class="[active ? 'text-white bg-blumilk-600' : 'text-gray-900', 'cursor-default truncate select-none relative py-2 pl-3 pr-9']"
|
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default truncate select-none relative py-2 pl-3 pr-9']"
|
||||||
>
|
>
|
||||||
{{ status.name }}
|
{{ status.name }}
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="selected"
|
v-if="selected"
|
||||||
:class="[active ? 'text-white' : 'text-blumilk-600', 'absolute inset-y-0 right-0 flex items-center pr-4']"
|
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||||
>
|
>
|
||||||
<CheckIcon class="w-5 h-5" />
|
<CheckIcon class="w-5 h-5" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -88,7 +88,10 @@
|
|||||||
-
|
-
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-5 px-4 bg-white sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
<div
|
||||||
|
v-if="VacationType.isVacation"
|
||||||
|
class="py-5 px-4 bg-white sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"
|
||||||
|
>
|
||||||
<dt class="flex items-center text-sm font-medium text-gray-500">
|
<dt class="flex items-center text-sm font-medium text-gray-500">
|
||||||
Załączniki
|
Załączniki
|
||||||
</dt>
|
</dt>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="py-2 px-4 text-gray-900 bg-white rounded-md shadow-md text-md">
|
<div class="py-2 px-4 text-gray-900 bg-white rounded-lg border border-gray-400 text-md">
|
||||||
<div class="flex items-center font-normal">
|
<div class="flex items-center font-normal">
|
||||||
<i
|
<i
|
||||||
class="inline-block mr-3 w-5 h-3"
|
class="inline-block mr-3 w-5 h-3"
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="py-2 space-y-1">
|
<div class="py-2 space-y-1">
|
||||||
<dt class="text-sm font-medium text-gray-500">
|
<dt class="text-sm font-medium text-gray-500">
|
||||||
Rodzaj urlopu
|
Rodzaj wniosku
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="mt-1 text-sm text-gray-900">
|
<dd class="mt-1 text-sm text-gray-900">
|
||||||
<VacationType :type="vacation.type" />
|
<VacationType :type="vacation.type" />
|
||||||
|
@ -25,11 +25,6 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="! absences.length">
|
|
||||||
<p class="py-2">
|
|
||||||
Brak danych
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
37
resources/js/Shared/Widgets/HomeOfficeList.vue
Normal file
37
resources/js/Shared/Widgets/HomeOfficeList.vue
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<template>
|
||||||
|
<section class="bg-white shadow-md">
|
||||||
|
<div class="p-4 sm:px-6">
|
||||||
|
<h2 class="text-lg font-medium leading-6 text-gray-900">
|
||||||
|
Dzisiejsza praca zdalna
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div class="px-4 border-t border-gray-200 sm:px-6">
|
||||||
|
<ul class="divide-y divide-gray-200">
|
||||||
|
<li
|
||||||
|
v-for="day in remoteDays"
|
||||||
|
:key="day.user.id"
|
||||||
|
class="flex py-4"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
class="w-10 h-10 rounded-full"
|
||||||
|
:src="day.user.avatar"
|
||||||
|
>
|
||||||
|
<div class="ml-3">
|
||||||
|
<p class="text-sm font-medium text-gray-900">
|
||||||
|
{{ day.user.name }}
|
||||||
|
</p>
|
||||||
|
<p class="text-sm text-gray-500">
|
||||||
|
{{ day.user.email }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
remoteDays: Object,
|
||||||
|
})
|
||||||
|
</script>
|
@ -39,7 +39,7 @@
|
|||||||
</dt>
|
</dt>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-5 px-4 bg-white shadow-md sm:p-6">
|
<div class="py-5 px-4 bg-white shadow-md sm:p-6">
|
||||||
<dt class="mt-1 text-4xl font-semibold text-gray-900">
|
<dt class="mt-1 text-4xl font-semibold text-blumilk-800">
|
||||||
{{ stats.limit }}
|
{{ stats.limit }}
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="font-medium text-gray-700 truncate text-md">
|
<dd class="font-medium text-gray-700 truncate text-md">
|
||||||
@ -49,8 +49,8 @@
|
|||||||
Twój roczny limit urlopu wypoczynkowego.
|
Twój roczny limit urlopu wypoczynkowego.
|
||||||
</dt>
|
</dt>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-2 py-5 px-4 bg-white shadow-md sm:p-6">
|
<div class="py-5 px-4 bg-white shadow-md sm:p-6">
|
||||||
<dt class="mt-1 text-4xl font-semibold text-gray-900">
|
<dt class="mt-1 text-4xl font-semibold text-gray-500">
|
||||||
{{ stats.other }}
|
{{ stats.other }}
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="font-medium text-gray-700 truncate text-md">
|
<dd class="font-medium text-gray-700 truncate text-md">
|
||||||
@ -60,6 +60,17 @@
|
|||||||
Urlopy bezpłatne, okolicznościowe, zwolnienia lekarskie, itd., które zostały już zatwierdzone.
|
Urlopy bezpłatne, okolicznościowe, zwolnienia lekarskie, itd., które zostały już zatwierdzone.
|
||||||
</dt>
|
</dt>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="py-5 px-4 bg-white shadow-md sm:p-6">
|
||||||
|
<dt class="mt-1 text-4xl font-semibold text-fuchsia-700">
|
||||||
|
{{ stats.homeOffice }}
|
||||||
|
</dt>
|
||||||
|
<dd class="font-medium text-gray-700 truncate text-md">
|
||||||
|
Praca zdalna
|
||||||
|
</dd>
|
||||||
|
<dt class="mt-2 text-sm font-medium text-gray-500">
|
||||||
|
Dni przepracowane poza biurem.
|
||||||
|
</dt>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
"time_in_lieu": "Odbiór za święto",
|
"time_in_lieu": "Odbiór za święto",
|
||||||
"sick_vacation": "Zwolnienie lekarskie",
|
"sick_vacation": "Zwolnienie lekarskie",
|
||||||
"absence": "Nieobecność",
|
"absence": "Nieobecność",
|
||||||
|
"home_office": "Praca zdalna",
|
||||||
"employee": "Pracownik",
|
"employee": "Pracownik",
|
||||||
"administrator": "Administrator",
|
"administrator": "Administrator",
|
||||||
"technical_approver": "Techniczny akceptujący",
|
"technical_approver": "Techniczny akceptujący",
|
||||||
@ -63,7 +64,7 @@
|
|||||||
"Vacation request :title is waiting for your administrative approval": "Wniosek urlopowy :title czeka na akceptację administracyjną",
|
"Vacation request :title is waiting for your administrative approval": "Wniosek urlopowy :title czeka na akceptację administracyjną",
|
||||||
"The vacation request :title from user :requester is waiting for your technical approval.": "Wniosek urlopowy :title użytkownika :requester czeka na Twoją akceptację techniczną.",
|
"The vacation request :title from user :requester is waiting for your technical approval.": "Wniosek urlopowy :title użytkownika :requester czeka na Twoją akceptację techniczną.",
|
||||||
"The vacation request :title from user :requester is waiting for your administrative approval.": "Wniosek urlopowy :title użytkownika :requester czeka na Twoją akceptację administracyjną.",
|
"The vacation request :title from user :requester is waiting for your administrative approval.": "Wniosek urlopowy :title użytkownika :requester czeka na Twoją akceptację administracyjną.",
|
||||||
"Vacation request :title has been :status": "Wniosek urlopowy :title został :status",
|
"Vacation request :title has been :status": "Wniosek :title został :status",
|
||||||
"The vacation request :title from user :requester has been :status.": "Wniosek urlopowy :title użytkownika :requester został :status.",
|
"The vacation request :title from user :requester has been :status.": "Wniosek urlopowy :title użytkownika :requester został :status.",
|
||||||
"Vacation request :title has been created on your behalf": "Wniosek urlopowy :title został utworzony w Twoim imieniu",
|
"Vacation request :title has been created on your behalf": "Wniosek urlopowy :title został utworzony w Twoim imieniu",
|
||||||
"The vacation request :title has been created correctly by user :creator on your behalf in the :appName.": "W systemie :appName został poprawnie utworzony wniosek urlopowy :title w Twoim imieniu przez użytkownika :creator."
|
"The vacation request :title has been created correctly by user :creator on your behalf in the :appName.": "W systemie :appName został poprawnie utworzony wniosek urlopowy :title w Twoim imieniu przez użytkownika :creator."
|
||||||
|
@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Bus;
|
|||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Inertia\Testing\AssertableInertia as Assert;
|
use Inertia\Testing\AssertableInertia as Assert;
|
||||||
use Tests\FeatureTestCase;
|
use Tests\FeatureTestCase;
|
||||||
|
use Toby\Domain\Enums\EmploymentForm;
|
||||||
use Toby\Domain\Enums\VacationType;
|
use Toby\Domain\Enums\VacationType;
|
||||||
use Toby\Domain\PolishHolidaysRetriever;
|
use Toby\Domain\PolishHolidaysRetriever;
|
||||||
use Toby\Domain\States\VacationRequest\Approved;
|
use Toby\Domain\States\VacationRequest\Approved;
|
||||||
@ -17,6 +18,7 @@ use Toby\Domain\States\VacationRequest\Cancelled;
|
|||||||
use Toby\Domain\States\VacationRequest\Rejected;
|
use Toby\Domain\States\VacationRequest\Rejected;
|
||||||
use Toby\Domain\States\VacationRequest\WaitingForAdministrative;
|
use Toby\Domain\States\VacationRequest\WaitingForAdministrative;
|
||||||
use Toby\Domain\States\VacationRequest\WaitingForTechnical;
|
use Toby\Domain\States\VacationRequest\WaitingForTechnical;
|
||||||
|
use Toby\Eloquent\Models\Profile;
|
||||||
use Toby\Eloquent\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Eloquent\Models\VacationLimit;
|
use Toby\Eloquent\Models\VacationLimit;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
@ -61,7 +63,9 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testUserCanCreateVacationRequest(): void
|
public function testUserCanCreateVacationRequest(): void
|
||||||
{
|
{
|
||||||
$user = User::factory()->create();
|
$user = User::factory()
|
||||||
|
->has(Profile::factory(["employment_form" => EmploymentForm::EmploymentContract]))
|
||||||
|
->create();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
@ -80,6 +84,7 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
"to" => Carbon::create($currentYearPeriod->year, 2, 11)->toDateString(),
|
"to" => Carbon::create($currentYearPeriod->year, 2, 11)->toDateString(),
|
||||||
"comment" => "Comment for the vacation request.",
|
"comment" => "Comment for the vacation request.",
|
||||||
])
|
])
|
||||||
|
->assertSessionHasNoErrors()
|
||||||
->assertRedirect();
|
->assertRedirect();
|
||||||
|
|
||||||
$this->assertDatabaseHas("vacation_requests", [
|
$this->assertDatabaseHas("vacation_requests", [
|
||||||
@ -96,7 +101,9 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
public function testUserCanCreateVacationRequestOnEmployeeBehalf(): void
|
public function testUserCanCreateVacationRequestOnEmployeeBehalf(): void
|
||||||
{
|
{
|
||||||
$creator = User::factory()->admin()->create();
|
$creator = User::factory()->admin()->create();
|
||||||
$user = User::factory()->create();
|
$user = User::factory()
|
||||||
|
->has(Profile::factory(["employment_form" => EmploymentForm::EmploymentContract]))
|
||||||
|
->create();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
@ -132,7 +139,9 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
public function testUserCanCreateVacationRequestOnEmployeeBehalfAndSkipAcceptanceFlow(): void
|
public function testUserCanCreateVacationRequestOnEmployeeBehalfAndSkipAcceptanceFlow(): void
|
||||||
{
|
{
|
||||||
$creator = User::factory()->admin()->create();
|
$creator = User::factory()->admin()->create();
|
||||||
$user = User::factory()->create();
|
$user = User::factory()
|
||||||
|
->has(Profile::factory(["employment_form" => EmploymentForm::EmploymentContract]))
|
||||||
|
->create();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
@ -245,7 +254,9 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testUserCannotCreateVacationRequestIfHeExceedsHisVacationLimit(): void
|
public function testUserCannotCreateVacationRequestIfHeExceedsHisVacationLimit(): void
|
||||||
{
|
{
|
||||||
$user = User::factory()->create();
|
$user = User::factory()
|
||||||
|
->has(Profile::factory(["employment_form" => EmploymentForm::EmploymentContract]))
|
||||||
|
->create();
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
VacationLimit::factory([
|
VacationLimit::factory([
|
||||||
@ -327,7 +338,9 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testUserCannotCreateVacationRequestIfHeHasPendingVacationRequestInThisRange(): void
|
public function testUserCannotCreateVacationRequestIfHeHasPendingVacationRequestInThisRange(): void
|
||||||
{
|
{
|
||||||
$user = User::factory()->create();
|
$user = User::factory()
|
||||||
|
->has(Profile::factory(["employment_form" => EmploymentForm::EmploymentContract]))
|
||||||
|
->create();
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
VacationLimit::factory([
|
VacationLimit::factory([
|
||||||
@ -363,7 +376,9 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testUserCannotCreateVacationRequestIfHeHasApprovedVacationRequestInThisRange(): void
|
public function testUserCannotCreateVacationRequestIfHeHasApprovedVacationRequestInThisRange(): void
|
||||||
{
|
{
|
||||||
$user = User::factory()->create();
|
$user = User::factory()
|
||||||
|
->has(Profile::factory(["employment_form" => EmploymentForm::EmploymentContract]))
|
||||||
|
->create();
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
VacationLimit::factory([
|
VacationLimit::factory([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user