Skip to content

Commit

Permalink
Create TransactionFactory class
Browse files Browse the repository at this point in the history
  • Loading branch information
Solveig Natvig committed May 24, 2026
1 parent 3f2aacc commit 74e51ac
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/Model/TransactionFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package Model;

/**
* Factory for creating transaction objects
*/
public class TransactionFactory {

/**
* Create purchase transaction
*/
public static Transaction createPurchase(Share share, int week) {
return new Purchase(share, week);
}

/**
* Create sale transaction
*/
public static Transaction createSale(Share share, int week) {
return new Sale(share, week);
}

}

0 comments on commit 74e51ac

Please sign in to comment.