package com.brilliance.isc.vo.component.dftcre;

import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.vo.model.CbbVo;
import com.brilliance.isc.vo.model.DfdgrpVo;
import com.brilliance.isc.vo.model.DftcreBizInfoVo;
import com.brilliance.isc.vo.model.DftpVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

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

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

//同业代付
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class DftcreVo extends AbstractCommonVo {

    private DftcreBizInfoVo rec;

    private Map<String, CbbVo> cbsMap;

    private List<PtsptaVo> ptsptaList;

    private  String dfflag = NULLSTR;
    //Origial Currency
    private  String oricur = NULLSTR;
    //Origial Amount
    private BigDecimal oriamt = BigDecimal.ZERO;
    //Exchange Rate
    private  BigDecimal extrat = BigDecimal.ZERO;

    private DfdgrpVo dfdgrp;

    private DftpVo dftp;

    private String trntyp;

    @Override
    public void reset() {
        if (rec == null) {
            rec = new DftcreBizInfoVo();
        }
        if (cbsMap == null) {
            cbsMap = new HashMap<>();
        }
        if (ptsptaList == null) {
            ptsptaList = new ArrayList<>();
        }
        ptsptaList.forEach(p -> p.reset());
        if (dfdgrp == null) {
           dfdgrp = new DfdgrpVo();
        }
        dfdgrp.reset();
        if (dftp == null) {
           dftp = new DftpVo();
        }
    }
}
