Merge remote-tracking branch 'origin/#20-vacation-requests' into #20-vacation-requests

# Conflicts:
#	app/Enums/VacationType.php
#	app/Helpers/Rules/MinimumOneVacationDayRule.php
#	app/Helpers/Rules/PendingVacationRequestInSameRange.php
#	app/Helpers/VacationRequestValidator.php
#	app/Http/Controllers/VacationRequestController.php
#	app/Http/Resources/VacationRequestResource.php
#	app/Models/VacationRequest.php
#	config/sanctum.php
#	database/factories/VacationRequestFactory.php
#	database/migrations/2022_01_26_100039_create_vacation_requests_table.php
#	package-lock.json
#	resources/js/Pages/VacationRequest/Create.vue
#	resources/js/Pages/VacationRequest/Index.vue
#	resources/js/Shared/MainMenu.vue
#	resources/lang/pl.json
#	routes/web.php
This commit is contained in:
Adrian Hopek 2022-02-01 09:21:28 +01:00
commit 58ef6af1a2
4 changed files with 83 additions and 9 deletions

View File

@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace Toby\Helpers\Rules;
use Closure;
use Toby\Models\VacationRequest;
class UsedVacationDaysInSameRange
{
public function check(VacationRequest $vacationRequest, Closure $next)
{
return $next($vacationRequest);
}
}

View File

@ -18,15 +18,6 @@ use Toby\Listeners\HandleCreatedVacationRequest;
class EventServiceProvider extends ServiceProvider
{
/**
* TODO: docelowo może osobne klasy + cast z eloquenta, ale to jak zadziała opcja z enumami
* TODO: dopisać brakujące walidatory
* TODO: przyciski pokolorować
* TODO: warunkowo wyświetlać opcje (policy?)
* TODO: tworzenie wniosku po walidacji
* TODO: obliczanie dni urlopu
*/
protected $listen = [
VacationRequestStateChanged::class => [CreateVacationRequestActivity::class],
VacationRequestCreated::class => [HandleCreatedVacationRequest::class],

64
composer.lock generated
View File

@ -1422,6 +1422,70 @@
},
"time": "2022-01-12T15:07:43+00:00"
},
{
"name": "laravel/sanctum",
"version": "v2.14.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/sanctum.git",
"reference": "0647a87140c7522e75826cffcadb3ad6e01f71e9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sanctum/zipball/0647a87140c7522e75826cffcadb3ad6e01f71e9",
"reference": "0647a87140c7522e75826cffcadb3ad6e01f71e9",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/contracts": "^6.9|^7.0|^8.0|^9.0",
"illuminate/database": "^6.9|^7.0|^8.0|^9.0",
"illuminate/support": "^6.9|^7.0|^8.0|^9.0",
"php": "^7.2|^8.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0",
"phpunit/phpunit": "^8.0|^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Sanctum\\SanctumServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Sanctum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
"keywords": [
"auth",
"laravel",
"sanctum"
],
"support": {
"issues": "https://github.com/laravel/sanctum/issues",
"source": "https://github.com/laravel/sanctum"
},
"time": "2022-01-12T15:07:43+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v1.0.5",

View File

@ -9,6 +9,7 @@ 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;
class UserTest extends FeatureTestCase
@ -87,6 +88,7 @@ class UserTest extends FeatureTestCase
->post("/users", [
"firstName" => "John",
"lastName" => "Doe",
"role" => Role::EMPLOYEE->value,
"email" => "john.doe@example.com",
"employmentForm" => EmploymentForm::B2B_CONTRACT->value,
"employmentDate" => Carbon::now()->toDateString(),
@ -122,6 +124,7 @@ class UserTest extends FeatureTestCase
"firstName" => "John",
"lastName" => "Doe",
"email" => "john.doe@example.com",
"role" => Role::EMPLOYEE->value,
"employmentForm" => EmploymentForm::B2B_CONTRACT->value,
"employmentDate" => Carbon::now()->toDateString(),
])