From 15198b0b065e27d652a8012ef2edb9d4a2cf0831 Mon Sep 17 00:00:00 2001 From: samuelory Date: Tue, 9 Apr 2024 16:38:21 +0800 Subject: [PATCH] Added colour option to remove command --- .../florizz/command/AddFlowerCommand.java | 41 +---- .../florizz/command/RemoveFlowerCommand.java | 49 ++++-- .../java/florizz/core/FlowerDictionary.java | 13 ++ src/main/java/florizz/core/Parser.java | 27 ++- src/main/java/florizz/core/Ui.java | 70 ++++++-- src/main/java/florizz/objects/Bouquet.java | 5 + src/main/java/florizz/objects/Flower.java | 25 ++- text-ui-test/ACTUAL.TXT | 28 ---- text-ui-test/EXPECTED.TXT | 158 +++++++++++++++++- text-ui-test/input.txt | 19 +++ 10 files changed, 329 insertions(+), 106 deletions(-) delete mode 100644 text-ui-test/ACTUAL.TXT diff --git a/src/main/java/florizz/command/AddFlowerCommand.java b/src/main/java/florizz/command/AddFlowerCommand.java index 8f250b711c..0da5774c07 100644 --- a/src/main/java/florizz/command/AddFlowerCommand.java +++ b/src/main/java/florizz/command/AddFlowerCommand.java @@ -51,11 +51,6 @@ public boolean execute(ArrayList bouquetList, Ui ui) throws FlorizzExce ArrayList matchingFlowers = FlowerDictionary.filterByName(flowerName); - if (matchingFlowers.isEmpty()) { - throw new FlorizzException("Mentioned flower is not in our database." + System.lineSeparator() + - "Check available flowers: `flower` " + System.lineSeparator() + - "Add custom flowers: {{TO BE DONE}}"); - } if (hasColour){ ArrayList matchedFlowerAndColour = FlowerDictionary.filterByColour(matchingFlowers, colour); if (!matchedFlowerAndColour.isEmpty()){ @@ -73,7 +68,7 @@ public boolean execute(ArrayList bouquetList, Ui ui) throws FlorizzExce ui.printAddFlowerSuccess(bouquetList, flowerName, quantity, bouquetName); } } else { - Flower flowerToAdd = chooseColour(ui, matchingFlowers, flowerName); + Flower flowerToAdd = ui.chooseColour(matchingFlowers, flowerName); if (!flowerToAdd.getFlowerName().isBlank()){ bouquetToAddFlower.addFlower(flowerToAdd, this.quantity); if (enableUi) { @@ -89,38 +84,4 @@ public boolean execute(ArrayList bouquetList, Ui ui) throws FlorizzExce return true; } - private Flower chooseColour(Ui ui, ArrayList flowers, String flowerName){ - ui.printAddFlowerColour(flowers, flowerName); - - while (true){ - String colourInput = ui.getInput().trim().toLowerCase(); - try { - switch (colourInput) { - case "back": - ui.printBackPage(); - break; - case "next": - ui.printNextPage(); - break; - case "cancel": - return new Flower(); - default: - Flower.Colour chosenColour = Flower.stringToColour(colourInput); - ArrayList chosenFlowerList = FlowerDictionary.filterByColour(flowers, chosenColour); - if (!chosenFlowerList.isEmpty()){ - return chosenFlowerList.get(0); - } else { - throw new FlorizzException("This flower is not available in this colour, " + - "try typing a colour shown above!"); - } - - } - } catch(FlorizzException error){ - ui.printError(error); - } catch(IllegalArgumentException error){ - System.out.println("Unrecognised input, type a colour that's available for this flower, " + - "or 'cancel' to stop adding a flower."); - } - } - } } diff --git a/src/main/java/florizz/command/RemoveFlowerCommand.java b/src/main/java/florizz/command/RemoveFlowerCommand.java index ecbe7224d8..7ffae0b566 100644 --- a/src/main/java/florizz/command/RemoveFlowerCommand.java +++ b/src/main/java/florizz/command/RemoveFlowerCommand.java @@ -14,6 +14,8 @@ public class RemoveFlowerCommand extends Command { private String flowerName; private Integer quantity; private String bouquetName; + private Flower.Colour colour; + private boolean hasColour = false; public RemoveFlowerCommand(String flowerName, int quantity, String bouquetName) { this.flowerName = flowerName; @@ -21,6 +23,13 @@ public RemoveFlowerCommand(String flowerName, int quantity, String bouquetName) this.bouquetName = bouquetName; } + public RemoveFlowerCommand(String flowerName, Flower.Colour colour, int quantity, String bouquetName) { + this.flowerName = flowerName; + this.quantity = quantity; + this.bouquetName = bouquetName; + this.colour = colour; + hasColour = true; + } @Override public boolean execute(ArrayList bouquetList, Ui ui) throws FlorizzException { logger.entering(RemoveFlowerCommand.class.getName(), "execute"); @@ -39,28 +48,36 @@ public boolean execute(ArrayList bouquetList, Ui ui) throws FlorizzExce "Create a bouquet by using 'new `"); } - boolean doesFlowerExist = false; - Flower flowerToBeAdded = new Flower(); - for (int i = 0; !doesFlowerExist && i < FlowerDictionary.size(); i++) { - if (FlowerDictionary.get(i).getFlowerName().toLowerCase().equals(flowerName)) { - flowerToBeAdded = FlowerDictionary.get(i); - doesFlowerExist = true; - } - } + ArrayList matchingFlowers = FlowerDictionary.filterByName( + bouquetToRemoveFlower.getFlowerList(), flowerName); - if (!doesFlowerExist) { - throw new FlorizzException("Mentioned flower is not in our database." + System.lineSeparator() + - "Check available flowers: `flower` " + System.lineSeparator() + - "Add custom flowers: {{TO BE DONE}}"); - } + if (hasColour){ + ArrayList matchedFlowerAndColour = FlowerDictionary.filterByColour(matchingFlowers, colour); + if (!matchedFlowerAndColour.isEmpty()){ + bouquetToRemoveFlower.removeFlower(matchedFlowerAndColour.get(0),this.quantity); + ui.printRemoveFlowerSuccess(bouquetList, flowerName, quantity, bouquetName); + } else { + throw new FlorizzException("This bouquet does not contain that colour" + + "Type mybouquets to view all your bouquets."); + } + } else if (matchingFlowers.size()==1){ + bouquetToRemoveFlower.removeFlower(matchingFlowers.get(0), this.quantity); + ui.printAddFlowerSuccess(bouquetList, flowerName, quantity, bouquetName); - if (bouquetToRemoveFlower.removeFlower(flowerToBeAdded, this.quantity)) { - ui.printRemoveFlowerSuccess(bouquetList, flowerName, quantity, bouquetName); } else { - ui.printRemoveFlowerUnsuccessful(bouquetList, flowerName, bouquetName); + Flower flowerToRemove = ui.chooseColour(matchingFlowers, flowerName); + if (!flowerToRemove.getFlowerName().isBlank()){ + bouquetToRemoveFlower.removeFlower(flowerToRemove, this.quantity); + ui.printRemoveFlowerSuccess(bouquetList, flowerName, quantity, bouquetName); + } else { + ui.printCancelCommand(); + } + } logger.exiting(RemoveFlowerCommand.class.getName(), "execute"); return true; } + + } diff --git a/src/main/java/florizz/core/FlowerDictionary.java b/src/main/java/florizz/core/FlowerDictionary.java index 6c4f395074..7ec51e0f19 100644 --- a/src/main/java/florizz/core/FlowerDictionary.java +++ b/src/main/java/florizz/core/FlowerDictionary.java @@ -128,6 +128,19 @@ public static ArrayList filterByName(String name) throws FlorizzExceptio return filteredFlowers; } + public static ArrayList filterByName(ArrayList listOfFlowers, String name) throws FlorizzException { + ArrayList filteredFlowers = new ArrayList<>(); + for (Flower flower : listOfFlowers) { + if (flower.getFlowerName().toLowerCase().contains(name.toLowerCase())) { + filteredFlowers.add(flower); + } + } + if (filteredFlowers.isEmpty()) { + throw new FlorizzException("Flower name is unidentified."); + } + return filteredFlowers; + } + /** * Gets a list of flowers that contain the colour search * diff --git a/src/main/java/florizz/core/Parser.java b/src/main/java/florizz/core/Parser.java index 1cf9a7e547..5e422e7738 100644 --- a/src/main/java/florizz/core/Parser.java +++ b/src/main/java/florizz/core/Parser.java @@ -39,6 +39,7 @@ public class Parser { private static final String ADD_FLOWER_AND_COLOUR_REGEX = "(.+)/c(\\s*)(.+)(\\s*)/q(\\s*)(\\d+)(\\s*)/to(.+)"; private static final String REMOVE_FLOWER_REGEX = "(.+)/q(\\s*)(\\d+)(\\s*)/from(.+)"; + private static final String REMOVE_FLOWER_AND_COLOUR_REGEX = "(.+)/c(\\s*)(.+)(\\s*)/q(\\s*)(\\d+)(\\s*)/from(.+)"; private static final String PARSE_OCCASION_REGEX = "^\\s*[A-Za-z]+(?:\\s+[A-Za-z]+)?\\s*$"; private static final String PARSE_COLOUR_REGEX = "^\\s*[A-Za-z]+(?:\\s+[A-Za-z]+)?\\s*$"; private static final String SAVE_BOUQUET_REGEX = "^\\s*(yes|no)\\s*$"; @@ -131,10 +132,14 @@ public static String[] commandHandler(String input) throws FlorizzException { int secondWhitespace = trimmedArgument.indexOf(" "); if (secondWhitespace < 0 && outputs[0].equals("remove")){ throw new FlorizzException("Incorrect usage of remove." + - " Correct format: remove /q /from "); + " Correct format: remove " + + "/c (optional) " + + "/q /from "); } else if (secondWhitespace < 0 && outputs[0].equals("add")) { throw new FlorizzException("Incorrect usage of add." + - " Correct format: add /q /to "); + " Correct format: add " + + "/c (optional) " + + "/q /to "); } arguments[0] = FuzzyLogic.detectItem(trimmedArgument.substring(0,secondWhitespace)); arguments[1] = trimmedArgument.substring(secondWhitespace).trim(); @@ -259,6 +264,7 @@ private static AddFlowerCommand handleAddFlower(String argument, boolean enableU * @throws FlorizzException If the input does not match the required format. */ private static RemoveFlowerCommand handleRemoveFlower(String argument) throws FlorizzException { + boolean includeColour = false; if (argument == null) { throw new FlorizzException("No argument detected! " + "Please use the correct format of 'remove /q /from "); @@ -268,7 +274,9 @@ private static RemoveFlowerCommand handleRemoveFlower(String argument) throws Fl throw new FlorizzException("Incorrect format detected! " + "Please use the correct format of 'remove /q /from "); } - + if (argument.matches(REMOVE_FLOWER_AND_COLOUR_REGEX)){ + includeColour = true; + } // [WARNING] might need to check for extra slash k int prefixIndex = argument.indexOf(REMOVE_FLOWER_PREFIX); @@ -279,7 +287,18 @@ private static RemoveFlowerCommand handleRemoveFlower(String argument) throws Fl // [WARNING] might need to check if it's a valid integer int quantity = Integer.parseInt(quantityString); String bouquetName = removePrefix(argument.substring(prefixIndex), REMOVE_FLOWER_PREFIX).trim(); - + if (includeColour){ + int colourIndex = argument.indexOf(COLOUR); + try{ + flowerName = argument.substring(0,colourIndex).trim(); + String colourString = removePrefix(argument.substring(colourIndex, quantityIndex), COLOUR).trim(); + Flower.Colour colourToAdd = Flower.stringToColour(colourString); + return new RemoveFlowerCommand(flowerName, colourToAdd, quantity, bouquetName); + } catch(IllegalArgumentException error){ + throw new FlorizzException("Tried to add a non recognised colour" + + "Type 'flowers' to view all the currently available flowers and their colours."); + } + } return new RemoveFlowerCommand(flowerName, quantity, bouquetName); } diff --git a/src/main/java/florizz/core/Ui.java b/src/main/java/florizz/core/Ui.java index 21737fff66..2d697a5fd4 100644 --- a/src/main/java/florizz/core/Ui.java +++ b/src/main/java/florizz/core/Ui.java @@ -50,7 +50,7 @@ public String getInput(){ */ public void printBouquetAdded(Bouquet bouquetAdded){ lastCommand = "OTHERS"; - System.out.println("Added new bouquet to list: \n" + bouquetAdded); + System.out.println("Added new bouquet to list:\n" + bouquetAdded); printBreakLine(); } @@ -61,7 +61,7 @@ public void printBouquetAdded(Bouquet bouquetAdded){ */ public void printBouquetDeleted(Bouquet bouquetDeleted){ lastCommand = "OTHERS"; - System.out.println("Deleted bouquet: \n" + bouquetDeleted); + System.out.println("Deleted bouquet:\n" + bouquetDeleted); printBreakLine(); } @@ -122,8 +122,10 @@ public void printHelpMessage() { System.out.println("2. delete - Delete a bouquets"); System.out.println("3. mybouquets - List current saved bouquets"); System.out.println("4. info - Provide information on chosen flower"); - System.out.println("5. add /q /to - add flower to a bouquet"); - System.out.println("6. remove /q /from - remove flower from a bouquet"); + System.out.println("5. add /c (optional) /q " + + "/to - add flower to a bouquet"); + System.out.println("6. remove /c (optional) /q " + + "/from - remove flower from a bouquet"); System.out.println("7. flowers - Shows a list of flowers that can be added into mybouquets"); System.out.println("8. flowers - Shows a list of flowers associated with said occasion"); System.out.println("9. occasion - Shows a list of occasions associated with available flowers"); @@ -182,7 +184,7 @@ public void printAllDictFlowerName(int pageNo) { lastCommand = "ALL_FLOWERS"; int maxPages = (int) Math.ceil((double)lastShownList.size() / PAGE_SIZE); System.out.println("Showing page " + pageNo + "/" + maxPages - + " of all the flowers you can add: "); + + " of all the flowers you can add:"); printFlowerList(false); } @@ -197,7 +199,7 @@ public void printFilteredFlowers(ArrayList flowers, String filter, int p lastCommand = "FILTERED_FLOWERS " + filter; int maxPages = (int) Math.ceil((double)lastShownList.size() / PAGE_SIZE); System.out.println("Here is page " + lastPageNo + "/" + maxPages + - " of all the flowers related to " + filter + ": "); + " of all the flowers related to " + filter + ":"); printFlowerList(false); } @@ -212,7 +214,7 @@ public void printFlowerInfo(ArrayList flowers, String targetFlower, int lastCommand = "INFO_FLOWERS " + targetFlower; int maxPages = (int) Math.ceil((double)lastShownList.size() / PAGE_SIZE); System.out.println("Here is page " + lastPageNo + "/" + maxPages + - " of info regarding flowers whose name contains " + targetFlower + ": "); + " of info regarding flowers whose name contains " + targetFlower + ":"); printFlowerList(true); } @@ -272,7 +274,7 @@ public void printBackPage() throws FlorizzException{ */ public void printAllOccasions() { lastCommand = "OTHERS"; - System.out.println("Here are all the occasions associated with the available flowers: "); + System.out.println("Here are all the occasions associated with the available flowers:"); for (Flower.Occasion occasion : Flower.Occasion.values()){ System.out.println("- " + Flower.occasionToString(occasion)); } @@ -291,7 +293,7 @@ public void printAllOccasions() { public void printAddFlowerSuccess(ArrayList bouquetList, String flowerName, Integer quantity, String bouquetName) { lastCommand = "OTHERS"; - System.out.println("You have successfully added the following: " + System.lineSeparator() + + System.out.println("You have successfully added the following:" + System.lineSeparator() + " - " + quantity + " x " + flowerName + " -> Bouquet: " + bouquetName); printAllBouquets(bouquetList); } @@ -307,7 +309,7 @@ public void printAddFlowerSuccess(ArrayList bouquetList, public void printRemoveFlowerSuccess(ArrayList bouquetList, String flowerName, Integer quantity, String bouquetName) { lastCommand = "OTHERS"; - System.out.println("You have successfully removed the following: " + System.lineSeparator() + + System.out.println("You have successfully removed the following:" + System.lineSeparator() + " - " + quantity + " x " + flowerName + " -> Bouquet: " + bouquetName); printAllBouquets(bouquetList); } @@ -361,7 +363,7 @@ public String printAskColour(ArrayList eligibleFlowers) { System.out.println("What colour would you like your bouquets to be?"); // print all available colours in a given array list - System.out.println("Here is the list of colours available for the occasion: "); + System.out.println("Here is the list of colours available for the occasion:"); // remove duplicate colours in eligible flowers ArrayList colourList = new ArrayList<>(); for (Flower flower : eligibleFlowers) { @@ -393,9 +395,49 @@ public void printSaveSuccess(String bouquetName) { printBreakLine(); } - public void printAddFlowerColour(ArrayList flowers, String flowerName){ - System.out.println("The flower you're looking to add has more than one colour available, " + - "each with their own vastly different meanings. Here's some info: "); + /** + * Asks the user to choose a colour of a flower from a list of the flowers. + * @param flowers The list of flowers where the user can choose the colour from + * @param flowerName The name of the flower that the user is trying to choose its colour from + * @return Flower the specific Flower with the correct colour. Is blank if user chose to cancel the command instead + */ + public Flower chooseColour(ArrayList flowers, String flowerName){ + printGetFlowerColour(flowers, flowerName); + + while (true){ + String colourInput = getInput().trim().toLowerCase(); + try { + switch (colourInput) { + case "back": + printBackPage(); + break; + case "next": + printNextPage(); + break; + case "cancel": + return new Flower(); + default: + Flower.Colour chosenColour = Flower.stringToColour(colourInput); + ArrayList chosenFlowerList = FlowerDictionary.filterByColour(flowers, chosenColour); + if (!chosenFlowerList.isEmpty()){ + return chosenFlowerList.get(0); + } else { + throw new FlorizzException("This flower is not available in this colour, " + + "try typing a colour shown above!"); + } + + } + } catch(FlorizzException error){ + printError(error); + } catch(IllegalArgumentException error){ + System.out.println("Unrecognised input, type a colour that's available for this flower, " + + "or 'cancel' to go back to the main menu."); + } + } + } + public void printGetFlowerColour(ArrayList flowers, String flowerName){ + System.out.println("The flower you're looking for has more than one colour available, " + + "each with their own vastly different meanings. Here's some info:"); printFlowerInfo(flowers, flowerName, 1); System.out.println("Type the colour you want to add into the bouquet, or 'cancel' to return to the main menu."); } diff --git a/src/main/java/florizz/objects/Bouquet.java b/src/main/java/florizz/objects/Bouquet.java index 2073e86d46..4a694b0152 100644 --- a/src/main/java/florizz/objects/Bouquet.java +++ b/src/main/java/florizz/objects/Bouquet.java @@ -4,6 +4,7 @@ import florizz.core.FlorizzException; +import java.util.ArrayList; import java.util.HashMap; import java.util.Objects; @@ -122,4 +123,8 @@ public String getBouquetName() { public void setName(String newName) { this.bouquetName = newName; } + + public ArrayList getFlowerList (){ + return new ArrayList (flowerHashMap.keySet()); + } } diff --git a/src/main/java/florizz/objects/Flower.java b/src/main/java/florizz/objects/Flower.java index 77893f3ad8..228f9edab8 100644 --- a/src/main/java/florizz/objects/Flower.java +++ b/src/main/java/florizz/objects/Flower.java @@ -1,6 +1,8 @@ package florizz.objects; + import java.util.ArrayList; +import java.util.Objects; /** * Represents a flower with its name, colour, occasions, and price. @@ -173,7 +175,7 @@ public String getNameAndColour() { * @return The colour of the flower. */ public String getColour (){ - return colour.toString(); + return colourToString(colour); } /** @@ -205,7 +207,6 @@ public String toString() { occasionsString.append(", "); } - for (String meaning : meanings){ meaningsString.append(meaning); meaningsString.append(", "); @@ -216,4 +217,24 @@ public String toString() { "Price: $" + String.format("%.2f", price) + "\n" + meaningsString.substring(0, meaningsString.lastIndexOf(","))); } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + + /* Check if o is an instance of Complex or not + "null instanceof [type]" also returns false */ + if (!(obj instanceof Flower)) { + return false; + } + + // typecast o to Complex so that we can compare data members + Flower c = (Flower) obj; + + // Compare the data members and return accordingly + return (Objects.equals(c.name.toUpperCase(), this.name.toUpperCase()) && + Objects.equals(c.colour, this.colour)); + } } diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT deleted file mode 100644 index bbc30ba059..0000000000 --- a/text-ui-test/ACTUAL.TXT +++ /dev/null @@ -1,28 +0,0 @@ -Hello from - - __ _ _ - / _| | (_) - | |_| | ___ _ __ _ ________ - | _| |/ _ \| '__| |_ /_ / - | | | | (_) | | | |/ / / / - |_| |_|\___/|_| |_/___/___| - - -What can I do for you? -Here are the list of commands you can use: -1. new - Add a bouquet -2. delete - Delete a bouquets -3. mybouquets - List current saved bouquets -4. info - Provide information on chosen flower -5. add /q /to - add flower to a bouquet -6. remove /q /from - remove flower from a bouquet -7. flowers - Shows a list of flowers that can be added into mybouquets -8. flowers - Shows a list of flowers associated with said occasion -9. occasion - Shows a list of occasions associated with available flowers -10. save - Saves a bouquet to an external .txt file -11. recommend - Recommends a bouquet based on the chosen occasion and colour -12. bye - Exits the programme -____________________________________________________________ -What can I do for you? -Enjoy your bouquet! Thank you for using Florizz! -____________________________________________________________ diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index bbc30ba059..801302d209 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -14,8 +14,8 @@ Here are the list of commands you can use: 2. delete - Delete a bouquets 3. mybouquets - List current saved bouquets 4. info - Provide information on chosen flower -5. add /q /to - add flower to a bouquet -6. remove /q /from - remove flower from a bouquet +5. add /c (optional) /q /to - add flower to a bouquet +6. remove /c (optional) /q /from - remove flower from a bouquet 7. flowers - Shows a list of flowers that can be added into mybouquets 8. flowers - Shows a list of flowers associated with said occasion 9. occasion - Shows a list of occasions associated with available flowers @@ -24,5 +24,159 @@ Here are the list of commands you can use: 12. bye - Exits the programme ____________________________________________________________ What can I do for you? +Added new bouquet to list: +test +____________________________________________________________ +What can I do for you? +--> Your input is [rose] but I am guessing you mean [Rose] +The flower you're looking for has more than one colour available, each with their own vastly different meanings. Here's some info: +Here is page 1/1 of info regarding flowers whose name contains rose: +1. Name: Rose +Colour: Dark crimson +Occasions: Funeral +Price: $2.00 +Meanings: Mourning +2. Name: Rose +Colour: Red +Occasions: Valentines, Wedding, Mothers day +Price: $2.00 +Meanings: Love +____________________________________________________________ +Type the colour you want to add into the bouquet, or 'cancel' to return to the main menu. +You have successfully added the following: + - 5 x rose -> Bouquet: test +Here is the list of your saved bouquets: +1. test : + - 5 x Red Rose + Total estimated price = $10.00 +____________________________________________________________ +What can I do for you? +--> Your input is [rose] but I am guessing you mean [Rose] +You have successfully added the following: + - 5 x Rose -> Bouquet: test +Here is the list of your saved bouquets: +1. test : + - 5 x Red Rose + - 5 x Dark crimson Rose + Total estimated price = $20.00 +____________________________________________________________ +What can I do for you? +For what occasion are you buying flowers for? +Here are all the occasions associated with the available flowers: +- Funeral +- Wedding +- Valentines +- Mothers day +____________________________________________________________ +What colour would you like your bouquets to be? +Here is the list of colours available for the occasion: +- White +- Red +- Blue +____________________________________________________________ +Great we managed to find some flowers for you! +Before we carry on what would you like to call your bouquet? +Would you like to save this bouquet to your list? +Here is the full list of flowers in test2: + - 5 x Hydrangea +____________________________________________________________ +Type 'yes' to save, 'no' to discard +Added new bouquet to list: +test2 +____________________________________________________________ +What can I do for you? +--> Your input is [rose] but I am guessing you mean [Rose] +You have successfully removed the following: + - 4 x Rose -> Bouquet: test +Here is the list of your saved bouquets: +1. test : + - 1 x Red Rose + - 5 x Dark crimson Rose + Total estimated price = $12.00 +2. test2 : + - 5 x Blue Hydrangea + Total estimated price = $45.00 +____________________________________________________________ +What can I do for you? +--> Your input is [rose] but I am guessing you mean [Rose] +The flower you're looking for has more than one colour available, each with their own vastly different meanings. Here's some info: +Here is page 1/1 of info regarding flowers whose name contains rose: +1. Name: Rose +Colour: Red +Occasions: Valentines, Wedding, Mothers day +Price: $2.00 +Meanings: Love +2. Name: Rose +Colour: Dark crimson +Occasions: Funeral +Price: $2.00 +Meanings: Mourning +____________________________________________________________ +Type the colour you want to add into the bouquet, or 'cancel' to return to the main menu. +You have successfully removed the following: + - 4 x rose -> Bouquet: test +Here is the list of your saved bouquets: +1. test : + - 1 x Red Rose + - 1 x Dark crimson Rose + Total estimated price = $4.00 +2. test2 : + - 5 x Blue Hydrangea + Total estimated price = $45.00 +____________________________________________________________ +What can I do for you? +Showing page 1/5 of all the flowers you can add: +1. White Orchid +2. Dark crimson Rose +3. Red Rose +4. White Lily +5. White Daisy +Type 'next' to go to the next page. +____________________________________________________________ +What can I do for you? +Showing page 2/5 of all the flowers you can add: +6. White Chrysanthemum +7. Blue Hydrangea +8. Pink Carnation +9. White Baby Breath +10. Green Eucalyptus +Type 'next' to go to the next page, or 'back' to go to the previous page. +____________________________________________________________ +What can I do for you? +Here are all the occasions associated with the available flowers: +- Funeral +- Wedding +- Valentines +- Mothers day +____________________________________________________________ +What can I do for you? +--> Your input is [funeral] but I am guessing you mean [Funeral] +Here is page 1/1 of all the flowers related to Funeral: +1. Dark crimson Rose +2. White Lily +3. White Chrysanthemum +____________________________________________________________ +What can I do for you? +Here is the list of your saved bouquets: +1. test : + - 1 x Red Rose + - 1 x Dark crimson Rose + Total estimated price = $4.00 +2. test2 : + - 5 x Blue Hydrangea + Total estimated price = $45.00 +____________________________________________________________ +What can I do for you? +Deleted bouquet: +test2 +____________________________________________________________ +What can I do for you? +Here is the list of your saved bouquets: +1. test : + - 1 x Red Rose + - 1 x Dark crimson Rose + Total estimated price = $4.00 +____________________________________________________________ +What can I do for you? Enjoy your bouquet! Thank you for using Florizz! ____________________________________________________________ diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index ea20819dd5..c80f636dca 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1,2 +1,21 @@ help +new test +add rose /q 5 /to test +red +add rose /c dark crimson /q 5 /to test +recommend +wedding +blue +test2 +yes +remove rose /c red /q 4 /from test +remove rose /q 4 /from test +dark crimson +flowers +next +occasion +flowers funeral +mybouquets +delete test2 +mybouquets bye \ No newline at end of file