feat: [interview] 카테고리 계층 구조(대분류/중분류) 지원

- InterviewCategory 모델에 parent/children 관계 추가
- Service: getTree, getProjectTree 루트+children eager loading
- Service: createCategory에 parent_id 지원
- Service: cloneMaster 2단계 계층 복제
- Controller: storeCategory validation에 parent_id 추가
- UI: CategorySidebar/DomainSidebar 트리 뷰 렌더링
- UI: findCategory 헬퍼로 트리 내 카테고리 검색
This commit is contained in:
김보곤
2026-02-28 21:23:30 +09:00
parent 974a356f39
commit 43127c9c4f
4 changed files with 295 additions and 114 deletions

View File

@@ -14,6 +14,7 @@ class InterviewCategory extends Model
protected $fillable = [
'tenant_id',
'interview_project_id',
'parent_id',
'name',
'description',
'domain',
@@ -29,6 +30,16 @@ class InterviewCategory extends Model
'sort_order' => 'integer',
];
public function parent()
{
return $this->belongsTo(self::class, 'parent_id');
}
public function children()
{
return $this->hasMany(self::class, 'parent_id')->orderBy('sort_order');
}
public function project()
{
return $this->belongsTo(InterviewProject::class, 'interview_project_id');