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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user