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;
}
