39 lines
801 B
Java
39 lines
801 B
Java
package dev.banking.model;
|
|
|
|
public class Transaction {
|
|
|
|
private final TransactionType type;
|
|
|
|
private final int sourceAccountId;
|
|
private final int targetAccountId;
|
|
|
|
private final int amount;
|
|
|
|
public Transaction(
|
|
TransactionType type,
|
|
int sourceAccountId,
|
|
int targetAccountId,
|
|
int amount
|
|
) {
|
|
this.type = type;
|
|
this.sourceAccountId = sourceAccountId;
|
|
this.targetAccountId = targetAccountId;
|
|
this.amount = amount;
|
|
}
|
|
|
|
public TransactionType getType() {
|
|
return type;
|
|
}
|
|
|
|
public int getSourceAccountId() {
|
|
return sourceAccountId;
|
|
}
|
|
|
|
public int getTargetAccountId() {
|
|
return targetAccountId;
|
|
}
|
|
|
|
public int getAmount() {
|
|
return amount;
|
|
}
|
|
} |