Files
invyone/frontend/types/department.ts
T
johngreen 0e895a90fa feat(부서관리): V1 슬림 스코프 + 트리 컨텍스트 메뉴 UX 리디자인
백엔드:
- V018 soft-delete (deleted_at 컬럼) + 휴지통/복구 흐름
- V019 미사용 컬럼 cleanup (V1 슬림 스코프)
- DepartmentService.updateDepartment 에 parent_dept_code 사이클 가드
  (자기 자신/자손을 부모로 지정 시도 차단)
- DepartmentController, mapper 갱신

프론트:
- 부서관리 페이지(deptMngList) UX 리디자인
  - 트리 노드 ⋮ 컨텍스트 메뉴 (하위 추가, 다른 부서 아래로 이동, 정렬 4단계, 삭제)
  - 헤더 breadcrumb 으로 부서 위치 상시 표시
  - 폼의 상위부서 row 제거 (트리 ⋮ 로 진입점 일원화)
  - 빈 상태 placeholder + X 닫기 동작
  - 토글 버튼 토스 스타일 (아이콘 + 툴팁, 일정한 위치)
  - 부서유형 row 좁은 화면 가로 오버플로 fix
- DepartmentPicker 신규 재사용 컴포넌트 (자손 자동 exclude, 사이클 차단)
- 회사관리/프로비저닝 폼 개선 (Step1Basic, fields, CompanyTable, AdminPageRenderer)
- companyList/[companyCode]/departments 구버전 페이지 삭제

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 08:34:23 +09:00

100 lines
3.0 KiB
TypeScript

/**
* 부서 관리 관련 타입 정의
*/
// 부서 정보 (dept_info 테이블 1:1 매핑) — V019 정리 후
export interface Department {
dept_code: string; // 부서 코드 (PK)
parent_dept_code?: string | null; // 상위 부서 코드
dept_name: string; // 부서명
location?: string | null; // 위치코드 (UI hide, V2 매핑용 컬럼만 유지)
created_date?: string | null; // 생성일시
status?: "active" | "inactive" | null; // 사용여부
company_name?: string | null; // 회사명
company_code: string; // 회사 코드
short_name?: string | null; // 부서약칭
dept_type?: string | null; // 부서유형 (dept/team/temp)
org_system?: string | null; // 조직체계
approval_manager?: string | null; // 결재관리자 user_id
dept_manager?: string | null; // 부서관리자 user_id
zipcode?: string | null;
address1?: string | null;
address2?: string | null;
start_date?: string | null; // YYYY-MM-DD
end_date?: string | null; // YYYY-MM-DD
sort_order?: number | null;
created_at?: string;
updated_at?: string;
deleted_at?: string | null; // V1: soft-delete 시각. NULL=active, 값 있음=휴지통
// UI용 추가 필드
children?: Department[];
member_count?: number;
}
// 부서원 정보
export interface DepartmentMember {
user_id: string; // 사용자 ID
user_name: string; // 사용자명
dept_code: string; // 부서 코드
dept_name: string; // 부서명
is_primary: boolean; // 주 부서 여부
position_name?: string; // 직책명
email?: string; // 이메일
phone?: string; // 전화번호
cell_phone?: string; // 휴대폰
}
// 사용자-부서 매핑 (겸직 지원)
export interface UserDepartmentMapping {
user_id: string;
dept_code: string;
is_primary: boolean; // 주 부서 여부
created_at?: string;
}
// 부서 등록/수정 폼 데이터 — dept_info 스키마 1:1 (V019 정리 후)
export interface DepartmentFormData {
dept_name: string; // 부서명 (필수)
parent_dept_code?: string | null;
short_name?: string | null;
dept_type?: string | null;
org_system?: string | null;
approval_manager?: string | null;
dept_manager?: string | null;
zipcode?: string | null;
address1?: string | null;
address2?: string | null;
start_date?: string | null;
end_date?: string | null;
sort_order?: number | null;
status?: "active" | "inactive" | null;
// dept_info 추가 필드 (location 코드만 유지)
location?: string | null;
dept_code?: string | null; // 일괄등록용 (자동 부여 시 미전달)
}
// 부서 트리 노드 (UI용)
export interface DepartmentTreeNode {
dept_code: string;
dept_name: string;
parent_dept_code?: string | null;
children: DepartmentTreeNode[];
member_count: number;
isExpanded: boolean;
}
// 부서 API 응답
export interface DepartmentApiResponse {
success: boolean;
message: string;
data?: Department | Department[];
}
// 부서원 API 응답
export interface DepartmentMemberApiResponse {
success: boolean;
message: string;
data?: DepartmentMember | DepartmentMember[];
}