Skip to content

Commit

Permalink
Demonstrate Peel.
Browse files Browse the repository at this point in the history
  • Loading branch information
codecop committed Feb 13, 2024
1 parent 2b32401 commit f64ee2f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Java/src/main/java/org/codecop/dependencies/c/Checkout.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
public class Checkout {

public Receipt createReceipt(Money amount) {
Receipt receipt = create(amount);

store(receipt);

return receipt;
}

protected Receipt create(Money amount) {
Receipt receipt = new Receipt();
Money vat = amount.percentage(20);

receipt.setAmount(amount);
receipt.setTax(vat);
receipt.setTotal(amount.add(vat));

store(receipt);

return receipt;
}

Expand Down

0 comments on commit f64ee2f

Please sign in to comment.