-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdmin.java
49 lines (44 loc) · 1.41 KB
/
Admin.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.util.ArrayList;
import java.util.List;
public class Admin extends BaseInfo {
private List <Seller> approvalRequests;
private boolean approved;
private List<AddFundsRequest> aprq;
public Admin(String username,String password, String email){
super(username,password,email);
this.approvalRequests = new ArrayList<>();
this.aprq = new ArrayList<>();
}
public void approveSeller(Seller seller){
approvalRequests.add(seller);
}
public List<Seller> getApprovalRequests() {
return approvalRequests;
}
@Override
public void displayAccountDetails(){
System.out.println("Admin user account : ");
System.out.println("Username :" + getUsername());
System.out.println("Email : "+getEmail());
}
public void approveSellers(Seller seller) {
seller.setApproved(true);
approvalRequests.remove(seller);
}
public void denySeller(Seller seller) {
approvalRequests.remove(seller);
}
public void setApproved(boolean approved) {
this.approved = approved;
}
public void approveFundsRequest(AddFundsRequest request) {
request.getUser().addToWallet(request.getAmount());
aprq.remove(request);
}
public void addApprovalRequest(AddFundsRequest request) {
aprq.add(request);
}
public List<AddFundsRequest> getAprq() {
return aprq;
}
}