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

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.vo.model.BpdgrpVo;
import com.brilliance.isc.vo.model.FinmodVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

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

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class BptbckVo extends AbstractCommonVo {

    //业务摘要信息
    private BizInfoVo rec;
    //currency discount paid back
    private  String dscbckcur = NULLSTR;
    //amount discount paid back
    private BigDecimal dscbckamt = Decimals.ZERO_SCALE3;
    //Cur Packing Credit paid back
    private  String pclbckcur = NULLSTR;
    //amount Packing Credit paid back
    private  BigDecimal pclbckamt = Decimals.ZERO_SCALE3;
    //Amount not to be used for repayment
    private  BigDecimal dscnotuseamt = Decimals.ZERO_SCALE3;
    //total amount financed at start
    private  BigDecimal dscopnamt = Decimals.ZERO_SCALE3;
    //Received for
    private  String rcvextid = NULLSTR;
    //caclulate amount only
    private  String sumonlflg = NULLSTR;
    //If empty, SETDOC\\DOCAMT used for repayment
    private  String docamtrepflg = NULLSTR;
    //Flag set, if Liaall is initialized once
    private  String liaalliniflg = NULLSTR;
    //Settlement Account
    private  String setact = NULLSTR;
    //Settlement Amount
    private  BigDecimal setamt = Decimals.ZERO_SCALE3;
    //Selection Number
    private  int selnbr;

    //old info read X表示已经读了old
    private String oldredflg = NULLSTR;

    private List<BptbckgVo> bptbckg;

    private FinmodVo wrkfinmod;

    private BpdgrpVo wrkbpdgrp;

    private List<Gle4338Vo> gle4338List;

    private Set<String> bmsAccSet;

    @Override
    public void reset() {
        if (rec == null) {
            rec = new BizInfoVo();
        }
        if (bptbckg == null) {
            bptbckg = new ArrayList<>();
        }
        bptbckg.forEach(b -> b.reset());
        if (wrkfinmod == null) {
            wrkfinmod = new FinmodVo();
        }
        wrkfinmod.reset();
        if (wrkbpdgrp == null) {
            wrkbpdgrp = new BpdgrpVo();
        }
        wrkbpdgrp.reset();
        if (gle4338List == null) {
            gle4338List = new ArrayList<>();
        }
        if (bmsAccSet == null) {
            bmsAccSet = new HashSet<>();
        }
    }
}
