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

import com.brilliance.mda.runtime.mda.CodetableItem;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.common.vo.AbstractCommonVo;
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 SetfolVo extends AbstractCommonVo implements Serializable {

    private static final long serialVersionUID = -7448730599609417037L;
    @ApiModelProperty(value = "Disposition", name = "dsp", required = true)
    private String dsp = NULLSTR;

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

    private List<CodetableItem> payerSet;

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

    private List<CodetableItem> payeeSet;

    @ApiModelProperty(value = "Text for Payer", name = "txtdbt", required = true)
    private String txtdbt = NULLSTR;

    @ApiModelProperty(value = "Text for Payee", name = "txtpay", required = true)
    private String txtpay = 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 = "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 = "rate", name = "rat", required = true)
    private BigDecimal rat = Decimals.ZERO_SCALE6;

    @ApiModelProperty(value = "Calculation information", name = "clcamtlab", required = true)
    private String clcamtlab = NULLSTR;

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

    @ApiModelProperty(value = "INR of pool record loaded", name = "srcfcpinr", required = true)
    private String srcfcpinr = NULLSTR;

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

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

    @ApiModelProperty(value = "Temporary settlement fee has been advised", name = "sepinr", required = true)
    private String sepinr = NULLSTR;

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

    @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;

    private boolean forflg = false;

    public void reset() {
        if (dsp == null) {
            dsp = "";
        }
        if (ptydbt == null) {
            ptydbt = "";
        }
        if (ptypay == null) {
            ptypay = "";
        }
        if (txtdbt == null) {
            txtdbt = "";
        }
        if (txtpay == null) {
            txtpay = "";
        }
        if (cur == null) {
            cur = "";
        }
        if (amt == null) {
            amt = Decimals.ZERO_SCALE2;
        }
        if (rat == null) {
            rat = Decimals.ZERO_SCALE6;
        }
        if (clcamtlab == null) {
            clcamtlab = "";
        }
        if (src == null) {
            src = "";
        }
        if (srcfcpinr == null) {
            srcfcpinr = "";
        }
        if (advtrninr == null) {
            advtrninr = "";
        }
        if (sepinr == null) {
            sepinr = "";
        }
        if (modflg == null) {
            modflg = "";
        }
        if (mac == null) {
            mac = "";
        }
        if (macold == null) {
            macold = "";
        }
    }
}
