package incheon.ags.ias.tmprUserAuthrt.service;

import incheon.ags.ias.tmprUserAuthrt.vo.TmprUserAuthrtSearchVO;

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

public interface TmprUserAuthrtService {

    // 임시 사용자 권한 목록 조회
    List<Map<String, Object>> selectTmprUserAuthrtList(TmprUserAuthrtSearchVO searchVO) throws Exception;

    // 임시 사용자 권한 총 개수 조회
    int selectTmprUserAuthrtListTotCnt(TmprUserAuthrtSearchVO searchVO) throws Exception;

    // 임시 사용자 권한 상세 조회
    Map<String, Object> selectTmprUserAuthrtDetail(Map<String, Object> params) throws Exception;

    // 임시 사용자 메뉴 권한 매핑 목록 조회
    List<Map<String, Object>> selectTmprUserMenuAuthrtList(Map<String, Object> params) throws Exception;

    // 임시 사용자 시스템 권한 매핑 목록 조회
    List<Map<String, Object>> selectTmprUserSysAuthrtList(Map<String, Object> params) throws Exception;

    // 역할 목록 조회 (ROLETY999 고정)
    List<Map<String, Object>> selectRoleList() throws Exception;

    // 권한 목록 조회
    List<Map<String, Object>> selectAuthrtList(String sysCd) throws Exception;

    // 메뉴 목록 조회 (계층 구조)
    List<Map<String, Object>> selectMenuListBySysCd(String sysCd) throws Exception;

    // 메뉴별 할당 가능한 권한 목록 조회 - 추가
    List<Map<String, Object>> selectMenuAuthrtListBySysCd(String sysCd) throws Exception;

    // 시스템 전역 권한 목록 조회 - 추가
    List<Map<String, Object>> selectSysAuthrtListBySysCd(String sysCd) throws Exception;

    // 시스템 권한 설정 목록 조회
    List<Map<String, Object>> selectSysAuthrtStngList(String sysCd) throws Exception;

    // 메뉴 권한 설정 목록 조회
    List<Map<String, Object>> selectMenuAuthrtStngList(String sysCd) throws Exception;

    // 권한 설정 배치 등록
    int insertAuthrtStngBatch(List<Map<String, Object>> stngList, String userId) throws Exception;

    // 메뉴-역할-권한 매핑 배치 등록
    int insertMenuRoleAuthrtMpngBatch(String userId, String roleCd, String sysCd, List<Map<String, Object>> addMenuList, String loginUserId) throws Exception;

    // 메뉴-역할-권한 매핑 삭제
    int deleteMenuRoleAuthrtMpng(String userId, String menuCd, String roleCd,String sysCd, String authrtCd) throws Exception;

    // 시스템-역할-권한 매핑 배치 등록
    int insertSysRoleAuthrtMpngBatch(String userId, String roleCd, String sysCd, List<Map<String, Object>> addSysList, String loginUserId) throws Exception;

    // 시스템-역할-권한 매핑 삭제
    int deleteSysRoleAuthrtMpng(String userId, String sysCd, String roleCd, String authrtCd) throws Exception;

    List<Map<String, Object>> selectSysList() throws Exception;

    // 사용자 검색 (사용자 ID, 사용자명으로 검색)
    List<Map<String, Object>> searchUsers(Map<String, Object> params) throws Exception;

    int insertTmprUserAuthrt(Map<String, Object> params) throws Exception;

    // 사용자별 모든 임시 권한 삭제
    int deleteAllTmprUserAuthrtByUserId(String userId) throws Exception;

    // 사용자별 특정 시스템 임시 권한 삭제 (상세 정보 포함)
    Map<String, Object> deleteTmprUserAuthrtByUserIdAndRoleCdWithDetail(String userId, String roleCd, String sysCd) throws Exception;

}