package com.goafanti.common.utils;

import com.goafanti.common.model.TOrderNew;

import java.math.BigDecimal;

public class OrderUtils {


    public static int getLiquidationStatus(TOrderNew t){
        if (t.getSettlementAmount().compareTo(t.getFirstAmount())<0)return 0;
        else if (t.getSettlementAmount().compareTo(t.getFirstAmount())>-1
          &&t.getSettlementAmount().compareTo(t.getTotalAmount())<0)return 1;
        else{
            return 2;
        }
    }

    public static int getLiquidationStatus(BigDecimal total,BigDecimal first,BigDecimal settlement){
        TOrderNew t=new TOrderNew();
        t.setTotalAmount(total);
        t.setFirstAmount(first);
        t.setSettlementAmount(settlement);
        return getLiquidationStatus(t);
    }


}
