package com.brilliance.isc.common.setfeg.vo;

import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.common.setmod.vo.CommCbsLine;
import com.brilliance.isc.common.setmod.vo.CommCbsLineGrid;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.FecVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

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

@Data
@ApiModel(value = "我行收费信息详情", description = "我行收费信息详情")
@JsonIgnoreProperties(ignoreUnknown = true)
public class SetfelVo extends AbstractCommonVo implements Serializable {

    private static final long serialVersionUID = 3848290206670004451L;

    @ApiModelProperty(value = "current MAC", name = "mac", required = true)
    private String mac = NULLSTR;

    @ApiModelProperty(value = "MAC after last run of Assert-fuction", name = "macold", required = true)
    private String macold = NULLSTR;

    @ApiModelProperty(value = "Role", name = "rol", required = true)
    private String rol = NULLSTR;

    @ApiModelProperty(value = "Code", name = "feecod", required = true)
    private String feecod = NULLSTR;

    @ApiModelProperty(value = "Source of fee", name = "src", required = true)
    private String src = NULLSTR;

    @ApiModelProperty(value = "disposition", name = "dsp", required = true)
    private String dsp = NULLSTR;

    @ApiModelProperty(value = "units", name = "unt", required = true)
    private int unt;

    @ApiModelProperty(value = "long feetext", name = "feetxtinf", required = true)
    private String feetxtinf = NULLSTR;

    @ApiModelProperty(value = "Currency", name = "cur", required = true)
    private String cur = NULLSTR;

    @ApiModelProperty(value = "Amount", name = "amt", required = true)
    private BigDecimal amt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "text", name = "feetxt", required = true)
    private String feetxt = NULLSTR;

    @ApiModelProperty(value = "Date-1", name = "dat1", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date dat1;

    @ApiModelProperty(value = "Date-2", name = "dat2", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date dat2;

    @ApiModelProperty(value = "Next commission due", name = "nxtcomdat", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date nxtcomdat;

    @ApiModelProperty(value = "Amount to be converted", name = "usramt", required = true)
    private BigDecimal usramt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Currency user entered fee", name = "usrcur", required = true)
    private String usrcur = NULLSTR;

    @ApiModelProperty(value = "Rate Calculation", name = "ratcal", required = true)
    private BigDecimal ratcal = Decimals.ZERO_SCALE6;

    @ApiModelProperty(value = "Rate Currency", name = "ratcur", required = true)
    private String ratcur = NULLSTR;

    @ApiModelProperty(value = "Label for rate /fixed amount", name = "ratlab", required = true)
    private String ratlab = NULLSTR;

    @ApiModelProperty(value = "rate amount", name = "untamt", required = true)
    private BigDecimal untamt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Begin Date of complete calculaton", name = "datrefbeg", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date datrefbeg;

    @ApiModelProperty(value = "modified", name = "modflg", required = true)
    private String modflg = NULLSTR;

    @ApiModelProperty(value = "details of calculation", name = "inftxt", required = true)
    private String inftxt = NULLSTR;

    @ApiModelProperty(value = "Interest receivable booked", name = "intrcv", required = true)
    private BigDecimal intrcv = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Details information from IRTCAL", name = "detstm", required = true)
    private IStream detstm = new StreamImpl();

    @ApiModelProperty(value = "INR of party paying", name = "rolptyinr", required = true)
    private String rolptyinr = NULLSTR;

    @ApiModelProperty(value = "fee account", name = "feeacc", required = true)
    private String feeacc = NULLSTR;

    @ApiModelProperty(value = "Currency of Converted Amount Usually SYSCUR, Optional", name = "xrfcur", required = true)
    private String xrfcur = NULLSTR;

    @ApiModelProperty(value = "Converted Amount in XRFCUR, Optional", name = "xrfamt", required = true)
    private BigDecimal xrfamt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Minimum or maximum used", name = "minmaxflg", required = true)
    private String minmaxflg = NULLSTR;

    @ApiModelProperty(value = "Details information for correspondence", name = "infdetstm", required = true)
    private IStream infdetstm = new StreamImpl();

    @ApiModelProperty(value = "", name = "errcod", required = true)
    private long errcod;

    @ApiModelProperty(value = "Errortext", name = "errtxt", required = true)
    private String errtxt = NULLSTR;

    @ApiModelProperty(value = "Confirmed untill", name = "cnftildat", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date cnftildat;

    @ApiModelProperty(value = "Date Advised", name = "advdat", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date advdat;

    @ApiModelProperty(value = "Transaction Advising the Fee if Set, Fee has been Advised", name = "advtrninr", required = true)
    private String advtrninr = NULLSTR;

    @ApiModelProperty(value = "Calculations used", name = "allcalflg", required = true)
    private String allcalflg = NULLSTR;

    @ApiModelProperty(value = "Base Amount", name = "basamt", required = true)
    private BigDecimal basamt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Base Amount from Defaulting or set by user", name = "basamtin", required = true)
    private BigDecimal basamtin = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "CPTPFX for fee calulation", name = "cbtpfx", required = true)
    private String cbtpfx = NULLSTR;

    @ApiModelProperty(value = "recredit paid fees of that type flag", name = "cdtoldflg", required = true)
    private String cdtoldflg = NULLSTR;

    @ApiModelProperty(value = "EXTID for fee calulation", name = "cextid", required = true)
    private String cextid = NULLSTR;

    @ApiModelProperty(value = "Date-2 - as defaulted by transaction", name = "dat2dft", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date dat2dft;

    @ApiModelProperty(value = "Ratetype for this fee set by transaction", name = "fecirt", required = true)
    private String fecirt = NULLSTR;

    @ApiModelProperty(value = "Condition for this fee", name = "fecmod", required = true)
    private String fecmod = NULLSTR;

    @ApiModelProperty(value = "Description for SWIFT", name = "feesftcod", required = true)
    private String feesftcod = NULLSTR;

    @ApiModelProperty(value = "Pool records represented by this line", name = "fepinrlst", required = true)
    private IStream fepinrlst = new StreamImpl();

    @ApiModelProperty(value = "Interest receivable booked", name = "intrcv1", required = true)
    private BigDecimal intrcv1 = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Contract for condtions and amounts", name = "objmod", required = true)
    private String objmod = NULLSTR;

    @ApiModelProperty(value = "relevant amount", name = "relamt", required = true)
    private BigDecimal relamt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "currency of relevant amount", name = "relcur", required = true)
    private String relcur = NULLSTR;

    @ApiModelProperty(value = "address PTA paying", name = "rolptainr", required = true)
    private String rolptainr = NULLSTR;

    @ApiModelProperty(value = "name", name = "rolnam", required = true)
    private String rolnam = NULLSTR;

    @ApiModelProperty(value = "Default role to pay the fee if set by transaction", name = "roldbt", required = true)
    private String roldbt = NULLSTR;

    @ApiModelProperty(value = "INR of Accruling control record", name = "acrinr", required = true)
    private String acrinr = NULLSTR;

    @ApiModelProperty(value = "document currency", name = "doccur", required = true)
    private String doccur = NULLSTR;

    @ApiModelProperty(value = "Accruing Account", name = "accacr", required = true)
    private String accacr = NULLSTR;

    @ApiModelProperty(value = "disposition Default", name = "dspdft", required = true)
    private String dspdft = NULLSTR;

    @ApiModelProperty(value = "Protected info from Defaulting", name = "proflg", required = true)
    private String proflg = NULLSTR;

    @ApiModelProperty(value = "Fee Code for DTA Messages", name = "feedtacod", required = true)
    private String feedtacod = NULLSTR;

    @ApiModelProperty(value = "", name = "feclst", required = true)
    private IStream feclst = new StreamImpl();

    @ApiModelProperty(value = "Holds the ID of the pooled entry if predebit settlement or pool entry", name = "predbt", required = true)
    private String predbt = NULLSTR;

    @ApiModelProperty(value = "Index of entry predebited", name = "predbtsetfelidx", required = true)
    private long predbtsetfelidx;

    @ApiModelProperty(value = "Cotract period in days for IRS access", name = "irsday", required = true)
    private int irsday;

    @ApiModelProperty(value = "Object INR", name = "objinr", required = true)
    private String objinr = NULLSTR;

    @ApiModelProperty(value = "Object Type", name = "objtyp", required = true)
    private String objtyp = NULLSTR;

    @ApiModelProperty(value = "Discount Amount", name = "dctamt", required = true)
    private BigDecimal dctamt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Original Amount", name = "ogiamt", required = true)
    private BigDecimal ogiamt = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "discount rate", name = "dctrat", required = true)
    private BigDecimal dctrat = Decimals.ZERO_SCALE2;

    @ApiModelProperty(value = "Old MATDAT", name = "oldmatdat", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date oldmatdat;

    @ApiModelProperty(value = "taxacc", name = "taxacc", required = true)
    private String taxacc = NULLSTR;

    @ApiModelProperty(value = "begdat", name = "begdat", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date begdat;

    @ApiModelProperty(value = "Fec", name = "wrkfec", required = true)
    private FecVo wrkfec = new FecVo();

    /**
     * 是否为commission费用
     */
    private String commFeeFlag = "N";

    /**
     * 费用金额取整
     *  commission的费用为N
     * 非commission的费用为Y
     */
    private String roundFlag = "N";

    /**
     * 宽限天数
     */
    private int graceDays = 0;

    /**
     * 计算明细开始信息
     */
    private String inftxtBegin;

    private List<CommCbsLine> commCbsLines;

    private List<CommCbsLineGrid> commCbsLineGrids;

    //费用描述是否允许修改
    private String dscmodflg;

    public void reset() {
        if (mac == null) {
            mac = NULLSTR;
        }
        if (macold == null) {
            macold = NULLSTR;
        }
        if (rol == null) {
            rol = NULLSTR;
        }
        if (feecod == null) {
            feecod = NULLSTR;
        }
        if (src == null) {
            src = NULLSTR;
        }
        if (dsp == null) {
            dsp = NULLSTR;
        }
        if (feetxtinf == null) {
            feetxtinf = NULLSTR;
        }
        if (cur == null) {
            cur = NULLSTR;
        }
        if (amt == null) {
            amt = Decimals.ZERO_SCALE2;
        }
        if (feetxt == null) {
            feetxt = NULLSTR;
        }
        if (usramt == null) {
            usramt = Decimals.ZERO_SCALE2;
        }
        if (usrcur == null) {
            usrcur = NULLSTR;
        }
        if (ratcal == null) {
            ratcal = Decimals.ZERO_SCALE6;
        }
        if (ratcur == null) {
            ratcur = NULLSTR;
        }
        if (ratlab == null) {
            ratlab = NULLSTR;
        }
        if (untamt == null) {
            untamt = Decimals.ZERO_SCALE2;
        }
        if (modflg == null) {
            modflg = NULLSTR;
        }
        if (inftxt == null) {
            inftxt = NULLSTR;
        }
        if (intrcv == null) {
            intrcv = Decimals.ZERO_SCALE2;
        }
        if (detstm == null) {
            detstm = new StreamImpl();
            detstm.setValue("");
        }
        if (rolptyinr == null) {
            rolptyinr = NULLSTR;
        }
        if (feeacc == null) {
            feeacc = NULLSTR;
        }
        if (xrfcur == null) {
            xrfcur = NULLSTR;
        }
        if (xrfamt == null) {
            xrfamt = Decimals.ZERO_SCALE2;
        }
        if (minmaxflg == null) {
            minmaxflg = NULLSTR;
        }
        if (infdetstm == null) {
            infdetstm = new StreamImpl();
            infdetstm.setValue("");
        }
        if (errtxt == null) {
            errtxt = NULLSTR;
        }
        if (advtrninr == null) {
            advtrninr = NULLSTR;
        }
        if (allcalflg == null) {
            allcalflg = NULLSTR;
        }
        if (basamt == null) {
            basamt = Decimals.ZERO_SCALE2;
        }
        if (basamtin == null) {
            basamtin = Decimals.ZERO_SCALE2;
        }
        if (cbtpfx == null) {
            cbtpfx = NULLSTR;
        }
        if (cdtoldflg == null) {
            cdtoldflg = NULLSTR;
        }
        if (cextid == null) {
            cextid = NULLSTR;
        }
        if (fecirt == null) {
            fecirt = NULLSTR;
        }
        if (fecmod == null) {
            fecmod = NULLSTR;
        }
        if (feesftcod == null) {
            feesftcod = NULLSTR;
        }
        if (fepinrlst == null) {
            fepinrlst = new StreamImpl();
            fepinrlst.setValue("");
        }
        if (intrcv1 == null) {
            intrcv1 = Decimals.ZERO_SCALE2;
        }
        if (objmod == null) {
            objmod = NULLSTR;
        }
        if (relamt == null) {
            relamt = Decimals.ZERO_SCALE2;
        }
        if (relcur == null) {
            relcur = NULLSTR;
        }
        if (rolptainr == null) {
            rolptainr = NULLSTR;
        }
        if (rolnam == null) {
            rolnam = NULLSTR;
        }
        if (roldbt == null) {
            roldbt = NULLSTR;
        }
        if (acrinr == null) {
            acrinr = NULLSTR;
        }
        if (doccur == null) {
            doccur = NULLSTR;
        }
        if (accacr == null) {
            accacr = NULLSTR;
        }
        if (dspdft == null) {
            dspdft = NULLSTR;
        }
        if (proflg == null) {
            proflg = NULLSTR;
        }
        if (feedtacod == null) {
            feedtacod = NULLSTR;
        }
        if (feclst == null) {
            feclst = new StreamImpl();
            feclst.setValue("");
        }
        if (predbt == null) {
            predbt = NULLSTR;
        }
        if (objinr == null) {
            objinr = NULLSTR;
        }
        if (objtyp == null) {
            objtyp = NULLSTR;
        }
        if (dctamt == null) {
            dctamt = Decimals.ZERO_SCALE2;
        }
        if (ogiamt == null) {
            ogiamt = Decimals.ZERO_SCALE2;
        }
        if (dctrat == null) {
            dctrat = Decimals.ZERO_SCALE2;
        }
        if (taxacc == null) {
            taxacc = NULLSTR;
        }
    }
}
