package com.brilliance.isc.vo.model;

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

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

    //Relevant amount of parent contract
    private BigDecimal relpntamt = Decimals.ZERO_SCALE3;
    //Latest Due date possible
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date maxmatdat;

    private TrdVo rec;

    private TrtVo blk;

    private TracbsVo cbs;

    private PtsptaVo rmb;

    private PtsptaVo fip;

    private PtsptaVo iss;

    private PtsptaVo oap;

    private PtsptaVo ose;

    @Override
    public void reset() {
        if (rec == null) {
            rec = new TrdVo();
        }
        if (blk == null) {
            blk = new TrtVo();
        }
        if (cbs == null) {
            cbs = new TracbsVo();
        }
        cbs.reset();
        if (rmb == null) {
            rmb = new PtsptaVo();
        }
        rmb.reset();
        if (fip == null) {
            fip = new PtsptaVo();
        }
        fip.reset();
        if (iss == null) {
            iss = new PtsptaVo();
        }
        iss.reset();
        if (oap == null) {
            oap = new PtsptaVo();
        }
        oap.reset();
        if (ose == null) {
            ose = new PtsptaVo();
        }
        ose.reset();
    }
}
