Skip to content

Commit

Permalink
Merge pull request #88 from Joellimjr/v2.0
Browse files Browse the repository at this point in the history
add help message
  • Loading branch information
Joellimjr committed Apr 1, 2024
2 parents c65306a + 42b096c commit 9af2555
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 41 deletions.
78 changes: 39 additions & 39 deletions StockMasterData.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
1. | apple iphone | Qty: 10 pieces | Cat: electronics | BuyPrice: $100.0 | SellPrice: $500.0
2. | apple | Qty: 180 pieces | Cat: fruits | BuyPrice: $4.0 | SellPrice: $5.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: fruit | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: N | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
1. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
2. | apple | Qty: 175 pieces | Cat: fruits | BuyPrice: $4.0 | SellPrice: $5.0
3. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
4. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
5. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
6. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
7. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
8. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
9. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
10. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
11. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
12. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
13. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
14. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
15. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
16. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
17. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
18. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
19. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
20. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
21. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
22. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
23. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
24. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
25. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
26. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
27. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
28. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
29. | testItem | Qty: 1 EA | Cat: fruit | BuyPrice: $1.0 | SellPrice: $10.0
30. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
31. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
32. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
33. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
34. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
35. | testItem | Qty: 1 EA | Cat: N | BuyPrice: $1.0 | SellPrice: $10.0
36. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
37. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
38. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
39. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
40. | testItem | Qty: 1 EA | Cat: null | BuyPrice: $1.0 | SellPrice: $10.0
8 changes: 8 additions & 0 deletions TransactionLogs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Date: 2024-04-01 21:32:44
Transaction ID: 1
Item Name: apple
Quantity: 5
Unit Price: 3.0
Total Price: 15.0
Profit: -5.0

26 changes: 25 additions & 1 deletion src/main/java/common/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,31 @@
public class Messages {
public static final String DIVIDER = "----------------";
public static final String INVALID_COMMAND = "Invalid command detected. Type 'help' for list of valid commands";
public static final String HELP = "Commands: ....";
public static final String HELP =
" _________________________________________________________________________________________\n" +
"| STOCKMASTER |\n" +
"|_________________________________________________________________________________________|\n" +
"| Commands | Format |\n" +
"|----------|------------------------------------------------------------------------------|\n" +
"| list | list |\n" +
"|----------|------------------------------------------------------------------------------|\n" +
"| add | add [ITEM_NAME] qty/[QUANTITY_OF_ITEM] /[UNIT_OF_MEASUREMENT] cat/[CATEGORY] |\n" +
"| | buy/[BUY_PRICE] sell/[SELL_PRICE] |\n" +
"|----------|------------------------------------------------------------------------------|\n" +
"| sell | sell [ITEM_NAME] qty/[SELL_QUANTITY] price/[SELL_PRICE] |\n" +
"|----------|------------------------------------------------------------------------------|\n" +
"| edit | edit [ITEM_NAME] name/[NEW_NAME] qty/[NEW_QUANTITY] uom/[NEW_UOM] |\n" +
"| | cat/[NEW_CATEGORY] |\n" +
"| | (use AT LEAST 1 of: qty/, uom/, cat/) |\n" +
"|----------|------------------------------------------------------------------------------|\n" +
"| delete | del [ITEM_NAME] |\n" +
"|----------|------------------------------------------------------------------------------|\n" +
"| find | 1. find [KEYWORD] - to search the entire Item List |\n" +
"| | 2. find /filter1/filter2 [KEYWORD] - to search under the filters* |\n" +
"| | * (filters: item, qty, uom, cat, buy, sell) |\n" +
"|----------|------------------------------------------------------------------------------|\n" +
"| exit | exit |\n" +
"|__________|______________________________________________________________________________|\n";
public static final String INVALID_ADD_FORMAT ="Invalid command format. Please use format: " + "\n" +
"'add [ITEM_NAME] qty/[QUANTITY_OF_ITEM] /[UNIT_OF_MEASUREMENT] cat/[CATEGORY] " +
"buy/[BUY_PRICE] sell/[SELL_PRICE]'";
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ui/TextUi.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ public static <T> void showInventoryList(ArrayList<T> arrayList) {
}

public static void showSellMessage(String item, int sellQuantity, int remainingQuantity, float sellPrice) {
float totalValue = sellQuantity * sellPrice;
replyToUser("Quantity of " + item + " sold: " + sellQuantity + ", for: $" + sellPrice + "\n" +
"Quantity remaining: " + remainingQuantity
"Quantity remaining: " + remainingQuantity + "\n" +
"Total value sold: " + totalValue
);
}

Expand Down

0 comments on commit 9af2555

Please sign in to comment.