feat: [pm] 이슈에 팀/담당자/고객사 필드 추가

- DB 마이그레이션: 하이브리드 FK + 문자열 필드 방식
- Model: fillable, casts, relationships, accessor 추가
- FormRequest: validation rules 추가 (Store/Update)
- ImportService: JSON import 시 새 필드 처리
- UI: 이슈 모달에 입력 필드 추가
- UI: 작업 탭 아코디언에 고객사·부서·담당자 표시
- 이슈 저장 후 작업 탭 즉시 갱신
This commit is contained in:
2025-12-02 19:10:15 +09:00
parent 8b88224be9
commit d4051e20fa
6 changed files with 143 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Models\Admin;
use App\Models\Department;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -41,6 +42,12 @@ class AdminPmIssue extends Model
'due_date',
'estimated_hours',
'is_urgent',
// 팀/담당자/고객사 (하이브리드)
'department_id',
'team',
'assignee_id',
'assignee_name',
'client',
'created_by',
'updated_by',
'deleted_by',
@@ -53,6 +60,8 @@ class AdminPmIssue extends Model
'due_date' => 'date',
'estimated_hours' => 'integer',
'is_urgent' => 'boolean',
'department_id' => 'integer',
'assignee_id' => 'integer',
'created_by' => 'integer',
'updated_by' => 'integer',
'deleted_by' => 'integer',
@@ -159,6 +168,46 @@ public function updater(): BelongsTo
return $this->belongsTo(User::class, 'updated_by');
}
/**
* 관계: 부서 (연동 시)
*/
public function department(): BelongsTo
{
return $this->belongsTo(Department::class, 'department_id');
}
/**
* 관계: 담당자 (연동 시)
*/
public function assignee(): BelongsTo
{
return $this->belongsTo(User::class, 'assignee_id');
}
/**
* 팀/부서 표시명 (FK 우선, 없으면 문자열)
*/
public function getTeamDisplayAttribute(): ?string
{
if ($this->department_id && $this->department) {
return $this->department->name;
}
return $this->team;
}
/**
* 담당자 표시명 (FK 우선, 없으면 문자열)
*/
public function getAssigneeDisplayAttribute(): ?string
{
if ($this->assignee_id && $this->assignee) {
return $this->assignee->name;
}
return $this->assignee_name;
}
/**
* 타입 아이콘
*/