package com.ruoyi.invest.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotNull;
import java.util.Date;
/**
 * 分期历史明细对象 installment_history_detail
 *
 * @author tianyongbao
 * @date 2024-03-23
 */
@ApiModel("分期历史明细对象")
@Data
public class InstallmentHistoryDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

    /** 分期历史id */
    private Long installmentHistoryId;

    /** 信用卡网贷 */
    @ApiModelProperty(value="信用卡网贷)")
    @NotNull(message="信用卡网贷不能为空")
    @Excel(name = "信用卡网贷")
    private Long bankCardLendId;

    /** 还款金额 */
    @ApiModelProperty(value="还款金额)")
    @NotNull(message="还款金额不能为空")
    @Excel(name = "还款金额")
    private Double currentAmount;

    /** 还款日期 */
    @ApiModelProperty(value="还款日期)")
    @NotNull(message="还款日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "还款日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date repaymentDate;

    /** 应还本金 */
    @ApiModelProperty(value="应还本金)")
    @NotNull(message="应还本金不能为空")
    @Excel(name = "应还本金")
    private Double principal;

    /** 利息 */
    @ApiModelProperty(value="利息)")
    @NotNull(message="利息不能为空")
    @Excel(name = "利息")
    private Double interest;

    /** 入账状态，1已入账，0未入账 */
    @ApiModelProperty(value="入账状态，1已入账，0未入账)")
    @NotNull(message="入账状态，1已入账，0未入账不能为空")
    @Excel(name = "入账状态，1已入账，0未入账")
    private String postingState;

    /** 删除标志（0代表存在 1代表删除） */
    private String delFlag;

    /** 类型，2信用卡,3网贷，4人情 */
    private String type;

    /** 还款期数 */
    @ApiModelProperty(value="还款期数")
    @Excel(name = "还款期数")
    private Integer periods;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("installmentHistoryId", getInstallmentHistoryId())
            .append("bankCardLendId", getBankCardLendId())
            .append("currentAmount", getCurrentAmount())
            .append("repaymentDate", getRepaymentDate())
            .append("principal", getPrincipal())
            .append("interest", getInterest())
            .append("postingState", getPostingState())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("delFlag", getDelFlag())
            .append("remark", getRemark())
            .append("type", getType())
            .append("periods", getPeriods())
            .toString();
    }
}
