package incheon.ags.ias.dataHoprReg.service;

import incheon.ags.ias.user.vo.UserVO;

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

/**
 * 사용자 동기화 서비스
 */
public interface UserSyncService {

    /**
     * 파일에서 사용자 데이터 동기화 (파일 파싱 + 동기화)
     * @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> syncUsers(List<UserVO> fileDataList, String operatorId) throws Exception;

    /**
     * 파일 컬럼을 UserVO로 변환 (고정 순서)
     */
    UserVO convertToUserVO(List<String> columns);

    /**
     * 사용자 조회 (userUnqId 기준) - UserVO 반환
     */
    UserVO selectUserByUnqId(String userUnqId) throws Exception;

    /**
     * 사용자 조회 (userUnqId 기준) - Map 반환
     */
    Map<String, Object> selectUserMapByUnqId(String userUnqId) throws Exception;

    /**
     * 사용자 이력 목록 조회
     */
    List<Map<String, Object>> selectUserHstryList(Map<String, Object> param) throws Exception;

    /**
     * 사용자 이력 총 건수 조회
     */
    int selectUserHstryCnt(Map<String, Object> param) throws Exception;

    /**
     * 사용자 이력 상세 조회
     */
    Map<String, Object> selectUserHstryDetail(Long userHstrySn) throws Exception;
}
