package com.chushang.loan.domin.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class LoanApproval implements Serializable {

    /**
     * 主键
     */
    @NotNull(message = "id不能为空")
    private Long id;

    /**
     * 跟进状态
     */
    @NotNull(message = "审批状态不能为空")
    @Range(max = 3, min = 2, message = "审批状态只能选择审批通过或审批拒绝")
    private Integer status;

    /**
     * 放款金额
     */
    @Digits(integer = 9, fraction = 2, message = "申请金额格式不正确")
    @DecimalMin(value = "0.00", message = "申请金额不能是负数")
    private BigDecimal loanAmount;

    /**
     * 拒绝原因
     */
    @Size(max = 310, message = "房屋地址不能超过310个字符")
    private String denialReason;
}
