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.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.FecismVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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 SetfegVo extends AbstractCommonVo {

    @ApiModelProperty(value = "current MAC (begin processing)", name = "macbog", required = true)
    private String macbog;

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

    @ApiModelProperty(value = "current MAC (end processing)", name = "maceog", required = true)
    private String maceog;

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

    @ApiModelProperty(value = "Roles for which fees are to be settled", name = "roldspmdyflg", required = true)
    private String roldspmdyflg;

    @ApiModelProperty(value = "Control stream for CBS amounts", name = "wrkcbsamtcon", required = true)
    private IStream wrkcbsamtcon = new StreamImpl();

//    @ApiModelProperty(value = "CBS Handling in Settlement", name = "setcbs", required = true)
//    private SetcbsVo setcbs;

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

    //Default correspondence charges
    private  String corchaflg = NULLSTR;

    @ApiModelProperty(value = "我行收费信息列表", name = "setfel", required = true)
    private List<SetfelVo> setfel;

    //Levels for parent contracts in Fee pool defaulting
    private int feppntlev;

    private FecismVo fecism;

    public void reset() {
        if (macbog == null) {
            macbog = NULLSTR;
        }
        if (macbogold == null) {
            macbogold = NULLSTR;
        }
        if (maceog == null) {
            maceog = NULLSTR;
        }
        if (maceogold == null) {
            maceogold = NULLSTR;
        }
        if (roldspmdyflg == null) {
            roldspmdyflg = NULLSTR;
        }
        if (wrkcbsamtcon == null) {
            wrkcbsamtcon = new StreamImpl();
        }
        if (dsppoldft == null) {
            dsppoldft = NULLSTR;
        }
        if (dsppoldftflg == null) {
            dsppoldftflg = NULLSTR;
        }
        if (setfel == null) {
            setfel = new ArrayList<>();
        }
        if (fecism == null) {
            fecism = new FecismVo();
        }
        setfel.forEach((value) -> {
            value.reset();
        });
    }
}
