Merge branch 'main' into #20-vacation-requests
# Conflicts: # app/Architecture/Providers/ObserverServiceProvider.php # app/Domain/Role.php # app/Domain/Rules/ApprovedVacationDaysInSameRange.php # app/Domain/Rules/DoesNotExceedLimitRule.php # app/Domain/Rules/MinimumOneVacationDayRule.php # app/Domain/Rules/PendingVacationRequestInSameRange.php # app/Domain/Rules/UsedVacationDaysInSameRange.php # app/Domain/Rules/VacationRequestRule.php # app/Domain/VacationRequestState.php # app/Domain/VacationRequestStateManager.php # app/Domain/VacationRequestValidator.php # app/Domain/VacationType.php # app/Domain/VacationTypeConfigRetriever.php # app/Eloquent/Models/User.php # app/Infrastructure/Http/Controllers/UserController.php # app/Infrastructure/Http/Kernel.php # app/Infrastructure/Http/Requests/UserRequest.php # database/factories/UserFactory.php # database/seeders/DatabaseSeeder.php # routes/web.php # tests/Feature/UserTest.php
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
APP_NAME=Laravel
 | 
			
		||||
APP_NAME="Toby HR applicaiton"
 | 
			
		||||
APP_ENV=local
 | 
			
		||||
APP_KEY=
 | 
			
		||||
APP_DEBUG=true
 | 
			
		||||
 
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Exceptions;
 | 
			
		||||
namespace Toby\Architecture;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 | 
			
		||||
use Illuminate\Foundation\Exceptions\Handler;
 | 
			
		||||
 | 
			
		||||
class Handler extends ExceptionHandler
 | 
			
		||||
class ExceptionHandler extends Handler
 | 
			
		||||
{
 | 
			
		||||
    protected $dontFlash = [
 | 
			
		||||
        "current_password",
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Providers;
 | 
			
		||||
namespace Toby\Architecture\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Illuminate\Support\ServiceProvider;
 | 
			
		||||
use Toby\Models\Holiday;
 | 
			
		||||
use Toby\Models\VacationLimit;
 | 
			
		||||
use Toby\Scopes\SelectedYearPeriodScope;
 | 
			
		||||
use Toby\Eloquent\Models\Holiday;
 | 
			
		||||
use Toby\Eloquent\Models\VacationLimit;
 | 
			
		||||
use Toby\Eloquent\Scopes\SelectedYearPeriodScope;
 | 
			
		||||
 | 
			
		||||
class AppServiceProvider extends ServiceProvider
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Providers;
 | 
			
		||||
namespace Toby\Architecture\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
 | 
			
		||||
 | 
			
		||||
@@ -2,19 +2,19 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Providers;
 | 
			
		||||
namespace Toby\Architecture\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
 | 
			
		||||
use Toby\Events\VacationRequestAcceptedByAdministrative;
 | 
			
		||||
use Toby\Events\VacationRequestAcceptedByTechnical;
 | 
			
		||||
use Toby\Events\VacationRequestApproved;
 | 
			
		||||
use Toby\Events\VacationRequestCreated;
 | 
			
		||||
use Toby\Events\VacationRequestStateChanged;
 | 
			
		||||
use Toby\Listeners\CreateVacationRequestActivity;
 | 
			
		||||
use Toby\Listeners\HandleAcceptedByAdministrativeVacationRequest;
 | 
			
		||||
use Toby\Listeners\HandleAcceptedByTechnicalVacationRequest;
 | 
			
		||||
use Toby\Listeners\HandleApprovedVacationRequest;
 | 
			
		||||
use Toby\Listeners\HandleCreatedVacationRequest;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestAcceptedByAdministrative;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestAcceptedByTechnical;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestApproved;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestCreated;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestStateChanged;
 | 
			
		||||
use Toby\Domain\Listeners\CreateVacationRequestActivity;
 | 
			
		||||
use Toby\Domain\Listeners\HandleAcceptedByAdministrativeVacationRequest;
 | 
			
		||||
use Toby\Domain\Listeners\HandleAcceptedByTechnicalVacationRequest;
 | 
			
		||||
use Toby\Domain\Listeners\HandleApprovedVacationRequest;
 | 
			
		||||
use Toby\Domain\Listeners\HandleCreatedVacationRequest;
 | 
			
		||||
 | 
			
		||||
class EventServiceProvider extends ServiceProvider
 | 
			
		||||
{
 | 
			
		||||
@@ -2,15 +2,15 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Providers;
 | 
			
		||||
namespace Toby\Architecture\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\ServiceProvider;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Observers\UserObserver;
 | 
			
		||||
use Toby\Observers\VacationRequestObserver;
 | 
			
		||||
use Toby\Observers\YearPeriodObserver;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Observers\UserObserver;
 | 
			
		||||
use Toby\Eloquent\Observers\VacationRequestObserver;
 | 
			
		||||
use Toby\Eloquent\Observers\YearPeriodObserver;
 | 
			
		||||
 | 
			
		||||
class ObserverServiceProvider extends ServiceProvider
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Providers;
 | 
			
		||||
namespace Toby\Architecture\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Cache\RateLimiting\Limit;
 | 
			
		||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Providers;
 | 
			
		||||
namespace Toby\Architecture\Providers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\ServiceProvider;
 | 
			
		||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Enums;
 | 
			
		||||
namespace Toby\Domain\Enums;
 | 
			
		||||
 | 
			
		||||
enum EmploymentForm: string
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Enums;
 | 
			
		||||
namespace Toby\Domain\Enums;
 | 
			
		||||
 | 
			
		||||
enum Role: string
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Enums;
 | 
			
		||||
namespace Toby\Domain\Enums;
 | 
			
		||||
 | 
			
		||||
enum VacationRequestState: string
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Enums;
 | 
			
		||||
namespace Toby\Domain\Enums;
 | 
			
		||||
 | 
			
		||||
enum VacationType: string
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Events;
 | 
			
		||||
namespace Toby\Domain\Events;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Events\Dispatchable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestAcceptedByAdministrative
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Events;
 | 
			
		||||
namespace Toby\Domain\Events;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Events\Dispatchable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestAcceptedByTechnical
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Events;
 | 
			
		||||
namespace Toby\Domain\Events;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Events\Dispatchable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestApproved
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Events;
 | 
			
		||||
namespace Toby\Domain\Events;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Events\Dispatchable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestCreated
 | 
			
		||||
{
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Events;
 | 
			
		||||
namespace Toby\Domain\Events;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Events\Dispatchable;
 | 
			
		||||
use Illuminate\Queue\SerializesModels;
 | 
			
		||||
use Toby\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Domain\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestStateChanged
 | 
			
		||||
{
 | 
			
		||||
@@ -2,9 +2,9 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Listeners;
 | 
			
		||||
namespace Toby\Domain\Listeners;
 | 
			
		||||
 | 
			
		||||
use Toby\Events\VacationRequestStateChanged;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestStateChanged;
 | 
			
		||||
 | 
			
		||||
class CreateVacationRequestActivity
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Listeners;
 | 
			
		||||
namespace Toby\Domain\Listeners;
 | 
			
		||||
 | 
			
		||||
use Toby\Events\VacationRequestAcceptedByAdministrative;
 | 
			
		||||
use Toby\Helpers\VacationRequestStateManager;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestAcceptedByAdministrative;
 | 
			
		||||
use Toby\Domain\VacationRequestStateManager;
 | 
			
		||||
 | 
			
		||||
class HandleAcceptedByAdministrativeVacationRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Listeners;
 | 
			
		||||
namespace Toby\Domain\Listeners;
 | 
			
		||||
 | 
			
		||||
use Toby\Events\VacationRequestAcceptedByTechnical;
 | 
			
		||||
use Toby\Helpers\VacationRequestStateManager;
 | 
			
		||||
use Toby\Helpers\VacationTypeConfigRetriever;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestAcceptedByTechnical;
 | 
			
		||||
use Toby\Domain\VacationRequestStateManager;
 | 
			
		||||
use Toby\Domain\VacationTypeConfigRetriever;
 | 
			
		||||
 | 
			
		||||
class HandleAcceptedByTechnicalVacationRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Listeners;
 | 
			
		||||
namespace Toby\Domain\Listeners;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Facades\Log;
 | 
			
		||||
use Toby\Events\VacationRequestApproved;
 | 
			
		||||
use Toby\Helpers\VacationTypeConfigRetriever;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestApproved;
 | 
			
		||||
use Toby\Domain\VacationTypeConfigRetriever;
 | 
			
		||||
 | 
			
		||||
class HandleApprovedVacationRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Listeners;
 | 
			
		||||
namespace Toby\Domain\Listeners;
 | 
			
		||||
 | 
			
		||||
use Toby\Events\VacationRequestCreated;
 | 
			
		||||
use Toby\Helpers\VacationRequestStateManager;
 | 
			
		||||
use Toby\Helpers\VacationTypeConfigRetriever;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestCreated;
 | 
			
		||||
use Toby\Domain\VacationRequestStateManager;
 | 
			
		||||
use Toby\Domain\VacationTypeConfigRetriever;
 | 
			
		||||
 | 
			
		||||
class HandleCreatedVacationRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers;
 | 
			
		||||
namespace Toby\Domain;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Illuminate\Support\Collection;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
use Yasumi\Holiday;
 | 
			
		||||
use Yasumi\Yasumi;
 | 
			
		||||
 | 
			
		||||
@@ -2,16 +2,16 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers;
 | 
			
		||||
namespace Toby\Domain;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Contracts\Auth\Factory as Auth;
 | 
			
		||||
use Illuminate\Contracts\Events\Dispatcher;
 | 
			
		||||
use Toby\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Events\VacationRequestAcceptedByAdministrative;
 | 
			
		||||
use Toby\Events\VacationRequestAcceptedByTechnical;
 | 
			
		||||
use Toby\Events\VacationRequestApproved;
 | 
			
		||||
use Toby\Events\VacationRequestCreated;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Domain\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestAcceptedByAdministrative;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestAcceptedByTechnical;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestApproved;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestCreated;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestStateManager
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers;
 | 
			
		||||
namespace Toby\Domain;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Contracts\Config\Repository;
 | 
			
		||||
use Toby\Enums\VacationType;
 | 
			
		||||
use Toby\Domain\Enums\VacationType;
 | 
			
		||||
 | 
			
		||||
class VacationTypeConfigRetriever
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers\Rules;
 | 
			
		||||
namespace Toby\Domain\Validation\Rules;
 | 
			
		||||
 | 
			
		||||
use Closure;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class ApprovedVacationDaysInSameRange implements VacationRequestRule
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers\Rules;
 | 
			
		||||
namespace Toby\Domain\Validation\Rules;
 | 
			
		||||
 | 
			
		||||
use Closure;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class DoesNotExceedLimitRule implements VacationRequestRule
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers\Rules;
 | 
			
		||||
namespace Toby\Domain\Validation\Rules;
 | 
			
		||||
 | 
			
		||||
use Closure;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class MinimumOneVacationDayRule implements VacationRequestRule
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers\Rules;
 | 
			
		||||
namespace Toby\Domain\Validation\Rules;
 | 
			
		||||
 | 
			
		||||
use Closure;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class PendingVacationRequestInSameRange implements VacationRequestRule
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers\Rules;
 | 
			
		||||
namespace Toby\Domain\Validation\Rules;
 | 
			
		||||
 | 
			
		||||
use Closure;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class UsedVacationDaysInSameRange
 | 
			
		||||
{
 | 
			
		||||
@@ -13,4 +13,4 @@ class UsedVacationDaysInSameRange
 | 
			
		||||
    {
 | 
			
		||||
        return $next($vacationRequest);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers\Rules;
 | 
			
		||||
namespace Toby\Domain\Validation\Rules;
 | 
			
		||||
 | 
			
		||||
use Closure;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
interface VacationRequestRule
 | 
			
		||||
{
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers;
 | 
			
		||||
namespace Toby\Domain\Validation;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Pipeline\Pipeline;
 | 
			
		||||
use Toby\Helpers\Rules\ApprovedVacationDaysInSameRange;
 | 
			
		||||
use Toby\Helpers\Rules\DoesNotExceedLimitRule;
 | 
			
		||||
use Toby\Helpers\Rules\MinimumOneVacationDayRule;
 | 
			
		||||
use Toby\Helpers\Rules\PendingVacationRequestInSameRange;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Domain\Validation\Rules\ApprovedVacationDaysInSameRange;
 | 
			
		||||
use Toby\Domain\Validation\Rules\DoesNotExceedLimitRule;
 | 
			
		||||
use Toby\Domain\Validation\Rules\MinimumOneVacationDayRule;
 | 
			
		||||
use Toby\Domain\Validation\Rules\PendingVacationRequestInSameRange;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestValidator
 | 
			
		||||
{
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers;
 | 
			
		||||
namespace Toby\Eloquent\Helpers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Facades\Storage;
 | 
			
		||||
use Illuminate\Support\Str;
 | 
			
		||||
use LasseRafn\InitialAvatarGenerator\InitialAvatar;
 | 
			
		||||
use SVG\SVG;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class UserAvatarGenerator
 | 
			
		||||
{
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Helpers;
 | 
			
		||||
namespace Toby\Eloquent\Helpers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Contracts\Session\Session;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class YearPeriodRetriever
 | 
			
		||||
{
 | 
			
		||||
@@ -2,8 +2,9 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Models;
 | 
			
		||||
namespace Toby\Eloquent\Models;
 | 
			
		||||
 | 
			
		||||
use Database\Factories\HolidayFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Model;
 | 
			
		||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
 | 
			
		||||
@@ -29,4 +30,9 @@ class Holiday extends Model
 | 
			
		||||
    {
 | 
			
		||||
        return $this->belongsTo(YearPeriod::class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected static function newFactory(): HolidayFactory
 | 
			
		||||
    {
 | 
			
		||||
        return HolidayFactory::new();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,8 +2,9 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Models;
 | 
			
		||||
namespace Toby\Eloquent\Models;
 | 
			
		||||
 | 
			
		||||
use Database\Factories\UserFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Builder;
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Relations\HasMany;
 | 
			
		||||
@@ -12,8 +13,8 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
 | 
			
		||||
use Illuminate\Notifications\Notifiable;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Illuminate\Support\Collection;
 | 
			
		||||
use Toby\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Enums\Role;
 | 
			
		||||
use Toby\Domain\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Domain\Enums\Role;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @property int $id
 | 
			
		||||
@@ -83,4 +84,9 @@ class User extends Authenticatable
 | 
			
		||||
    {
 | 
			
		||||
        return $this->role === $role;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected static function newFactory(): UserFactory
 | 
			
		||||
    {
 | 
			
		||||
        return UserFactory::new();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,8 +2,9 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Models;
 | 
			
		||||
namespace Toby\Eloquent\Models;
 | 
			
		||||
 | 
			
		||||
use Database\Factories\VacationLimitFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Builder;
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Model;
 | 
			
		||||
@@ -42,4 +43,9 @@ class VacationLimit extends Model
 | 
			
		||||
 | 
			
		||||
        return $query->orderBy($userQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected static function newFactory(): VacationLimitFactory
 | 
			
		||||
    {
 | 
			
		||||
        return VacationLimitFactory::new();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,16 +2,17 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Models;
 | 
			
		||||
namespace Toby\Eloquent\Models;
 | 
			
		||||
 | 
			
		||||
use Database\Factories\VacationRequestFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Model;
 | 
			
		||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
 | 
			
		||||
use Illuminate\Database\Eloquent\Relations\HasMany;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Illuminate\Support\Collection;
 | 
			
		||||
use Toby\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Enums\VacationType;
 | 
			
		||||
use Toby\Domain\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Domain\Enums\VacationType;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @property int $id
 | 
			
		||||
@@ -52,4 +53,9 @@ class VacationRequest extends Model
 | 
			
		||||
 | 
			
		||||
        $this->save();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected static function newFactory(): VacationRequestFactory
 | 
			
		||||
    {
 | 
			
		||||
        return VacationRequestFactory::new();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Models;
 | 
			
		||||
namespace Toby\Eloquent\Models;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Eloquent\Model;
 | 
			
		||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
 | 
			
		||||
use Toby\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Domain\Enums\VacationRequestState;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @property int $id
 | 
			
		||||
@@ -2,8 +2,9 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Models;
 | 
			
		||||
namespace Toby\Eloquent\Models;
 | 
			
		||||
 | 
			
		||||
use Database\Factories\YearPeriodFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\Model;
 | 
			
		||||
use Illuminate\Database\Eloquent\Relations\HasMany;
 | 
			
		||||
@@ -44,4 +45,9 @@ class YearPeriod extends Model
 | 
			
		||||
    {
 | 
			
		||||
        return $this->hasMany(Holiday::class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected static function newFactory(): YearPeriodFactory
 | 
			
		||||
    {
 | 
			
		||||
        return YearPeriodFactory::new();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,12 +2,12 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Observers;
 | 
			
		||||
namespace Toby\Eloquent\Observers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Facades\Storage;
 | 
			
		||||
use Toby\Helpers\UserAvatarGenerator;
 | 
			
		||||
use Toby\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Helpers\UserAvatarGenerator;
 | 
			
		||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class UserObserver
 | 
			
		||||
{
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Observers;
 | 
			
		||||
namespace Toby\Eloquent\Observers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Contracts\Auth\Factory as Auth;
 | 
			
		||||
use Illuminate\Events\Dispatcher;
 | 
			
		||||
use Toby\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Events\VacationRequestStateChanged;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Domain\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Domain\Events\VacationRequestStateChanged;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestObserver
 | 
			
		||||
{
 | 
			
		||||
@@ -2,12 +2,12 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Observers;
 | 
			
		||||
namespace Toby\Eloquent\Observers;
 | 
			
		||||
 | 
			
		||||
use Toby\Helpers\PolishHolidaysRetriever;
 | 
			
		||||
use Toby\Helpers\UserAvatarGenerator;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Domain\PolishHolidaysRetriever;
 | 
			
		||||
use Toby\Eloquent\Helpers\UserAvatarGenerator;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class YearPeriodObserver
 | 
			
		||||
{
 | 
			
		||||
@@ -2,12 +2,12 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Scopes;
 | 
			
		||||
namespace Toby\Eloquent\Scopes;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Eloquent\Builder;
 | 
			
		||||
use Illuminate\Database\Eloquent\Model;
 | 
			
		||||
use Illuminate\Database\Eloquent\Scope;
 | 
			
		||||
use Toby\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
 | 
			
		||||
 | 
			
		||||
class SelectedYearPeriodScope implements Scope
 | 
			
		||||
{
 | 
			
		||||
@@ -2,15 +2,14 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Console\Commands;
 | 
			
		||||
namespace Toby\Infrastructure\Console\Commands;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Console\Command;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class CreateUserCommand extends Command
 | 
			
		||||
{
 | 
			
		||||
    protected $signature = "user:create
 | 
			
		||||
                            {email : an email for the user}";
 | 
			
		||||
    protected $signature = "user:create {email : an email for the user}";
 | 
			
		||||
    protected $description = "Creates a user";
 | 
			
		||||
 | 
			
		||||
    public function handle(): void
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Console;
 | 
			
		||||
namespace Toby\Infrastructure\Console;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Console\Scheduling\Schedule;
 | 
			
		||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
 | 
			
		||||
use Illuminate\Foundation\Bus\DispatchesJobs;
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Contracts\Auth\Factory as AuthFactory;
 | 
			
		||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
 | 
			
		||||
use Laravel\Socialite\SocialiteManager;
 | 
			
		||||
use Symfony\Component\HttpFoundation\RedirectResponse;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class GoogleController extends Controller
 | 
			
		||||
{
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\RedirectResponse;
 | 
			
		||||
use Inertia\Response;
 | 
			
		||||
use Toby\Http\Requests\HolidayRequest;
 | 
			
		||||
use Toby\Http\Resources\HolidayFormDataResource;
 | 
			
		||||
use Toby\Http\Resources\HolidayResource;
 | 
			
		||||
use Toby\Models\Holiday;
 | 
			
		||||
use Toby\Eloquent\Models\Holiday;
 | 
			
		||||
use Toby\Infrastructure\Http\Requests\HolidayRequest;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\HolidayFormDataResource;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\HolidayResource;
 | 
			
		||||
 | 
			
		||||
class HolidayController extends Controller
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Illuminate\Support\Facades\Auth;
 | 
			
		||||
@@ -2,12 +2,12 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\RedirectResponse;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Toby\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class SelectYearPeriodController extends Controller
 | 
			
		||||
{
 | 
			
		||||
@@ -2,17 +2,17 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\RedirectResponse;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Inertia\Response;
 | 
			
		||||
use Toby\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Enums\Role;
 | 
			
		||||
use Toby\Http\Requests\UserRequest;
 | 
			
		||||
use Toby\Http\Resources\UserFormDataResource;
 | 
			
		||||
use Toby\Http\Resources\UserResource;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Domain\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Domain\Enums\Role;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Infrastructure\Http\Requests\UserRequest;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\UserFormDataResource;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\UserResource;
 | 
			
		||||
 | 
			
		||||
class UserController extends Controller
 | 
			
		||||
{
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\RedirectResponse;
 | 
			
		||||
use Inertia\Response;
 | 
			
		||||
use Toby\Http\Requests\VacationLimitRequest;
 | 
			
		||||
use Toby\Http\Resources\VacationLimitResource;
 | 
			
		||||
use Toby\Models\VacationLimit;
 | 
			
		||||
use Toby\Eloquent\Models\VacationLimit;
 | 
			
		||||
use Toby\Infrastructure\Http\Requests\VacationLimitRequest;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\VacationLimitResource;
 | 
			
		||||
 | 
			
		||||
class VacationLimitController extends Controller
 | 
			
		||||
{
 | 
			
		||||
@@ -2,18 +2,18 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Controllers;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Controllers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\RedirectResponse;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Inertia\Response;
 | 
			
		||||
use Toby\Enums\VacationType;
 | 
			
		||||
use Toby\Helpers\VacationRequestStateManager;
 | 
			
		||||
use Toby\Helpers\VacationRequestValidator;
 | 
			
		||||
use Toby\Http\Requests\VacationRequestRequest;
 | 
			
		||||
use Toby\Http\Resources\VacationRequestActivityResource;
 | 
			
		||||
use Toby\Http\Resources\VacationRequestResource;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Domain\Enums\VacationType;
 | 
			
		||||
use Toby\Domain\VacationRequestStateManager;
 | 
			
		||||
use Toby\Domain\Validation\VacationRequestValidator;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
use Toby\Infrastructure\Http\Requests\VacationRequestRequest;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\VacationRequestActivityResource;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\VacationRequestResource;
 | 
			
		||||
 | 
			
		||||
class VacationRequestController extends Controller
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http;
 | 
			
		||||
namespace Toby\Infrastructure\Http;
 | 
			
		||||
 | 
			
		||||
use Fruitcake\Cors\HandleCors;
 | 
			
		||||
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
 | 
			
		||||
@@ -24,11 +24,11 @@ use Illuminate\Session\Middleware\AuthenticateSession;
 | 
			
		||||
use Illuminate\Session\Middleware\StartSession;
 | 
			
		||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
 | 
			
		||||
use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful;
 | 
			
		||||
use Toby\Http\Middleware\Authenticate;
 | 
			
		||||
use Toby\Http\Middleware\HandleInertiaRequests;
 | 
			
		||||
use Toby\Http\Middleware\RedirectIfAuthenticated;
 | 
			
		||||
use Toby\Http\Middleware\TrimStrings;
 | 
			
		||||
use Toby\Http\Middleware\TrustProxies;
 | 
			
		||||
use Toby\Infrastructure\Http\Middleware\Authenticate;
 | 
			
		||||
use Toby\Infrastructure\Http\Middleware\HandleInertiaRequests;
 | 
			
		||||
use Toby\Infrastructure\Http\Middleware\RedirectIfAuthenticated;
 | 
			
		||||
use Toby\Infrastructure\Http\Middleware\TrimStrings;
 | 
			
		||||
use Toby\Infrastructure\Http\Middleware\TrustProxies;
 | 
			
		||||
 | 
			
		||||
class Kernel extends HttpKernel
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Middleware;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Middleware;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
 | 
			
		||||
 | 
			
		||||
@@ -2,12 +2,12 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Middleware;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Middleware;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
use Inertia\Middleware;
 | 
			
		||||
use Toby\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Http\Resources\UserResource;
 | 
			
		||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Infrastructure\Http\Resources\UserResource;
 | 
			
		||||
 | 
			
		||||
class HandleInertiaRequests extends Middleware
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Middleware;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Middleware;
 | 
			
		||||
 | 
			
		||||
use Closure;
 | 
			
		||||
use Illuminate\Http\Request;
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Middleware;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Middleware;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
 | 
			
		||||
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Middleware;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Middleware;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
 | 
			
		||||
use Symfony\Component\HttpFoundation\Request;
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Requests;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Requests;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Http\FormRequest;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Illuminate\Validation\Rule;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Rules\YearPeriodExists;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
use Toby\Infrastructure\Http\Rules\YearPeriodExists;
 | 
			
		||||
 | 
			
		||||
class HolidayRequest extends FormRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Requests;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Requests;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Http\FormRequest;
 | 
			
		||||
use Illuminate\Validation\Rule;
 | 
			
		||||
use Illuminate\Validation\Rules\Enum;
 | 
			
		||||
use Toby\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Enums\Role;
 | 
			
		||||
use Toby\Domain\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Domain\Enums\Role;
 | 
			
		||||
 | 
			
		||||
class UserRequest extends FormRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Requests;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Requests;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Http\FormRequest;
 | 
			
		||||
use Illuminate\Support\Collection;
 | 
			
		||||
use Toby\Models\VacationLimit;
 | 
			
		||||
use Toby\Eloquent\Models\VacationLimit;
 | 
			
		||||
 | 
			
		||||
class VacationLimitRequest extends FormRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,12 +2,12 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Requests;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Requests;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Http\FormRequest;
 | 
			
		||||
use Illuminate\Validation\Rules\Enum;
 | 
			
		||||
use Toby\Enums\VacationType;
 | 
			
		||||
use Toby\Rules\YearPeriodExists;
 | 
			
		||||
use Toby\Domain\Enums\VacationType;
 | 
			
		||||
use Toby\Infrastructure\Http\Rules\YearPeriodExists;
 | 
			
		||||
 | 
			
		||||
class VacationRequestRequest extends FormRequest
 | 
			
		||||
{
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Resources;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Resources;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Resources\Json\JsonResource;
 | 
			
		||||
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Resources;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Resources;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Resources\Json\JsonResource;
 | 
			
		||||
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Resources;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Resources;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Resources\Json\JsonResource;
 | 
			
		||||
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Resources;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Resources;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Resources\Json\JsonResource;
 | 
			
		||||
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Resources;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Resources;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Resources\Json\JsonResource;
 | 
			
		||||
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Resources;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Resources;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Resources\Json\JsonResource;
 | 
			
		||||
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Http\Resources;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Resources;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Http\Resources\Json\JsonResource;
 | 
			
		||||
 | 
			
		||||
@@ -2,11 +2,11 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Rules;
 | 
			
		||||
namespace Toby\Infrastructure\Http\Rules;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Contracts\Validation\Rule;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class YearPeriodExists implements Rule
 | 
			
		||||
{
 | 
			
		||||
@@ -2,13 +2,13 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Toby\Jobs;
 | 
			
		||||
namespace Toby\Infrastructure\Jobs;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Bus\Queueable;
 | 
			
		||||
use Illuminate\Contracts\Queue\ShouldQueue;
 | 
			
		||||
use Illuminate\Foundation\Bus\Dispatchable;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class CheckYearPeriod implements ShouldQueue
 | 
			
		||||
{
 | 
			
		||||
							
								
								
									
										52
									
								
								artisan
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								artisan
									
									
									
									
									
								
							@@ -1,52 +1,20 @@
 | 
			
		||||
#!/usr/bin/env php
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
define('LARAVEL_START', microtime(true));
 | 
			
		||||
use Illuminate\Contracts\Console\Kernel;
 | 
			
		||||
use Symfony\Component\Console\Input\ArgvInput;
 | 
			
		||||
use Symfony\Component\Console\Output\ConsoleOutput;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
|--------------------------------------------------------------------------
 | 
			
		||||
| Register The Auto Loader
 | 
			
		||||
|--------------------------------------------------------------------------
 | 
			
		||||
|
 | 
			
		||||
| Composer provides a convenient, automatically generated class loader
 | 
			
		||||
| for our application. We just need to utilize it! We'll require it
 | 
			
		||||
| into the script here so that we do not have to worry about the
 | 
			
		||||
| loading of any of our classes manually. It's great to relax.
 | 
			
		||||
|
 | 
			
		||||
*/
 | 
			
		||||
define("LARAVEL_START", microtime(true));
 | 
			
		||||
 | 
			
		||||
require __DIR__.'/vendor/autoload.php';
 | 
			
		||||
require __DIR__ . "/vendor/autoload.php";
 | 
			
		||||
 | 
			
		||||
$app = require_once __DIR__.'/bootstrap/app.php';
 | 
			
		||||
$app = require_once __DIR__ . "/bootstrap/app.php";
 | 
			
		||||
/** @var Kernel $kernel */
 | 
			
		||||
$kernel = $app->make(Kernel::class);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
|--------------------------------------------------------------------------
 | 
			
		||||
| Run The Artisan Application
 | 
			
		||||
|--------------------------------------------------------------------------
 | 
			
		||||
|
 | 
			
		||||
| When we run the console application, the current CLI command will be
 | 
			
		||||
| executed in this console and the response sent back to a terminal
 | 
			
		||||
| or another output device for the developers. Here goes nothing!
 | 
			
		||||
|
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
 | 
			
		||||
 | 
			
		||||
$status = $kernel->handle(
 | 
			
		||||
    $input = new Symfony\Component\Console\Input\ArgvInput,
 | 
			
		||||
    new Symfony\Component\Console\Output\ConsoleOutput
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
|--------------------------------------------------------------------------
 | 
			
		||||
| Shutdown The Application
 | 
			
		||||
|--------------------------------------------------------------------------
 | 
			
		||||
|
 | 
			
		||||
| Once Artisan has finished running, we will fire off the shutdown events
 | 
			
		||||
| so that any final work may be done by the application before we shut
 | 
			
		||||
| down the process. This is the last thing to happen to the request.
 | 
			
		||||
|
 | 
			
		||||
*/
 | 
			
		||||
$input = new ArgvInput();
 | 
			
		||||
$status = $kernel->handle($input, new ConsoleOutput());
 | 
			
		||||
 | 
			
		||||
$kernel->terminate($input, $status);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,15 +6,15 @@ use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
 | 
			
		||||
use Illuminate\Contracts\Debug\ExceptionHandler as HandlerContract;
 | 
			
		||||
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
 | 
			
		||||
use Illuminate\Foundation\Application;
 | 
			
		||||
use Toby\Console\Kernel as ConsoleKernel;
 | 
			
		||||
use Toby\Exceptions\Handler;
 | 
			
		||||
use Toby\Http\Kernel as HttpKernel;
 | 
			
		||||
use Toby\Architecture\ExceptionHandler;
 | 
			
		||||
use Toby\Infrastructure\Console\Kernel as ConsoleKernel;
 | 
			
		||||
use Toby\Infrastructure\Http\Kernel as HttpKernel;
 | 
			
		||||
 | 
			
		||||
$basePath = $_ENV["APP_BASE_PATH"] ?? dirname(__DIR__);
 | 
			
		||||
$application = new Application($basePath);
 | 
			
		||||
 | 
			
		||||
$application->singleton(HttpKernelContract::class, HttpKernel::class);
 | 
			
		||||
$application->singleton(ConsoleKernelContract::class, ConsoleKernel::class);
 | 
			
		||||
$application->singleton(HandlerContract::class, Handler::class);
 | 
			
		||||
$application->singleton(HandlerContract::class, ExceptionHandler::class);
 | 
			
		||||
 | 
			
		||||
return $application;
 | 
			
		||||
 
 | 
			
		||||
@@ -37,11 +37,11 @@ return [
 | 
			
		||||
        Illuminate\Translation\TranslationServiceProvider::class,
 | 
			
		||||
        Illuminate\Validation\ValidationServiceProvider::class,
 | 
			
		||||
        Illuminate\View\ViewServiceProvider::class,
 | 
			
		||||
        Toby\Providers\AppServiceProvider::class,
 | 
			
		||||
        Toby\Providers\AuthServiceProvider::class,
 | 
			
		||||
        Toby\Providers\EventServiceProvider::class,
 | 
			
		||||
        Toby\Providers\RouteServiceProvider::class,
 | 
			
		||||
        Toby\Providers\TelescopeServiceProvider::class,
 | 
			
		||||
        Toby\Providers\ObserverServiceProvider::class,
 | 
			
		||||
        Toby\Architecture\Providers\AppServiceProvider::class,
 | 
			
		||||
        Toby\Architecture\Providers\AuthServiceProvider::class,
 | 
			
		||||
        Toby\Architecture\Providers\EventServiceProvider::class,
 | 
			
		||||
        Toby\Architecture\Providers\RouteServiceProvider::class,
 | 
			
		||||
        Toby\Architecture\Providers\TelescopeServiceProvider::class,
 | 
			
		||||
        Toby\Architecture\Providers\ObserverServiceProvider::class,
 | 
			
		||||
    ],
 | 
			
		||||
];
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
return [
 | 
			
		||||
    "defaults" => [
 | 
			
		||||
 
 | 
			
		||||
@@ -2,8 +2,8 @@
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
use Toby\Enums\VacationType;
 | 
			
		||||
use Toby\Helpers\VacationTypeConfigRetriever;
 | 
			
		||||
use Toby\Domain\Enums\VacationType;
 | 
			
		||||
use Toby\Domain\VacationTypeConfigRetriever;
 | 
			
		||||
 | 
			
		||||
return [
 | 
			
		||||
    VacationType::VACATION->value => [
 | 
			
		||||
 
 | 
			
		||||
@@ -5,10 +5,13 @@ declare(strict_types=1);
 | 
			
		||||
namespace Database\Factories;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\Factory;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\Holiday;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class HolidayFactory extends Factory
 | 
			
		||||
{
 | 
			
		||||
    protected $model = Holiday::class;
 | 
			
		||||
 | 
			
		||||
    public function definition(): array
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
 
 | 
			
		||||
@@ -7,11 +7,14 @@ namespace Database\Factories;
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\Factory;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Illuminate\Support\Str;
 | 
			
		||||
use Toby\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Enums\Role;
 | 
			
		||||
use Toby\Domain\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Domain\Enums\Role;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class UserFactory extends Factory
 | 
			
		||||
{
 | 
			
		||||
    protected $model = User::class;
 | 
			
		||||
 | 
			
		||||
    public function definition(): array
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
 
 | 
			
		||||
@@ -5,11 +5,14 @@ declare(strict_types=1);
 | 
			
		||||
namespace Database\Factories;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\Factory;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\VacationLimit;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class VacationLimitFactory extends Factory
 | 
			
		||||
{
 | 
			
		||||
    protected $model = VacationLimit::class;
 | 
			
		||||
 | 
			
		||||
    public function definition(): array
 | 
			
		||||
    {
 | 
			
		||||
        $hasVacation = $this->faker->boolean(75);
 | 
			
		||||
 
 | 
			
		||||
@@ -5,12 +5,15 @@ declare(strict_types=1);
 | 
			
		||||
namespace Database\Factories;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\Factory;
 | 
			
		||||
use Toby\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Enums\VacationType;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Domain\Enums\VacationRequestState;
 | 
			
		||||
use Toby\Domain\Enums\VacationType;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
class VacationRequestFactory extends Factory
 | 
			
		||||
{
 | 
			
		||||
    protected $model = VacationRequest::class;
 | 
			
		||||
 | 
			
		||||
    public function definition(): array
 | 
			
		||||
    {
 | 
			
		||||
        $number = $this->faker->numberBetween(1, 20);
 | 
			
		||||
 
 | 
			
		||||
@@ -5,9 +5,12 @@ declare(strict_types=1);
 | 
			
		||||
namespace Database\Factories;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Database\Eloquent\Factories\Factory;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class YearPeriodFactory extends Factory
 | 
			
		||||
{
 | 
			
		||||
    protected $model = YearPeriod::class;
 | 
			
		||||
 | 
			
		||||
    public function definition(): array
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Toby\Enums\Role;
 | 
			
		||||
use Toby\Domain\Enums\Role;
 | 
			
		||||
 | 
			
		||||
return new class() extends Migration {
 | 
			
		||||
    public function up(): void
 | 
			
		||||
 
 | 
			
		||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
return new class() extends Migration {
 | 
			
		||||
    public function up(): void
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
return new class() extends Migration {
 | 
			
		||||
    public function up(): void
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
return new class() extends Migration {
 | 
			
		||||
    public function up(): void
 | 
			
		||||
 
 | 
			
		||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
 | 
			
		||||
use Illuminate\Database\Migrations\Migration;
 | 
			
		||||
use Illuminate\Database\Schema\Blueprint;
 | 
			
		||||
use Illuminate\Support\Facades\Schema;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
 | 
			
		||||
return new class() extends Migration {
 | 
			
		||||
    public function up(): void
 | 
			
		||||
@@ -21,9 +21,6 @@ return new class() extends Migration {
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Reverse the migrations.
 | 
			
		||||
     */
 | 
			
		||||
    public function down(): void
 | 
			
		||||
    {
 | 
			
		||||
        Schema::dropIfExists("vacation_request_activities");
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,12 @@ namespace Database\Seeders;
 | 
			
		||||
use Illuminate\Database\Seeder;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Illuminate\Support\Collection;
 | 
			
		||||
use Toby\Helpers\PolishHolidaysRetriever;
 | 
			
		||||
use Toby\Helpers\UserAvatarGenerator;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\VacationLimit;
 | 
			
		||||
use Toby\Models\VacationRequest;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Domain\PolishHolidaysRetriever;
 | 
			
		||||
use Toby\Eloquent\Helpers\UserAvatarGenerator;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\VacationLimit;
 | 
			
		||||
use Toby\Eloquent\Models\VacationRequest;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class DatabaseSeeder extends Seeder
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ services:
 | 
			
		||||
      - MYSQL_USER=${DOCKER_DEV_DB_USERNAME}
 | 
			
		||||
      - MYSQL_PASSWORD=${DOCKER_DEV_DB_PASSWORD}
 | 
			
		||||
    ports:
 | 
			
		||||
      - ${DOCKER_DB_EXTERNAL_PORT:-3306}:3306
 | 
			
		||||
      - ${DOCKER_DEV_DB_EXTERNAL_PORT:-3306}:3306
 | 
			
		||||
    volumes:
 | 
			
		||||
      - toby-mysql-data:/var/lib/mysql
 | 
			
		||||
    networks:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "toby",
 | 
			
		||||
    "name": "application",
 | 
			
		||||
    "lockfileVersion": 2,
 | 
			
		||||
    "requires": true,
 | 
			
		||||
    "packages": {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								readme.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								readme.md
									
									
									
									
									
								
							@@ -4,7 +4,15 @@
 | 
			
		||||
 | 
			
		||||
> HR software you love to hate
 | 
			
		||||
 | 
			
		||||
## Architecture
 | 
			
		||||
Directory structure little differs from a standard Laravel tree. We decided to refactor main `app` directory to better suit our needs. All classes are grouped in four major categories:
 | 
			
		||||
* `app/Architecture` for all framework-related stuff like service providers, exception handler and more;
 | 
			
		||||
* `app/Domain` for all framework-agnostic services related to the business logic of the application;
 | 
			
		||||
* `app/Eloquent` for all database/ORM-related classes like models, observers and scopes;
 | 
			
		||||
* `app/Infrastructure` for entry points to the application: CLI, HTTP and async ones.
 | 
			
		||||
 | 
			
		||||
## Local setup
 | 
			
		||||
- run `sh setup` or:
 | 
			
		||||
 | 
			
		||||
> `dcr` is an alias to `docker-compose run --rm -u "$(id -u):$(id -g)"`
 | 
			
		||||
 | 
			
		||||
@@ -95,4 +103,4 @@ Docker container:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
docker-compose run --rm -e XDEBUG_MODE=off php php artisan test
 | 
			
		||||
```
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
@@ -3,13 +3,13 @@
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
use Illuminate\Support\Facades\Route;
 | 
			
		||||
use Toby\Http\Controllers\GoogleController;
 | 
			
		||||
use Toby\Http\Controllers\HolidayController;
 | 
			
		||||
use Toby\Http\Controllers\LogoutController;
 | 
			
		||||
use Toby\Http\Controllers\SelectYearPeriodController;
 | 
			
		||||
use Toby\Http\Controllers\UserController;
 | 
			
		||||
use Toby\Http\Controllers\VacationLimitController;
 | 
			
		||||
use Toby\Http\Controllers\VacationRequestController;
 | 
			
		||||
use Toby\Infrastructure\Http\Controllers\GoogleController;
 | 
			
		||||
use Toby\Infrastructure\Http\Controllers\HolidayController;
 | 
			
		||||
use Toby\Infrastructure\Http\Controllers\LogoutController;
 | 
			
		||||
use Toby\Infrastructure\Http\Controllers\SelectYearPeriodController;
 | 
			
		||||
use Toby\Infrastructure\Http\Controllers\UserController;
 | 
			
		||||
use Toby\Infrastructure\Http\Controllers\VacationLimitController;
 | 
			
		||||
use Toby\Infrastructure\Http\Controllers\VacationRequestController;
 | 
			
		||||
 | 
			
		||||
Route::middleware("auth")->group(function (): void {
 | 
			
		||||
    Route::get("/", fn() => inertia("Dashboard"))
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								setup
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								setup
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [ ! -f ".env" ]; then
 | 
			
		||||
   cp .env.example .env
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
docker-compose build --no-cache --pull
 | 
			
		||||
docker-compose up -d
 | 
			
		||||
docker-compose run --rm -u "$(id -u):$(id -g)" php composer install
 | 
			
		||||
docker-compose run --rm -u "$(id -u):$(id -g)" php php artisan key:generate
 | 
			
		||||
docker-compose run --rm -u "$(id -u):$(id -g)" php php artisan migrate --seed
 | 
			
		||||
docker-compose run --rm -u "$(id -u):$(id -g)" node npm install
 | 
			
		||||
docker-compose run --rm -u "$(id -u):$(id -g)" node npm run dev
 | 
			
		||||
@@ -8,7 +8,7 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
 | 
			
		||||
use Laravel\Dusk\Browser;
 | 
			
		||||
use Tests\Browser\Pages\HomePage;
 | 
			
		||||
use Tests\DuskTestCase;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class AuthenticationTest extends DuskTestCase
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ namespace Tests\Feature;
 | 
			
		||||
 | 
			
		||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
 | 
			
		||||
use Tests\FeatureTestCase;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class AuthenticationTest extends FeatureTestCase
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,9 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Inertia\Testing\AssertableInertia as Assert;
 | 
			
		||||
use Tests\FeatureTestCase;
 | 
			
		||||
use Toby\Models\Holiday;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Models\YearPeriod;
 | 
			
		||||
use Toby\Eloquent\Models\Holiday;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\YearPeriod;
 | 
			
		||||
 | 
			
		||||
class HolidayTest extends FeatureTestCase
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ namespace Tests\Feature;
 | 
			
		||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
 | 
			
		||||
use Inertia\Testing\AssertableInertia as Assert;
 | 
			
		||||
use Tests\FeatureTestCase;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class InertiaTest extends FeatureTestCase
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -7,8 +7,8 @@ namespace Tests\Feature;
 | 
			
		||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Tests\FeatureTestCase;
 | 
			
		||||
use Toby\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class SelectYearPeriodTest extends FeatureTestCase
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,9 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
 | 
			
		||||
use Illuminate\Support\Carbon;
 | 
			
		||||
use Inertia\Testing\AssertableInertia as Assert;
 | 
			
		||||
use Tests\FeatureTestCase;
 | 
			
		||||
use Toby\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Enums\Role;
 | 
			
		||||
use Toby\Models\User;
 | 
			
		||||
use Toby\Domain\Enums\EmploymentForm;
 | 
			
		||||
use Toby\Domain\Enums\Role;
 | 
			
		||||
use Toby\Eloquent\Models\User;
 | 
			
		||||
 | 
			
		||||
class UserTest extends FeatureTestCase
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user