feat: incar 갭 반영 수수료/운영 14개 도메인 풀스택 + 배치통합 + 신입교육자료
incar CMS(116메뉴) 벤치마킹 갭분석으로 ga-pro에 없던 14개 도메인을 풀스택 추가. P7 수수료 계산 7종 (V88~V96): - 수입수수료+수지차, 소개·이관수수료, 정착지원금, 인정실적+환산율, 시상, 생보운영지원수수료, 지점장수당 - 각 rule/ledger + 공식(보험료×요율, 수입−지급 등) Service 내장 P8 운영/정산 7종 (V97~V105): - 단계마감, 본사정산, 등급평가, 공동계약, 보증보험, 적립금, 수수료시뮬레이터 - close/reopen/apply/simulate/upsert 등 액션 + 손익·잔액·등급 산정 로직 배치 통합 (V106): - settle_master.other_commission_total 컬럼 추가(DEFAULT 0, 백필) - 설계사 지급성 9종 원장 aggregateByAgent → AggregateStep gross 합산 - 빈 원장 0 → 기존 정산결과·무결성 불변(비파괴적) 테스트: P7/P8 Service 공식 단위테스트 21건(ga-api:test 57건 전체 통과) 프론트: 화면 14개 + React.lazy 코드 스플리팅(단일 4MB → 130+ 청크) 문서: DOMAIN_GAP_P7/P8.md, 신입교육_보험과수수료_완전기초.md, DOMAIN_KNOWLEDGE/HANDOFF 갱신 검증: 전체 ./gradlew build(test 포함) SUCCESSFUL, Flyway V88~V106 success, GET+액션POST smoke 5xx 0건, 9개 집계쿼리 SQL 유효성 확인, 공식 런타임 실측. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.AgentGradeEvaluationResp;
|
||||
import com.ga.core.vo.commission.AgentGradeEvaluationSearchParam;
|
||||
import com.ga.core.vo.commission.AgentGradeEvaluationVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* agent_grade_evaluation Mapper.
|
||||
* 설계사 등급평가 원장: 월별 실적점수 기반 등급 산정 결과.
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgentGradeEvaluationMapper {
|
||||
|
||||
AgentGradeEvaluationResp selectById(@Param("evalId") Long evalId);
|
||||
|
||||
List<AgentGradeEvaluationResp> selectList(AgentGradeEvaluationSearchParam param);
|
||||
|
||||
int insert(AgentGradeEvaluationVO vo);
|
||||
|
||||
/**
|
||||
* 등급 반영 상태 변경 (EVALUATED → APPLIED).
|
||||
*/
|
||||
int updateStatus(@Param("evalId") Long evalId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("evalId") Long evalId);
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.AgentGuaranteeInsuranceResp;
|
||||
import com.ga.core.vo.commission.AgentGuaranteeInsuranceSearchParam;
|
||||
import com.ga.core.vo.commission.AgentGuaranteeInsuranceVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* agent_guarantee_insurance Mapper.
|
||||
* 보증보험: 설계사 신원보증보험 가입현황 관리.
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgentGuaranteeInsuranceMapper {
|
||||
|
||||
AgentGuaranteeInsuranceResp selectById(@Param("guaranteeId") Long guaranteeId);
|
||||
|
||||
List<AgentGuaranteeInsuranceResp> selectList(AgentGuaranteeInsuranceSearchParam param);
|
||||
|
||||
int insert(AgentGuaranteeInsuranceVO vo);
|
||||
|
||||
int update(AgentGuaranteeInsuranceVO vo);
|
||||
|
||||
int delete(@Param("guaranteeId") Long guaranteeId);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.AgentReserveFundResp;
|
||||
import com.ga.core.vo.commission.AgentReserveFundSearchParam;
|
||||
import com.ga.core.vo.commission.AgentReserveFundVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* agent_reserve_fund Mapper.
|
||||
* 적립금: 설계사별 월별 적립금 잔액 관리.
|
||||
* balance = 전월잔액 + reserve_in - reserve_out (Service 계산).
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgentReserveFundMapper {
|
||||
|
||||
AgentReserveFundResp selectById(@Param("reserveId") Long reserveId);
|
||||
|
||||
List<AgentReserveFundResp> selectList(AgentReserveFundSearchParam param);
|
||||
|
||||
/**
|
||||
* 설계사 + 정산월 단건 조회 — 중복 방지 및 해당 월 잔액 확인용.
|
||||
*/
|
||||
AgentReserveFundVO selectByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/**
|
||||
* 설계사의 지정월 이전 최신(직전월) 레코드 1건 — 잔액 누적 계산용.
|
||||
* settleMonth 미만인 데이터 중 settle_month DESC LIMIT 1.
|
||||
*/
|
||||
AgentReserveFundVO selectLatestBefore(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(AgentReserveFundVO vo);
|
||||
|
||||
int update(AgentReserveFundVO vo);
|
||||
|
||||
int delete(@Param("reserveId") Long reserveId);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.AwardLedgerResp;
|
||||
import com.ga.core.vo.commission.AwardLedgerSearchParam;
|
||||
import com.ga.core.vo.commission.AwardLedgerVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* award_ledger Mapper — 시상 원장 (V92)
|
||||
*/
|
||||
@Mapper
|
||||
public interface AwardLedgerMapper {
|
||||
|
||||
AwardLedgerResp selectById(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
List<AwardLedgerResp> selectList(AwardLedgerSearchParam param);
|
||||
|
||||
/** 설계사 + 정산월 시상금 합계 */
|
||||
BigDecimal sumAwardByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 설계사별 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(AwardLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.AwardRuleResp;
|
||||
import com.ga.core.vo.commission.AwardRuleSearchParam;
|
||||
import com.ga.core.vo.commission.AwardRuleVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* award_rule Mapper — 시상 룰 마스터 (V92)
|
||||
*/
|
||||
@Mapper
|
||||
public interface AwardRuleMapper {
|
||||
|
||||
AwardRuleResp selectById(@Param("ruleId") Long ruleId);
|
||||
|
||||
List<AwardRuleResp> selectList(AwardRuleSearchParam param);
|
||||
|
||||
/**
|
||||
* 시상 유형 + 기준일 유효 룰 1건 조회.
|
||||
* 시상 계산 Service에서 호출.
|
||||
*/
|
||||
AwardRuleVO selectActiveRule(@Param("awardType") String awardType,
|
||||
@Param("baseDate") LocalDate baseDate);
|
||||
|
||||
int insert(AwardRuleVO vo);
|
||||
|
||||
int update(AwardRuleVO vo);
|
||||
|
||||
int delete(@Param("ruleId") Long ruleId);
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.BranchMgrAllowanceLedgerResp;
|
||||
import com.ga.core.vo.commission.BranchMgrAllowanceLedgerSearchParam;
|
||||
import com.ga.core.vo.commission.BranchMgrAllowanceLedgerVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_ledger Mapper — 지점장수당 원장 (V94)
|
||||
*/
|
||||
@Mapper
|
||||
public interface BranchMgrAllowanceLedgerMapper {
|
||||
|
||||
BranchMgrAllowanceLedgerResp selectById(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
List<BranchMgrAllowanceLedgerResp> selectList(BranchMgrAllowanceLedgerSearchParam param);
|
||||
|
||||
/** 지점장 + 정산월 수당 합계 */
|
||||
BigDecimal sumAllowanceByManagerAndMonth(@Param("managerAgentId") Long managerAgentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 지점장별 순수당 합계(allowance_amount - COALESCE(clawback_amount,0)) — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(BranchMgrAllowanceLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.BranchMgrAllowanceRuleResp;
|
||||
import com.ga.core.vo.commission.BranchMgrAllowanceRuleSearchParam;
|
||||
import com.ga.core.vo.commission.BranchMgrAllowanceRuleVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_rule Mapper — 지점장수당 룰 (V94)
|
||||
*/
|
||||
@Mapper
|
||||
public interface BranchMgrAllowanceRuleMapper {
|
||||
|
||||
BranchMgrAllowanceRuleResp selectById(@Param("ruleId") Long ruleId);
|
||||
|
||||
List<BranchMgrAllowanceRuleResp> selectList(BranchMgrAllowanceRuleSearchParam param);
|
||||
|
||||
/**
|
||||
* 직책코드 + 기준일 유효 룰 1건 조회.
|
||||
* 지점장수당 계산 Service에서 호출.
|
||||
*/
|
||||
BranchMgrAllowanceRuleVO selectActiveRule(@Param("positionCode") String positionCode,
|
||||
@Param("baseDate") LocalDate baseDate);
|
||||
|
||||
int insert(BranchMgrAllowanceRuleVO vo);
|
||||
|
||||
int update(BranchMgrAllowanceRuleVO vo);
|
||||
|
||||
int delete(@Param("ruleId") Long ruleId);
|
||||
}
|
||||
+4
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* collection_commission_ledger Mapper.
|
||||
@@ -23,6 +24,9 @@ public interface CollectionCommissionLedgerMapper {
|
||||
BigDecimal sumByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 설계사별 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(CollectionCommissionLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.CommissionSimulationResp;
|
||||
import com.ga.core.vo.commission.CommissionSimulationSearchParam;
|
||||
import com.ga.core.vo.commission.CommissionSimulationVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* commission_simulation Mapper.
|
||||
* 수수료 시뮬레이터: 시나리오별 산출 결과 저장/조회.
|
||||
*/
|
||||
@Mapper
|
||||
public interface CommissionSimulationMapper {
|
||||
|
||||
CommissionSimulationResp selectById(@Param("simId") Long simId);
|
||||
|
||||
List<CommissionSimulationResp> selectList(CommissionSimulationSearchParam param);
|
||||
|
||||
int insert(CommissionSimulationVO vo);
|
||||
|
||||
int delete(@Param("simId") Long simId);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.GradeEvalRuleResp;
|
||||
import com.ga.core.vo.commission.GradeEvalRuleSearchParam;
|
||||
import com.ga.core.vo.commission.GradeEvalRuleVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* grade_eval_rule Mapper.
|
||||
* 등급평가 룰: 점수 구간별 등급 매핑 마스터.
|
||||
*/
|
||||
@Mapper
|
||||
public interface GradeEvalRuleMapper {
|
||||
|
||||
GradeEvalRuleResp selectById(@Param("ruleId") Long ruleId);
|
||||
|
||||
List<GradeEvalRuleResp> selectList(GradeEvalRuleSearchParam param);
|
||||
|
||||
/**
|
||||
* 점수 이상인 최대 min_score 룰 1건 조회 — 등급 산정 Service 용도.
|
||||
* 기준일(baseDate) 기준 유효한 룰 중 score 이상이고 min_score 가 최대인 1건 반환.
|
||||
*/
|
||||
GradeEvalRuleVO selectActiveRuleByScore(@Param("score") BigDecimal score,
|
||||
@Param("baseDate") LocalDate baseDate);
|
||||
|
||||
int insert(GradeEvalRuleVO vo);
|
||||
|
||||
int update(GradeEvalRuleVO vo);
|
||||
|
||||
int delete(@Param("ruleId") Long ruleId);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.HqSettleItemResp;
|
||||
import com.ga.core.vo.commission.HqSettleItemSearchParam;
|
||||
import com.ga.core.vo.commission.HqSettleItemVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* hq_settle_item Mapper.
|
||||
* 본사정산: GA 자체 수입/비용 항목. 손익 = Σ(INCOME) − Σ(EXPENSE).
|
||||
*/
|
||||
@Mapper
|
||||
public interface HqSettleItemMapper {
|
||||
|
||||
HqSettleItemResp selectById(@Param("itemId") Long itemId);
|
||||
|
||||
List<HqSettleItemResp> selectList(HqSettleItemSearchParam param);
|
||||
|
||||
/**
|
||||
* 정산월 + 항목유형별 금액 합계 — 본사손익 집계용.
|
||||
* itemType = INCOME or EXPENSE
|
||||
*/
|
||||
BigDecimal sumByMonthAndType(@Param("settleMonth") String settleMonth,
|
||||
@Param("itemType") String itemType);
|
||||
|
||||
int insert(HqSettleItemVO vo);
|
||||
|
||||
int update(HqSettleItemVO vo);
|
||||
|
||||
int delete(@Param("itemId") Long itemId);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.IncomeCommissionLedgerResp;
|
||||
import com.ga.core.vo.commission.IncomeCommissionLedgerSearchParam;
|
||||
import com.ga.core.vo.commission.IncomeCommissionLedgerVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* income_commission_ledger Mapper — 수입수수료 원장 (V88)
|
||||
*/
|
||||
@Mapper
|
||||
public interface IncomeCommissionLedgerMapper {
|
||||
|
||||
IncomeCommissionLedgerResp selectById(@Param("incomeId") Long incomeId);
|
||||
|
||||
List<IncomeCommissionLedgerResp> selectList(IncomeCommissionLedgerSearchParam param);
|
||||
|
||||
/** 보험사 + 정산월 수입수수료 합계 — margin_summary recalc 배치 용도 */
|
||||
BigDecimal sumByCarrierAndMonth(@Param("carrierId") Long carrierId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(IncomeCommissionLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("incomeId") Long incomeId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("incomeId") Long incomeId);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.JointContractResp;
|
||||
import com.ga.core.vo.commission.JointContractSearchParam;
|
||||
import com.ga.core.vo.commission.JointContractVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* joint_contract Mapper.
|
||||
* 공동계약: 복수 설계사의 계약별 지분율 관리.
|
||||
*/
|
||||
@Mapper
|
||||
public interface JointContractMapper {
|
||||
|
||||
JointContractResp selectById(@Param("jointId") Long jointId);
|
||||
|
||||
List<JointContractResp> selectList(JointContractSearchParam param);
|
||||
|
||||
/**
|
||||
* 계약별 공동설계사 목록 조회 — 지분율 확인용.
|
||||
*/
|
||||
List<JointContractResp> selectByContract(@Param("contractId") Long contractId);
|
||||
|
||||
/**
|
||||
* 계약별 지분율 합산 — 합=1 검증(Service 가드) 용도.
|
||||
*/
|
||||
BigDecimal sumShareByContract(@Param("contractId") Long contractId);
|
||||
|
||||
int insert(JointContractVO vo);
|
||||
|
||||
int update(JointContractVO vo);
|
||||
|
||||
int delete(@Param("jointId") Long jointId);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.LifeSupportLedgerResp;
|
||||
import com.ga.core.vo.commission.LifeSupportLedgerSearchParam;
|
||||
import com.ga.core.vo.commission.LifeSupportLedgerVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* life_support_ledger Mapper — 생보운영지원수수료 원장 (V93)
|
||||
*/
|
||||
@Mapper
|
||||
public interface LifeSupportLedgerMapper {
|
||||
|
||||
LifeSupportLedgerResp selectById(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
List<LifeSupportLedgerResp> selectList(LifeSupportLedgerSearchParam param);
|
||||
|
||||
/** 설계사 + 정산월 실지급액 합계 */
|
||||
BigDecimal sumNetByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 설계사별 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(LifeSupportLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.LifeSupportRuleResp;
|
||||
import com.ga.core.vo.commission.LifeSupportRuleSearchParam;
|
||||
import com.ga.core.vo.commission.LifeSupportRuleVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* life_support_rule Mapper — 생보운영지원수수료 룰 (V93)
|
||||
*/
|
||||
@Mapper
|
||||
public interface LifeSupportRuleMapper {
|
||||
|
||||
LifeSupportRuleResp selectById(@Param("ruleId") Long ruleId);
|
||||
|
||||
List<LifeSupportRuleResp> selectList(LifeSupportRuleSearchParam param);
|
||||
|
||||
/**
|
||||
* 설계사 등급 + 기준일 유효 룰 1건 조회.
|
||||
* 생보운영지원수수료 계산 Service에서 호출.
|
||||
*/
|
||||
LifeSupportRuleVO selectActiveRule(@Param("agentGrade") String agentGrade,
|
||||
@Param("baseDate") LocalDate baseDate);
|
||||
|
||||
int insert(LifeSupportRuleVO vo);
|
||||
|
||||
int update(LifeSupportRuleVO vo);
|
||||
|
||||
int delete(@Param("ruleId") Long ruleId);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.MarginSummaryResp;
|
||||
import com.ga.core.vo.commission.MarginSummarySearchParam;
|
||||
import com.ga.core.vo.commission.MarginSummaryVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* margin_summary Mapper — 수지차 집계 (V88)
|
||||
*/
|
||||
@Mapper
|
||||
public interface MarginSummaryMapper {
|
||||
|
||||
MarginSummaryResp selectById(@Param("marginId") Long marginId);
|
||||
|
||||
List<MarginSummaryResp> selectList(MarginSummarySearchParam param);
|
||||
|
||||
/**
|
||||
* 정산월 + 설계사(NULL=전체) 단위 수지차 1건 조회.
|
||||
* recalc 시 UPSERT 전 존재 여부 확인용.
|
||||
*/
|
||||
MarginSummaryVO selectByMonthAndAgent(@Param("settleMonth") String settleMonth,
|
||||
@Param("agentId") Long agentId);
|
||||
|
||||
/** 정산월 전체 수입수수료 합 (income_commission_ledger, CANCELLED 제외). */
|
||||
BigDecimal sumIncomeByMonth(@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 지급 합 (settle_master.net_amount). agentId NULL=전체. */
|
||||
BigDecimal sumPayoutByMonth(@Param("settleMonth") String settleMonth,
|
||||
@Param("agentId") Long agentId);
|
||||
|
||||
int insert(MarginSummaryVO vo);
|
||||
|
||||
int update(MarginSummaryVO vo);
|
||||
|
||||
int delete(@Param("marginId") Long marginId);
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* persistency_bonus Mapper.
|
||||
@@ -30,4 +31,7 @@ public interface PersistencyBonusMapper {
|
||||
int updateStatus(@Param("bonusId") Long bonusId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("bonusId") Long bonusId);
|
||||
|
||||
/** 정산월 기준 설계사별 유지보너스 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.ProductConversionRateResp;
|
||||
import com.ga.core.vo.commission.ProductConversionRateSearchParam;
|
||||
import com.ga.core.vo.commission.ProductConversionRateVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* product_conversion_rate Mapper — 상품별 환산율 마스터 (V91)
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductConversionRateMapper {
|
||||
|
||||
ProductConversionRateResp selectById(@Param("rateId") Long rateId);
|
||||
|
||||
List<ProductConversionRateResp> selectList(ProductConversionRateSearchParam param);
|
||||
|
||||
/**
|
||||
* 상품 + 기준일 유효 환산율 1건 조회.
|
||||
* 인정실적 계산 Service에서 호출.
|
||||
*/
|
||||
ProductConversionRateVO selectActiveRate(@Param("productId") Long productId,
|
||||
@Param("baseDate") LocalDate baseDate);
|
||||
|
||||
int insert(ProductConversionRateVO vo);
|
||||
|
||||
int update(ProductConversionRateVO vo);
|
||||
|
||||
int delete(@Param("rateId") Long rateId);
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.RecognizedPerformanceLedgerResp;
|
||||
import com.ga.core.vo.commission.RecognizedPerformanceLedgerSearchParam;
|
||||
import com.ga.core.vo.commission.RecognizedPerformanceLedgerVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* recognized_performance_ledger Mapper — 인정실적 원장 (V91)
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecognizedPerformanceLedgerMapper {
|
||||
|
||||
RecognizedPerformanceLedgerResp selectById(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
List<RecognizedPerformanceLedgerResp> selectList(RecognizedPerformanceLedgerSearchParam param);
|
||||
|
||||
/** 설계사 + 정산월 인정실적 합계 — 시상 기준 실적 산출 용도 */
|
||||
BigDecimal sumRecognizedByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(RecognizedPerformanceLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.ReferralCommissionLedgerResp;
|
||||
import com.ga.core.vo.commission.ReferralCommissionLedgerSearchParam;
|
||||
import com.ga.core.vo.commission.ReferralCommissionLedgerVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* referral_commission_ledger Mapper — 소개·이관수수료 원장 (V89)
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReferralCommissionLedgerMapper {
|
||||
|
||||
ReferralCommissionLedgerResp selectById(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
List<ReferralCommissionLedgerResp> selectList(ReferralCommissionLedgerSearchParam param);
|
||||
|
||||
/** 설계사 + 정산월 소개·이관수수료 합계 — commission_master 집계 배치 용도 */
|
||||
BigDecimal sumByAgentAndMonth(@Param("referrerAgentId") Long referrerAgentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 설계사별 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(ReferralCommissionLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.ReferralCommissionRuleResp;
|
||||
import com.ga.core.vo.commission.ReferralCommissionRuleSearchParam;
|
||||
import com.ga.core.vo.commission.ReferralCommissionRuleVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* referral_commission_rule Mapper — 소개·이관수수료 룰 (V89)
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReferralCommissionRuleMapper {
|
||||
|
||||
ReferralCommissionRuleResp selectById(@Param("ruleId") Long ruleId);
|
||||
|
||||
List<ReferralCommissionRuleResp> selectList(ReferralCommissionRuleSearchParam param);
|
||||
|
||||
/**
|
||||
* 유형 + 기준일 기준 유효 룰 1건 조회.
|
||||
* 수수료 계산 Service에서 호출.
|
||||
*/
|
||||
ReferralCommissionRuleVO selectActiveRule(@Param("referralType") String referralType,
|
||||
@Param("baseDate") LocalDate baseDate);
|
||||
|
||||
int insert(ReferralCommissionRuleVO vo);
|
||||
|
||||
int update(ReferralCommissionRuleVO vo);
|
||||
|
||||
int delete(@Param("ruleId") Long ruleId);
|
||||
}
|
||||
+4
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface ReinstatementCommissionLedgerMapper {
|
||||
@@ -15,6 +16,9 @@ public interface ReinstatementCommissionLedgerMapper {
|
||||
List<ReinstatementCommissionLedgerResp> selectList(ReinstatementCommissionLedgerSearchParam param);
|
||||
BigDecimal sumByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 설계사별 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
int insert(ReinstatementCommissionLedgerVO vo);
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface RenewalCommissionLedgerMapper {
|
||||
@@ -15,6 +16,9 @@ public interface RenewalCommissionLedgerMapper {
|
||||
List<RenewalCommissionLedgerResp> selectList(RenewalCommissionLedgerSearchParam param);
|
||||
BigDecimal sumByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 설계사별 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
int insert(RenewalCommissionLedgerVO vo);
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.SettlingSupportLedgerResp;
|
||||
import com.ga.core.vo.commission.SettlingSupportLedgerSearchParam;
|
||||
import com.ga.core.vo.commission.SettlingSupportLedgerVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* settling_support_ledger Mapper — 정착지원금 원장 (V90)
|
||||
*/
|
||||
@Mapper
|
||||
public interface SettlingSupportLedgerMapper {
|
||||
|
||||
SettlingSupportLedgerResp selectById(@Param("ledgerId") Long ledgerId);
|
||||
|
||||
List<SettlingSupportLedgerResp> selectList(SettlingSupportLedgerSearchParam param);
|
||||
|
||||
/** 설계사 + 정산월 실지급액 합계 */
|
||||
BigDecimal sumNetByAgentAndMonth(@Param("agentId") Long agentId,
|
||||
@Param("settleMonth") String settleMonth);
|
||||
|
||||
/** 정산월 기준 설계사별 합계 — settle_master 집계 배치 용도 */
|
||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(SettlingSupportLedgerVO vo);
|
||||
|
||||
int updateStatus(@Param("ledgerId") Long ledgerId, @Param("status") String status);
|
||||
|
||||
int delete(@Param("ledgerId") Long ledgerId);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.SettlingSupportRuleResp;
|
||||
import com.ga.core.vo.commission.SettlingSupportRuleSearchParam;
|
||||
import com.ga.core.vo.commission.SettlingSupportRuleVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* settling_support_rule Mapper — 정착지원금 룰 (V90)
|
||||
*/
|
||||
@Mapper
|
||||
public interface SettlingSupportRuleMapper {
|
||||
|
||||
SettlingSupportRuleResp selectById(@Param("ruleId") Long ruleId);
|
||||
|
||||
List<SettlingSupportRuleResp> selectList(SettlingSupportRuleSearchParam param);
|
||||
|
||||
/**
|
||||
* 설계사 등급 + 기준일 유효 룰 1건 조회.
|
||||
* 정착지원금 계산 Service에서 호출.
|
||||
*/
|
||||
SettlingSupportRuleVO selectActiveRule(@Param("agentGrade") String agentGrade,
|
||||
@Param("baseDate") LocalDate baseDate);
|
||||
|
||||
int insert(SettlingSupportRuleVO vo);
|
||||
|
||||
int update(SettlingSupportRuleVO vo);
|
||||
|
||||
int delete(@Param("ruleId") Long ruleId);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ga.core.mapper.commission;
|
||||
|
||||
import com.ga.core.vo.commission.StepCloseResp;
|
||||
import com.ga.core.vo.commission.StepCloseSearchParam;
|
||||
import com.ga.core.vo.commission.StepCloseVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* settlement_step_close Mapper.
|
||||
* 단계마감: 월별 정산 단계(수신→계산→검증→지급)의 OPEN/CLOSED 상태 관리.
|
||||
*/
|
||||
@Mapper
|
||||
public interface StepCloseMapper {
|
||||
|
||||
StepCloseResp selectById(@Param("stepCloseId") Long stepCloseId);
|
||||
|
||||
List<StepCloseResp> selectList(StepCloseSearchParam param);
|
||||
|
||||
/** 정산월 전체 단계 목록 (step_seq 순) */
|
||||
List<StepCloseResp> selectBySettleMonth(@Param("settleMonth") String settleMonth);
|
||||
|
||||
int insert(StepCloseVO vo);
|
||||
|
||||
/**
|
||||
* 단계 상태 변경 (close: CLOSED, reopen: OPEN).
|
||||
* closedAt/closedBy 는 SQL에서 NOW()/userId 처리.
|
||||
*/
|
||||
int updateStatus(@Param("stepCloseId") Long stepCloseId,
|
||||
@Param("status") String status,
|
||||
@Param("closedBy") Long closedBy);
|
||||
|
||||
int delete(@Param("stepCloseId") Long stepCloseId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* agent_grade_evaluation 조회 응답 — 설계사명/등급명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class AgentGradeEvaluationResp {
|
||||
private Long evalId;
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String orgName;
|
||||
private String evalPeriod;
|
||||
private BigDecimal performanceScore;
|
||||
private Long prevGradeId;
|
||||
private String prevGradeName;
|
||||
private Long evaluatedGradeId;
|
||||
private String evaluatedGradeName;
|
||||
private String status;
|
||||
private String statusName;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* agent_grade_evaluation 저장 요청.
|
||||
* evaluatedGradeId/status 는 Service(등급산정 로직)가 결정.
|
||||
*/
|
||||
@Data
|
||||
public class AgentGradeEvaluationSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long agentId;
|
||||
|
||||
@NotBlank
|
||||
private String evalPeriod;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal performanceScore;
|
||||
|
||||
/** 기존 등급 — 선택값 */
|
||||
private Long prevGradeId;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* agent_grade_evaluation 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentGradeEvaluationSearchParam extends SearchParam {
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String evalPeriod;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* agent_grade_evaluation — 설계사 등급평가 원장 (V99)
|
||||
* 월별 실적점수 기반 등급 산정 결과.
|
||||
* 공식: evaluated_grade = score 이상인 최대 min_score 룰의 grade (Service 결정).
|
||||
*/
|
||||
@Data
|
||||
public class AgentGradeEvaluationVO {
|
||||
private Long evalId;
|
||||
/** 대상 설계사 FK */
|
||||
private Long agentId;
|
||||
/** 평가 기준월 (YYYYMM) */
|
||||
private String evalPeriod;
|
||||
/** 실적 점수 */
|
||||
private BigDecimal performanceScore;
|
||||
/** 기존(직전) 등급 FK */
|
||||
private Long prevGradeId;
|
||||
/** 산정 등급 FK */
|
||||
private Long evaluatedGradeId;
|
||||
/** EVALUATED=평가완료/APPLIED=반영완료 */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* agent_guarantee_insurance 조회 응답 — 설계사명/보험사명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class AgentGuaranteeInsuranceResp {
|
||||
private Long guaranteeId;
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String orgName;
|
||||
private String policyNo;
|
||||
private Long carrierId;
|
||||
private String carrierName;
|
||||
private BigDecimal guaranteeAmount;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
private String status;
|
||||
private String statusName;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* agent_guarantee_insurance 저장 요청.
|
||||
* status/createdAt/updatedAt 는 서버 결정.
|
||||
*/
|
||||
@Data
|
||||
public class AgentGuaranteeInsuranceSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long agentId;
|
||||
|
||||
@NotBlank
|
||||
private String policyNo;
|
||||
|
||||
/** 보증보험사 — 선택 */
|
||||
private Long carrierId;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal guaranteeAmount;
|
||||
|
||||
@NotNull
|
||||
private LocalDate startDate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate endDate;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* agent_guarantee_insurance 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentGuaranteeInsuranceSearchParam extends SearchParam {
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private Long carrierId;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* agent_guarantee_insurance — 보증보험 (V101)
|
||||
* 설계사 신원보증보험 가입현황 추적(관리 목적, 공식 없음).
|
||||
*/
|
||||
@Data
|
||||
public class AgentGuaranteeInsuranceVO {
|
||||
private Long guaranteeId;
|
||||
/** 설계사 FK */
|
||||
private Long agentId;
|
||||
/** 증권번호 */
|
||||
private String policyNo;
|
||||
/** 보증보험사 FK (insurance_company.company_id) */
|
||||
private Long carrierId;
|
||||
private BigDecimal guaranteeAmount;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
/** ACTIVE=유효/EXPIRED=만료/CANCELLED=해지 */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* agent_reserve_fund 조회 응답 — 설계사명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class AgentReserveFundResp {
|
||||
private Long reserveId;
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String orgName;
|
||||
private String settleMonth;
|
||||
private BigDecimal reserveIn;
|
||||
private BigDecimal reserveOut;
|
||||
private BigDecimal balance;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* agent_reserve_fund 저장 요청.
|
||||
* balance 는 Service가 직전월 잔액 조회 후 계산하여 채워 넣음.
|
||||
*/
|
||||
@Data
|
||||
public class AgentReserveFundSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long agentId;
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
private BigDecimal reserveIn;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
private BigDecimal reserveOut;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* agent_reserve_fund 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentReserveFundSearchParam extends SearchParam {
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String settleMonth;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* agent_reserve_fund — 적립금 (V102)
|
||||
* 환수 대비 설계사별 월별 적립금 잔액.
|
||||
* balance = (직전월 balance) + reserve_in - reserve_out (Service 계산).
|
||||
*/
|
||||
@Data
|
||||
public class AgentReserveFundVO {
|
||||
private Long reserveId;
|
||||
/** 설계사 FK */
|
||||
private Long agentId;
|
||||
/** 정산 귀속월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
/** 당월 적립액 */
|
||||
private BigDecimal reserveIn;
|
||||
/** 당월 인출/사용액 */
|
||||
private BigDecimal reserveOut;
|
||||
/** 잔액 = 전월잔액 + reserve_in - reserve_out */
|
||||
private BigDecimal balance;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* award_ledger 조회 응답 — 설계사명·공통코드명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class AwardLedgerResp {
|
||||
private Long ledgerId;
|
||||
private Long agentId;
|
||||
/** agent.agent_name */
|
||||
private String agentName;
|
||||
/** organization.org_name */
|
||||
private String orgName;
|
||||
private String settleMonth;
|
||||
private String awardType;
|
||||
/** 공통코드 AWARD_TYPE */
|
||||
private String awardTypeName;
|
||||
private BigDecimal baseAmount;
|
||||
private BigDecimal awardAmount;
|
||||
private String status;
|
||||
/** 공통코드 INCOME_STATUS */
|
||||
private String statusName;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* award_ledger 등록 요청.
|
||||
* award_amount 는 Service가 계산 후 VO에 set.
|
||||
*/
|
||||
@Data
|
||||
public class AwardLedgerSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long agentId;
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
@NotBlank
|
||||
private String awardType;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal baseAmount;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* award_ledger 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AwardLedgerSearchParam extends SearchParam {
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String settleMonth;
|
||||
private String awardType;
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* award_ledger — 시상 원장 (V92)
|
||||
* award_amount = base_amount × award_rate (RATE) or award_fixed (FIXED)
|
||||
*/
|
||||
@Data
|
||||
public class AwardLedgerVO {
|
||||
private Long ledgerId;
|
||||
private Long agentId;
|
||||
/** 정산 귀속월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
/** AwardType: NEW_RECRUIT / CORPORATE / RETENTION / PERFORMANCE */
|
||||
private String awardType;
|
||||
/** 기준 실적 */
|
||||
private BigDecimal baseAmount;
|
||||
/** 시상금 */
|
||||
private BigDecimal awardAmount;
|
||||
/** CALCULATED / CONFIRMED / PAID / CANCELLED */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* award_rule 조회 응답 — 공통코드명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class AwardRuleResp {
|
||||
private Long ruleId;
|
||||
private String awardType;
|
||||
/** 공통코드 AWARD_TYPE */
|
||||
private String awardTypeName;
|
||||
private String calcType;
|
||||
/** 공통코드 CALC_TYPE */
|
||||
private String calcTypeName;
|
||||
private BigDecimal thresholdAmount;
|
||||
private BigDecimal awardRate;
|
||||
private BigDecimal awardFixed;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* award_rule 등록/수정 요청.
|
||||
*/
|
||||
@Data
|
||||
public class AwardRuleSaveReq {
|
||||
|
||||
@NotBlank
|
||||
private String awardType;
|
||||
|
||||
@NotBlank
|
||||
private String calcType;
|
||||
|
||||
@DecimalMin("0")
|
||||
private BigDecimal thresholdAmount;
|
||||
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal awardRate;
|
||||
|
||||
@DecimalMin("0")
|
||||
private BigDecimal awardFixed;
|
||||
|
||||
@NotNull
|
||||
private LocalDate effectiveFrom;
|
||||
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* award_rule 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AwardRuleSearchParam extends SearchParam {
|
||||
private String awardType;
|
||||
private String calcType;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* award_rule — 시상 룰 마스터 (V92)
|
||||
*/
|
||||
@Data
|
||||
public class AwardRuleVO {
|
||||
private Long ruleId;
|
||||
/** AwardType: NEW_RECRUIT / CORPORATE / RETENTION / PERFORMANCE */
|
||||
private String awardType;
|
||||
/** CalcType: RATE / FIXED */
|
||||
private String calcType;
|
||||
/** 충족 기준 실적 (NULL=조건 없음) */
|
||||
private BigDecimal thresholdAmount;
|
||||
/** 정률 시상율 (소수, calc_type=RATE 일 때 사용) */
|
||||
private BigDecimal awardRate;
|
||||
/** 정액 시상금 (calc_type=FIXED 일 때 사용) */
|
||||
private BigDecimal awardFixed;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* 시상 유형 코드 (AWARD_TYPE 그룹, V96)
|
||||
* award_rule.award_type, award_ledger.award_type 에서 사용.
|
||||
*/
|
||||
public enum AwardType {
|
||||
NEW_RECRUIT("신인도입"),
|
||||
CORPORATE("법인"),
|
||||
RETENTION("유지율"),
|
||||
PERFORMANCE("실적");
|
||||
|
||||
private final String label;
|
||||
|
||||
AwardType(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getCode() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_ledger 조회 응답 — 지점장명·조직명·공통코드명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class BranchMgrAllowanceLedgerResp {
|
||||
private Long ledgerId;
|
||||
private Long managerAgentId;
|
||||
/** agent.agent_name (지점장) */
|
||||
private String managerAgentName;
|
||||
private Long orgId;
|
||||
/** organization.org_name */
|
||||
private String orgName;
|
||||
private String settleMonth;
|
||||
private BigDecimal baseAmount;
|
||||
private BigDecimal allowanceRate;
|
||||
private BigDecimal allowanceAmount;
|
||||
private BigDecimal clawbackAmount;
|
||||
private String status;
|
||||
/** 공통코드 SUPPORT_STATUS */
|
||||
private String statusName;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_ledger 등록 요청.
|
||||
* allowance_amount 는 Service가 계산(LEAST 적용) 후 VO에 set.
|
||||
*/
|
||||
@Data
|
||||
public class BranchMgrAllowanceLedgerSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long managerAgentId;
|
||||
|
||||
@NotNull
|
||||
private Long orgId;
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal baseAmount;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal allowanceRate;
|
||||
|
||||
@DecimalMin("0")
|
||||
private BigDecimal clawbackAmount;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_ledger 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BranchMgrAllowanceLedgerSearchParam extends SearchParam {
|
||||
private Long managerAgentId;
|
||||
private String managerAgentName;
|
||||
private Long orgId;
|
||||
private String settleMonth;
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_ledger — 지점장수당 원장 (V94)
|
||||
* allowance_amount = LEAST(base_amount × allowance_rate, cap_amount)
|
||||
*/
|
||||
@Data
|
||||
public class BranchMgrAllowanceLedgerVO {
|
||||
private Long ledgerId;
|
||||
/** 지점장 설계사 FK */
|
||||
private Long managerAgentId;
|
||||
/** 대상 조직 FK */
|
||||
private Long orgId;
|
||||
/** 정산 귀속월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
/** 조직 실적 기준금액 */
|
||||
private BigDecimal baseAmount;
|
||||
/** 적용 수당율 (branch_mgr_allowance_rule 스냅샷) */
|
||||
private BigDecimal allowanceRate;
|
||||
/** 수당액 = LEAST(base_amount × allowance_rate, cap_amount) */
|
||||
private BigDecimal allowanceAmount;
|
||||
/** 환수액 */
|
||||
private BigDecimal clawbackAmount;
|
||||
/** CALCULATED / CONFIRMED / PAID / CLAWED_BACK / CANCELLED */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_rule 조회 응답 — 직책명 공통코드 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class BranchMgrAllowanceRuleResp {
|
||||
private Long ruleId;
|
||||
private String positionCode;
|
||||
/** 공통코드 POSITION_CODE */
|
||||
private String positionCodeName;
|
||||
private BigDecimal allowanceRate;
|
||||
private BigDecimal capAmount;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_rule 등록/수정 요청.
|
||||
*/
|
||||
@Data
|
||||
public class BranchMgrAllowanceRuleSaveReq {
|
||||
|
||||
@NotBlank
|
||||
private String positionCode;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal allowanceRate;
|
||||
|
||||
/** NULL=무제한 */
|
||||
@DecimalMin("0")
|
||||
private BigDecimal capAmount;
|
||||
|
||||
@NotNull
|
||||
private LocalDate effectiveFrom;
|
||||
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_rule 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BranchMgrAllowanceRuleSearchParam extends SearchParam {
|
||||
private String positionCode;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* branch_mgr_allowance_rule — 지점장수당 룰 마스터 (V94)
|
||||
*/
|
||||
@Data
|
||||
public class BranchMgrAllowanceRuleVO {
|
||||
private Long ruleId;
|
||||
/** 직책 코드 (지점장 등) */
|
||||
private String positionCode;
|
||||
/** 수당율 (소수, 예: 0.02 = 2%) */
|
||||
private BigDecimal allowanceRate;
|
||||
/** 수당 상한금액 (NULL=무제한) */
|
||||
private BigDecimal capAmount;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* 계산방식 코드 (CALC_TYPE 그룹, V96)
|
||||
* referral_commission_rule.calc_type, award_rule.calc_type 등에서 사용.
|
||||
*/
|
||||
public enum CalcType {
|
||||
RATE("정률"),
|
||||
FIXED("정액");
|
||||
|
||||
private final String label;
|
||||
|
||||
CalcType(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getCode() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* commission_simulation 조회 응답.
|
||||
* 시뮬레이터는 조인 대상이 없으므로 VO와 거의 동일하되 응답 전용 클래스로 분리.
|
||||
*/
|
||||
@Data
|
||||
public class CommissionSimulationResp {
|
||||
private Long simId;
|
||||
private String simName;
|
||||
private BigDecimal premiumAmount;
|
||||
private BigDecimal companyRate;
|
||||
private BigDecimal payoutRate;
|
||||
private Integer commissionYear;
|
||||
private BigDecimal companyPayment;
|
||||
private BigDecimal agentCommission;
|
||||
private BigDecimal withholdingTax;
|
||||
private BigDecimal netAmount;
|
||||
private BigDecimal expectedChargeback;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* commission_simulation 저장 요청.
|
||||
* 산출 결과 컬럼(companyPayment/agentCommission/withholdingTax/netAmount)은
|
||||
* Service의 simulate() 메서드가 계산 후 VO에 채워 INSERT.
|
||||
*/
|
||||
@Data
|
||||
public class CommissionSimulationSaveReq {
|
||||
|
||||
@NotBlank
|
||||
private String simName;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal premiumAmount;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal companyRate;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal payoutRate;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private Integer commissionYear;
|
||||
|
||||
/** 예상 환수액 — 선택 입력 */
|
||||
private BigDecimal expectedChargeback;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* commission_simulation 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommissionSimulationSearchParam extends SearchParam {
|
||||
private String simName;
|
||||
private Long createdBy;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* commission_simulation — 수수료 시뮬레이터 (V103)
|
||||
* 시나리오별 수수료 산출 결과 저장.
|
||||
* 공식:
|
||||
* company_payment = premium_amount × company_rate
|
||||
* agent_commission = company_payment × payout_rate
|
||||
* withholding_tax = agent_commission × 0.033 (3.3%, HALF_UP)
|
||||
* net_amount = agent_commission - withholding_tax
|
||||
*/
|
||||
@Data
|
||||
public class CommissionSimulationVO {
|
||||
private Long simId;
|
||||
private String simName;
|
||||
private BigDecimal premiumAmount;
|
||||
private BigDecimal companyRate;
|
||||
private BigDecimal payoutRate;
|
||||
private Integer commissionYear;
|
||||
/** 보험사 지급액 = 보험료 × company_rate */
|
||||
private BigDecimal companyPayment;
|
||||
/** 설계사 수수료 = 보험사지급액 × payout_rate */
|
||||
private BigDecimal agentCommission;
|
||||
/** 원천세 = 설계사수수료 × 3.3% */
|
||||
private BigDecimal withholdingTax;
|
||||
/** 실지급 = 설계사수수료 - 원천세 */
|
||||
private BigDecimal netAmount;
|
||||
/** 예상 환수액 (시나리오에 따라 선택) */
|
||||
private BigDecimal expectedChargeback;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
}
|
||||
@@ -15,7 +15,15 @@ public enum CommissionType {
|
||||
REINSTATE("부활수수료"),
|
||||
PERSIST("유지보수수당"),
|
||||
INCENTIVE("시책수수료"),
|
||||
ONBOARD("위촉수수료");
|
||||
ONBOARD("위촉수수료"),
|
||||
INCOME("수입수수료"),
|
||||
REFERRAL("소개수수료"),
|
||||
TRANSFER("이관수수료"),
|
||||
SETTLING("정착지원금"),
|
||||
RECOGNIZED("인정실적"),
|
||||
AWARD("시상"),
|
||||
LIFE_SUPPORT("생보운영지원수수료"),
|
||||
BRANCH_ALLOWANCE("지점장수당");
|
||||
|
||||
private final String label;
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* grade_eval_rule 조회 응답 — 등급명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class GradeEvalRuleResp {
|
||||
private Long ruleId;
|
||||
private Long gradeId;
|
||||
private String gradeName;
|
||||
private BigDecimal minScore;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* grade_eval_rule 저장 요청.
|
||||
*/
|
||||
@Data
|
||||
public class GradeEvalRuleSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long gradeId;
|
||||
|
||||
@NotNull
|
||||
private BigDecimal minScore;
|
||||
|
||||
@NotNull
|
||||
private LocalDate effectiveFrom;
|
||||
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* grade_eval_rule 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GradeEvalRuleSearchParam extends SearchParam {
|
||||
private Long gradeId;
|
||||
/** 적용 기준일 (이 날짜가 effective_from~effective_to 범위 안에 있는 룰만 조회) */
|
||||
private String baseDate;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* grade_eval_rule — 등급평가 룰 마스터 (V99)
|
||||
* 점수 구간별 등급 매핑. min_score 이상이면 해당 grade 부여.
|
||||
*/
|
||||
@Data
|
||||
public class GradeEvalRuleVO {
|
||||
private Long ruleId;
|
||||
/** 부여 등급 FK (grade.grade_id) */
|
||||
private Long gradeId;
|
||||
/** 최소 실적점수 (이 점수 이상이면 해당 등급) */
|
||||
private BigDecimal minScore;
|
||||
private LocalDate effectiveFrom;
|
||||
/** NULL = 현재 유효 */
|
||||
private LocalDate effectiveTo;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* 본사정산 항목유형 (HQ_ITEM_TYPE 그룹, V98)
|
||||
* hq_settle_item.item_type 에서 사용.
|
||||
* 본사손익 = Σ(INCOME) − Σ(EXPENSE)
|
||||
*/
|
||||
public enum HqItemType {
|
||||
INCOME("수입"),
|
||||
EXPENSE("비용");
|
||||
|
||||
private final String label;
|
||||
|
||||
HqItemType(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getCode() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* hq_settle_item 조회 응답 — 코드명 포함.
|
||||
*/
|
||||
@Data
|
||||
public class HqSettleItemResp {
|
||||
private Long itemId;
|
||||
private String settleMonth;
|
||||
private String itemType;
|
||||
private String itemTypeName;
|
||||
private String itemName;
|
||||
private BigDecimal amount;
|
||||
private String memo;
|
||||
private String status;
|
||||
private String statusName;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* hq_settle_item 저장 요청.
|
||||
* status/createdAt/updatedAt 는 서버에서 결정.
|
||||
*/
|
||||
@Data
|
||||
public class HqSettleItemSaveReq {
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
@NotBlank
|
||||
private String itemType;
|
||||
|
||||
@NotBlank
|
||||
private String itemName;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal amount;
|
||||
|
||||
private String memo;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* hq_settle_item 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class HqSettleItemSearchParam extends SearchParam {
|
||||
private String settleMonth;
|
||||
private String itemType;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* hq_settle_item — 본사정산 항목 (V98)
|
||||
* GA 자체 수입/비용 정산. 본사손익 = Σ(INCOME) − Σ(EXPENSE).
|
||||
*/
|
||||
@Data
|
||||
public class HqSettleItemVO {
|
||||
private Long itemId;
|
||||
/** 정산 귀속월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
/** 항목유형 (INCOME=수입/EXPENSE=비용) */
|
||||
private String itemType;
|
||||
private String itemName;
|
||||
private BigDecimal amount;
|
||||
private String memo;
|
||||
/** REGISTERED=등록/CONFIRMED=확정 */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* income_commission_ledger 조회 응답 — 보험사명·계약번호 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class IncomeCommissionLedgerResp {
|
||||
private Long incomeId;
|
||||
private Long contractId;
|
||||
/** contract.policy_no */
|
||||
private String policyNo;
|
||||
private Long carrierId;
|
||||
/** insurance_company.company_name */
|
||||
private String carrierName;
|
||||
private String settleMonth;
|
||||
private BigDecimal premiumAmount;
|
||||
private BigDecimal companyRate;
|
||||
private BigDecimal incomeAmount;
|
||||
private String commissionType;
|
||||
/** 공통코드 COMMISSION_TYPE */
|
||||
private String commissionTypeName;
|
||||
private String status;
|
||||
/** 공통코드 INCOME_STATUS */
|
||||
private String statusName;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* income_commission_ledger 등록/수정 요청.
|
||||
* income_amount는 Service가 계산 후 VO에 set하므로 요청에 포함하지 않는다.
|
||||
*/
|
||||
@Data
|
||||
public class IncomeCommissionLedgerSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long contractId;
|
||||
|
||||
@NotNull
|
||||
private Long carrierId;
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private java.math.BigDecimal premiumAmount;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private java.math.BigDecimal companyRate;
|
||||
|
||||
@NotBlank
|
||||
private String commissionType;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* income_commission_ledger 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class IncomeCommissionLedgerSearchParam extends SearchParam {
|
||||
private Long carrierId;
|
||||
private Long contractId;
|
||||
private String settleMonth;
|
||||
private String commissionType;
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* income_commission_ledger — 수입수수료 원장 (V88)
|
||||
* 보험사가 GA에 지급한 수입 측 수수료. income_amount = premium_amount × company_rate.
|
||||
*/
|
||||
@Data
|
||||
public class IncomeCommissionLedgerVO {
|
||||
private Long incomeId;
|
||||
private Long contractId;
|
||||
/** 보험사 FK (insurance_company.company_id) */
|
||||
private Long carrierId;
|
||||
/** 정산 귀속월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
private BigDecimal premiumAmount;
|
||||
/** 보험사 수수료율 (소수, 예: 0.12 = 12%) */
|
||||
private BigDecimal companyRate;
|
||||
/** 수입수수료 = premium_amount × company_rate */
|
||||
private BigDecimal incomeAmount;
|
||||
/** CommissionType: RECRUIT/MAINTAIN/RENEWAL/REINSTATE/COLLECTION */
|
||||
private String commissionType;
|
||||
/** CALCULATED / CONFIRMED / CANCELLED */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* joint_contract 조회 응답 — 설계사명/계약번호 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class JointContractResp {
|
||||
private Long jointId;
|
||||
private Long contractId;
|
||||
private String policyNo;
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String orgName;
|
||||
private String role;
|
||||
private String roleName;
|
||||
private BigDecimal shareRate;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* joint_contract 저장 요청.
|
||||
* share_rate 합=1 은 Service 레이어에서 검증.
|
||||
*/
|
||||
@Data
|
||||
public class JointContractSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long contractId;
|
||||
|
||||
@NotNull
|
||||
private Long agentId;
|
||||
|
||||
@NotBlank
|
||||
private String role;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal shareRate;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* joint_contract 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class JointContractSearchParam extends SearchParam {
|
||||
private Long contractId;
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String role;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* joint_contract — 공동계약 (V100)
|
||||
* 한 계약을 여러 설계사가 공동 모집. share_rate 합=1 (Service 검증).
|
||||
* 설계사몫 = 계약수수료 × share_rate
|
||||
*/
|
||||
@Data
|
||||
public class JointContractVO {
|
||||
private Long jointId;
|
||||
/** 대상 계약 FK */
|
||||
private Long contractId;
|
||||
/** 참여 설계사 FK */
|
||||
private Long agentId;
|
||||
/** 역할 (LEAD=주설계사/SUB=공동설계사) */
|
||||
private String role;
|
||||
/** 지분율 0~1 */
|
||||
private BigDecimal shareRate;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* 공동계약 역할 (JOINT_ROLE 그룹, V100)
|
||||
* joint_contract.role 에서 사용.
|
||||
* 계약별 share_rate 합 = 1 (Service 검증).
|
||||
*/
|
||||
public enum JointRole {
|
||||
LEAD("주설계사"),
|
||||
SUB("공동설계사");
|
||||
|
||||
private final String label;
|
||||
|
||||
JointRole(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getCode() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* life_support_ledger 조회 응답 — 설계사명·조직명·공통코드명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class LifeSupportLedgerResp {
|
||||
private Long ledgerId;
|
||||
private Long agentId;
|
||||
/** agent.agent_name */
|
||||
private String agentName;
|
||||
/** organization.org_name */
|
||||
private String orgName;
|
||||
private String settleMonth;
|
||||
private BigDecimal baseAmount;
|
||||
private BigDecimal supportRate;
|
||||
private BigDecimal supportAmount;
|
||||
private BigDecimal clawbackAmount;
|
||||
private BigDecimal netAmount;
|
||||
private String status;
|
||||
/** 공통코드 SUPPORT_STATUS */
|
||||
private String statusName;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* life_support_ledger 등록 요청.
|
||||
* support_amount / net_amount 는 Service가 계산 후 VO에 set.
|
||||
*/
|
||||
@Data
|
||||
public class LifeSupportLedgerSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long agentId;
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal baseAmount;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal supportRate;
|
||||
|
||||
@DecimalMin("0")
|
||||
private BigDecimal clawbackAmount;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* life_support_ledger 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LifeSupportLedgerSearchParam extends SearchParam {
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private String settleMonth;
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* life_support_ledger — 생보운영지원수수료 원장 (V93)
|
||||
* support_amount = base_amount × support_rate
|
||||
* net_amount = support_amount - clawback_amount
|
||||
*/
|
||||
@Data
|
||||
public class LifeSupportLedgerVO {
|
||||
private Long ledgerId;
|
||||
private Long agentId;
|
||||
/** 정산 귀속월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
/** 생보 실적 기준금액 */
|
||||
private BigDecimal baseAmount;
|
||||
/** 적용 지급률 (life_support_rule 스냅샷) */
|
||||
private BigDecimal supportRate;
|
||||
/** 지원수수료 = base_amount × support_rate */
|
||||
private BigDecimal supportAmount;
|
||||
/** 환수액 */
|
||||
private BigDecimal clawbackAmount;
|
||||
/** 실지급액 = support_amount - clawback_amount */
|
||||
private BigDecimal netAmount;
|
||||
/** CALCULATED / CONFIRMED / PAID / CLAWED_BACK / CANCELLED */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* life_support_rule 조회 응답 — 등급명 공통코드 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class LifeSupportRuleResp {
|
||||
private Long ruleId;
|
||||
private String agentGrade;
|
||||
/** 공통코드 AGENT_GRADE */
|
||||
private String agentGradeName;
|
||||
private BigDecimal supportRate;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* life_support_rule 등록/수정 요청.
|
||||
*/
|
||||
@Data
|
||||
public class LifeSupportRuleSaveReq {
|
||||
|
||||
@NotBlank
|
||||
private String agentGrade;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal supportRate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate effectiveFrom;
|
||||
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* life_support_rule 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LifeSupportRuleSearchParam extends SearchParam {
|
||||
private String agentGrade;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* life_support_rule — 생보운영지원수수료 룰 마스터 (V93)
|
||||
*/
|
||||
@Data
|
||||
public class LifeSupportRuleVO {
|
||||
private Long ruleId;
|
||||
/** 설계사 등급 */
|
||||
private String agentGrade;
|
||||
/** 지급률 (소수, 예: 0.03 = 3%) */
|
||||
private BigDecimal supportRate;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* margin_summary 조회 응답 — 설계사명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class MarginSummaryResp {
|
||||
private Long marginId;
|
||||
private String settleMonth;
|
||||
private Long agentId;
|
||||
/** agent.agent_name (NULL = 전체) */
|
||||
private String agentName;
|
||||
private BigDecimal incomeTotal;
|
||||
private BigDecimal payoutTotal;
|
||||
private BigDecimal marginAmount;
|
||||
private BigDecimal marginRate;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* margin_summary 등록/수정 요청.
|
||||
* margin_amount / margin_rate 는 Service가 계산 후 VO에 set.
|
||||
*/
|
||||
@Data
|
||||
public class MarginSummarySaveReq {
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
/** 설계사 FK (NULL = GA 전체 합산) */
|
||||
private Long agentId;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* margin_summary 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MarginSummarySearchParam extends SearchParam {
|
||||
private String settleMonth;
|
||||
private Long agentId;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* margin_summary — 수지차 집계 (V88)
|
||||
* recalc 배치 액션으로 채움. agent_id NULL = GA 전체 합산.
|
||||
* margin_amount = income_total - payout_total
|
||||
*/
|
||||
@Data
|
||||
public class MarginSummaryVO {
|
||||
private Long marginId;
|
||||
/** 정산월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
/** 설계사 FK (NULL = GA 전체) */
|
||||
private Long agentId;
|
||||
/** 수입 합계 (income_commission_ledger SUM) */
|
||||
private BigDecimal incomeTotal;
|
||||
/** 지급 합계 (settle_master.net_amount SUM) */
|
||||
private BigDecimal payoutTotal;
|
||||
/** 수지차 = income_total - payout_total */
|
||||
private BigDecimal marginAmount;
|
||||
/** 수지차율 = margin_amount / income_total */
|
||||
private BigDecimal marginRate;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* product_conversion_rate 조회 응답 — 상품명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class ProductConversionRateResp {
|
||||
private Long rateId;
|
||||
private Long productId;
|
||||
/** product.product_name */
|
||||
private String productName;
|
||||
private BigDecimal conversionRate;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* product_conversion_rate 등록/수정 요청.
|
||||
*/
|
||||
@Data
|
||||
public class ProductConversionRateSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long productId;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal conversionRate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate effectiveFrom;
|
||||
|
||||
private LocalDate effectiveTo;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* product_conversion_rate 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ProductConversionRateSearchParam extends SearchParam {
|
||||
private Long productId;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* product_conversion_rate — 상품별 환산율 마스터 (V91)
|
||||
* 인정실적 산출을 위한 보험료 환산율.
|
||||
*/
|
||||
@Data
|
||||
public class ProductConversionRateVO {
|
||||
private Long rateId;
|
||||
private Long productId;
|
||||
/** 환산율 (소수, 예: 0.5 = 50%) */
|
||||
private BigDecimal conversionRate;
|
||||
private LocalDate effectiveFrom;
|
||||
private LocalDate effectiveTo;
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* recognized_performance_ledger 조회 응답 — 설계사명·계약번호 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class RecognizedPerformanceLedgerResp {
|
||||
private Long ledgerId;
|
||||
private Long agentId;
|
||||
/** agent.agent_name */
|
||||
private String agentName;
|
||||
/** organization.org_name */
|
||||
private String orgName;
|
||||
private Long contractId;
|
||||
/** contract.policy_no */
|
||||
private String policyNo;
|
||||
private String settleMonth;
|
||||
private BigDecimal premiumAmount;
|
||||
private BigDecimal conversionRate;
|
||||
private BigDecimal convertedPremium;
|
||||
private BigDecimal recognitionRate;
|
||||
private BigDecimal recognizedAmount;
|
||||
private String status;
|
||||
/** 공통코드 INCOME_STATUS */
|
||||
private String statusName;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* recognized_performance_ledger 등록 요청.
|
||||
* converted_premium / recognized_amount 는 Service가 계산 후 VO에 set.
|
||||
*/
|
||||
@Data
|
||||
public class RecognizedPerformanceLedgerSaveReq {
|
||||
|
||||
@NotNull
|
||||
private Long agentId;
|
||||
|
||||
@NotNull
|
||||
private Long contractId;
|
||||
|
||||
@NotBlank
|
||||
private String settleMonth;
|
||||
|
||||
@NotNull
|
||||
@Positive
|
||||
private BigDecimal premiumAmount;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal conversionRate;
|
||||
|
||||
@NotNull
|
||||
@DecimalMin("0")
|
||||
@DecimalMax("1")
|
||||
private BigDecimal recognitionRate;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import com.ga.common.model.SearchParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* recognized_performance_ledger 검색 조건.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RecognizedPerformanceLedgerSearchParam extends SearchParam {
|
||||
private Long agentId;
|
||||
private String agentName;
|
||||
private Long contractId;
|
||||
private String settleMonth;
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* recognized_performance_ledger — 인정실적 원장 (V91)
|
||||
* converted_premium = premium_amount × conversion_rate
|
||||
* recognized_amount = converted_premium × recognition_rate
|
||||
*/
|
||||
@Data
|
||||
public class RecognizedPerformanceLedgerVO {
|
||||
private Long ledgerId;
|
||||
private Long agentId;
|
||||
private Long contractId;
|
||||
/** 정산 귀속월 (YYYYMM) */
|
||||
private String settleMonth;
|
||||
private BigDecimal premiumAmount;
|
||||
/** 적용 환산율 (product_conversion_rate 스냅샷) */
|
||||
private BigDecimal conversionRate;
|
||||
/** 환산보험료 = premium_amount × conversion_rate */
|
||||
private BigDecimal convertedPremium;
|
||||
/** 인정율 (설계사 등급/정책 기준) */
|
||||
private BigDecimal recognitionRate;
|
||||
/** 인정실적 = converted_premium × recognition_rate */
|
||||
private BigDecimal recognizedAmount;
|
||||
/** CALCULATED / CONFIRMED / CANCELLED */
|
||||
private String status;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ga.core.vo.commission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* referral_commission_ledger 조회 응답 — 설계사명·계약번호·공통코드명 조인 포함.
|
||||
*/
|
||||
@Data
|
||||
public class ReferralCommissionLedgerResp {
|
||||
private Long ledgerId;
|
||||
private Long contractId;
|
||||
/** contract.policy_no */
|
||||
private String policyNo;
|
||||
private Long referrerAgentId;
|
||||
/** agent.agent_name */
|
||||
private String referrerAgentName;
|
||||
private String settleMonth;
|
||||
private String referralType;
|
||||
/** 공통코드 REFERRAL_TYPE */
|
||||
private String referralTypeName;
|
||||
private BigDecimal baseAmount;
|
||||
private BigDecimal commissionRate;
|
||||
private BigDecimal commissionAmount;
|
||||
private String status;
|
||||
/** 공통코드 INCOME_STATUS */
|
||||
private String statusName;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user