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

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

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

@Data
@ApiModel(value = "他行收费信息", description = "他行收费信息")
@JsonIgnoreProperties(ignoreUnknown = true)
public class SetfogVo extends AbstractCommonVo {

    @ApiModelProperty(value = "current MAC for EOG function", name = "maceog", required = true)
    private String maceog = NULLSTR;

    @ApiModelProperty(value = "current MAC for BOG function", name = "macbog", required = true)
    private String macbog = NULLSTR;

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

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

    @ApiModelProperty(value = "Sign. for Foreign expenses in Net amount", name = "forsgn", required = true)
    private int forsgn;

    @ApiModelProperty(value = "Default Value for pool disposition", name = "dsppoldft", required = true)
    private String dsppoldft = NULLSTR;

    @ApiModelProperty(value = "Disableflag for pool disposition", name = "dsppoldftflg", required = true)
    private String dsppoldftflg = NULLSTR;

    @ApiModelProperty(value = "Levels for parent contracts in foreign charges pool defaulting", name = "fcppntlev", required = true)
    private long fcppntlev;

    @ApiModelProperty(value = "net amount calculated", name = "netamt", required = true)
    private BigDecimal netamt = BigDecimal.ZERO;

    @ApiModelProperty(value = "他行收费信息列表", name = "setfol", required = true)
    private List<SetfolVo> setfol;

    //国外收费是否可见
    private String invisibleFlag;

    public void reset() {
        if (maceog == null) {
            maceog = "";
        }
        if (macbog == null) {
            macbog = "";
        }
        if (maceogold == null) {
            maceogold = "";
        }
        if (macbogold == null) {
            macbogold = "";
        }
        if (dsppoldft == null) {
            dsppoldft = "";
        }
        if (dsppoldftflg == null) {
            dsppoldftflg = "";
        }
        if (netamt == null) {
            netamt = Decimals.ZERO_SCALE2;
        }
        if (setfol == null) {
            setfol = new ArrayList<>();
        }
        for (SetfolVo setfolVo : setfol) {
            setfolVo.reset();
        }
    }
}
