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;

    /** 수당 상한(룰의 cap_amount). 지정 시 allowance_amount = min(base×rate, cap). NULL이면 상한 없음. */
    @DecimalMin("0")
    private BigDecimal capAmount;
}
