Skip to content

Commit

Permalink
Auction Without Chat
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBrave committed Jul 29, 2020
1 parent e52123d commit 06bd0e1
Show file tree
Hide file tree
Showing 25 changed files with 596 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/Model/Account/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public abstract class Account implements Serializable {
private String telephone;
private Role role;
private String imgPath;

public void setRole(Role role) {
this.role = role;
}

private String avatar;
private String ip = null;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/Model/Account/Boss.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public Boss(String username, String password, String firstName, String secondNam
super(username, password, firstName, secondName, Email, telephone, role);
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public String getFatherBoss() {
return fatherBoss;
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/Model/Account/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ public class Customer extends Account implements Serializable {
private static final long serialVersionUID = 6529685098267757690L;


public void setCustomerOffCodes(HashMap<String, Integer> customerOffCodes) {
this.customerOffCodes = customerOffCodes;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public Customer(String username, String password, String firstName, String secondName, String Email, String telephone,
String role, int credit) {
super(username, password, firstName, secondName, Email, telephone, role);
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/Model/Account/Salesman.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ public String toStringForRequest() {
" Username: " + this.getUsername() + " Company: " + this.getCompany();
}

public ArrayList<String> getRequestIDs() {
return requestIDs;
}

public void setRequestIDs(ArrayList<String> requestIDs) {
this.requestIDs = requestIDs;
}

public void setCommercials(ArrayList<String> commercials) {
this.commercials = commercials;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public String toString() {
String result = super.toString();
result += "Company: " + this.getCompany() + "\n";
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/Model/Auction/Auction.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ public void setStartingDate(Date startingDate) {
this.startingDate = startingDate;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public Date getEndingDate() {
return endingDate;
}
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/Model/Auction/AuctionChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ public static AuctionChat getAuctionChat(Auction auction) {
return null;
}

public Auction getAuction() {
return auction;
}

public void setAuction(Auction auction) {
this.auction = auction;
}

public ArrayList<String> getSender() {
return sender;
}

public void setSender(ArrayList<String> sender) {
this.sender = sender;
}

public ArrayList<String> getMessage() {
return message;
}

public void setMessage(ArrayList<String> message) {
this.message = message;
}

public String getChatStringFormatted() {
return sender.toString() + " - " + message.toString();
}
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/Model/Cart/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ private String toStringSingleItem(Triplet<String, String, Integer> item) {
return result;
}

public void setCartID(String cartID) {
this.cartID = cartID;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public void setAllItems(ArrayList<Triplet<String, String, Integer>> allItems) {
this.allItems = allItems;
}

//updated with Triplet
public String toString() {
StringBuilder result = new StringBuilder("Here are all of your products in cart:");
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/Model/Category/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ private StringBuilder toStringParentCategory() {
return result;
}

public void setAllProductIDs(ArrayList<String> allProductIDs) {
this.allProductIDs = allProductIDs;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public String toStringForBoss() {
String father = this.getParentCategoryName();
if (father == null) {
Expand Down
60 changes: 60 additions & 0 deletions src/main/java/Model/Log/BuyLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,66 @@ private String toStringOffCodeUsage() {
}
}

public ArrayList<Triplet<String, String, Integer>> getAllItems() {
return allItems;
}

public void setAllItems(ArrayList<Triplet<String, String, Integer>> allItems) {
this.allItems = allItems;
}

public void setPrices(HashMap<String, Integer> prices) {
this.prices = prices;
}

public void setPricesAfterSale(HashMap<String, Integer> pricesAfterSale) {
this.pricesAfterSale = pricesAfterSale;
}

public void setCustomerUsername(String customerUsername) {
this.customerUsername = customerUsername;
}

public void setBuyLogID(String buyLogID) {
this.buyLogID = buyLogID;
}

public String getOffCodeID() {
return offCodeID;
}

public void setOffCodeID(String offCodeID) {
this.offCodeID = offCodeID;
}

public int getTotalAmountWithOutOffCode() {
return totalAmountWithOutOffCode;
}

public void setTotalAmountWithOutOffCode(int totalAmountWithOutOffCode) {
this.totalAmountWithOutOffCode = totalAmountWithOutOffCode;
}

public int getTotalAmountWithOffCode() {
return totalAmountWithOffCode;
}

public void setTotalAmountWithOffCode(int totalAmountWithOffCode) {
this.totalAmountWithOffCode = totalAmountWithOffCode;
}

public void setDeliveryState(Delivery deliveryState) {
this.deliveryState = deliveryState;
}

public boolean isWasOffCodeUsed() {
return wasOffCodeUsed;
}

public void setWasOffCodeUsed(boolean wasOffCodeUsed) {
this.wasOffCodeUsed = wasOffCodeUsed;
}

@Override
public String toString() {
return "Customer: " + customerUsername + "\n" +
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/Model/Log/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public static boolean hasCustomerBoughtProduct(String username, String productID
return false;
}

public void setDate(Date date) {
this.date = date;
}

public static ArrayList<String> getBuyerOfProduct(String productID) {
Set<String> customerUserNames = new HashSet<>();
for (BuyLog buyLog : Storage.allBuyLogs) {
Expand Down
52 changes: 52 additions & 0 deletions src/main/java/Model/Log/SellLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,58 @@ private String toStringSingleSellLogs() {
return result;
}

public void setSellLogID(String sellLogID) {
this.sellLogID = sellLogID;
}

public BuyLog getBuyLog() {
return buyLog;
}

public void setBuyLog(BuyLog buyLog) {
this.buyLog = buyLog;
}

public String getProductID() {
return productID;
}

public void setProductID(String productID) {
this.productID = productID;
}

public int getProductCount() {
return productCount;
}

public void setProductCount(int productCount) {
this.productCount = productCount;
}

public boolean isWasOnSale() {
return wasOnSale;
}

public void setWasOnSale(boolean wasOnSale) {
this.wasOnSale = wasOnSale;
}

public int getPriceBeforeSale() {
return priceBeforeSale;
}

public void setPriceBeforeSale(int priceBeforeSale) {
this.priceBeforeSale = priceBeforeSale;
}

public int getPriceAfterSale() {
return priceAfterSale;
}

public void setPriceAfterSale(int priceAfterSale) {
this.priceAfterSale = priceAfterSale;
}

public static String getSalesmanSellLogs_StringFormatted(String salesmanID) {
if (!hasSalesmanAnySellLog(salesmanID)) {
return "no sell log yet!";
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/Model/Off/Off.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ public String toString() {
return result;
}


public void setStart(Date start) {
this.start = start;
}

public void setEnd(Date end) {
this.end = end;
}

public void setPercentage(int percentage) {
this.percentage = percentage;
}

protected String dateToLocalDate(Date date) {
ZoneId zoneId = ZoneId.systemDefault();
Instant instant = date.toInstant();
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/Model/Off/OffCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,23 @@ public void reduceNumberOfTimesItCanBeUsed() {

//return string formatted off code for boss menu


public void setOffCodeID(String offCodeID) {
this.offCodeID = offCodeID;
}

public ArrayList<String> getUserNamesCanUseIt() {
return userNamesCanUseIt;
}

public void setUserNamesCanUseIt(ArrayList<String> userNamesCanUseIt) {
this.userNamesCanUseIt = userNamesCanUseIt;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public String toStringForBoss() {
StringBuilder result = new StringBuilder(super.toString());
result.append("Max:").append(ceiling).append("\n");
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/Model/Off/Sale.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ public static ArrayList<Sale> getAllAuthenticSales(String salesmanID) {
return sales;
}

public ArrayList<String> getProductIDs() {
return productIDs;
}

public void setProductIDs(ArrayList<String> productIDs) {
this.productIDs = productIDs;
}

public void setSaleID(String saleID) {
this.saleID = saleID;
}

public Confirmation getConfirmationState() {
return confirmationState;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

public String toStringForTable() {
// StringBuilder result = new StringBuilder(super.toString());
StringBuilder result = new StringBuilder("");
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/Model/Off/SpecialOffCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,46 @@ public void setPercentage(int percentage) {
this.percentage = percentage;
}

public int getTimeInSeconds() {
return timeInSeconds;
}

public void setSpecialOffCodeID(String specialOffCodeID) {
this.specialOffCodeID = specialOffCodeID;
}

public int getDurationInHour() {
return durationInHour;
}

public void setDurationInHour(int durationInHour) {
this.durationInHour = durationInHour;
}

public int getCeiling() {
return ceiling;
}

public boolean isActiveness() {
return activeness;
}

public void setActiveness(boolean activeness) {
this.activeness = activeness;
}

public int getPercentage() {
return percentage;
}

public int getNumberOfTimesItCanBeUsed() {
return numberOfTimesItCanBeUsed;
}

public static long getSerialVersionUID() {
return serialVersionUID;
}

@Override
public void run() {
if (!activeness) {
Expand Down
Loading

0 comments on commit 06bd0e1

Please sign in to comment.