package com.brilliance.isc.common.api.usrmd.vo;

import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.bo.Umd;
import com.brilliance.isc.bo.model.Ptsaddg;
import com.brilliance.isc.common.setglg.vo.SetglgVo;
import com.brilliance.isc.common.umdmod.vo.UmdmodVo;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.vo.CipmodVo;
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 java.util.Map;

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

@Data
@ApiModel(value = "统一名单请求信息", description = "统一名单请求信息")
@JsonIgnoreProperties(ignoreUnknown = true)
public class UsrmdRequest<T1 extends BizInfoVo, T2 extends BizAmdInfoVo> extends AbstractCommonVo {

    @ApiModelProperty(value = "当前交易码", name = "transName", required = true)
    private String transName = NULLSTR;

    @ApiModelProperty(value = "当前经办人员ID", name = "userId", required = true)
    private String userId = NULLSTR;

    @ApiModelProperty(value = "业务摘要信息", name = "rec", required = true)
    private T1 rec;

    @ApiModelProperty(value = "业务摘要修改信息", name = "amdrec", required = true)
    private T2 amdRec;

    @ApiModelProperty(value = "CBB列表", name = "cbsMap", required = true)
    private Map<String, Cbb> cbsMap;

    @ApiModelProperty(value = "交易角色参与方列表", name = "ptsList", required = true)
    private List<PtsptaVo> ptsList;
    @ApiModelProperty(value = "角色addition列表", name = "ptsaddg", required = true)
    private List<Ptsaddg> ptsaddg;

    @ApiModelProperty(value = "交易对手信息", name = "bennam", required = true)
    private String bennam;
    /**
     * 人民币
     */
    private CipmodVo cipmodVo;
    /**
     * 费用账务
     */
    private SetglgVo setglgVo;
    /**
     * 界面列表
     */
    private List<Umd> umdList;

    @ApiModelProperty(hidden = true)
    private UmdmodVo umdmodVo;

    @Override
    public void reset() {
        if (rec == null) {
            rec = (T1) new BizInfoVo();
        }
        rec.reset();
        if (amdRec == null) {
            amdRec = (T2) new BizAmdInfoVo();
        }
        amdRec.reset();
        if (ptsList == null) {
            ptsList = new ArrayList<>();
        }

        if (umdmodVo == null) {
            umdmodVo = new UmdmodVo(this);
        }

        if (cipmodVo == null) {
            cipmodVo = new CipmodVo();
        }
        if(setglgVo == null ){
            setglgVo = new SetglgVo();
        }
        setglgVo.reset();
        umdmodVo.reset();
        if (umdList == null) {
            umdList = new ArrayList<>();
        }
    }
}
