package com.brilliance.isc.vo.finance;

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.common.json.BigDecimalSerialize;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

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

import static com.brilliance.mda.runtime.mda.Constants.NULLDATE;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;

/**
 * 出口融资业务信息
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class BpdBizInfoVo extends BizInfoVo {
    //Type of Financing
    private String fintyp = NULLSTR;

    private String inttyp;
    private String pntinr;
    private String onlybptflg;
    private String accbch;
    private String fortyp;
    private String payrol;
    private String opttyp;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date mcdate = NULLDATE;
    private BigDecimal shuilv = Decimals.ZERO_SCALE4;
    private BigDecimal bmhamt = Decimals.ZERO_SCALE3;
    private BigDecimal tolrat = Decimals.ZERO_SCALE6;

    private String doccur = NULLSTR;

    private String fenlishi;
    //委托行代付
    private String dfflag;
    //代付业务编号
    private String dfownref;
    //代付币种
    private String dfcur;
    //代付金额
    private BigDecimal dfamt;

    //默认对手费用收取角色
    private String feecorrol = NULLSTR;


    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal docamt = Decimals.ZERO_SCALE2;

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal intamt = Decimals.ZERO_SCALE2;

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal trdbckamt = Decimals.ZERO_SCALE2;

    private String cbscalflg;
    private String reptyp;

    @JsonSerialize(using = BigDecimalSerialize.class) // 还款金额
    private BigDecimal setamt = Decimals.ZERO_SCALE2;

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbbamt = Decimals.ZERO_SCALE2;

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbbintamt = Decimals.ZERO_SCALE2; //利息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbbintamt1 = Decimals.ZERO_SCALE2; //表外欠息利息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbbintamt2 = Decimals.ZERO_SCALE2; //表内欠息利息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbbintamty1 = Decimals.ZERO_SCALE2; //表外欠息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbbintamty2 = Decimals.ZERO_SCALE2; //表内欠息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbeamt = Decimals.ZERO_SCALE2; //本金

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbeintamt = Decimals.ZERO_SCALE2; //利息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbeintamt1 = Decimals.ZERO_SCALE2; //表外欠息利息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbeintamt2 = Decimals.ZERO_SCALE2; //表内欠息利息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbeintamty1 = Decimals.ZERO_SCALE2; //表外欠息

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal cbeintamty2 = Decimals.ZERO_SCALE2; //表内欠息

    private String actflg = NULLSTR;
    private String wipflg = NULLSTR;
    private String clsflg = NULLSTR;
    private String setact = NULLSTR;

    private String sndmsg = NULLSTR;

    //fremsg相关
    private String sndmt;
    private String msgrol = NULLSTR;
    private String ccrol = NULLSTR;
    private PtsptaVo othmsg;
    private PtsptaVo othcc;
    private String reldir = NULLSTR;
    private String fulmt = NULLSTR;
    private String relmt = NULLSTR;
    private Integer tenmaxday;

    private String ownref;

    //Finance Risk Type BPDGRP\REC\RSKTYP
    private String rsktyp = NULLSTR;

    //额度  BPTP\PURTYP Purchase Type
    private String purtyp = NULLSTR;

    //额度  BPTP\DISTYP Discount Type
    private String distyp = NULLSTR;

    //报送使用  执行利率  BRDGRP.REC.TOLRAT
    private BigDecimal cfarat = Decimals.ZERO_SCALE6;

    //报送使用  还本付息金额  FINMOD.CBS.TOTINT
    private BigDecimal totint = Decimals.ZERO_SCALE2;

    //报送使用  还本金额  FINMOD.CBS.CBE.AMT
    private BigDecimal finbckamt = Decimals.ZERO_SCALE2;

    //报送使用 借据号 FINMOD.FINCOD
    private String fincod = NULLSTR;

    //报送使用 到期日 BRDGRP.REC.MATDAT
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date matdat = NULLDATE;

    private String guaflg;
    //发票类型
    private String invtyp;

    private String financacc;

    //ledgrp inr
    private String ledinr;

    //转卖付款账号
    private String baomzh;

    @Override
    public void reset() {

    }
}
