ERP-node/frontend/types/user.ts

70 lines
1.9 KiB
TypeScript

/**
* 사용자 관리 관련 타입 정의
*/
// 사용자 정보 인터페이스 (백엔드 API 응답과 일치하는 camelCase)
export interface User {
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)
status: string; // 상태 (active, inactive)
dataType?: string; // 데이터 타입
endDate?: string; // 퇴사일
locale?: string; // 로케일
rnum?: number; // 행 번호
}
// 사용자 검색 필터
export interface UserSearchFilter {
searchType?: "all" | "sabun" | "companyCode" | "deptName" | "positionName" | "userId" | "userName" | "tel" | "email"; // 검색 대상
searchValue?: string; // 검색어
}
// 사용자 목록 테이블 컬럼 정의
export interface UserTableColumn {
key: string;
label: string;
sortable?: boolean;
width?: string;
}
// 사용자 등록/수정 폼 데이터
export interface UserFormData {
userId: string;
userName: string;
deptCode: string;
deptName: string;
positionName: string;
email: string;
tel: string;
cellPhone: string;
userTypeName: string;
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;