package com.brilliance.isc.vo.model;

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.mda.support.jakson.serialize.BigDecimalSerializeRate;
import com.brilliance.mda.support.jakson.serialize.DecimalLength;
import com.brilliance.isc.common.json.BigDecimalSerialize;
import com.brilliance.isc.common.vo.AbstractCommonVo;
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;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class DfdVo extends AbstractCommonVo {

    //INR of Loan Contract
    private String inr = NULLSTR;

    //Our Reference
    private String ownref = NULLSTR;

    //Name of Loan Contract
    private String nam = NULLSTR;

    //Date of Creation
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date credat = NULLDATE;

    //Parent Contract Type
    private String pnttyp = NULLSTR;

    //Parent Contract
    private String pntinr = NULLSTR;

    //inr of trd
    private String trdinr = NULLSTR;

    //Parent Contract Name
    private String pntnam = NULLSTR;

    //Parent Contract Reference
    private String pntref = NULLSTR;

    //Date Issued
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date issdat = NULLDATE;

    //Maturity Date
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date matdat = NULLDATE;

    //Start Date Tenor
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date stttendat = NULLDATE;

    //Date Opened
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date opndat = NULLDATE;

    //Date Closed
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date clsdat = NULLDATE;

    //Tenor Days
    private  int tenday ;

    //Resp. User
    private String ownusr = NULLSTR;

    //Version
    private String ver = NULLSTR;

    //Type
    private String fintyp = NULLSTR;

    //Country Code for Statistics
    private String stacty = NULLSTR;

    //actural rate
    @JsonFormat(pattern = "#0.000000", shape = JsonFormat.Shape.STRING)
    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal actrat  = Decimals.ZERO_SCALE6;

    //BRANCH CODE KEYINR
    private String bchkeyinr = NULLSTR;

    //BRANCHINR
    private String branchinr = NULLSTR;

    //Mortgage Flag
    private String guaflg = NULLSTR;

    //计息周期
    private String intprd = NULLSTR;

    //浮动方式
    private String flttyp = NULLSTR;

    //浮动值
    @JsonSerialize(using = BigDecimalSerializeRate.class)
    @DecimalLength(7)
    private  BigDecimal fltval  = Decimals.ZERO_SCALE7;

    //境内境外代付标识
    private String dfuflg = NULLSTR;

    //交易类型
    private String trntyp = NULLSTR;

    //cur
    private String taxcur = NULLSTR;

    //tax
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal inctax  = Decimals.ZERO_SCALE3;

    //bussiness Tax
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal bustax  = Decimals.ZERO_SCALE3;

    //total TAX
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal tottax  = Decimals.ZERO_SCALE3;

    //代付行中文名
    private String bankcn = NULLSTR;

    //代付行核心客户号
    private String bankno = NULLSTR;

    //同业代付内部�'�号
    private String bnkact = NULLSTR;

    //还代币种
    private String rescur = NULLSTR;

    //还代利息
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal resamt  = Decimals.ZERO_SCALE3;

    //Entity holding Contract
    private String etyextkey = NULLSTR;

    //预留字段
    private String othuse = NULLSTR;

    //发票类型
    private String invtyp = NULLSTR;

    //贸易合同号
    private String mycontno = NULLSTR;
}
