package com.brilliance.isc.bo.lc;

import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.bo.model.Aammod;
import com.brilliance.isc.common.json.BigDecimalSerialize;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.math.BigDecimal;

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

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

    private Aammod aammod;

    private String maxcur = NULLSTR;

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal maxamt = Decimals.ZERO_SCALE2;

    private String engcur = NULLSTR;

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal engamt = Decimals.ZERO_SCALE2;

    private String pansta = NULLSTR;

    private String ramrol = NULLSTR;

    private String ramrollab = NULLSTR;

    private String cre707flg = NULLSTR;

    private int amenbr;

    private String tag72txt707 = NULLSTR;

    private String nartxtdef = NULLSTR;

    private String nartxtold = NULLSTR;

    private String rejflg = NULLSTR;

    private IStream rejstm = new StreamImpl();

    private int nbr;

    private String amecur = NULLSTR;

    @JsonSerialize(using = BigDecimalSerialize.class)
    private BigDecimal ameamt = Decimals.ZERO_SCALE2;

    private String amedat = NULLSTR;

    private String rejbut = NULLSTR;

    private Lcramep lcrdocamep;

    private Lcramep spcbenamep;

    private Lcramep spcrcbamep;

    private Lcramep lcrgodamep;

    private Lcramep adlcndamep;

    @Override
    public void reset() {
        if (aammod == null) {
            aammod = new Aammod();
        }
        if (lcrdocamep == null) {
            lcrdocamep = new Lcramep();
        }
        if (spcbenamep == null) {
            spcbenamep = new Lcramep();
        }
        if (spcrcbamep == null) {
            spcrcbamep = new Lcramep();
        }
        if (lcrgodamep == null) {
            lcrgodamep = new Lcramep();
        }
        if (adlcndamep == null) {
            adlcndamep = new Lcramep();
        }
    }
}
