package com.brilliance.isc.bo;

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

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

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


/**
 * TABLE:fec:FEC - Fee Condition and Calculation Rule
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Fec {

    //Internal Unique ID of FEC Fee Condition Rule
    private String inr = NULLSTR;

    //INR of Related FEE Record
    private String feeinr = NULLSTR;

    //Type of Condition
    private String feepri = NULLSTR;

    //Table Name
    private String objtyp = NULLSTR;

    //Relevant Object for Special Conditions or Empty
    private String objinr = NULLSTR;

    //Begin Date Incl.
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date begdat = NULLDATE;

    //End Date Excl.
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date enddat = NULLDATE;

    //Calculation Base
    private String calcbs = NULLSTR;

    //Calculation Code
    private String calfcc = NULLSTR;

    //Low Amount Incl.
    private  BigDecimal lowamt  = Decimals.ZERO_SCALE2;

    //High Amount Excl.
    private  BigDecimal higamt  = Decimals.ZERO_SCALE2;

    //Maximum Currency
    private String maxcur = NULLSTR;

    //Maximum Amount
    private  BigDecimal maxamt  = Decimals.ZERO_SCALE2;

    //Maximum Code
    private String maxfcc = NULLSTR;

    //Minimum Currency
    private String mincur = NULLSTR;

    //Minimum Amount/Value
    private  BigDecimal minamt  = Decimals.ZERO_SCALE2;

    //Minimum for Complete Validity
    private  BigDecimal minamttot  = Decimals.ZERO_SCALE2;

    //Amount to be Settled in Advance
    private  BigDecimal amtsetall  = Decimals.ZERO_SCALE2;

    //Minimum Code
    private String minfcc = NULLSTR;

    //Amount per Unit
    private  BigDecimal untamt  = Decimals.ZERO_SCALE2;

    //Rate Calculation
    private  BigDecimal ratcal  = Decimals.ZERO_SCALE6;

    //Rate Currency
    private String ratcur = NULLSTR;

    //Rate Code
    private String ratfcc = NULLSTR;

    //Reference Rate
    private String ratirs = NULLSTR;

    //Rate Type for Increase/Decrease
    private String ratirsinc = NULLSTR;

    //Mode of Settlement
    private String setmod = NULLSTR;

    //Settle from
    private String setbeg = NULLSTR;

    //Settle to
    private String setend = NULLSTR;

    //Period Type
    private String pertyp = NULLSTR;

    //Type of Tiers
    private String tirtyp = NULLSTR;

    //Minimum Periods
    private  int permin ;

    //Start Period Tier 2
    private  int perbegtr2 ;

    //Rate Tier 2
    private  BigDecimal perrattr2  = Decimals.ZERO_SCALE6;

    //Minimum for Period Tier 2
    private  BigDecimal permintr2  = Decimals.ZERO_SCALE2;

    //Start Period Tier 3
    private  int perbegtr3 ;

    //Rate Tier 3
    private  BigDecimal perrattr3  = Decimals.ZERO_SCALE6;

    //Minimum for Period Tier 3
    private  BigDecimal permintr3  = Decimals.ZERO_SCALE2;

    //Start Period Tier 4
    private  int perbegtr4 ;

    //Rate Tier 4
    private  BigDecimal perrattr4  = Decimals.ZERO_SCALE6;

    //Minimum for Period Tier 4
    private  BigDecimal permintr4  = Decimals.ZERO_SCALE2;

    //Start Period Tier 5
    private  int perbegtr5 ;

    //Rate Tier 5
    private  BigDecimal perrattr5  = Decimals.ZERO_SCALE6;

    //Minimum for Period Tier 5
    private  BigDecimal permintr5  = Decimals.ZERO_SCALE2;

    //Start Period Tier 6
    private  int perbegtr6 ;

    //Rate Tier 6
    private  BigDecimal perrattr6  = Decimals.ZERO_SCALE6;

    //Minimum for Period Tier 6
    private  BigDecimal permintr6  = Decimals.ZERO_SCALE2;

    //Start Period Tier 7
    private  int perbegtr7 ;

    //Rate Tier 7
    private  BigDecimal perrattr7  = Decimals.ZERO_SCALE6;

    //Minimum for Period Tier 7
    private  BigDecimal permintr7  = Decimals.ZERO_SCALE2;

    //Start Amount Tier 2
    private  BigDecimal amtbegtr2  = Decimals.ZERO_SCALE2;

    //Rate by Amount Tier 2
    private  BigDecimal amtrattr2  = Decimals.ZERO_SCALE6;

    //Start Amount Tier 3
    private  BigDecimal amtbegtr3  = Decimals.ZERO_SCALE2;

    //Rate by Amount Tier 3
    private  BigDecimal amtrattr3  = Decimals.ZERO_SCALE6;

    //Start Amount Tier 4
    private  BigDecimal amtbegtr4  = Decimals.ZERO_SCALE2;

    //Rate by Amount Tier 4
    private  BigDecimal amtrattr4  = Decimals.ZERO_SCALE6;

    //Version Counter
    private String ver = NULLSTR;

    //Disposition Defaulting
    private String colltr = NULLSTR;

    //Type of Settlement
    private String settyp = NULLSTR;

    //Automatic Settlement
    private String setflg = NULLSTR;

    //Settl. Period
    private String setperflg = NULLSTR;

    //Flag, if Amount Can or Must be Changed
    private String setchgflg = NULLSTR;

    //Period Type Previous Periods
    private String pertypprv = NULLSTR;

    //Minimum Period Count
    private  int minpercnt ;

    //Maximum Period Count
    private  int maxpercnt ;

    //Maximum Periods Covered by Condition
    private  int maxpercov ;

    //Base Amount
    private  BigDecimal basamt  = Decimals.ZERO_SCALE2;

    //Maximum for Period Tier 2
    private  BigDecimal permaxtr2  = Decimals.ZERO_SCALE2;

    //Maximum for Period Tier 3
    private  BigDecimal permaxtr3  = Decimals.ZERO_SCALE2;

    //Maximum for Period Tier 4
    private  BigDecimal permaxtr4  = Decimals.ZERO_SCALE2;

    //Maximum for Period Tier 5
    private  BigDecimal permaxtr5  = Decimals.ZERO_SCALE2;

    //Maximum for Period Tier 6
    private  BigDecimal permaxtr6  = Decimals.ZERO_SCALE2;

    //Maximum for Period Tier 7
    private  BigDecimal permaxtr7  = Decimals.ZERO_SCALE2;

    //Recalculation
    private String clcdifflg = NULLSTR;

    //Entity Group of Fee Condition
    private String etgextkey = NULLSTR;

    //Calculation Rule
    private String calrul = NULLSTR;

    //Amount Flag
    private String amtflg = NULLSTR;
}