Merge branch 'vacation-request-form' into dashboard
This commit is contained in:
commit
936a279606
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Toby\Infrastructure\Http\Requests\Api;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class CalculateVacationStatsRequest extends FormRequest
|
||||||
|
{
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
"user" => ["required", "exists:users,id"],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
144
composer.lock
generated
144
composer.lock
generated
@ -6,6 +6,62 @@
|
|||||||
],
|
],
|
||||||
"content-hash": "09609461b05d589abb8bc0cbac9c653c",
|
"content-hash": "09609461b05d589abb8bc0cbac9c653c",
|
||||||
"packages": [
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "asm89/stack-cors",
|
||||||
|
"version": "v2.1.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/asm89/stack-cors.git",
|
||||||
|
"reference": "73e5b88775c64ccc0b84fb60836b30dc9d92ac4a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/asm89/stack-cors/zipball/73e5b88775c64ccc0b84fb60836b30dc9d92ac4a",
|
||||||
|
"reference": "73e5b88775c64ccc0b84fb60836b30dc9d92ac4a",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2|^8.0",
|
||||||
|
"symfony/http-foundation": "^4|^5|^6",
|
||||||
|
"symfony/http-kernel": "^4|^5|^6"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^7|^9",
|
||||||
|
"squizlabs/php_codesniffer": "^3.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.1-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Asm89\\Stack\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Alexander",
|
||||||
|
"email": "iam.asm89@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Cross-origin resource sharing library and stack middleware",
|
||||||
|
"homepage": "https://github.com/asm89/stack-cors",
|
||||||
|
"keywords": [
|
||||||
|
"cors",
|
||||||
|
"stack"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/asm89/stack-cors/issues",
|
||||||
|
"source": "https://github.com/asm89/stack-cors/tree/v2.1.1"
|
||||||
|
},
|
||||||
|
"time": "2022-01-18T09:12:03+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "azuyalabs/yasumi",
|
"name": "azuyalabs/yasumi",
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
@ -763,20 +819,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fruitcake/laravel-cors",
|
"name": "fruitcake/laravel-cors",
|
||||||
"version": "v2.1.0",
|
"version": "v2.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fruitcake/laravel-cors.git",
|
"url": "https://github.com/fruitcake/laravel-cors.git",
|
||||||
"reference": "361d71f00a0eea8b74da26ae75d0d207c53aa5b3"
|
"reference": "783a74f5e3431d7b9805be8afb60fd0a8f743534"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/361d71f00a0eea8b74da26ae75d0d207c53aa5b3",
|
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/783a74f5e3431d7b9805be8afb60fd0a8f743534",
|
||||||
"reference": "361d71f00a0eea8b74da26ae75d0d207c53aa5b3",
|
"reference": "783a74f5e3431d7b9805be8afb60fd0a8f743534",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"fruitcake/php-cors": "^1",
|
"asm89/stack-cors": "^2.0.1",
|
||||||
"illuminate/contracts": "^6|^7|^8|^9",
|
"illuminate/contracts": "^6|^7|^8|^9",
|
||||||
"illuminate/support": "^6|^7|^8|^9",
|
"illuminate/support": "^6|^7|^8|^9",
|
||||||
"php": ">=7.2"
|
"php": ">=7.2"
|
||||||
@ -826,7 +882,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/fruitcake/laravel-cors/issues",
|
"issues": "https://github.com/fruitcake/laravel-cors/issues",
|
||||||
"source": "https://github.com/fruitcake/laravel-cors/tree/v2.1.0"
|
"source": "https://github.com/fruitcake/laravel-cors/tree/v2.2.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -838,7 +894,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-19T14:17:28+00:00"
|
"time": "2022-02-23T14:25:13+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fruitcake/php-cors",
|
"name": "fruitcake/php-cors",
|
||||||
@ -1295,12 +1351,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"GuzzleHttp\\Promise\\": "src/"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"src/functions_include.php"
|
"src/functions_include.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Promise\\": "src/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
@ -1622,16 +1678,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/framework",
|
"name": "laravel/framework",
|
||||||
"version": "v9.1.0",
|
"version": "v9.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/framework.git",
|
"url": "https://github.com/laravel/framework.git",
|
||||||
"reference": "ca7ddd4782f120ae50569d04eb9e40e52f67a9d9"
|
"reference": "13372872bed31ae75df8709b9de5cde01d50646e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/framework/zipball/ca7ddd4782f120ae50569d04eb9e40e52f67a9d9",
|
"url": "https://api.github.com/repos/laravel/framework/zipball/13372872bed31ae75df8709b9de5cde01d50646e",
|
||||||
"reference": "ca7ddd4782f120ae50569d04eb9e40e52f67a9d9",
|
"reference": "13372872bed31ae75df8709b9de5cde01d50646e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1640,6 +1696,7 @@
|
|||||||
"egulias/email-validator": "^3.1",
|
"egulias/email-validator": "^3.1",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
|
"fruitcake/php-cors": "^1.2",
|
||||||
"laravel/serializable-closure": "^1.0",
|
"laravel/serializable-closure": "^1.0",
|
||||||
"league/commonmark": "^2.2",
|
"league/commonmark": "^2.2",
|
||||||
"league/flysystem": "^3.0",
|
"league/flysystem": "^3.0",
|
||||||
@ -1714,7 +1771,7 @@
|
|||||||
"league/flysystem-ftp": "^3.0",
|
"league/flysystem-ftp": "^3.0",
|
||||||
"league/flysystem-sftp-v3": "^3.0",
|
"league/flysystem-sftp-v3": "^3.0",
|
||||||
"mockery/mockery": "^1.4.4",
|
"mockery/mockery": "^1.4.4",
|
||||||
"orchestra/testbench-core": "^7.0",
|
"orchestra/testbench-core": "^7.1",
|
||||||
"pda/pheanstalk": "^4.0",
|
"pda/pheanstalk": "^4.0",
|
||||||
"phpstan/phpstan": "^1.0",
|
"phpstan/phpstan": "^1.0",
|
||||||
"phpunit/phpunit": "^9.5.8",
|
"phpunit/phpunit": "^9.5.8",
|
||||||
@ -1796,20 +1853,20 @@
|
|||||||
"issues": "https://github.com/laravel/framework/issues",
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
"source": "https://github.com/laravel/framework"
|
"source": "https://github.com/laravel/framework"
|
||||||
},
|
},
|
||||||
"time": "2022-02-15T15:06:44+00:00"
|
"time": "2022-02-22T15:30:23+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/sanctum",
|
"name": "laravel/sanctum",
|
||||||
"version": "v2.14.1",
|
"version": "v2.14.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/sanctum.git",
|
"url": "https://github.com/laravel/sanctum.git",
|
||||||
"reference": "89937617fa144ddb759a740861a47c4f2fd2245b"
|
"reference": "dc5d749ba9bfcfd68d8f5c272238f88bea223e66"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/sanctum/zipball/89937617fa144ddb759a740861a47c4f2fd2245b",
|
"url": "https://api.github.com/repos/laravel/sanctum/zipball/dc5d749ba9bfcfd68d8f5c272238f88bea223e66",
|
||||||
"reference": "89937617fa144ddb759a740861a47c4f2fd2245b",
|
"reference": "dc5d749ba9bfcfd68d8f5c272238f88bea223e66",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1860,7 +1917,7 @@
|
|||||||
"issues": "https://github.com/laravel/sanctum/issues",
|
"issues": "https://github.com/laravel/sanctum/issues",
|
||||||
"source": "https://github.com/laravel/sanctum"
|
"source": "https://github.com/laravel/sanctum"
|
||||||
},
|
},
|
||||||
"time": "2022-02-15T08:08:57+00:00"
|
"time": "2022-02-16T14:40:23+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/serializable-closure",
|
"name": "laravel/serializable-closure",
|
||||||
@ -2477,16 +2534,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/flysystem",
|
"name": "league/flysystem",
|
||||||
"version": "3.0.8",
|
"version": "3.0.9",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/flysystem.git",
|
"url": "https://github.com/thephpleague/flysystem.git",
|
||||||
"reference": "30f2c7069b2625da5b126ac66cbea7618a3db8b6"
|
"reference": "fb0801a60b7f9ea4188f01c25cb48aed26db7fb6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/30f2c7069b2625da5b126ac66cbea7618a3db8b6",
|
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/fb0801a60b7f9ea4188f01c25cb48aed26db7fb6",
|
||||||
"reference": "30f2c7069b2625da5b126ac66cbea7618a3db8b6",
|
"reference": "fb0801a60b7f9ea4188f01c25cb48aed26db7fb6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2546,7 +2603,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/thephpleague/flysystem/issues",
|
"issues": "https://github.com/thephpleague/flysystem/issues",
|
||||||
"source": "https://github.com/thephpleague/flysystem/tree/3.0.8"
|
"source": "https://github.com/thephpleague/flysystem/tree/3.0.9"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2562,7 +2619,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-16T18:51:54+00:00"
|
"time": "2022-02-22T07:37:40+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/mime-type-detection",
|
"name": "league/mime-type-detection",
|
||||||
@ -7739,9 +7796,6 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1 || ^8.0"
|
"php": "^7.1 || ^8.0"
|
||||||
},
|
},
|
||||||
"replace": {
|
|
||||||
"myclabs/deep-copy": "self.version"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/collections": "^1.0",
|
"doctrine/collections": "^1.0",
|
||||||
"doctrine/common": "^2.6",
|
"doctrine/common": "^2.6",
|
||||||
@ -8272,16 +8326,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-code-coverage",
|
"name": "phpunit/php-code-coverage",
|
||||||
"version": "9.2.11",
|
"version": "9.2.13",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||||
"reference": "665a1ac0a763c51afc30d6d130dac0813092b17f"
|
"reference": "deac8540cb7bd40b2b8cfa679b76202834fd04e8"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/665a1ac0a763c51afc30d6d130dac0813092b17f",
|
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/deac8540cb7bd40b2b8cfa679b76202834fd04e8",
|
||||||
"reference": "665a1ac0a763c51afc30d6d130dac0813092b17f",
|
"reference": "deac8540cb7bd40b2b8cfa679b76202834fd04e8",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -8337,7 +8391,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.11"
|
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.13"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -8345,7 +8399,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-18T12:46:09+00:00"
|
"time": "2022-02-23T17:02:38+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-file-iterator",
|
"name": "phpunit/php-file-iterator",
|
||||||
@ -8590,16 +8644,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
"version": "9.5.14",
|
"version": "9.5.16",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "1883687169c017d6ae37c58883ca3994cfc34189"
|
"reference": "5ff8c545a50226c569310a35f4fa89d79f1ddfdc"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1883687169c017d6ae37c58883ca3994cfc34189",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5ff8c545a50226c569310a35f4fa89d79f1ddfdc",
|
||||||
"reference": "1883687169c017d6ae37c58883ca3994cfc34189",
|
"reference": "5ff8c545a50226c569310a35f4fa89d79f1ddfdc",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -8615,7 +8669,7 @@
|
|||||||
"phar-io/version": "^3.0.2",
|
"phar-io/version": "^3.0.2",
|
||||||
"php": ">=7.3",
|
"php": ">=7.3",
|
||||||
"phpspec/prophecy": "^1.12.1",
|
"phpspec/prophecy": "^1.12.1",
|
||||||
"phpunit/php-code-coverage": "^9.2.7",
|
"phpunit/php-code-coverage": "^9.2.13",
|
||||||
"phpunit/php-file-iterator": "^3.0.5",
|
"phpunit/php-file-iterator": "^3.0.5",
|
||||||
"phpunit/php-invoker": "^3.1.1",
|
"phpunit/php-invoker": "^3.1.1",
|
||||||
"phpunit/php-text-template": "^2.0.3",
|
"phpunit/php-text-template": "^2.0.3",
|
||||||
@ -8677,7 +8731,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.14"
|
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.16"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -8689,7 +8743,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-18T12:54:07+00:00"
|
"time": "2022-02-23T17:10:58+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/cli-parser",
|
"name": "sebastian/cli-parser",
|
||||||
@ -10055,5 +10109,5 @@
|
|||||||
"ext-pdo": "*"
|
"ext-pdo": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.1.0"
|
"plugin-api-version": "2.2.0"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<InertiaHead title="Złóż wniosek urlopowy" />
|
<InertiaHead title="Złóż wniosek urlopowy" />
|
||||||
<div class="bg-white shadow-md">
|
<div class="grid grid-cols-1 gap-4 items-start lg:grid-cols-3 lg:gap-8">
|
||||||
|
<div class="grid grid-cols-1 lg:col-span-2 bg-white shadow-md">
|
||||||
<div class="p-4 sm:px-6">
|
<div class="p-4 sm:px-6">
|
||||||
<h2 class="text-lg leading-6 font-medium text-gray-900">
|
<h2 class="text-lg leading-6 font-medium text-gray-900">
|
||||||
Złóż wniosek urlopowy
|
Złóż wniosek urlopowy
|
||||||
@ -68,7 +69,9 @@
|
|||||||
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 ? 'text-white bg-blumilk-600' : '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"
|
||||||
@ -269,6 +272,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="grid grid-cols-1 bg-white shadow-md h-full">
|
||||||
|
<div>
|
||||||
|
<div class="p-4 sm:px-6">
|
||||||
|
<h2 class="text-lg leading-6 font-medium text-gray-900">
|
||||||
|
Urlop wypoczynkowy
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div class="border-t border-gray-200 px-6 pt-8">
|
||||||
|
<VacationChart :stats="stats" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -276,13 +292,15 @@ import {useForm} from '@inertiajs/inertia-vue3'
|
|||||||
import FlatPickr from 'vue-flatpickr-component'
|
import FlatPickr from 'vue-flatpickr-component'
|
||||||
import {Listbox, ListboxButton, ListboxLabel, ListboxOption, ListboxOptions, Switch} from '@headlessui/vue'
|
import {Listbox, ListboxButton, ListboxLabel, ListboxOption, ListboxOptions, Switch} from '@headlessui/vue'
|
||||||
import {CheckIcon, SelectorIcon, XCircleIcon} from '@heroicons/vue/solid'
|
import {CheckIcon, SelectorIcon, XCircleIcon} from '@heroicons/vue/solid'
|
||||||
import {reactive, ref} from 'vue'
|
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'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VacationRequestCreate',
|
name: 'VacationRequestCreate',
|
||||||
components: {
|
components: {
|
||||||
|
VacationChart,
|
||||||
Switch,
|
Switch,
|
||||||
FlatPickr,
|
FlatPickr,
|
||||||
Listbox,
|
Listbox,
|
||||||
@ -323,6 +341,13 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const estimatedDays = ref([])
|
const estimatedDays = ref([])
|
||||||
|
|
||||||
|
const stats = ref({
|
||||||
|
used: 0,
|
||||||
|
pending: 0,
|
||||||
|
remaining: 0,
|
||||||
|
})
|
||||||
|
|
||||||
const {minDate, maxDate} = useCurrentYearPeriodInfo()
|
const {minDate, maxDate} = useCurrentYearPeriodInfo()
|
||||||
|
|
||||||
const disableDates = [
|
const disableDates = [
|
||||||
@ -341,9 +366,15 @@ export default {
|
|||||||
disable: disableDates,
|
disable: disableDates,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(() => form.user, user => {
|
||||||
|
axios.post('/api/calculate-vacations-stats', {user: user.id})
|
||||||
|
.then(res => stats.value = res.data)
|
||||||
|
}, {immediate: true})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
form,
|
form,
|
||||||
estimatedDays,
|
estimatedDays,
|
||||||
|
stats,
|
||||||
fromInputConfig,
|
fromInputConfig,
|
||||||
toInputConfig,
|
toInputConfig,
|
||||||
}
|
}
|
||||||
@ -372,6 +403,11 @@ export default {
|
|||||||
.then(res => this.estimatedDays = res.data)
|
.then(res => this.estimatedDays = res.data)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updateVacationStats(user) {
|
||||||
|
console.log(user)
|
||||||
|
axios.post('/api/get-vacations-stats')
|
||||||
|
.then(res => this.stats = res.data)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ export default {
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
label: {
|
label: {
|
||||||
position: 'inner',
|
position: 'inner',
|
||||||
formatter: params => params.value,
|
formatter: param => param.value !== 0 ? param.value : '' ,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: '#FFFFFF',
|
color: '#FFFFFF',
|
||||||
|
@ -3,8 +3,30 @@
|
|||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Toby\Domain\UserVacationStatsRetriever;
|
||||||
|
use Toby\Eloquent\Models\User;
|
||||||
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
use Toby\Infrastructure\Http\Controllers\Api\CalculateVacationDaysController;
|
use Toby\Infrastructure\Http\Controllers\Api\CalculateVacationDaysController;
|
||||||
|
use Toby\Infrastructure\Http\Requests\Api\CalculateVacationStatsRequest;
|
||||||
|
|
||||||
Route::middleware("auth:sanctum")->group(function (): void {
|
Route::middleware("auth:sanctum")->group(function (): void {
|
||||||
Route::post("calculate-vacation-days", CalculateVacationDaysController::class);
|
Route::post("calculate-vacation-days", CalculateVacationDaysController::class);
|
||||||
|
Route::post("calculate-vacations-stats", function (CalculateVacationStatsRequest $request, UserVacationStatsRetriever $vacationStatsRetriever) {
|
||||||
|
/** @var User $user */
|
||||||
|
$user = User::query()->find($request->get("user"));
|
||||||
|
$yearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
|
$limit = $vacationStatsRetriever->getVacationDaysLimit($user, $yearPeriod);
|
||||||
|
$used = $vacationStatsRetriever->getUsedVacationDays($user, $yearPeriod);
|
||||||
|
$pending = $vacationStatsRetriever->getPendingVacationDays($user, $yearPeriod);
|
||||||
|
$other = $vacationStatsRetriever->getOtherApprovedVacationDays($user, $yearPeriod);
|
||||||
|
|
||||||
|
return [
|
||||||
|
"limit" => $limit,
|
||||||
|
"remaining" => $limit - $used - $pending,
|
||||||
|
"used" => $used,
|
||||||
|
"pending" => $pending,
|
||||||
|
"other" => $other,
|
||||||
|
];
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user