package com.brilliance.isc.bo.model;

import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.vo.model.DftcreBizInfoVo;
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 Dftcre extends AbstractCommonVo {

    private DftcreBizInfoVo rec;

    private Map<String, Cbb> 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 Dfdgrp dfdgrp;

    private Dftp dftp;

    private String trntyp;

    private BigDecimal dfuamt = BigDecimal.ZERO;

    @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 Dfdgrp();
        }
        dfdgrp.reset();
        if (dftp == null) {
            dftp = new Dftp();
        }
    }
}
