ERP-node/frontend/types/user.ts

83 lines
2.5 KiB
TypeScript
Raw Permalink Normal View History

2025-08-21 09:41:46 +09:00
/**
*
*/
2025-08-25 13:12:17 +09:00
// 사용자 정보 인터페이스 (백엔드 API 응답과 일치하는 camelCase)
2025-08-21 09:41:46 +09:00
export interface User {
2025-08-25 13:12:17 +09:00
sabun?: string; // 사번
userId: string; // 사용자 ID
userName: string; // 사용자명
userNameEng?: string; // 영문명
userNameCn?: string; // 중문명
companyCode?: string; // 회사 코드
companyName?: string; // 회사명
deptCode?: string; // 부서 코드
deptName?: string; // 부서명
positionCode?: string; // 직책 코드
positionName?: string; // 직책
email?: string; // 이메일
tel?: string; // 전화번호
cellPhone?: string; // 휴대폰
userType?: string; // 사용자 유형 코드
userTypeName?: string; // 사용자 유형명
regDate?: string; // 등록일 (YYYY-MM-DD)
2025-08-21 09:41:46 +09:00
status: string; // 상태 (active, inactive)
2025-08-25 13:12:17 +09:00
dataType?: string; // 데이터 타입
endDate?: string; // 퇴사일
locale?: string; // 로케일
2025-08-21 09:41:46 +09:00
rnum?: number; // 행 번호
}
// 사용자 검색 필터
export interface UserSearchFilter {
2025-08-26 14:23:22 +09:00
// 통합 검색 (우선순위: 가장 높음)
searchValue?: string; // 통합 검색어 (모든 필드 대상)
// 단일 필드 검색 (중간 우선순위)
searchType?: "all" | "sabun" | "companyCode" | "deptName" | "positionName" | "userId" | "userName" | "tel" | "email"; // 검색 대상 (하위 호환성)
// 고급 검색 (개별 필드별 AND 조건)
search_sabun?: string; // 사번 검색
search_companyName?: string; // 회사명 검색
search_deptName?: string; // 부서명 검색
search_positionName?: string; // 직책 검색
search_userId?: string; // 사용자 ID 검색
search_userName?: string; // 사용자명 검색
search_tel?: string; // 전화번호 검색 (TEL + CELL_PHONE)
search_email?: string; // 이메일 검색
2025-08-21 09:41:46 +09:00
}
// 사용자 목록 테이블 컬럼 정의
export interface UserTableColumn {
key: string;
label: string;
sortable?: boolean;
width?: string;
}
// 사용자 등록/수정 폼 데이터
export interface UserFormData {
2025-08-25 13:12:17 +09:00
userId: string;
userName: string;
deptCode: string;
deptName: string;
positionName: string;
2025-08-21 09:41:46 +09:00
email: string;
tel: string;
2025-08-25 13:12:17 +09:00
cellPhone: string;
userTypeName: string;
2025-08-21 09:41:46 +09:00
status: string;
}
// 사용자 상태 상수
export const USER_STATUS = {
ACTIVE: "active",
INACTIVE: "inactive",
} as const;
// 사용자 상태 라벨
export const USER_STATUS_LABELS = {
[USER_STATUS.ACTIVE]: "활성",
[USER_STATUS.INACTIVE]: "비활성",
} as const;