feat: [pm] 프로젝트 진행 관리 시스템 구현

- Models: AdminPmProject, AdminPmTask, AdminPmIssue
- Services: ProjectService, TaskService, IssueService, ImportService
- API Controllers: ProjectController, TaskController, IssueController, ImportController
- FormRequests: Store/Update/BulkAction 요청 검증
- Views: 대시보드, 프로젝트 CRUD, JSON Import 화면
- Routes: API 42개 + Web 6개 엔드포인트

주요 기능:
- 프로젝트/작업/이슈 계층 구조 관리
- 상태 변경, 우선순위, 마감일 추적
- 작업 순서 드래그앤드롭 (reorder API)
- JSON Import로 일괄 등록
- Soft Delete 및 복원
This commit is contained in:
2025-11-28 08:49:30 +09:00
parent fe902472c1
commit e2475d0d9f
30 changed files with 5131 additions and 1 deletions

View File

@@ -0,0 +1,97 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use App\Models\Admin\AdminPmIssue;
use App\Models\Admin\AdminPmTask;
use Illuminate\Foundation\Http\FormRequest;
class BulkActionRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
$rules = [
'ids' => 'required|array|min:1',
'ids.*' => 'required|integer',
'action' => 'required|in:change_status,change_priority,change_assignee,change_type,link_task,delete,restore',
];
// 액션에 따른 추가 유효성 검사
switch ($this->input('action')) {
case 'change_status':
$statusOptions = $this->getStatusOptions();
$rules['value'] = 'required|in:'.implode(',', $statusOptions);
break;
case 'change_priority':
$rules['value'] = 'required|in:'.implode(',', array_keys(AdminPmTask::getPriorities()));
break;
case 'change_assignee':
$rules['value'] = 'nullable|exists:users,id';
break;
case 'change_type':
$rules['value'] = 'required|in:'.implode(',', array_keys(AdminPmIssue::getTypes()));
break;
case 'link_task':
$rules['value'] = 'nullable|exists:admin_pm_tasks,id';
break;
}
return $rules;
}
/**
* Get status options based on resource type.
*/
protected function getStatusOptions(): array
{
$type = $this->input('type', 'task');
if ($type === 'issue') {
return array_keys(AdminPmIssue::getStatuses());
}
return array_keys(AdminPmTask::getStatuses());
}
/**
* Get custom attributes for validator errors.
*/
public function attributes(): array
{
return [
'ids' => '선택된 항목',
'ids.*' => '항목 ID',
'action' => '작업',
'value' => '값',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'ids.required' => '최소 하나의 항목을 선택해주세요.',
'ids.array' => '선택된 항목이 올바르지 않습니다.',
'ids.min' => '최소 하나의 항목을 선택해주세요.',
'ids.*.integer' => '항목 ID가 올바르지 않습니다.',
'action.required' => '수행할 작업을 선택해주세요.',
'action.in' => '올바른 작업을 선택해주세요.',
'value.required' => '값을 입력해주세요.',
'value.in' => '올바른 값을 선택해주세요.',
'value.exists' => '존재하지 않는 항목입니다.',
];
}
}

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use Illuminate\Foundation\Http\FormRequest;
class ImportProjectRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
// 프로젝트
'project' => 'required|array',
'project.name' => 'required|string|max:255',
'project.description' => 'nullable|string',
'project.status' => 'nullable|in:active,completed,on_hold',
'project.start_date' => 'nullable|date',
'project.end_date' => 'nullable|date|after_or_equal:project.start_date',
// 작업 목록
'tasks' => 'nullable|array',
'tasks.*.title' => 'required|string|max:255',
'tasks.*.description' => 'nullable|string',
'tasks.*.status' => 'nullable|in:todo,in_progress,done',
'tasks.*.priority' => 'nullable|in:low,medium,high',
'tasks.*.due_date' => 'nullable|date',
// 작업별 이슈 목록
'tasks.*.issues' => 'nullable|array',
'tasks.*.issues.*.title' => 'required|string|max:255',
'tasks.*.issues.*.description' => 'nullable|string',
'tasks.*.issues.*.type' => 'nullable|in:bug,feature,improvement',
'tasks.*.issues.*.status' => 'nullable|in:open,in_progress,resolved,closed',
];
}
public function messages(): array
{
return [
'project.required' => 'project 객체는 필수입니다.',
'project.name.required' => 'project.name은 필수입니다.',
'tasks.*.title.required' => '각 작업의 title은 필수입니다.',
'tasks.*.issues.*.title.required' => '각 이슈의 title은 필수입니다.',
];
}
}

View File

@@ -0,0 +1,78 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use App\Models\Admin\AdminPmIssue;
use Illuminate\Foundation\Http\FormRequest;
class StoreIssueRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'project_id' => 'required|exists:admin_pm_projects,id',
'task_id' => 'nullable|exists:admin_pm_tasks,id',
'title' => 'required|string|max:255',
'description' => 'nullable|string|max:5000',
'type' => 'nullable|in:'.implode(',', array_keys(AdminPmIssue::getTypes())),
'status' => 'nullable|in:'.implode(',', array_keys(AdminPmIssue::getStatuses())),
];
}
/**
* Get custom attributes for validator errors.
*/
public function attributes(): array
{
return [
'project_id' => '프로젝트',
'task_id' => '연결된 작업',
'title' => '이슈 제목',
'description' => '이슈 설명',
'type' => '타입',
'status' => '상태',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'project_id.required' => '프로젝트를 선택해주세요.',
'project_id.exists' => '존재하지 않는 프로젝트입니다.',
'task_id.exists' => '존재하지 않는 작업입니다.',
'title.required' => '이슈 제목은 필수입니다.',
'title.max' => '이슈 제목은 최대 255자까지 입력 가능합니다.',
'description.max' => '이슈 설명은 최대 5000자까지 입력 가능합니다.',
'type.in' => '올바른 타입을 선택해주세요.',
'status.in' => '올바른 상태를 선택해주세요.',
];
}
/**
* Prepare the data for validation.
*/
protected function prepareForValidation(): void
{
// 기본값 설정
if (! $this->has('type')) {
$this->merge(['type' => AdminPmIssue::TYPE_BUG]);
}
if (! $this->has('status')) {
$this->merge(['status' => AdminPmIssue::STATUS_OPEN]);
}
}
}

View File

@@ -0,0 +1,72 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use App\Models\Admin\AdminPmProject;
use Illuminate\Foundation\Http\FormRequest;
class StoreProjectRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'name' => 'required|string|max:100',
'description' => 'nullable|string|max:2000',
'status' => 'nullable|in:'.implode(',', array_keys(AdminPmProject::getStatuses())),
'start_date' => 'nullable|date',
'end_date' => 'nullable|date|after_or_equal:start_date',
];
}
/**
* Get custom attributes for validator errors.
*/
public function attributes(): array
{
return [
'name' => '프로젝트 이름',
'description' => '설명',
'status' => '상태',
'start_date' => '시작일',
'end_date' => '종료일',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'name.required' => '프로젝트 이름은 필수입니다.',
'name.max' => '프로젝트 이름은 최대 100자까지 입력 가능합니다.',
'description.max' => '설명은 최대 2000자까지 입력 가능합니다.',
'status.in' => '올바른 상태를 선택해주세요.',
'start_date.date' => '올바른 날짜 형식이 아닙니다.',
'end_date.date' => '올바른 날짜 형식이 아닙니다.',
'end_date.after_or_equal' => '종료일은 시작일 이후여야 합니다.',
];
}
/**
* Prepare the data for validation.
*/
protected function prepareForValidation(): void
{
// 기본값 설정
if (! $this->has('status')) {
$this->merge(['status' => AdminPmProject::STATUS_ACTIVE]);
}
}
}

View File

@@ -0,0 +1,84 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use App\Models\Admin\AdminPmTask;
use Illuminate\Foundation\Http\FormRequest;
class StoreTaskRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'project_id' => 'required|exists:admin_pm_projects,id',
'title' => 'required|string|max:255',
'description' => 'nullable|string|max:5000',
'status' => 'nullable|in:'.implode(',', array_keys(AdminPmTask::getStatuses())),
'priority' => 'nullable|in:'.implode(',', array_keys(AdminPmTask::getPriorities())),
'due_date' => 'nullable|date',
'sort_order' => 'nullable|integer|min:0',
'assignee_id' => 'nullable|exists:users,id',
];
}
/**
* Get custom attributes for validator errors.
*/
public function attributes(): array
{
return [
'project_id' => '프로젝트',
'title' => '작업 제목',
'description' => '작업 설명',
'status' => '상태',
'priority' => '우선순위',
'due_date' => '마감일',
'sort_order' => '정렬 순서',
'assignee_id' => '담당자',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'project_id.required' => '프로젝트를 선택해주세요.',
'project_id.exists' => '존재하지 않는 프로젝트입니다.',
'title.required' => '작업 제목은 필수입니다.',
'title.max' => '작업 제목은 최대 255자까지 입력 가능합니다.',
'description.max' => '작업 설명은 최대 5000자까지 입력 가능합니다.',
'status.in' => '올바른 상태를 선택해주세요.',
'priority.in' => '올바른 우선순위를 선택해주세요.',
'due_date.date' => '올바른 날짜 형식이 아닙니다.',
'sort_order.integer' => '정렬 순서는 숫자여야 합니다.',
'assignee_id.exists' => '존재하지 않는 담당자입니다.',
];
}
/**
* Prepare the data for validation.
*/
protected function prepareForValidation(): void
{
// 기본값 설정
if (! $this->has('status')) {
$this->merge(['status' => AdminPmTask::STATUS_TODO]);
}
if (! $this->has('priority')) {
$this->merge(['priority' => AdminPmTask::PRIORITY_MEDIUM]);
}
}
}

View File

@@ -0,0 +1,63 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use App\Models\Admin\AdminPmIssue;
use Illuminate\Foundation\Http\FormRequest;
class UpdateIssueRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'project_id' => 'sometimes|exists:admin_pm_projects,id',
'task_id' => 'nullable|exists:admin_pm_tasks,id',
'title' => 'sometimes|required|string|max:255',
'description' => 'nullable|string|max:5000',
'type' => 'sometimes|in:'.implode(',', array_keys(AdminPmIssue::getTypes())),
'status' => 'sometimes|in:'.implode(',', array_keys(AdminPmIssue::getStatuses())),
];
}
/**
* Get custom attributes for validator errors.
*/
public function attributes(): array
{
return [
'project_id' => '프로젝트',
'task_id' => '연결된 작업',
'title' => '이슈 제목',
'description' => '이슈 설명',
'type' => '타입',
'status' => '상태',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'project_id.exists' => '존재하지 않는 프로젝트입니다.',
'task_id.exists' => '존재하지 않는 작업입니다.',
'title.required' => '이슈 제목은 필수입니다.',
'title.max' => '이슈 제목은 최대 255자까지 입력 가능합니다.',
'description.max' => '이슈 설명은 최대 5000자까지 입력 가능합니다.',
'type.in' => '올바른 타입을 선택해주세요.',
'status.in' => '올바른 상태를 선택해주세요.',
];
}
}

View File

@@ -0,0 +1,61 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use App\Models\Admin\AdminPmProject;
use Illuminate\Foundation\Http\FormRequest;
class UpdateProjectRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'name' => 'sometimes|required|string|max:100',
'description' => 'nullable|string|max:2000',
'status' => 'sometimes|in:'.implode(',', array_keys(AdminPmProject::getStatuses())),
'start_date' => 'nullable|date',
'end_date' => 'nullable|date|after_or_equal:start_date',
];
}
/**
* Get custom attributes for validator errors.
*/
public function attributes(): array
{
return [
'name' => '프로젝트 이름',
'description' => '설명',
'status' => '상태',
'start_date' => '시작일',
'end_date' => '종료일',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'name.required' => '프로젝트 이름은 필수입니다.',
'name.max' => '프로젝트 이름은 최대 100자까지 입력 가능합니다.',
'description.max' => '설명은 최대 2000자까지 입력 가능합니다.',
'status.in' => '올바른 상태를 선택해주세요.',
'start_date.date' => '올바른 날짜 형식이 아닙니다.',
'end_date.date' => '올바른 날짜 형식이 아닙니다.',
'end_date.after_or_equal' => '종료일은 시작일 이후여야 합니다.',
];
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace App\Http\Requests\ProjectManagement;
use App\Models\Admin\AdminPmTask;
use Illuminate\Foundation\Http\FormRequest;
class UpdateTaskRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'project_id' => 'sometimes|exists:admin_pm_projects,id',
'title' => 'sometimes|required|string|max:255',
'description' => 'nullable|string|max:5000',
'status' => 'sometimes|in:'.implode(',', array_keys(AdminPmTask::getStatuses())),
'priority' => 'sometimes|in:'.implode(',', array_keys(AdminPmTask::getPriorities())),
'due_date' => 'nullable|date',
'sort_order' => 'nullable|integer|min:0',
'assignee_id' => 'nullable|exists:users,id',
];
}
/**
* Get custom attributes for validator errors.
*/
public function attributes(): array
{
return [
'project_id' => '프로젝트',
'title' => '작업 제목',
'description' => '작업 설명',
'status' => '상태',
'priority' => '우선순위',
'due_date' => '마감일',
'sort_order' => '정렬 순서',
'assignee_id' => '담당자',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'project_id.exists' => '존재하지 않는 프로젝트입니다.',
'title.required' => '작업 제목은 필수입니다.',
'title.max' => '작업 제목은 최대 255자까지 입력 가능합니다.',
'description.max' => '작업 설명은 최대 5000자까지 입력 가능합니다.',
'status.in' => '올바른 상태를 선택해주세요.',
'priority.in' => '올바른 우선순위를 선택해주세요.',
'due_date.date' => '올바른 날짜 형식이 아닙니다.',
'sort_order.integer' => '정렬 순서는 숫자여야 합니다.',
'assignee_id.exists' => '존재하지 않는 담당자입니다.',
];
}
}