Skip to content

Commit 8556696

Browse files
feat: add business logic method
1 parent b003a88 commit 8556696

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/itau/transferencia/entities/Customer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ public static boolean isSameAccount(Customer customer, Customer other) {
6262
return customer.getAccount().equals(other.getAccount());
6363
}
6464

65-
public boolean hasFundsToTransfer(BigDecimal amount) {
65+
public boolean canTransfer(BigDecimal amount) {
6666
return this.getBalance().compareTo(amount) >= 0;
6767
}
6868

69+
public boolean cannotTransfer(BigDecimal amount) {
70+
return !this.canTransfer(amount);
71+
}
72+
6973
public Long getId() {
7074
return id;
7175
}

0 commit comments

Comments
 (0)