package incheon.ags.ias.dataHoprReg.service;

import incheon.ags.ias.dept.vo.DeptVO;

import java.util.List;
import java.util.Map;

/**
 * 부서 동기화 서비스
 */
public interface DeptSyncService {

    /**
     * 파일에서 부서 데이터 동기화 (파일 파싱 + 동기화)
     * @param atchFileId 첨부파일 ID
     * @param operatorId 작업자 ID
     * @return 처리된 건수 (inserted + updated + deleted)
     */
    int syncFromFile(String atchFileId, String operatorId) throws Exception;

    /**
     * 부서 데이터 동기화
     * @param fileDataList 파일에서 파싱한 부서 목록
     * @param operatorId 작업자 ID
     * @return 동기화 결과 (inserted, updated, deleted, unchanged)
     */
    Map<String, Integer> syncDepts(List<DeptVO> fileDataList, String operatorId) throws Exception;

    /**
     * 파일 헤더와 값을 DeptVO로 변환
     */
    DeptVO convertToDeptVO(List<String> headers, List<String> values);

    /**
     * 부서 조회 (deptCd 기준)
     */
    DeptVO selectDeptByCd(String deptCd) throws Exception;

    /**
     * 부서 이력 목록 조회
     */
    List<Map<String, Object>> selectDeptHstryList(Map<String, Object> param) throws Exception;

    /**
     * 부서 이력 총 건수 조회
     */
    int selectDeptHstryCnt(Map<String, Object> param) throws Exception;

    /**
     * 부서 이력 상세 조회
     */
    Map<String, Object> selectDeptHstryDetail(Long deptHstrySn) throws Exception;
}
