-
Notifications
You must be signed in to change notification settings - Fork 0
/
Seller.java
69 lines (62 loc) · 2.01 KB
/
Seller.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import java.util.ArrayList;
import java.util.List;
public class Seller extends BaseInfo{
private String companyName;
private List<Product> productList;
private Wallet wallet;
private boolean isApproved;
public Seller(String username,String password,String email,String companyName){
super(username,password,email);
this.companyName=companyName;
this.productList=new ArrayList<>();
this.wallet=new Wallet();
this.isApproved=false;
}
public String getCompanyName(){
return companyName;
}
public void setCompanyName(String companyName){
this.companyName=companyName;
}
public List<Product> getProductList(){
return productList;
}
public void setProductList(List<Product> productList){
this.productList=productList;
}
public Wallet getWallet(){
return wallet;
}
public void setWallet(Wallet wallet){
this.wallet=wallet;
}
public void approve() {
this.isApproved = true;
}
public boolean isApproved(){
return isApproved;
}
public void setApproved(boolean isApproved){
this.isApproved=isApproved;
}
public void addProduct(Product product){
if(isApproved){
this.productList.add(product);
System.out.println("Product added to the seller's product list");
}
else {
System.out.println("Seller is not approved to add products");
}
}
public void requestApproval() {
// Logic to send a request for approval can be implemented here
System.out.println("Request for approval has been sent to the admin.");}
@Override
public void displayAccountDetails(){
System.out.println("Seller user Account : ");
System.out.println("Company NAME : "+companyName);
System.out.println("Email : "+getEmail());
System.out.println("Wallet balance : $" +wallet);
System.out.println("Approved: " + (isApproved ? "Yes" : "No"));
}
}