package com.ga.core.mapper.tax;

import com.ga.core.vo.tax.WithholdingTaxAdjustmentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * withholding_tax_adjustment Mapper — 환수 원천세 역분개 (V124)
 */
@Mapper
public interface WithholdingTaxAdjustmentMapper {

    /**
     * 멱등 upsert.
     * ON CONFLICT(agent_id, settle_month, reason) DO UPDATE
     * SET base_amount/income_tax_adj/local_tax_adj=EXCLUDED.
     */
    int upsert(WithholdingTaxAdjustmentVO vo);

    /**
     * 정산월 역분개 전량 삭제 — AggregateStep 재실행 시 clean slate 확보용(멱등).
     * 처리 건수 반환.
     */
    int deleteBySettleMonth(@Param("settleMonth") String settleMonth);
}
