package com.ga.core.mapper.regulatory;

import com.ga.core.vo.regulatory.RegulatoryLimitResp;
import com.ga.core.vo.regulatory.RegulatoryLimitSearchParam;
import com.ga.core.vo.regulatory.RegulatoryLimitVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RegulatoryLimitMapper {

    List<RegulatoryLimitResp> selectList(RegulatoryLimitSearchParam param);

    RegulatoryLimitResp selectDetailById(@Param("limitId") Long limitId);

    RegulatoryLimitVO selectById(@Param("limitId") Long limitId);

    /** 특정 날짜에 유효한 한도 1건 조회 (limitType + productCategory 조합) */
    RegulatoryLimitVO selectActiveByType(@Param("limitType") String limitType,
                                         @Param("productCategory") String productCategory,
                                         @Param("baseDate") String baseDate);

    /** 특정 날짜에 유효한 모든 활성 한도 조회 (배치/검증용) */
    List<RegulatoryLimitVO> selectAllActive(@Param("baseDate") String baseDate);

    int insert(RegulatoryLimitVO vo);

    int update(RegulatoryLimitVO vo);

    /** is_active 플래그 변경 */
    int updateStatus(@Param("limitId") Long limitId, @Param("isActive") Boolean isActive);
}
