package dev.banking.model; /** * Base class for all transaction types. */ public abstract class Transaction { private final int amount; protected Transaction(int amount) { if (amount <= 0) { throw new IllegalArgumentException( "Transaction amount must be positive." ); } this.amount = amount; } public int getAmount() { return amount; } }