-- ============================================================================
-- V007: 권한 트리 노드의 한국어 명칭을 좌측 사이드바 i18n 라벨과 일치시킴
-- (구조는 유지, rsrc_nm만 갱신)
-- ============================================================================

-- ─── Level 0 (탭/그룹) ─────────────────────────
UPDATE kcg.auth_perm_tree SET rsrc_nm = '종합 상황판'      WHERE rsrc_cd = 'dashboard';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '경보 현황판'      WHERE rsrc_cd = 'monitoring';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '감시'             WHERE rsrc_cd = 'surveillance';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '탐지·분석'        WHERE rsrc_cd = 'detection';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '선박'             WHERE rsrc_cd = 'vessel';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '위험평가'         WHERE rsrc_cd = 'risk-assessment';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '순찰·경로'        WHERE rsrc_cd = 'patrol';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '단속·이력'        WHERE rsrc_cd = 'enforcement';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '현장 대응'        WHERE rsrc_cd = 'field-ops';
UPDATE kcg.auth_perm_tree SET rsrc_nm = 'AI 운영'          WHERE rsrc_cd = 'ai-operations';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '통계·보고'        WHERE rsrc_cd = 'statistics';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '모선 워크플로우' WHERE rsrc_cd = 'parent-inference-workflow';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '시스템 관리'     WHERE rsrc_cd = 'admin';

-- ─── Level 1 (서브탭/패널) ─────────────────────
-- monitoring 자식 (사이드바엔 없으나 향후 분리 가능성)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '알림 목록'        WHERE rsrc_cd = 'monitoring:alert-list';
UPDATE kcg.auth_perm_tree SET rsrc_nm = 'KPI 패널'         WHERE rsrc_cd = 'monitoring:kpi-panel';

-- surveillance 자식 (좌측: /events = live-map, /map-control)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '이벤트 목록'      WHERE rsrc_cd = 'surveillance:live-map';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '위험도 지도'      WHERE rsrc_cd = 'surveillance:map-control';

-- detection 자식 (사이드바: /dark-vessel, /gear-detection, /china-fishing)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '어구 탐지'        WHERE rsrc_cd = 'detection:gear-detection';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '다크베셀 탐지'    WHERE rsrc_cd = 'detection:dark-vessel';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '중국어선 분석'    WHERE rsrc_cd = 'detection:china-fishing';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '어구식별'         WHERE rsrc_cd = 'detection:gear-identification';

-- vessel 자식 (사이드바: /vessel/:id 단일)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '선박 상세'        WHERE rsrc_cd = 'vessel:vessel-detail';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '환적·접촉 탐지'   WHERE rsrc_cd = 'vessel:transfer-detection';

-- risk-assessment 자식 (사이드바: /risk-map, /enforcement-plan)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '위험도 지도'      WHERE rsrc_cd = 'risk-assessment:risk-map';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '단속 계획'        WHERE rsrc_cd = 'risk-assessment:enforcement-plan';

-- patrol 자식 (사이드바: /patrol-route, /fleet-optimization)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '순찰경로 추천'    WHERE rsrc_cd = 'patrol:patrol-route';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '다함정 최적화'    WHERE rsrc_cd = 'patrol:fleet-optimization';

-- enforcement 자식 (사이드바: /enforcement-history, /event-list)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '단속 이력'        WHERE rsrc_cd = 'enforcement:enforcement-history';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '이벤트 목록'      WHERE rsrc_cd = 'enforcement:event-list';

-- field-ops 자식 (사이드바: /mobile-service, /ship-agent, /ai-alert)
UPDATE kcg.auth_perm_tree SET rsrc_nm = '모바일 서비스'    WHERE rsrc_cd = 'field-ops:mobile-service';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '함정 Agent'       WHERE rsrc_cd = 'field-ops:ship-agent';
UPDATE kcg.auth_perm_tree SET rsrc_nm = 'AI 알림 발송'     WHERE rsrc_cd = 'field-ops:ai-alert';

-- ai-operations 자식
UPDATE kcg.auth_perm_tree SET rsrc_nm = 'AI 의사결정 지원' WHERE rsrc_cd = 'ai-operations:ai-assistant';
UPDATE kcg.auth_perm_tree SET rsrc_nm = 'AI 모델관리'      WHERE rsrc_cd = 'ai-operations:ai-model';
UPDATE kcg.auth_perm_tree SET rsrc_nm = 'MLOps'            WHERE rsrc_cd = 'ai-operations:mlops';

-- statistics 자식
UPDATE kcg.auth_perm_tree SET rsrc_nm = '통계 분석'        WHERE rsrc_cd = 'statistics:statistics';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '외부 서비스'      WHERE rsrc_cd = 'statistics:external-service';

-- parent-inference-workflow 자식
UPDATE kcg.auth_perm_tree SET rsrc_nm = '모선 확정/거부'   WHERE rsrc_cd = 'parent-inference-workflow:parent-review';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '후보 제외'        WHERE rsrc_cd = 'parent-inference-workflow:parent-exclusion';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '학습 세션'        WHERE rsrc_cd = 'parent-inference-workflow:label-session';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '전역 제외 관리'   WHERE rsrc_cd = 'parent-inference-workflow:exclusion-management';

-- admin 자식
UPDATE kcg.auth_perm_tree SET rsrc_nm = '사용자 관리'      WHERE rsrc_cd = 'admin:user-management';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '역할 관리'        WHERE rsrc_cd = 'admin:role-management';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '권한 관리'        WHERE rsrc_cd = 'admin:permission-management';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '메뉴 설정'        WHERE rsrc_cd = 'admin:menu-management';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '감사 로그'        WHERE rsrc_cd = 'admin:audit-logs';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '접근 이력'        WHERE rsrc_cd = 'admin:access-logs';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '로그인 이력'      WHERE rsrc_cd = 'admin:login-history';
UPDATE kcg.auth_perm_tree SET rsrc_nm = '환경설정'         WHERE rsrc_cd = 'admin:system-config';
