diff --git a/docs/AboutUs.md b/docs/AboutUs.md
index 1b6824c19a..9fa86d2e04 100644
--- a/docs/AboutUs.md
+++ b/docs/AboutUs.md
@@ -6,4 +6,4 @@ Display | Name | Github Profile | Portfolio
 | Naychi | [Github](https://github.com/NaychiMin/tp) | [Portfolio](team/naychimin.md)
 | Zi Yi | [Github](https://github.com/ziyi105) | [Portfolio](team/ziyi105.md)
| Dexter Hoon | [Github](https://github.com/DextheChik3n) | [Portfolio](team/dexthechik3n.md)
- | Chua Zhong Heng | [Github](https://github.com/Cazh1/tp) | [Portfolio](team/cazh1.md)
\ No newline at end of file
+ | Chua Zhong Heng | [Github](https://github.com/Cazh1/tp) | [Portfolio](team/cazh1.md)
diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index 75d74f9645..7075f588dc 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -205,17 +205,21 @@ When the `execute()` method of AddOrderCommand is invoked in Main, the parsed `o
A `Chef` object is then created to process the order by running `cookDish()`.
This method first checks if the order has already been completed by running `order.getIsCompleted()`.
-If the order has not been completed, the `showDeleteMesage()` in the Ui component is triggered to display a message to show the user that the dish is being 'prepared'.
+If the order has not been completed, the `showChefMesage()` in the Ui component is triggered to display a message to show the user that the dish is being 'prepared'.
An ArrayList of Ingredients, ingredientList, is retrieved from the `order` object by `order.getIngredientList()`.
-This ingredientList is passed into the `pantry` object in `pantry.decreaseIngredientsStock()` to process the ingredients used from the pantry stock.
-The order is then marked as completed by `order.setComplete()`
+This ingredientList is passed into the `pantry` object in `pantry.isDishCook()` to process the ingredients used from the pantry stock.
+This method returns a boolean, true if there is sufficient ingredients in the pantry, false is insufficient.
+The order completeness status is updated by the boolean method, passing it into `order.setComplete()`
Returning to the AddOrderCommand, the `order` object is checked to be completed again by running `order.getIsCompleted()`.
-This verifies that the ingredientList has been successfully retrieved and passed into `pantry.decreaseIngredientsStock()` to run without errors.
+This verifies that the has been successfully completed.
After verifying that the order has been completed, the cost of the order is added to the total order by `orderList.addCost()`.
+The total cost is the shown to the user using `ui.showOrderStatus`.
+Lastly, the pantry checks on the remaining ingredients in stock and calculates the potential future dishes able to be made with the remaining stock, using `pantry.calculateDishAvailability()`.
-The total sum of orders in the `orderList` object is retrieved using `orderList.getTotalCost()`.
-This is then passed into Ui using `ui.showTotalCost()` to display a message to the user with the total order cost.
+If the order has been marked incomplete, the details of the orderedDish is retrieved from `Order` using `order.getOrderedDish()`.
+This is then passed on to the `Pantry` to figure out the missing ingredients, by `pantry.calculateMaxDishes()`.
+Lastly, the user is shown a message informing that the order has not been completed due to the lack of ingredients using `ui.showIncompleteOrder()`.
### Next Day
A `next_day` command can be used advance the current day.
diff --git a/docs/UserGuide.md b/docs/UserGuide.md
index bc6d219d49..099390343d 100644
--- a/docs/UserGuide.md
+++ b/docs/UserGuide.md
@@ -211,14 +211,14 @@ Format: `list_menu`
Example:
```
-+-----------------------------------------+
-| Ah, behold, the grand menu of delights! |
-+--------------------------+--------------+
-| Dish Name | Price |
-+--------------------------+--------------+
-| 1. chicken rice | $2.50 |
-| 2. chicken curry | $4.30 |
-+-----------------------------------------+
++-------------------------------------------------------+
+| Ah, behold, the grand menu of delights! |
++----------------------------------------+--------------+
+| Dish Name | Price |
++----------------------------------------+--------------+
+| 1. chicken rice | $2.50 |
+| 2. chicken curry | $4.30 |
++-------------------------------------------------------+
```
@@ -286,6 +286,8 @@ Adds an order consisting of dishes off the menu to an order list
Format: `add_order name/DISH_NAME qty/DISH_QTY`
+* The `DISH_QTY` must be a positive integer number.
+
Example:
```
> add_order name/chicken rice qty/2
@@ -301,22 +303,23 @@ Available Dishes: 8
Dish: chicken curry
Available Dishes: 4
```
-* The `DISH_QTY` must be a positive integer number.
-
-Adds an order to the current business day
-Format: `add_order name/DISH_NAME qty/QUANTITY`
+However, if there is insufficient ingredients in the pantry required for the desired dish quantity,
+the following message will be shown, prompting the user to `buy_ingredient`
-Example: `add_order name/chicken rice qty/2`
-
-Output:
-```
+```agsl
+> add_order name/chicken rice qty/2
I'm busy crafting your selected dish in the virtual kitchen of your dreams. Bon appétit!
-Is order completed?: true
-Total orderList cost: $4.00
++----------------------------------------+--------------+--------------+
+| Restock | Current | Needed |
++----------------------------------------+--------------+--------------+
+| chicken | 0g | 200g |
++----------------------------------------------------------------------+
+| rice | 0g | 100g |
++----------------------------------------------------------------------+
+Please restock ingredients before preparing the order :)
```
-
### Showing total sales : `list_total_sales`
Displays the dishes sold and total sales for each from Day 1 to the current day that
the cafe is operating on.
@@ -361,6 +364,8 @@ Example: `list_sale day/2`
Output:
- list_sale day/2 lists the dishes sold along with the total sales for day 2.
+
+
```
+---------------------------------------------------------------------------+
| Day 2: |
@@ -374,6 +379,7 @@ Output:
| Total for day: | $12.00 |
+---------------------------------------------------------------------------+
```
+
### Advancing to the next day: `next_day`
Proceeds to the next business day
diff --git a/docs/diagrams/sequence/AddOrderCommand_execute.puml b/docs/diagrams/sequence/AddOrderCommand_execute.puml
index 71cf13001f..bea75401c2 100644
--- a/docs/diagrams/sequence/AddOrderCommand_execute.puml
+++ b/docs/diagrams/sequence/AddOrderCommand_execute.puml
@@ -40,10 +40,24 @@ autonumber
activate ":Pantry"
return
return
- opt order.getIsComplete()
+ destroy ":Chef"
+ alt order.getIsComplete()
":AddOrderCommand" -> ":OrderList" : addCost(order : Order)
- activate ":OrderList"
- return
+ activate ":OrderList"
+ return
+ ":AddOrderCommand" -> ":Ui" : showOrderStatus(totalCost : String)
+ activate ":Ui"
+ return
+ else
+ ":AddOrderCommand" -> ":Order" : getOrderedDish()
+ activate ":Order"
+ return orderedDish : Dish
+ ":AddOrderCommand" -> ":Pantry" : calculateMaxDishes(orderedDish : Dish, menu : Menu, order : Order)
+ activate ":Pantry"
+ return
+ ":AddOrderCommand" -> ":Ui" : showIncompleteOrder()
+ activate ":Ui"
+ return
end
return
@enduml
\ No newline at end of file
diff --git a/docs/images/aboutUs/zhongheng.jpg b/docs/images/aboutUs/zhongheng.jpg
new file mode 100644
index 0000000000..9aff6000ce
Binary files /dev/null and b/docs/images/aboutUs/zhongheng.jpg differ
diff --git a/docs/images/class/AddOrderCommandClass.png b/docs/images/class/AddOrderCommandClass.png
index 924dca2ed5..0615cee9ca 100644
Binary files a/docs/images/class/AddOrderCommandClass.png and b/docs/images/class/AddOrderCommandClass.png differ
diff --git a/docs/images/class/ListMenuCommandClass.png b/docs/images/class/ListMenuCommandClass.png
index 8073ec6f3a..2119f14c07 100644
Binary files a/docs/images/class/ListMenuCommandClass.png and b/docs/images/class/ListMenuCommandClass.png differ
diff --git a/docs/images/class/NextDayCommandClass.png b/docs/images/class/NextDayCommandClass.png
index e4422a4e48..ba3adefc2d 100644
Binary files a/docs/images/class/NextDayCommandClass.png and b/docs/images/class/NextDayCommandClass.png differ
diff --git a/docs/images/class/PreviousDayCommandClass.png b/docs/images/class/PreviousDayCommandClass.png
index 14f91293f2..769fb2400c 100644
Binary files a/docs/images/class/PreviousDayCommandClass.png and b/docs/images/class/PreviousDayCommandClass.png differ
diff --git a/docs/images/sequence/AddDishCommand_execute.png b/docs/images/sequence/AddDishCommand_execute.png
index 115205ae34..741cd1c8d1 100644
Binary files a/docs/images/sequence/AddDishCommand_execute.png and b/docs/images/sequence/AddDishCommand_execute.png differ
diff --git a/docs/images/sequence/AddOrderCommand_execute.png b/docs/images/sequence/AddOrderCommand_execute.png
index 91196ab29c..9326ecbaa2 100644
Binary files a/docs/images/sequence/AddOrderCommand_execute.png and b/docs/images/sequence/AddOrderCommand_execute.png differ
diff --git a/docs/images/sequence/ListMenuCommand_execute.png b/docs/images/sequence/ListMenuCommand_execute.png
index a38d67a4d9..bdb1496d94 100644
Binary files a/docs/images/sequence/ListMenuCommand_execute.png and b/docs/images/sequence/ListMenuCommand_execute.png differ
diff --git a/docs/images/sequence/NextDayCommand_execute.png b/docs/images/sequence/NextDayCommand_execute.png
index b5f1296eff..2daefd13b4 100644
Binary files a/docs/images/sequence/NextDayCommand_execute.png and b/docs/images/sequence/NextDayCommand_execute.png differ
diff --git a/docs/images/sequence/PreviousDayCommand_execute.png b/docs/images/sequence/PreviousDayCommand_execute.png
index 65ace4b7f2..f47f9b40d8 100644
Binary files a/docs/images/sequence/PreviousDayCommand_execute.png and b/docs/images/sequence/PreviousDayCommand_execute.png differ
diff --git a/src/main/java/seedu/cafectrl/CafeCtrl.java b/src/main/java/seedu/cafectrl/CafeCtrl.java
index da399ecd72..470d8bcf3f 100644
--- a/src/main/java/seedu/cafectrl/CafeCtrl.java
+++ b/src/main/java/seedu/cafectrl/CafeCtrl.java
@@ -39,7 +39,7 @@ public class CafeCtrl {
private CafeCtrl() {
initLogger();
this.ui = new Ui();
- this.storage = new Storage(this.ui);
+ this.storage = new Storage(ui);
this.pantry = this.storage.loadPantryStock();
this.menu = this.storage.loadMenu();
this.sales = this.storage.loadOrderList(menu);
@@ -74,7 +74,7 @@ private void run() {
}
} while (!command.isExit());
- this.storage.saveAll(this.menu, this.sales, this.pantry);
+ storage.saveAll(menu, sales, pantry);
logger.info("CafeCtrl terminated.");
}
diff --git a/src/main/java/seedu/cafectrl/command/AddOrderCommand.java b/src/main/java/seedu/cafectrl/command/AddOrderCommand.java
index ceda5c53bf..918b8434ee 100644
--- a/src/main/java/seedu/cafectrl/command/AddOrderCommand.java
+++ b/src/main/java/seedu/cafectrl/command/AddOrderCommand.java
@@ -8,7 +8,6 @@
import seedu.cafectrl.data.Chef;
import seedu.cafectrl.data.dish.Dish;
-import seedu.cafectrl.ui.Messages;
import seedu.cafectrl.ui.Ui;
import java.util.logging.Logger;
@@ -45,13 +44,13 @@ public void execute() {
if (order.getIsComplete()) {
orderList.addCost(order);
String totalCost = dollarValue.format(order.getTotalOrderCost());
- ui.showOrderStatus(Messages.COMPLETE_ORDER, totalCost);
+ ui.showOrderStatus(totalCost);
pantry.calculateDishAvailability(menu, order);
} else {
//pass in dish only and not entire menu
Dish orderedDish = order.getOrderedDish();
pantry.calculateMaxDishes(orderedDish, menu, order);
- ui.showToUser(Messages.INCOMPLETE_ORDER);
+ ui.showIncompleteOrder();
}
}
diff --git a/src/main/java/seedu/cafectrl/command/BuyIngredientCommand.java b/src/main/java/seedu/cafectrl/command/BuyIngredientCommand.java
index f370c27b7f..faa5ea4616 100644
--- a/src/main/java/seedu/cafectrl/command/BuyIngredientCommand.java
+++ b/src/main/java/seedu/cafectrl/command/BuyIngredientCommand.java
@@ -10,6 +10,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import static seedu.cafectrl.ui.Ui.OFFSET_LIST_INDEX;
+
//@@author ShaniceTang
/**
* The BuyIngredientCommand class represents a command to buy ingredients and add them to the pantry.
@@ -73,7 +75,7 @@ private void addIngredient() {
ingredients.set(i, ingredient);
}
- for (int i = ingredients.size() - ui.OFFSET_LIST_INDEX; i >= finalIndex; i--) {
+ for (int i = ingredients.size() - OFFSET_LIST_INDEX; i >= finalIndex; i--) {
Ingredient ingredient = ingredients.get(i);
buildBuyIngredientMessage(ingredient);
}
diff --git a/src/main/java/seedu/cafectrl/command/ListMenuCommand.java b/src/main/java/seedu/cafectrl/command/ListMenuCommand.java
index 7dcdc5b520..c203347213 100644
--- a/src/main/java/seedu/cafectrl/command/ListMenuCommand.java
+++ b/src/main/java/seedu/cafectrl/command/ListMenuCommand.java
@@ -8,6 +8,7 @@
import java.text.DecimalFormat;
import java.util.logging.Logger;
+//@@author Cazh1
/**
* Lists all dishes in the menu to the user.
*/
diff --git a/src/main/java/seedu/cafectrl/command/ListSaleByDayCommand.java b/src/main/java/seedu/cafectrl/command/ListSaleByDayCommand.java
index 2335589404..8d374cbfce 100644
--- a/src/main/java/seedu/cafectrl/command/ListSaleByDayCommand.java
+++ b/src/main/java/seedu/cafectrl/command/ListSaleByDayCommand.java
@@ -1,7 +1,6 @@
package seedu.cafectrl.command;
import seedu.cafectrl.CafeCtrl;
-import seedu.cafectrl.data.Menu;
import seedu.cafectrl.data.Sales;
import seedu.cafectrl.ui.ErrorMessages;
import seedu.cafectrl.ui.Ui;
@@ -19,13 +18,11 @@ public class ListSaleByDayCommand extends Command {
private final int day;
private final Ui ui;
private final Sales sales;
- private final Menu menu;
- public ListSaleByDayCommand(int day, Ui ui, Sales sales, Menu menu) {
+ public ListSaleByDayCommand(int day, Ui ui, Sales sales) {
this.day = day;
this.ui = ui;
this.sales = sales;
- this.menu = menu;
}
@Override
diff --git a/src/main/java/seedu/cafectrl/command/ListTotalSalesCommand.java b/src/main/java/seedu/cafectrl/command/ListTotalSalesCommand.java
index e402e8073a..9187616c3f 100644
--- a/src/main/java/seedu/cafectrl/command/ListTotalSalesCommand.java
+++ b/src/main/java/seedu/cafectrl/command/ListTotalSalesCommand.java
@@ -1,7 +1,6 @@
package seedu.cafectrl.command;
import seedu.cafectrl.CafeCtrl;
-import seedu.cafectrl.data.Menu;
import seedu.cafectrl.data.Sales;
import seedu.cafectrl.ui.Ui;
@@ -13,12 +12,10 @@ public class ListTotalSalesCommand extends Command {
private static Logger logger = Logger.getLogger(CafeCtrl.class.getName());
private Sales sales;
private Ui ui;
- private Menu menu;
- public ListTotalSalesCommand(Sales sales, Ui ui, Menu menu) {
+ public ListTotalSalesCommand(Sales sales, Ui ui) {
this.sales = sales;
this.ui = ui;
- this.menu = menu;
}
@Override
diff --git a/src/main/java/seedu/cafectrl/command/NextDayCommand.java b/src/main/java/seedu/cafectrl/command/NextDayCommand.java
index ebeba34d99..236fddc60f 100644
--- a/src/main/java/seedu/cafectrl/command/NextDayCommand.java
+++ b/src/main/java/seedu/cafectrl/command/NextDayCommand.java
@@ -8,6 +8,7 @@
import java.util.logging.Logger;
+//@@author Cazh1
public class NextDayCommand extends Command {
public static final String COMMAND_WORD = "next_day";
public static final String MESSAGE_USAGE = "To travel to next day:\n"
diff --git a/src/main/java/seedu/cafectrl/command/PreviousDayCommand.java b/src/main/java/seedu/cafectrl/command/PreviousDayCommand.java
index 1fe391797b..d098fc1a85 100644
--- a/src/main/java/seedu/cafectrl/command/PreviousDayCommand.java
+++ b/src/main/java/seedu/cafectrl/command/PreviousDayCommand.java
@@ -6,6 +6,7 @@
import java.util.logging.Logger;
+//@@author Cazh1
public class PreviousDayCommand extends Command{
public static final String COMMAND_WORD = "previous_day";
public static final String MESSAGE_USAGE = "To go back to previous day:\n" + COMMAND_WORD;
diff --git a/src/main/java/seedu/cafectrl/parser/Parser.java b/src/main/java/seedu/cafectrl/parser/Parser.java
index 24344299b1..e127192510 100644
--- a/src/main/java/seedu/cafectrl/parser/Parser.java
+++ b/src/main/java/seedu/cafectrl/parser/Parser.java
@@ -150,10 +150,10 @@ public Command parseCommand(Menu menu, String userInput, Ui ui,
return preparePreviousDay(ui, currentDate);
case ListTotalSalesCommand.COMMAND_WORD:
- return prepareShowSales(sales, menu, ui, arguments);
+ return prepareShowSales(sales, ui, arguments);
case ListSaleByDayCommand.COMMAND_WORD:
- return prepareShowSalesByDay(arguments, ui, sales, menu);
+ return prepareShowSalesByDay(arguments, ui, sales);
default:
logger.warning(ErrorMessages.UNKNOWN_COMMAND_MESSAGE);
@@ -194,7 +194,7 @@ private static Command prepareEditPriceCommand(Menu menu, String arguments, Ui u
int dishIndexGroup = 1;
int newPriceGroup = 2;
int dishIndex;
- float newPrice;
+ float newDishPrice;
try {
String dishIndexText = matcher.group(dishIndexGroup).trim();
@@ -218,13 +218,13 @@ private static Command prepareEditPriceCommand(Menu menu, String arguments, Ui u
}
try {
- newPrice = parsePriceToFloat(matcher.group(newPriceGroup).trim());
+ newDishPrice = parsePriceToFloat(matcher.group(newPriceGroup).trim());
} catch (ParserException e) {
logger.log(Level.WARNING, "Invalid price!", e);
return new IncorrectCommand(e.getMessage(), ui);
}
- return new EditPriceCommand(dishIndex, newPrice, menu, ui);
+ return new EditPriceCommand(dishIndex, newDishPrice, menu, ui);
}
//@@author DextheChik3n
@@ -813,13 +813,12 @@ private static Command prepareNextDay(Ui ui, Sales sales, CurrentDate currentDat
* Prepares a command to display all sales items.
*
* @param sale The Sales object containing sales data.
- * @param menu The Menu object representing the cafe's menu.
* @param ui The Ui object for user interface interactions.
* @return A ShowSalesCommand instance for viewing all sales items.
*/
- private static Command prepareShowSales(Sales sale, Menu menu, Ui ui, String arguments) {
+ private static Command prepareShowSales(Sales sale, Ui ui, String arguments) {
if (arguments.isEmpty()) {
- return new ListTotalSalesCommand(sale, ui, menu);
+ return new ListTotalSalesCommand(sale, ui);
} else {
return new IncorrectCommand(ErrorMessages.WRONG_LIST_TOTAL_SALES_FORMAT, ui);
}
@@ -832,10 +831,9 @@ private static Command prepareShowSales(Sales sale, Menu menu, Ui ui, String arg
* @param arguments The arguments containing the day for which sales are to be displayed.
* @param ui The Ui object for user interface interactions.
* @param sales The Sales object containing sales data.
- * @param menu The Menu object representing the cafe's menu.
* @return A ShowSalesByDayCommand instance for viewing sales items on a specific day.
*/
- private static Command prepareShowSalesByDay(String arguments, Ui ui, Sales sales, Menu menu) {
+ private static Command prepareShowSalesByDay(String arguments, Ui ui, Sales sales) {
final Pattern showSaleByDayPattern = Pattern.compile(SHOW_SALE_BY_DAY_ARGUMENT_STRING);
Matcher matcher = showSaleByDayPattern.matcher(arguments.trim());
@@ -850,7 +848,7 @@ private static Command prepareShowSalesByDay(String arguments, Ui ui, Sales sale
if (day < 0) {
throw new Exception();
}
- return new ListSaleByDayCommand(day, ui, sales, menu);
+ return new ListSaleByDayCommand(day, ui, sales);
} catch (Exception e) {
return new IncorrectCommand(ErrorMessages.INVALID_DAY_FORMAT, ui);
}
diff --git a/src/main/java/seedu/cafectrl/storage/Storage.java b/src/main/java/seedu/cafectrl/storage/Storage.java
index 4e9f8fee00..56a87b8ebb 100644
--- a/src/main/java/seedu/cafectrl/storage/Storage.java
+++ b/src/main/java/seedu/cafectrl/storage/Storage.java
@@ -73,6 +73,7 @@ private boolean isFileCorrupted(ArrayList encodedStringArrayList) {
}
} catch (Exception e) {
isHashStringTampered = true;
+ logger.log(Level.INFO, "Tampered Hash string");
return true;
}
return false;
diff --git a/src/main/java/seedu/cafectrl/ui/Ui.java b/src/main/java/seedu/cafectrl/ui/Ui.java
index 08fd772a71..d5000b7674 100644
--- a/src/main/java/seedu/cafectrl/ui/Ui.java
+++ b/src/main/java/seedu/cafectrl/ui/Ui.java
@@ -268,13 +268,16 @@ public void showTotalCost(String dollarCost) {
showToUser("Total order cost: $" + dollarCost);
}
- public void showOrderStatus(String orderStatus, String totalCost) {
+ public void showOrderStatus(String totalCost) {
printLine();
- showToUser(orderStatus);
+ showToUser(Messages.COMPLETE_ORDER);
showTotalCost(totalCost);
printLine();
showDishAvailabilityMessage();
}
+ public void showIncompleteOrder() {
+ showToUser(Messages.INCOMPLETE_ORDER);
+ }
public void showDishAvailabilityMessage() {
showToUser(Messages.AVAILABLE_DISHES);
diff --git a/src/test/java/seedu/cafectrl/command/ListSaleByDayCommandTest.java b/src/test/java/seedu/cafectrl/command/ListSaleByDayCommandTest.java
index b379ab351a..9d1262d4f7 100644
--- a/src/test/java/seedu/cafectrl/command/ListSaleByDayCommandTest.java
+++ b/src/test/java/seedu/cafectrl/command/ListSaleByDayCommandTest.java
@@ -69,7 +69,7 @@ public void execute_validDayIndex_listSaleOfDay() {
int dayToListSale = 1;
ListSaleByDayCommand listSaleByDayCommand =
- new ListSaleByDayCommand(dayToListSale, ui, sales, menu);
+ new ListSaleByDayCommand(dayToListSale, ui, sales);
listSaleByDayCommand.execute();
String actualOutput = baos.toString().trim();
@@ -130,7 +130,7 @@ public void execute_invalidDayIndex_errorMessage() {
int dayToListSale = 200;
ListSaleByDayCommand listSaleByDayCommand =
- new ListSaleByDayCommand(dayToListSale, ui, sales, menu);
+ new ListSaleByDayCommand(dayToListSale, ui, sales);
listSaleByDayCommand.execute();
String actualOutput = baos.toString().trim();
@@ -184,7 +184,7 @@ public void execute_validDayNoSales_showNoSalesMessage() {
int dayToListSale = 2;
ListSaleByDayCommand listSaleByDayCommand =
- new ListSaleByDayCommand(dayToListSale, ui, sales, menu);
+ new ListSaleByDayCommand(dayToListSale, ui, sales);
listSaleByDayCommand.execute();
String actualOutput = baos.toString().trim();
diff --git a/src/test/java/seedu/cafectrl/command/ListTotalSalesCommandCommandTest.java b/src/test/java/seedu/cafectrl/command/ListTotalSalesCommandCommandTest.java
index 9b70079f05..50ac260144 100644
--- a/src/test/java/seedu/cafectrl/command/ListTotalSalesCommandCommandTest.java
+++ b/src/test/java/seedu/cafectrl/command/ListTotalSalesCommandCommandTest.java
@@ -74,7 +74,7 @@ public void execute_existingSales_listTotalSales() {
System.setOut(consoleStream);
ListTotalSalesCommand listTotalSalesCommand =
- new ListTotalSalesCommand(sales, ui, menu);
+ new ListTotalSalesCommand(sales, ui);
listTotalSalesCommand.execute();
String actualOutput = baos.toString().trim();
@@ -127,7 +127,7 @@ public void execute_noSales_showNoSalesMessage() {
System.setOut(consoleStream);
ListTotalSalesCommand listTotalSalesCommand =
- new ListTotalSalesCommand(sales, ui, menu);
+ new ListTotalSalesCommand(sales, ui);
listTotalSalesCommand.execute();
String actualOutput = baos.toString().trim();