diff --git a/src/main/java/Model/Account/Account.java b/src/main/java/Model/Account/Account.java index d14b5b0..5607641 100644 --- a/src/main/java/Model/Account/Account.java +++ b/src/main/java/Model/Account/Account.java @@ -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; diff --git a/src/main/java/Model/Account/Boss.java b/src/main/java/Model/Account/Boss.java index cda53f3..e5972fa 100644 --- a/src/main/java/Model/Account/Boss.java +++ b/src/main/java/Model/Account/Boss.java @@ -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; } diff --git a/src/main/java/Model/Account/Customer.java b/src/main/java/Model/Account/Customer.java index 7543d3d..5d30c05 100644 --- a/src/main/java/Model/Account/Customer.java +++ b/src/main/java/Model/Account/Customer.java @@ -19,6 +19,14 @@ public class Customer extends Account implements Serializable { private static final long serialVersionUID = 6529685098267757690L; + public void setCustomerOffCodes(HashMap 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); diff --git a/src/main/java/Model/Account/Salesman.java b/src/main/java/Model/Account/Salesman.java index 1e0dfd3..b4a4dc7 100644 --- a/src/main/java/Model/Account/Salesman.java +++ b/src/main/java/Model/Account/Salesman.java @@ -72,6 +72,22 @@ public String toStringForRequest() { " Username: " + this.getUsername() + " Company: " + this.getCompany(); } + public ArrayList getRequestIDs() { + return requestIDs; + } + + public void setRequestIDs(ArrayList requestIDs) { + this.requestIDs = requestIDs; + } + + public void setCommercials(ArrayList commercials) { + this.commercials = commercials; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + public String toString() { String result = super.toString(); result += "Company: " + this.getCompany() + "\n"; diff --git a/src/main/java/Model/Auction/Auction.java b/src/main/java/Model/Auction/Auction.java index 9749bb2..2ed6a20 100644 --- a/src/main/java/Model/Auction/Auction.java +++ b/src/main/java/Model/Auction/Auction.java @@ -112,6 +112,10 @@ public void setStartingDate(Date startingDate) { this.startingDate = startingDate; } + public static long getSerialVersionUID() { + return serialVersionUID; + } + public Date getEndingDate() { return endingDate; } diff --git a/src/main/java/Model/Auction/AuctionChat.java b/src/main/java/Model/Auction/AuctionChat.java index 6b64585..905a17b 100644 --- a/src/main/java/Model/Auction/AuctionChat.java +++ b/src/main/java/Model/Auction/AuctionChat.java @@ -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 getSender() { + return sender; + } + + public void setSender(ArrayList sender) { + this.sender = sender; + } + + public ArrayList getMessage() { + return message; + } + + public void setMessage(ArrayList message) { + this.message = message; + } + public String getChatStringFormatted() { return sender.toString() + " - " + message.toString(); } diff --git a/src/main/java/Model/Cart/Cart.java b/src/main/java/Model/Cart/Cart.java index 3db9b7d..65472e1 100644 --- a/src/main/java/Model/Cart/Cart.java +++ b/src/main/java/Model/Cart/Cart.java @@ -218,6 +218,18 @@ private String toStringSingleItem(Triplet item) { return result; } + public void setCartID(String cartID) { + this.cartID = cartID; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public void setAllItems(ArrayList> allItems) { + this.allItems = allItems; + } + //updated with Triplet public String toString() { StringBuilder result = new StringBuilder("Here are all of your products in cart:"); diff --git a/src/main/java/Model/Category/Category.java b/src/main/java/Model/Category/Category.java index 3735488..edab4e3 100644 --- a/src/main/java/Model/Category/Category.java +++ b/src/main/java/Model/Category/Category.java @@ -125,6 +125,14 @@ private StringBuilder toStringParentCategory() { return result; } + public void setAllProductIDs(ArrayList allProductIDs) { + this.allProductIDs = allProductIDs; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + public String toStringForBoss() { String father = this.getParentCategoryName(); if (father == null) { diff --git a/src/main/java/Model/Log/BuyLog.java b/src/main/java/Model/Log/BuyLog.java index 1aa01f4..678d18d 100644 --- a/src/main/java/Model/Log/BuyLog.java +++ b/src/main/java/Model/Log/BuyLog.java @@ -165,6 +165,66 @@ private String toStringOffCodeUsage() { } } + public ArrayList> getAllItems() { + return allItems; + } + + public void setAllItems(ArrayList> allItems) { + this.allItems = allItems; + } + + public void setPrices(HashMap prices) { + this.prices = prices; + } + + public void setPricesAfterSale(HashMap 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" + diff --git a/src/main/java/Model/Log/Log.java b/src/main/java/Model/Log/Log.java index bdc2eb5..e394cd3 100644 --- a/src/main/java/Model/Log/Log.java +++ b/src/main/java/Model/Log/Log.java @@ -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 getBuyerOfProduct(String productID) { Set customerUserNames = new HashSet<>(); for (BuyLog buyLog : Storage.allBuyLogs) { diff --git a/src/main/java/Model/Log/SellLog.java b/src/main/java/Model/Log/SellLog.java index 274d035..6fcfc20 100644 --- a/src/main/java/Model/Log/SellLog.java +++ b/src/main/java/Model/Log/SellLog.java @@ -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!"; diff --git a/src/main/java/Model/Off/Off.java b/src/main/java/Model/Off/Off.java index 0ffbc32..fd20125 100644 --- a/src/main/java/Model/Off/Off.java +++ b/src/main/java/Model/Off/Off.java @@ -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(); diff --git a/src/main/java/Model/Off/OffCode.java b/src/main/java/Model/Off/OffCode.java index 6b1f31f..c317940 100644 --- a/src/main/java/Model/Off/OffCode.java +++ b/src/main/java/Model/Off/OffCode.java @@ -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 getUserNamesCanUseIt() { + return userNamesCanUseIt; + } + + public void setUserNamesCanUseIt(ArrayList 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"); diff --git a/src/main/java/Model/Off/Sale.java b/src/main/java/Model/Off/Sale.java index 2b28d95..cd6f911 100644 --- a/src/main/java/Model/Off/Sale.java +++ b/src/main/java/Model/Off/Sale.java @@ -145,6 +145,26 @@ public static ArrayList getAllAuthenticSales(String salesmanID) { return sales; } + public ArrayList getProductIDs() { + return productIDs; + } + + public void setProductIDs(ArrayList 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(""); diff --git a/src/main/java/Model/Off/SpecialOffCode.java b/src/main/java/Model/Off/SpecialOffCode.java index b3c8de5..0e65cdf 100644 --- a/src/main/java/Model/Off/SpecialOffCode.java +++ b/src/main/java/Model/Off/SpecialOffCode.java @@ -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) { diff --git a/src/main/java/Model/Product/Comment.java b/src/main/java/Model/Product/Comment.java index 873ca91..4041007 100644 --- a/src/main/java/Model/Product/Comment.java +++ b/src/main/java/Model/Product/Comment.java @@ -24,6 +24,7 @@ public class Comment implements Serializable { private static final long serialVersionUID = 6529685098267757690L; + public Comment(String title, String text, String senderUsername, String productID) { this.title = title; this.text = text; @@ -128,6 +129,46 @@ public static boolean isThereCommentForProduct(String productID) { return false; } + public void setCommentID(String commentID) { + this.commentID = commentID; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public void setProductID(String productID) { + this.productID = productID; + } + + public Confirmation getConfirmationState() { + return confirmationState; + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + public String getCommentID() { return commentID; } diff --git a/src/main/java/Model/Product/Point.java b/src/main/java/Model/Product/Point.java index 8e77a2f..9f66aff 100644 --- a/src/main/java/Model/Product/Point.java +++ b/src/main/java/Model/Product/Point.java @@ -73,6 +73,10 @@ public String getProductID() { return productID; } + public static long getSerialVersionUID() { + return serialVersionUID; + } + public void setProductID(String productID) { this.productID = productID; } diff --git a/src/main/java/Model/Product/Product.java b/src/main/java/Model/Product/Product.java index 982fd79..a868499 100644 --- a/src/main/java/Model/Product/Product.java +++ b/src/main/java/Model/Product/Product.java @@ -370,6 +370,58 @@ public String toStringForSalesmanView(String salesmanUser) { return result.toString(); } + public void setSalesmanIDs(ArrayList salesmanIDs) { + this.salesmanIDs = salesmanIDs; + } + + public void setProductID(String productID) { + this.productID = productID; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public HashMap getIsOnSale() { + return isOnSale; + } + + public void setIsOnSale(HashMap isOnSale) { + this.isOnSale = isOnSale; + } + + public HashMap getHasBeenDeleted() { + return hasBeenDeleted; + } + + public void setHasBeenDeleted(HashMap hasBeenDeleted) { + this.hasBeenDeleted = hasBeenDeleted; + } + + public HashMap getConfirmationState() { + return confirmationState; + } + + public void setConfirmationState(HashMap confirmationState) { + this.confirmationState = confirmationState; + } + + public HashMap getRemainder() { + return remainder; + } + + public void setRemainder(HashMap remainder) { + this.remainder = remainder; + } + + public HashMap getPrice() { + return price; + } + + public void setPrice(HashMap price) { + this.price = price; + } + public String createID() { return RandomString.createID("Product"); } diff --git a/src/main/java/Model/Request/ChangeProductRequest.java b/src/main/java/Model/Request/ChangeProductRequest.java index a014fdd..bc7b7d0 100644 --- a/src/main/java/Model/Request/ChangeProductRequest.java +++ b/src/main/java/Model/Request/ChangeProductRequest.java @@ -46,6 +46,26 @@ public void updateAttributeWithUpdatedInfo() throws ParseException { } } + public ProductAttributes getAttribute() { + return attribute; + } + + public void setAttribute(ProductAttributes attribute) { + this.attribute = attribute; + } + + public String getUpdatedInfo() { + return updatedInfo; + } + + public void setUpdatedInfo(String updatedInfo) { + this.updatedInfo = updatedInfo; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + public String toStringChangeProduct() { Product product = (Product) object; Salesman salesman = (Salesman) Storage.getAccountWithUsername(accountUsername); diff --git a/src/main/java/Model/Request/ChangeSaleRequest.java b/src/main/java/Model/Request/ChangeSaleRequest.java index 36d8c86..97c6261 100644 --- a/src/main/java/Model/Request/ChangeSaleRequest.java +++ b/src/main/java/Model/Request/ChangeSaleRequest.java @@ -35,6 +35,26 @@ public void updateAttributeWithUpdatedInfo() throws ParseException { } } + public SaleAttributes getAttribute() { + return attribute; + } + + public void setAttribute(SaleAttributes attribute) { + this.attribute = attribute; + } + + public String getUpdatedInfo() { + return updatedInfo; + } + + public void setUpdatedInfo(String updatedInfo) { + this.updatedInfo = updatedInfo; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + public String toStringChangeSale() { return "Salesman username: " + accountUsername + "\n" + "Attribute to change: " + attribute.name().toLowerCase() + "\n" diff --git a/src/main/java/Model/Request/Request.java b/src/main/java/Model/Request/Request.java index 6db2e49..0cb3267 100644 --- a/src/main/java/Model/Request/Request.java +++ b/src/main/java/Model/Request/Request.java @@ -296,6 +296,26 @@ public String toString() { return null; } + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + public void setObject(Object object) { + this.object = object; + } + + public void setRequestType(RequestType requestType) { + this.requestType = requestType; + } + + public void setConfirmation(Confirmation confirmation) { + this.confirmation = confirmation; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + public String getObjectID() { if (object instanceof Product) { return ((Product) object).getProductID(); diff --git a/src/main/java/Model/Storage.java b/src/main/java/Model/Storage.java index 859a59a..2f103b9 100644 --- a/src/main/java/Model/Storage.java +++ b/src/main/java/Model/Storage.java @@ -86,7 +86,7 @@ public static boolean isThereOffCodeWithID(String offCodeID) { return getOffCodeById(offCodeID) != null; } - public static OffCode getOffCodeById (String offCodeID) { + public static OffCode getOffCodeById(String offCodeID) { for (OffCode offCode : allOffCodes) { if (offCode.getOffCodeID().equals(offCodeID)) return offCode; } @@ -165,4 +165,83 @@ public static ArrayList getAllSalesByUsername(String username) { } } + public static ArrayList getAllComments() { + return allComments; + } + + public static void setAllComments(ArrayList allComments) { + Storage.allComments = allComments; + } + + public static ArrayList getAllPoints() { + return allPoints; + } + + public static void setAllPoints(ArrayList allPoints) { + Storage.allPoints = allPoints; + } + + public static void setAllProducts(ArrayList allProducts) { + Storage.allProducts = allProducts; + } + + public static ArrayList getAllOffCodes() { + return allOffCodes; + } + + public static void setAllOffCodes(ArrayList allOffCodes) { + Storage.allOffCodes = allOffCodes; + } + + public static ArrayList getAllSales() { + return allSales; + } + + public static void setAllSales(ArrayList allSales) { + Storage.allSales = allSales; + } + + public static ArrayList getAllBuyLogs() { + return allBuyLogs; + } + + public static void setAllBuyLogs(ArrayList allBuyLogs) { + Storage.allBuyLogs = allBuyLogs; + } + + public static void setAllCategories(ArrayList allCategories) { + Storage.allCategories = allCategories; + } + + public static void setAllAccounts(ArrayList allAccounts) { + Storage.allAccounts = allAccounts; + } + + public static ArrayList getAllSpecialOffCodes() { + return allSpecialOffCodes; + } + + public static void setAllSpecialOffCodes(ArrayList allSpecialOffCodes) { + Storage.allSpecialOffCodes = allSpecialOffCodes; + } + + public static ArrayList getAllCarts() { + return allCarts; + } + + public static void setAllCarts(ArrayList allCarts) { + Storage.allCarts = allCarts; + } + + public static void setAllRequests(ArrayList allRequests) { + Storage.allRequests = allRequests; + } + + public static ArrayList getAllSellLogs() { + return allSellLogs; + } + + public static void setAllSellLogs(ArrayList allSellLogs) { + Storage.allSellLogs = allSellLogs; + } } diff --git a/src/main/java/Model/Supporter/Chat.java b/src/main/java/Model/Supporter/Chat.java index 2244f3e..cc4e555 100644 --- a/src/main/java/Model/Supporter/Chat.java +++ b/src/main/java/Model/Supporter/Chat.java @@ -107,6 +107,38 @@ public ArrayList getChatsOfSupporterWithUsername(String supporterUsername) return buffer; } + public void setFirstPerson(String firstPerson) { + this.firstPerson = firstPerson; + } + + public void setSecondPerson(String secondPerson) { + this.secondPerson = secondPerson; + } + + public void setSender(ArrayList sender) { + this.sender = sender; + } + + public void setMessage(ArrayList message) { + this.message = message; + } + + public static ArrayList getAllChats() { + return allChats; + } + + public static void setAllChats(ArrayList allChats) { + Chat.allChats = allChats; + } + + public boolean isHasUnreadMessage() { + return hasUnreadMessage; + } + + public void setHasUnreadMessage(boolean hasUnreadMessage) { + this.hasUnreadMessage = hasUnreadMessage; + } + public ArrayList getChatsOfAccountWithUsername(String userUsername) { ArrayList buffer = new ArrayList<>(); for (Chat chat : allChats) { diff --git a/src/main/java/Model/Supporter/Supporter.java b/src/main/java/Model/Supporter/Supporter.java index 1d506ea..c46a1a4 100644 --- a/src/main/java/Model/Supporter/Supporter.java +++ b/src/main/java/Model/Supporter/Supporter.java @@ -41,6 +41,22 @@ public static ArrayList getOnlineSupporters() { return onlineSupporters; } + public void setUsername(String username) { + this.username = username; + } + + public void setPassword(String password) { + this.password = password; + } + + public static void setAllSupporters(ArrayList allSupporters) { + Supporter.allSupporters = allSupporters; + } + + public static void setOnlineSupporters(ArrayList onlineSupporters) { + Supporter.onlineSupporters = onlineSupporters; + } + public static Supporter getSupporterWithUsername(String username) { for (Supporter supporter : allSupporters) { if (supporter.getUsername().equals(username)) { diff --git a/src/main/java/Model/Token/Token.java b/src/main/java/Model/Token/Token.java index eb482b9..3cfd6ac 100644 --- a/src/main/java/Model/Token/Token.java +++ b/src/main/java/Model/Token/Token.java @@ -82,6 +82,30 @@ public static ArrayList getOnlineUsers() { return arrayList; } + public static ArrayList getToken() { + return token; + } + + public static void setToken(ArrayList token) { + Token.token = token; + } + + public static long getOnlineTimeDuration() { + return ONLINE_TIME_DURATION; + } + + public static void setOnlineUsers(HashMap onlineUsers) { + Token.onlineUsers = onlineUsers; + } + + public static SecureRandom getSecureRandom() { + return secureRandom; + } + + public static Base64.Encoder getBase64Encoder() { + return base64Encoder; + } + public static String getUsernameFromToken(String token) { token = decode(token); return token.split("--caption neuer--")[1];