'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())), 'start_date' => 'nullable|date', 'due_date' => 'nullable|date|after_or_equal:start_date', 'estimated_hours' => 'nullable|integer|min:0|max:9999', // 팀/담당자/고객사 (하이브리드) 'department_id' => 'nullable|integer|exists:departments,id', 'team' => 'nullable|string|max:100', 'assignee_id' => 'nullable|integer|exists:users,id', 'assignee_name' => 'nullable|string|max:100', 'client' => 'nullable|string|max:100', ]; } /** * Get custom attributes for validator errors. */ public function attributes(): array { return [ 'project_id' => '프로젝트', 'task_id' => '연결된 작업', 'title' => '이슈 제목', 'description' => '이슈 설명', 'type' => '타입', 'status' => '상태', 'start_date' => '시작일', 'due_date' => '마감일', 'estimated_hours' => '예상 시간', 'department_id' => '부서', 'team' => '팀/부서명', 'assignee_id' => '담당자', 'assignee_name' => '담당자명', 'client' => '고객사', ]; } /** * 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' => '올바른 상태를 선택해주세요.', ]; } }