Skip to content

Commit f94a57b

Browse files
committed
chore: delete JBey
1 parent a0b838d commit f94a57b

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.codedifferently.lesson17.bank;
2+
3+
import java.util.Set;
4+
5+
import com.codedifferently.lesson17.bank.exceptions.InvalidBusinessAccountException;
6+
7+
/**
8+
* Creates a business account.
9+
*
10+
* @param accountNumber The account number.
11+
* @param owners The owners of the account.
12+
* @param initialBalance The initial balance of the account.
13+
*/
14+
public class BusinessCheckingAccount extends CheckingAccount {
15+
public BusinessCheckingAccount(
16+
String accountNumber, Set<Customer> owners, double initialBalance) {
17+
super(accountNumber, owners, initialBalance);
18+
19+
boolean hasBusinessOwner = owners.stream().anyMatch(Customer::isBusiness);
20+
if (!hasBusinessOwner) {
21+
throw new InvalidBusinessAccountException("At least one owner must be a business.");
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.codedifferently.lesson17.bank.exceptions;
2+
3+
public class InvalidBusinessAccountException extends RuntimeException {
4+
public InvalidBusinessAccountException(String message) {
5+
super(message);
6+
}
7+
}

lesson_27/JBey/package-lock.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)