Skip to content

Commit

Permalink
feat(SaleCalculator): Implement method for getting total profit
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelsa committed May 13, 2026
1 parent 1183c00 commit 989d98d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,9 @@ public BigDecimal calculateTotal() {
return calculateGross().subtract(calculateCommision()).subtract(calculateTax());
}

// TODO: Javadocs, junit
public BigDecimal calculateProfit() {
return calculateTotal().divide(purchasePrice.multiply(quantity));
}

}

0 comments on commit 989d98d

Please sign in to comment.