package com.brilliance.isc.bo.model;

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.bo.Trd;
import com.brilliance.isc.bo.Trt;
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 Trdgrp 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 Trd rec;

    private Trt blk;

    private Tracbs 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 Trd();
        }
        if (blk == null) {
            blk = new Trt();
        }
        if (cbs == null) {
            cbs = new Tracbs();
        }
        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();
    }
}
