Skip to content

Commit

Permalink
salcalculator construktor
Browse files Browse the repository at this point in the history
  • Loading branch information
EspenTinius committed Feb 19, 2026
1 parent f3e7f30 commit f20e90b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/SaleCalculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package edu.ntnu.idi.idatt2003.g40.mappe;

import java.math.BigDecimal;

public class SaleCalculator implements TransactionCalculator {

private static final BigDecimal COMMISSION_RATE = new BigDecimal("0.01");
private static final BigDecimal TAX_RATE = new BigDecimal("0.30");

private final BigDecimal purchasePrice;
private final BigDecimal salesPrice;
private final BigDecimal quantity;

public SaleCalculator(Share share) {
this.purchasePrice = share.getPurchasePrice();
this.salesPrice = share.getStock().getSalesPrice();
this.quantity = share.getQuantity();
}
}

0 comments on commit f20e90b

Please sign in to comment.