package com.brilliance.isc.vo.lc;

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

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

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

@Data
public class LitameInfo extends AbstractCommonVo {

    private BigDecimal engamt = Decimals.ZERO_SCALE2;

    private BigDecimal maxamt = Decimals.ZERO_SCALE2;

    private BigDecimal ameamt = Decimals.ZERO_SCALE2;

    private String amecur = NULLSTR;

    private BigDecimal newamt = Decimals.ZERO_SCALE2;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date amedat;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date newexpdat;

    private String purpos = NULLSTR;

    private String reqcan = NULLSTR;

    private int amenbr;

    private String trnchato = NULLSTR;

    private String trnfeetxt = NULLSTR;

    private String amemsgdonflg = NULLSTR;

    private String narrativeStructuredText = NULLSTR;

    @Override
    public void reset() {
        if (engamt == null) {
            engamt = Decimals.ZERO_SCALE2;
        }
        if (maxamt == null) {
            maxamt = Decimals.ZERO_SCALE2;
        }
        if (ameamt == null) {
            ameamt = Decimals.ZERO_SCALE2;
        }
        if (newamt == null) {
            newamt = Decimals.ZERO_SCALE2;
        }
    }
}
