package com.sunxung.factoring.entity.financing.review;

import com.alibaba.fastjson.annotation.JSONField;
import com.sunxung.factoring.entity.BaseEntity;
import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description : 额度支用-放款条件
 * @Author : L.Jia
 * @Date: 2023-12-12 21:13
 */
public class ReviewLoanCondition extends BaseEntity {

    /**
     * 额度支用审批信息ID
     */
    private Long reviewQuotaDisburseApprovalId;
    /**
     * 额度支用节点：对应收支计划的ID
     **/
    private Long incomeExpenditurePlanId;

    /**
     * 放款日期
     **/
    @JSONField(format = "yyyy-MM-dd")
    private Date loanDate;
    /**
     * 金额
     **/
    private BigDecimal amount;

    @Length(max = 2000, message = "放款条件不能超过2000个字符")
    private String loanCondition;

    public ReviewLoanCondition() {
    }

    public ReviewLoanCondition(ReviewIncomeExpenditurePlan plan) {
        this.loanDate = plan.getIncomeExpenditureDate();
        this.amount = plan.getLoan();
        this.incomeExpenditurePlanId = plan.getId();
    }

    public Date getLoanDate() {
        return loanDate;
    }

    public void setLoanDate(Date loanDate) {
        this.loanDate = loanDate;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getLoanCondition() {
        return loanCondition;
    }

    public void setLoanCondition(String loanCondition) {
        this.loanCondition = loanCondition;
    }

    public Long getReviewQuotaDisburseApprovalId() {
        return reviewQuotaDisburseApprovalId;
    }

    public void setReviewQuotaDisburseApprovalId(Long reviewQuotaDisburseApprovalId) {
        this.reviewQuotaDisburseApprovalId = reviewQuotaDisburseApprovalId;
    }

    public Long getIncomeExpenditurePlanId() {
        return incomeExpenditurePlanId;
    }

    public void setIncomeExpenditurePlanId(Long incomeExpenditurePlanId) {
        this.incomeExpenditurePlanId = incomeExpenditurePlanId;
    }
}
