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

import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.bo.model.Ptsaddg;
import com.brilliance.isc.common.liaall.vo.LiaallVo;
import com.brilliance.isc.common.liaccv.vo.LiaccvVo;
import com.brilliance.isc.common.limmod.vo.*;
import com.brilliance.isc.common.transaction.vo.TrnInfo;
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.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 LimRequest<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 = "表外记账", name = "liaall", required = true)
    private LiaallVo liaall;

    @ApiModelProperty(value = "表外保证金", name = "liaccv", required = true)
    private LiaccvVo liaccv;
    @ApiModelProperty(value = "额度界面角色要素", name = "limpts", required = true)
    private LimptsVo limpts;
    /**
     * 额度查询信息
     */
    private LimQueryVo limQueryVo;
    /**
     * 额度查询信息
     */
    private LimQueryVo oldlimQueryVo;
    /**
     * 额度试算信息
     */
    private LimPreCalVo limPreCalVo;

    /**
     * 查询勾选币种标志
     */
    private List<String> limQueryDisabled;
    /**
     * 试算按钮控制标志
     */
    private String limPreCalDisabled;
    /**
     * 交易信息，收单行标志
     */
    private TrnInfo trnInfo;
    @ApiModelProperty(hidden = true)
    private LimmodVo limmodVo;

    @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 (limmodVo == null) {
            limmodVo = new LimmodVo(this);
        }
        if (limQueryVo == null) {
            limQueryVo = new LimQueryVo();
        }
        if(oldlimQueryVo == null ){
            oldlimQueryVo=new LimQueryVo();
        }
        if(limPreCalVo == null){
            limPreCalVo=new LimPreCalVo();
        }
        limPreCalVo.reset();
        oldlimQueryVo.reset();
        limQueryVo.reset();
        limmodVo.reset();
    }
}
