feat: [org-chart] 조직도 관리 API 이관 (8개 엔드포인트)
- OrgChartController + OrgChartService 신규 생성 - FormRequest 5개 (Assign/Unassign/ReorderEmployees/ReorderDepartments/ToggleHide) - Department 모델 options cast 추가 - Swagger 문서 (OrgChartApi.php) 생성 - hr.php 라우트 그룹 추가 (/v1/org-chart)
This commit is contained in:
21
app/Http/Requests/OrgChart/AssignRequest.php
Normal file
21
app/Http/Requests/OrgChart/AssignRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\OrgChart;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AssignRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'employee_id' => 'required|integer',
|
||||
'department_id' => 'required|integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
23
app/Http/Requests/OrgChart/ReorderDepartmentsRequest.php
Normal file
23
app/Http/Requests/OrgChart/ReorderDepartmentsRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\OrgChart;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReorderDepartmentsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'orders' => 'required|array',
|
||||
'orders.*.id' => 'required|integer',
|
||||
'orders.*.parent_id' => 'nullable|integer',
|
||||
'orders.*.sort_order' => 'required|integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
22
app/Http/Requests/OrgChart/ReorderEmployeesRequest.php
Normal file
22
app/Http/Requests/OrgChart/ReorderEmployeesRequest.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\OrgChart;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReorderEmployeesRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'moves' => 'required|array',
|
||||
'moves.*.employee_id' => 'required|integer',
|
||||
'moves.*.department_id' => 'nullable|integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
20
app/Http/Requests/OrgChart/ToggleHideRequest.php
Normal file
20
app/Http/Requests/OrgChart/ToggleHideRequest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\OrgChart;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ToggleHideRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'hidden' => 'required|boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
20
app/Http/Requests/OrgChart/UnassignRequest.php
Normal file
20
app/Http/Requests/OrgChart/UnassignRequest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\OrgChart;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UnassignRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'employee_id' => 'required|integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user