// PersonBean 대응 - 세션 사용자 정보
export interface User {
  sabun: string;
  userId: string;
  userName: string;
  userNameEng: string;
  userNameCn: string;
  deptCode: string;
  deptName: string;
  positionCode: string;
  positionName: string;
  email: string;
  tel: string;
  cellPhone: string;
  userType: string;
  userTypeName: string;
  authName: string;
  partnerCd: string;
  isAdmin: boolean;
  // MOMO 추가 필드 (선택 — FITO 사용자에게는 비어있음)
  role?: "USER" | "ADMIN";
  objid?: string;
  companyName?: string;
}

// 메뉴 정보
export interface MenuItem {
  objid: string;
  menuNameKor: string;
  menuNameEng: string;
  menuUrl: string;
  parentObjId: string;
  menuOrder: string;
  level: string;
  children?: MenuItem[];
}

// 공통 코드
export interface CodeItem {
  minorCd: string;
  cdNm: string;
  cdNmEng: string;
  sortOrder: string;
}

// 페이징 정보
export interface PaginationInfo {
  totalCount: number;
  countPerPage: number;
  currentPage: number;
  maxPage: number;
  pageStart: number;
  pageEnd: number;
}

// API 응답 공통
export interface ApiResponse<T = unknown> {
  success: boolean;
  data?: T;
  message?: string;
}

// 그리드 데이터 응답 (기존 RESULTLIST, PAGE_HTML, TOTAL_CNT 대응)
export interface GridResponse<T = Record<string, unknown>> {
  RESULTLIST: T[];
  TOTAL_CNT: number;
  PAGE_HTML?: string;
  MAX_PAGE_SIZE?: number;
  COUNT_PER_PAGE?: number;
}

// 첨부파일 정보
export interface FileInfo {
  objid: string;
  targetObjId: string;
  docType: string;
  docTypeName: string;
  realFileName: string;
  savedFileName: string;
  filePath: string;
  fileSize: string;
  creator: string;
  cretDate: string;
}

// 결재 정보
export interface ApprovalInfo {
  objid: string;
  title: string;
  status: string;
  creator: string;
  createDate: string;
  approvalTargets: ApprovalTarget[];
}

export interface ApprovalTarget {
  objid: string;
  userId: string;
  userName: string;
  status: string;
  comment: string;
}
