package com.brilliance.isc.common.setglg.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.fasterxml.jackson.annotation.JsonFormat;
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 static com.brilliance.mda.runtime.mda.Constants.NULLSTR;

@Data
@ApiModel(value = "结算汇总信息", description = "结算汇总信息")
public class SetsumwVo implements Serializable {

    private static final long serialVersionUID = 5990602884594746790L;

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

    @ApiModelProperty(value = "acc. currency", name = "acccur", required = true)
    private String acccur = NULLSTR;

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

    @ApiModelProperty(value = "account", name = "act", required = true)
    private String act = 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 = "2.nd Amount", name = "amt2", required = true)
    private BigDecimal amt2 = Decimals.ZERO_SCALE2;

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

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

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

    @ApiModelProperty(value = "disposition flag F-not modifiable", name = "dspflg", required = true)
    private String dspflg = NULLSTR;

    @ApiModelProperty(value = "Forward contract to be used for conversion", name = "fcdinr", required = true)
    private String fcdinr = NULLSTR;

    @ApiModelProperty(value = "value date as set from transaction", name = "valdattrn", required = true)
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date valdattrn;

    @ApiModelProperty(value = "Type of amount setteled", name = "docamttyp", required = true)
    private String docamttyp = NULLSTR;

    @ApiModelProperty(value = "Document Cur to Base EXTernal RATe", name = "dcbextrat", required = true)
    private BigDecimal dcbextrat = Decimals.ZERO_SCALE6;

    @ApiModelProperty(value = "Settle Cur to Base EXTernal RATe", name = "scbextrat", required = true)
    private BigDecimal scbextrat = Decimals.ZERO_SCALE6;

    @ApiModelProperty(value = "Ids totalled up for amount", name = "amtidsstm", required = true)
    private IStream amtidsstm = new StreamImpl();

    @ApiModelProperty(value = "Group of amounts", name = "gllgrp", required = true)
    private String gllgrp = NULLSTR;

    public void reset() {
        if (accamt == null) {
            accamt = Decimals.ZERO_SCALE2;
        }
        if (acccur == null) {
            acccur = NULLSTR;
        }
        if (act == null) {
            act = NULLSTR;
        }
        if (cur == null) {
            cur = NULLSTR;
        }
        if (amt == null) {
            amt = Decimals.ZERO_SCALE2;
        }
        if (amt2 == null) {
            amt2 = Decimals.ZERO_SCALE2;
        }
        if (dsp == null) {
            dsp = NULLSTR;
        }
        if (flg == null) {
            flg = NULLSTR;
        }
        if (rol == null) {
            rol = NULLSTR;
        }
        if (dspflg == null) {
            dspflg = NULLSTR;
        }
        if (fcdinr == null) {
            fcdinr = NULLSTR;
        }
        if (docamttyp == null) {
            docamttyp = NULLSTR;
        }
        if (dcbextrat == null) {
            dcbextrat = Decimals.ZERO_SCALE6;
        }
        if (scbextrat == null) {
            scbextrat = Decimals.ZERO_SCALE6;
        }
        if (amtidsstm == null) {
            amtidsstm = new StreamImpl();
        }
        if (gllgrp == null) {
            gllgrp = NULLSTR;
        }
    }
}
