package dev.banking.model; /** * Represents a deposit operation. */ public final class DepositTransaction extends Transaction { private final int accountId; public DepositTransaction( int accountId, int amount ) { super(amount); if (accountId < 0) { throw new IllegalArgumentException( "Invalid account id." ); } this.accountId = accountId; } public int getAccountId() { return accountId; } @Override public String toString() { return "DepositTransaction{" + "accountId=" + accountId + ", amount=" + getAmount() + '}'; } }