Subversion Repositories SmartDukaan

Rev

Rev 34374 | Rev 34378 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34374 Rev 34377
Line 3597... Line 3597...
3597
        }
3597
        }
3598
 
3598
 
3599
    }
3599
    }
3600
    private static final NavigableMap<Double, Double> discountMap = new TreeMap<>();
3600
    private static final NavigableMap<Double, Double> discountMap = new TreeMap<>();
3601
    static {
3601
    static {
3602
        discountMap.put(6*ProfitMandiConstants.ONE_LAC, 0.2);   // Up to 6 -> 20%
3602
        discountMap.put(6*ProfitMandiConstants.ONE_LAC-1, 0.2);   // Up to 6 -> 20%
3603
        discountMap.put(10*ProfitMandiConstants.ONE_LAC, 0.25);  // 6-10 -> 25%
3603
        discountMap.put(10*ProfitMandiConstants.ONE_LAC-1, 0.25);  // 6-10 -> 25%
3604
        discountMap.put(20*ProfitMandiConstants.ONE_LAC, 0.3); // Above 10 -> 30%
3604
        discountMap.put(20*ProfitMandiConstants.ONE_LAC-1, 0.3); // Above 10 -> 30%
3605
        discountMap.put(Double.MAX_VALUE, 0.4); // Above 10 -> 30%
3605
        discountMap.put(Double.MAX_VALUE, 0.4); // Above 10 -> 30%
3606
    }
3606
    }
3607
    public  BigDecimal getSuggestedLimit(double investmentValue) {
3607
    public  BigDecimal getSuggestedLimit(double investmentValue) {
3608
        double percentageValue = discountMap.ceilingEntry(investmentValue).getValue();
3608
        double percentageValue = discountMap.ceilingEntry(investmentValue).getValue();
3609
        return BigDecimal.valueOf(investmentValue * percentageValue);
3609
        return BigDecimal.valueOf(investmentValue * percentageValue);