This commit is contained in:
Adrian Hopek
2022-01-26 10:56:25 +01:00
parent 026bfe485f
commit 01de63e9f4
71 changed files with 5631 additions and 3587 deletions

30
app/Enums/Role.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Toby\Enums;
enum Role: string
{
case EMPLOYEE = "employee";
case ADMINISTRATOR = "administrator";
case TECHNICAL_APPROVER = "technical_approver";
case ADMINISTRATIVE_APPROVER = "administrative_approver";
public function label(): string
{
return __($this->value);
}
public static function casesToSelect(): array
{
$cases = collect(Role::cases());
return $cases->map(
fn(Role $enum) => [
"label" => $enum->label(),
"value" => $enum->value,
],
)->toArray();
}
}

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Toby\Enums;
enum VacationRequestState: string
{
case CREATED = "created";
case CANCELED = "canceled";
case REJECTED = "rejected";
case APPROVED = "approved";
case WAITING_FOR_TECHNICAL = "waiting_for_technical";
case WAITING_FOR_ADMINISTRATIVE = "waiting_for_administrative";
case ACCEPTED_BY_TECHNICAL = "accepted_by_technical";
case ACCEPTED_BY_ADMINSTRATIVE = "accepted_by_administrative";
public function label(): string
{
return __($this->value);
}
}

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Toby\Enums;
enum VacationType: string
{
case VACATION = "vacation";
case VACATION_ON_REQUEST = "vacation_on_request";
case SPECIAL_VACATION = "special_vacation";
case CHILDCARE_VACATION = "childcare_vacation";
case TRAINING_VACATION = "training_vacation";
case UNPAID_VACATION = "unpaid_vacation";
case VOLUNTEERING_VACATION = "volunteering_vacation";
case TIME_IN_LIEU = "time_in_lieu";
case SICK_VACATION = "sick_vacation";
public function label(): string
{
return __($this->value);
}
public static function casesToSelect(): array
{
$cases = collect(VacationType::cases());
return $cases->map(
fn(VacationType $enum) => [
"label" => $enum->label(),
"value" => $enum->value,
],
)->toArray();
}
}