diff --git a/README.md b/README.md index f82e2494b7..e60f15fc0d 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,8 @@ -# Duke project template +# Florizz -This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it. +An easy-to-use bouquet recommendation software using CLI. -## Setting up in Intellij - -Prerequisites: JDK 11 (use the exact version), update Intellij to the most recent version. - -1. **Ensure Intellij JDK 11 is defined as an SDK**, as described [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk) -- this step is not needed if you have used JDK 11 in a previous Intellij project. -1. **Import the project _as a Gradle project_**, as described [here](https://se-education.org/guides/tutorials/intellijImportGradleProject.html). -1. **Verify the set up**: After the importing is complete, locate the `src/main/java/seedu/duke/Duke.java` file, right-click it, and choose `Run Duke.main()`. If the setup is correct, you should see something like the below: - ``` - > Task :compileJava - > Task :processResources NO-SOURCE - > Task :classes - - > Task :Duke.main() - Hello from - ____ _ - | _ \ _ _| | _____ - | | | | | | | |/ / _ \ - | |_| | |_| | < __/ - |____/ \__,_|_|\_\___| - - What is your name? - ``` - Type some word and press enter to let the execution proceed to the end. - -## Build automation using Gradle - -* This project uses Gradle for build automation and dependency management. It includes a basic build script as well (i.e. the `build.gradle` file). -* If you are new to Gradle, refer to the [Gradle Tutorial at se-education.org/guides](https://se-education.org/guides/tutorials/gradle.html). - -## Testing - -### I/O redirection tests - -* To run _I/O redirection_ tests (aka _Text UI tests_), navigate to the `text-ui-test` and run the `runtest(.bat/.sh)` script. - -### JUnit tests - -* A skeleton JUnit test (`src/test/java/seedu/duke/DukeTest.java`) is provided with this project template. -* If you are new to JUnit, refer to the [JUnit Tutorial at se-education.org/guides](https://se-education.org/guides/tutorials/junit.html). - -## Checkstyle - -* A sample CheckStyle rule configuration is provided in this project. -* If you are new to Checkstyle, refer to the [Checkstyle Tutorial at se-education.org/guides](https://se-education.org/guides/tutorials/checkstyle.html). - -## CI using GitHub Actions - -The project uses [GitHub actions](https://github.com/features/actions) for CI. When you push a commit to this repo or PR against it, GitHub actions will run automatically to build and verify the code as updated by the commit/PR. - -## Documentation - -`/docs` folder contains a skeleton version of the project documentation. - -Steps for publishing documentation to the public: -1. If you are using this project template for an individual project, go your fork on GitHub.
- If you are using this project template for a team project, go to the team fork on GitHub. -1. Click on the `settings` tab. -1. Scroll down to the `GitHub Pages` section. -1. Set the `source` as `master branch /docs folder`. -1. Optionally, use the `choose a theme` button to choose a theme for your documentation. +Useful links: +* [User Guide](docs/UserGuide.md) +* [Developer Guide](docs/DeveloperGuide.md) +* [About Us](docs/AboutUs.md) diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 3bdd8fccab..c8b632d174 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -2,8 +2,8 @@ Display | Name | Github Profile | Portfolio --------|:-------------------:|:----------------------------------------------:|:---------: -![](https://via.placeholder.com/100.png?text=Photo) | Ian Freda Hariyanto | [Github](https://github.com/IanFH) | [Portfolio](docs/team/ianfh.md) -![](https://via.placeholder.com/100.png?text=Photo) | Mohamed Ijaaz | [Github](https://github.com/Ijaaz01) | [Portfolio](docs/team/ijaaz01.md) -![](https://via.placeholder.com/100.png?text=Photo) | Jeffinson Darmawan | [Github](https://github.com/JeffinsonDarmawan) | [Portfolio](docs/team/jeffinsondarmawan.md) -![](https://via.placeholder.com/100.png?text=Photo) | Samuel Ong | [Github](https://github.com/samuelory) | [Portfolio](docs/team/samuelory.md) +![](https://via.placeholder.com/100.png?text=Photo) | Ian Freda Hariyanto | [Github](https://github.com/IanFH) | [Portfolio](team/ianfh.md) +![](https://via.placeholder.com/100.png?text=Photo) | Mohamed Ijaaz | [Github](https://github.com/Ijaaz01) | [Portfolio](team/ijaaz01.md) +![](https://via.placeholder.com/100.png?text=Photo) | Jeffinson Darmawan | [Github](https://github.com/JeffinsonDarmawan) | [Portfolio](team/jeffinsondarmawan.md) +![](https://via.placeholder.com/100.png?text=Photo) | Samuel Ong | [Github](https://github.com/samuelory) | [Portfolio](team/samuelory.md) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 3dde7f13c1..429775f276 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -49,11 +49,41 @@ Step 3: `InfoCommand` class will call `printFlowerInfo()` method of `Ui` class Step 4: `get()` of `FlowerDictionary` class will then be called in order to retrive information about the specified flower. This information will be printed by the `Ui` class -### Flower Remove Command +### Flower Help Command + +`help` Shows a list of valid commands + +![Help Command Sequence Diagram](UML-diagrams/Jeffinson/Jeffinson-UML-Help.png); + +Help command utilises the `parser` class to identify the keyword `help` + +**Step 1:** User will write `help` and `HelpCommand` class will be instantiated and `execute()` method will run. + +**Step 2:** `HelpCommand` class will call `printHelpMessage()` method of `Ui` class + +**Step 3:** The list of valid commands will be printed by the `Ui` class + +### Add Flower Command + +`add /q /to ` command adds specified number of flower to a bouquet + +![Add Flower Command Diagram](UML-diagrams/Ijaaz/AddFlowerCommand.png) + +**Step 1:** Firstly the input is put into the `Parser.parse()` method to identify that it is infact an add flower command. + +**Step 2:** Then an object of type `AddFlowerCommand` is returned which contains the name, quantity of the flower to be added, as well as the target bouquet + +**Step 3:** The `execute()` method is called to execute the add flower command + +**Step 4:** The target bouquet, which is under model, is updated accordingly + +**Step 5:** A confirmation message is then sent back to the user + +### Remove Flower Command `remove /q /from ` removes flower(s) from a bouquet -![Remove Command Sequence Diagram](UML-diagrams/Jeffinson/Jeffinson-UML-Remove.png); +![Remove Command Sequence Diagram](UML-diagrams/Jeffinson/Jeffinson-UML-Remove.png) Removing flowers utilise the `parser` class to parse user command to identify which flower to remove, how much to remove and from which bouquet to remove. @@ -67,35 +97,53 @@ class will be instantiated and run its `execute()` method. **Step 4:** The flowers are removed and a confirmation message is sent back to the user -### Flower Help Command +### Recommend Command -`help` Shows a list of valid commands +`recommend` recommends a bouquet based on user input -![Help Command Sequence Diagram](UML-diagrams/Jeffinson/Jeffinson-UML-Help.png); +![Recommend Command Sequence Diagram](UML-diagrams/Ian/RecommendCommand.png) +*simplified version of the sequence diagram* -Help command utilises the `parser` class to identify the keyword `help` +**Step 1:** User will input `recommend` into the CLI, which will be parsed by the `parser` class to identify. -**Step 1: ** User will write `help` and `HelpCommand` class will be instantiated and `execute()` method will run. +**Step 2:** `RecommendCommand` class will be instantiated and run its `execute()` method. -**Step 2:** `HelpCommand` class will call `printHelpMessage()` method of `Ui` class +**Step 3:** Various methods will be called to get the user input. In order, the methods are `askOccasion(...)`, `askColour(...)`, `askSize(...)`, `askBouquetName(...)`, `askSize()`, `addRandomFlowers()`, `askSaveBouquet()`. -**Step 3:** The list of valid commands will be printed by the `Ui` class +#### askOccasion(...) -### Add Flower Command +A deeper look into the `askOccasion(...)` method -`add /q /to ` command adds specified number of flower to a bouquet +![askOccasion Sequence Diagram](UML-diagrams/Ian/askOccasion.png) -![Add Flower Command Diagram](UML-diagrams/Ijaaz/AddFlowerCommand.png) +**Step 1:** `askOccasion(...)` method will call `Ui.askOccasion()` to get the user input. -Step 1: Firstly the input is put into the `Parser.parse()` method to identify that it is infact an add flower command. +**Step 2:** `askOccasion(...)` method will call `Parser` to validate the format of user input. -Step 2: Then an object of type `AddFlowerCommand` is returned which contains the name, quantity of the flower to be added, as well as the target bouquet +**Step 3:** `askOccasion(...)` method will check with `Flower` class to see if the occasion is valid. -Step 3: The `execute()` method is called to execute the add flower command +**Step 4:** once format is validated and the occasion inputted is valid, the method will return the occasion. -Step 4: The target bouquet, which is under model, is updated accordingly +#### askColour(...), askSize(...), askBouquetName(...), askSize(...), addRandomFlowers(...), askSaveBouquet() -Step 5: A confirmation message is then sent back to the user +The other methods will follow a similar structure as `askOccasion(...)` method, where the user input is taken, validated, and then stored in the `RecommendCommand` class to be further processed. + +### Compare Flower Command + +`compare /vs/ ` command compares two flowers based on their flowers names. + +![Compare Flower Command Diagram](UML-diagrams/Jeffinson/Jeffinson-UML-compare.png) + +Step 1: User will input the two flower names into the `Parser.parse()` method to identify the `compare` command keyword +and the presence of the 2 flowers in the userInput to compare + +Step 2: An object of type `CompareCommand` is then returned which contains the names of the two flowers to be compared. + +Step 3: The `execute()` method is called to execute the compare command + +Step 4: Ui.printCompareFlowers() is called to print the comparison of the two flowers + +Step 5: A table is printed out to the user showing the comparison between the two flowers ### Save Command @@ -163,7 +211,7 @@ Main Success Scenario (MSS): 4. Programme responds that the 3 stalks of rose has been successfully added 5. Programme displays the current state of "for valentine" bouquet and all the flowers inside it -** Use case: Removing flowers from a bouquet named "for valentine" ** +**Use case: Removing flowers from a bouquet named "for valentine"** Main Success Scenario (MSS): 1. User removes 5 stalks of rose from the bouquet named "for valentine" diff --git a/docs/README.md b/docs/README.md index 241adb3cdd..ab17837558 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Florizz -An easy to use bouquet recomendation software using CLI +An easy to use bouquet recommendation software using CLI Useful links: * [User Guide](UserGuide.md) diff --git a/docs/UML-diagrams/Ian/RecommendCommand.png b/docs/UML-diagrams/Ian/RecommendCommand.png new file mode 100644 index 0000000000..692630b6df Binary files /dev/null and b/docs/UML-diagrams/Ian/RecommendCommand.png differ diff --git a/docs/UML-diagrams/Ian/askOccasion.png b/docs/UML-diagrams/Ian/askOccasion.png new file mode 100644 index 0000000000..62afd86ff5 Binary files /dev/null and b/docs/UML-diagrams/Ian/askOccasion.png differ diff --git a/docs/UML-diagrams/Ian/askOccasion.puml b/docs/UML-diagrams/Ian/askOccasion.puml new file mode 100644 index 0000000000..d768acedf6 --- /dev/null +++ b/docs/UML-diagrams/Ian/askOccasion.puml @@ -0,0 +1,33 @@ +@startuml +'https://plantuml.com/sequence-diagram +!include Ian-style.puml + +box Logic LOGIC_COLOUR +participant ":Parser" as Parser LOGIC_COLOUR_T1 +participant "a:RecommendCommand" as RecommendCommand LOGIC_COLOUR_T1 +participant "b:Flower" as Flower LOGIC_COLOUR_T1 + +box Ui UI_COLOUR +participant ":Ui" as Ui UI_COLOUR_T1 + +activate RecommendCommand + +loop !isValidFormat && !isValidOccasion +RecommendCommand -> Ui : printAskOccasion() + +activate Ui +Ui --> RecommendCommand : input +deactivate Ui + +RecommendCommand -> Parser : parseOccasion(input) +activate Parser +Parser --> RecommendCommand : isValidFormat +deactivate Parser + +RecommendCommand -> Flower : isValidOccasion() +activate Flower +Flower --> RecommendCommand :isValidOccasion +deactivate Flower + +end +@enduml \ No newline at end of file diff --git a/docs/UML-diagrams/Ian/command.puml b/docs/UML-diagrams/Ian/command.puml new file mode 100644 index 0000000000..1ea733e443 --- /dev/null +++ b/docs/UML-diagrams/Ian/command.puml @@ -0,0 +1,42 @@ +@startuml +'https://plantuml.com/sequence-diagram +!include Ian-style.puml + +actor "user" as user +participant ":Florizz" as Florizz +box Logic LOGIC_COLOUR +participant ":Parser" as Parser LOGIC_COLOUR_T1 +participant "a:RecommendCommand" as RecommendCommand LOGIC_COLOUR_T1 + +[-> Florizz : execute("recommend") +activate Florizz + +Florizz -> Parser : parse("recommend") +activate Parser + +create RecommendCommand +Parser -> RecommendCommand : RecommendCommand("rose") +activate RecommendCommand + +RecommendCommand --> Parser : a +deactivate RecommendCommand + +Parser --> Florizz : a +deactivate Parser + +Florizz -> RecommendCommand : execute() +activate RecommendCommand + +RecommendCommand -> RecommendCommand: askOccasion(...) +RecommendCommand -> RecommendCommand: askColour(...) +RecommendCommand -> RecommendCommand: askBouquetName(...) +RecommendCommand -> RecommendCommand: askSize(...); +RecommendCommand -> RecommendCommand: addRandomFlowers(...) +RecommendCommand -> RecommendCommand: askSaveBouquet(...); + +RecommendCommand --> Florizz +deactivate RecommendCommand + +<--Florizz +deactivate Florizz +@enduml \ No newline at end of file diff --git a/docs/UML-diagrams/Jeffinson/(Old)Jeffinson-UML-Remove.png b/docs/UML-diagrams/Jeffinson/(Old)Jeffinson-UML-Remove.png new file mode 100644 index 0000000000..20f53c42dc Binary files /dev/null and b/docs/UML-diagrams/Jeffinson/(Old)Jeffinson-UML-Remove.png differ diff --git a/docs/UML-diagrams/Jeffinson/Jeffinson-UML-Remove.png b/docs/UML-diagrams/Jeffinson/Jeffinson-UML-Remove.png index 20f53c42dc..6aecd17ec0 100644 Binary files a/docs/UML-diagrams/Jeffinson/Jeffinson-UML-Remove.png and b/docs/UML-diagrams/Jeffinson/Jeffinson-UML-Remove.png differ diff --git a/docs/UML-diagrams/Jeffinson/Jeffinson-UML-compare.png b/docs/UML-diagrams/Jeffinson/Jeffinson-UML-compare.png new file mode 100644 index 0000000000..de45e3a8a4 Binary files /dev/null and b/docs/UML-diagrams/Jeffinson/Jeffinson-UML-compare.png differ diff --git a/docs/UML-diagrams/Jeffinson/Jeffinson-UML-compare.puml b/docs/UML-diagrams/Jeffinson/Jeffinson-UML-compare.puml new file mode 100644 index 0000000000..357c85eb08 --- /dev/null +++ b/docs/UML-diagrams/Jeffinson/Jeffinson-UML-compare.puml @@ -0,0 +1,56 @@ +@startuml +!include Jeffinson-style.puml + +actor "user" as user +participant ":Florizz" as Florizz +box Logic LOGIC_COLOUR +participant ":Parser" as Parser LOGIC_COLOUR_T1 +participant "a:CompareCommand" as CompareCommand LOGIC_COLOUR_T1 +participant "b:FlowerDictionary" as FlowerDictionary LOGIC_COLOUR_T1 +end box + +box Ui UI_COLOUR +participant ":UI" as Ui UI_COLOUR_T1 +end box + +[-> Florizz : execute("compare rose /vs/ lily") +activate Florizz + +Florizz -> Parser : parse("compare rose /vs/ lily") +activate Parser + +create CompareCommand +Parser -> CompareCommand : CompareCommand("rose", "lily") +activate CompareCommand + +CompareCommand --> Parser : a +deactivate CompareCommand + +Parser --> Florizz : a +deactivate Parser + +Florizz -> CompareCommand : execute() +activate CompareCommand + +CompareCommand -> Ui : printCompareFlowers("rose") +activate Ui + +Ui -> FlowerDictionary : get("rose") +activate FlowerDictionary +FlowerDictionary ---> Ui +deactivate FlowerDictionary + +Ui -> FlowerDictionary : get("lily") +activate FlowerDictionary +FlowerDictionary ---> Ui +deactivate FlowerDictionary + +Ui --> CompareCommand +deactivate Ui + +CompareCommand --> Florizz +deactivate CompareCommand + +<--Florizz +deactivate Florizz +@enduml \ No newline at end of file diff --git a/docs/UserGuide.md b/docs/UserGuide.md index aa67d0330d..f101013cfd 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -2,8 +2,30 @@ Florizz is your personal digital florist which helps people in Singapore to curate flowers to create bouquets for all occasions. -## Features -### Viewing help: `help` +## Table of Contents + +* [User Guide](#user-guide) + * [Table of Contents](#table-of-contents) + * [Features ](#features-a-namefeaturesa) + * [Viewing help: `help` ](#viewing-help-help-a-namehelpa) + * [Create a new bouquet: `new`](#create-a-new-bouquet-new) + * [Delete existing bouquet: `delete`](#delete-existing-bouquet-delete) + * [View existing bouquets: `mybouquets`](#view-existing-bouquets-mybouquets) + * [List all available flowers: `flowers`](#list-all-available-flowers-flowers) + * [View detailed info of a flower: `info`](#view-detailed-info-of-a-flower-info) + * [Add flower: `add`](#add-flower-add) + * [Remove flower: `remove`](#remove-flower-remove) + * [List occasions: `occasion`](#list-occasions-occasion) + * [Recommend A Bouquet: `recommend`](#recommend-a-bouquet-recommend) + * [Save a bouquet to device: `save`](#save-a-bouquet-to-device-save) + * [Compare two flowers: `compare`](#compare-two-flowers-compare) + * [Exit programme: `bye`](#exit-programme-bye) + * [Fuzzy Logic](#fuzzy-logic) + * [Autosave](#autosave) + + +## Features +### Viewing help: `help` Shows a list of commands and its corresponding function Format: `help` @@ -44,7 +66,8 @@ Creates an empty bouquet to add flowers to later Format: `new NAME` -Bouquet name must not already exist +- Bouquet name must not already exist +- Bouquet names are not case-sensitive i.e. For Girlfriend = for girlfriend Examples: `new For Girlfriend` @@ -61,7 +84,7 @@ Deletes a bouquet from the bouquet list Format: `delete ` -Bouquet of that name must exist in the list +- Bouquet of that name must exist in the list Example: `delete For Mother` @@ -97,25 +120,23 @@ Example: `flowers` Expected output: ``` -Showing page 1/2 of all the flowers you can add: -1. White Orchid -2. Dark crimson Rose -3. Red Rose -4. White Lily -5. White Daisy +Showing page 1/6 of all the flowers you can add: +1. Orchid (White) +2. Rose (Dark crimson) +3. Rose (Red) +4. Rose (Yellow) +5. Lily (White) Type 'next' to go to the next page. -____________________________________________________________ ``` Example: `flowers Funeral` Expected output: ``` -Here is page 1/1 of all the flowers related to Funeral: -1. Dark crimson Rose -2. White Lily -3. White Chrysanthemum -____________________________________________________________ +Here is page 1/1 of all the flowers related to Funeral: +1. Rose (Dark crimson) +2. Lily (White) +3. Chrysanthemum (White) ``` ### View detailed info of a flower: `info` @@ -145,54 +166,106 @@ ____________________________________________________________ Adds a flower into a bouquet -Format: `add /q /to ` +Format: `add /c (optional) /q /to ` - Flower must exist in the database - Quantity must be a positive integer - Bouquet must exist in the database +- If flower has several colours available, but user did not enter a colour in the command, user will be prompted to choose a colour from the available colours +- If flower only has one colour available, user does not need to enter a colour Examples: -- `add Rose /q 3 /to For Girlfriend` -- `add Babys breath /q 2 /to Sister’s graduation` +- `add Rose /c red /q 3 /to For Girlfriend` Expected Output: ``` -You have successfully added the following: - - 3 x rose -> Bouquet: For Girlfriend +What can I do for you? +add Rose /c red /q 3 /to For Girlfriend +You have successfully added the following: + - 3 x Rose (Red) -> Bouquet: For Girlfriend Here is the list of your saved bouquets: 1. For Girlfriend : - - 3 x Rose + - 3 x Rose (Red) Total estimated price = $6.00 +__________________________________ +``` +- `add Rose /q 3 /to For Girlfriend` + +``` +The flower you're looking for has more than one colour available, each with their own vastly different meanings. +Here is a table of information about the flower rose: ++-----+-------------+--------------+----------------------------------+----------------------------------------+-------------+-----------+ +| No. | Flower Name | Colour | Occasion | Meaning | Type | Price ($) | ++-----+-------------+--------------+----------------------------------+----------------------------------------+-------------+-----------+ +| 1 | Rose | Dark crimson | Funeral | Mourning | MAIN_FLOWER | 2.00 | +| 2 | Rose | Red | Valentines, Wedding, Mothers day | Love | MAIN_FLOWER | 2.00 | +| 3 | Rose | Yellow | - | Jealousy, Decrease of love, Infidelity | MAIN_FLOWER | 2.00 | ++-----+-------------+--------------+----------------------------------+----------------------------------------+-------------+-----------+ ____________________________________________________________ -What can I do for you? +Type the colour you want to add into the bouquet, or 'cancel' to return to the main menu. +red +You have successfully added the following: + - 3 x Rose (Red) -> Bouquet: For Girlfriend +Here is the list of your saved bouquets: +1. For Girlfriend : + - 3 x Rose (Red) + Total estimated price = $6.00 +``` +- `add daisy /q 3 /to For Girlfriend` + +``` +You have successfully added the following: + - 3 x Daisy (White) -> Bouquet: For Girlfriend +Here is the list of your saved bouquets: +1. For Girlfriend : + - 3 x Daisy (White) + - 3 x Rose (Red) + Total estimated price = $7.50 ``` ### Remove flower: `remove` Removes a flower from a bouquet -Format: `remove /q /from ` +Format: `remove /c (optional) /q /from ` -- Flower must exist in the database and the bouquet specified +- Flower of that colour must exist in the database and the bouquet specified - Quantity must be between 1 and the current amount of flowers in the bouquet (inclusive). - Bouquet must exist in the database +- If multiple flowers of that colour exist in the bouquet and colour is not specified, user will be prompted to choose a colour from the ones available Examples: -- `remove Rose /q 1 /from For Girfriend` -- `remove Gerbera /q 3 /from Valentine’s Day` +- `remove Carnation /q 1 /from for mother` Expected output: ``` -You have successfully removed the following: - - 1 x rose -> Bouquet: For Girlfriend -Here is the list of your saved bouquets: -1. For Girlfriend : - - 2 x Rose - Total estimated price = $4.00 +The flower you're looking for has more than one colour available, each with their own vastly different meanings. +Here is a table of information about the flower carnation: ++-----+-------------+--------+-------------+---------------------------+-------------+-----------+ +| No. | Flower Name | Colour | Occasion | Meaning | Type | Price ($) | ++-----+-------------+--------+-------------+---------------------------+-------------+-----------+ +| 1 | Carnation | Pink | Mothers day | Gratitude, Love | MAIN_FLOWER | 2.00 | +| 2 | Carnation | Red | Valentines | My heart aches, Deep Love | MAIN_FLOWER | 2.00 | ++-----+-------------+--------+-------------+---------------------------+-------------+-----------+ ____________________________________________________________ -What can I do for you? +Type the colour you want to add into the bouquet, or 'cancel' to return to the main menu. +red +You have successfully removed the following: + - 1 x Carnation (Red) -> Bouquet: for mother +Here is the list of your saved bouquets: +1. For Mother : + - 1 x Carnation (Pink) + Total estimated price = $2.00 ``` +- `remove carnation /c pink /q 1 /from for mother` +``` +You have successfully removed the following: + - 1 x Carnation (Pink) -> Bouquet: for mother +Here is the list of your saved bouquets: +1. For Mother : + No flowers added so far +``` ### List occasions: `occasion` Shows a list of occasions that the flowers in the database are associated with. @@ -208,30 +281,34 @@ Here are all the occasions associated with the available flowers: ____________________________________________________________ ``` ### Recommend A Bouquet: `recommend` -Recommends a bouquet based on the occasion and the recipient's preference + +Recommends a bouquet based on the occasion and the recipient's preference. Will enter user into 'recommend mode'. Type `cancel` to exit recommend mode. Steps: 1. Type command: `recommend` Expected output: ``` - For what occasion are you buying flowers for? - Here is the list of our available occasion: - Here are all the occasions associated with the available flowers: - - Funeral - - Wedding - - Valentines - - Mothers day - ____________________________________________________________ + For what occasion are you buying flowers for? + Here are all the occasions associated with the available flowers: + - Funeral + - Wedding + - Valentines + - Mothers day + ____________________________________________________________ + Type 'cancel' if you would like to exit the recommendation page ``` + 2. Type occasion: `Funeral` Expected output: ``` What colour would you like your bouquets to be? - Here is the list of colours available for the occasion: - - DARK_CRIMSON - - WHITE + Here is the list of colours available for the occasion: + - Dark crimson + - White + ____________________________________________________________ + Type 'cancel' if you would like to exit the recommendation page ``` 3. Select colour of bouquet: `WHITE` @@ -239,19 +316,51 @@ Steps: Expected output: ``` - Would you like to save this bouquet to your list? - Here is the full list of flowers in Recommended Bouquet: - - 3 x Lily - - 2 x Chrysanthemum - ____________________________________________________________ - Type 'yes' to save, 'no' to discard + Great we managed to find some flowers for you! + Before we carry on what would you like to call your bouquet? + Note: please take note 'cancel' cannot be used as a bouquet name + ____________________________________________________________ + Type 'cancel' if you would like to exit the recommendation page ``` -4. Confirm whether you want to add the recommended bouquet to your mybouquets list: `yes` + +4. Type bouquet name: `for grandma` + + Expected output: + ``` + What size would you like your recommended bouquet to be? + 1. Small + 2. Medium + 3. Large + ____________________________________________________________ + Type 'cancel' if you would like to exit the recommendation page + ``` + +5. Select bouquet size: `Large` + + Expected output: + ``` + Would you like to save this bouquet to your list? + Here is the full list of flowers in for grandma: + - 2 x Pittosporum + - 2 x Freesia + - 1 x Dusty Miller + - 3 x Chrysanthemum + - 1 x Pistacia + - 2 x Lily + ____________________________________________________________ + Type 'yes' to save, 'no' to discard + Type 'cancel' if you would like to exit the recommendation page + ``` + *Note: The flowers in the bouquet are randomly generated and may differ from the example* + + +6. Confirm whether you want to add the recommended bouquet to your mybouquets list: `yes` ``` - Added new bouquet to list: - Recommended Bouquet - ____________________________________________________________ + Added new bouquet to list: + for grandma + ____________________________________________________________ + What can I do for you? ``` ### Save a bouquet to device: `save` diff --git a/docs/team/ianfh.md b/docs/team/ianfh.md index dc01577d1f..06748a3f6d 100644 --- a/docs/team/ianfh.md +++ b/docs/team/ianfh.md @@ -4,9 +4,11 @@ Florizz is a digital florist replacement that helps users choose appropriate flowers to put into a bouquet for various occasions. -### Summary of Contributions -* Click [here](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=ianfh&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2024-02-23&tabOpen=true&tabType=authorship&tabAuthor=IanFH&tabRepo=AY2324S2-CS2113-T11-3%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code~other&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false) to view my contributions. +## Summary of Contributions +### Code Contributed +Click [here](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=ianfh&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2024-02-23&tabOpen=true&tabType=authorship&tabAuthor=IanFH&tabRepo=AY2324S2-CS2113-T11-3%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code~other&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false) to view my contributions. +### Enhancements Implemented * **New Feature**: Add Flower Command * Command takes in the format `add /q /to `. This command was necessary to allow users to create bouquets with flowers of their choosing, and was a key feature of the programme. @@ -23,14 +25,42 @@ flowers to put into a bouquet for various occasions. * **New Feature**: Recommend Command * Command takes in the format `recommend` which will enter the user into 'recommend mode'. In this mode, the user can - input the occasion, colour and name of the bouquet and the programme will recommend a bouquet based on the occasion. - * This command was necessary to allow beginner users who is not familiar with flowers to get a bouquet recommendation + input the occasion, colour, name, and size of the bouquet and the programme will recommend a bouquet for them. + * The command matches the user requirements with the flowers in `FlowerDictionary` and creates a bouquet containing some main flowers and some filler flowers. + * This command was necessary to allow beginner users who are not familiar with flowers to get a bouquet recommendation based on the occasion they are looking for. * **New Feature**: Bye Command * Command takes in the format `bye` which will exit the programme. This command was necessary to allow users to exit the programme when they are done using it. -* **Enhancements to Existing Features** +* **Enhancements**: Added Regex for Parsing User Input * The first to suggest and implemented regex for parsing user input for `add` and `remove` command. This was necessary to ensure that the user input was - correctly parsed and the correct flower, quantity and bouquet name was identified. [proof](https://github.com/nus-cs2113-AY2324S2/tp/commit/34889baaa7a024c6c8f1fef686b7ebe4493d9f44#diff-bb1b61dd1311729e01e01d2e43ccaf1648d0e8a57a97f5eafc82c1add885d247) \ No newline at end of file + correctly parsed and the correct flower, quantity and bouquet name was identified. [proof](https://github.com/nus-cs2113-AY2324S2/tp/commit/34889baaa7a024c6c8f1fef686b7ebe4493d9f44#diff-bb1b61dd1311729e01e01d2e43ccaf1648d0e8a57a97f5eafc82c1add885d247) + +* **Enhancements**: Added More Flowers to `FlowerDictionary` + * Researched main flowers and filler flowers that are available in Singapore along with their prices [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/97/files) + +* **Unused** : Configured sqlite3 database for storage of flowers and bouquets. + * This was not used in the final product as we found out DBMS was not allowed for this project. [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/92) + +### Contributions to the UG +- Added Table of Contents to the UG [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/178/files) +- Added the add flower command to the UG [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/42/files) +- Added the remove flower command to the UG [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/42/files) +- Added the recommend command to the UG [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/178/files) +- Added the bye command to the UG [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/42/files) + +### Contributions to the DG +- Responsible for the add flower command sequence diagram and descriptions [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/78/files) +- Responsible for proposed storage implementation for DG draft [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/78/files) +- Responsible for recommend command sequence diagram and descriptions [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/178/files) +- Responsible for askOccasion sequence diagram and description [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/178/files) +- Responsible for Appendix of product scope, value proposition, user stories, and use cases [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/72/files) +- Updated info command, remove flower command sequence diagram based on TA's feedback [proof](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/169/files) + +### Contributions to Team-based Tasks +- Helped to set up the issue tracker for the team (i.e. milestones, tagging) + +### Review/mentoring Contributions +- Reviewed and provided feedback on PRs by other team members [proof](https://nus-cs2113-ay2324s2.github.io/dashboards/contents/tp-comments.html#19-ian-anto-ianfh-31-comments) \ No newline at end of file diff --git a/docs/team/samuelory.md b/docs/team/samuelory.md index 5db7336cf8..bfcd0776b7 100644 --- a/docs/team/samuelory.md +++ b/docs/team/samuelory.md @@ -58,4 +58,5 @@ flowers to put into a bouquet for various occasions. * Added documentation for features `new bouquet`, `mybouquets` and `delete bouquet` * Updated documentation for `info` and `flowers` features * Developer Guide: - * Added implementation details for `new bouquet` feature \ No newline at end of file + * Added implementation details for `new bouquet` feature + * Added overall architecture section \ No newline at end of file diff --git a/src/main/java/florizz/command/AddFlowerCommand.java b/src/main/java/florizz/command/AddFlowerCommand.java index d94c1a644f..f56a0f1427 100644 --- a/src/main/java/florizz/command/AddFlowerCommand.java +++ b/src/main/java/florizz/command/AddFlowerCommand.java @@ -66,7 +66,7 @@ public boolean execute(ArrayList bouquetList, Ui ui) throws FlorizzExce boolean doesBouquetExist = false; Bouquet bouquetToAddFlower = new Bouquet(); for (int i = 0; !doesBouquetExist && i < bouquetList.size(); i++) { - if (bouquetList.get(i).getBouquetName().equals(this.bouquetName)) { + if (bouquetList.get(i).getBouquetName().equalsIgnoreCase(this.bouquetName)) { bouquetToAddFlower = bouquetList.get(i); doesBouquetExist = true; } diff --git a/src/main/java/florizz/command/RemoveFlowerCommand.java b/src/main/java/florizz/command/RemoveFlowerCommand.java index 1a5be36597..6a48e8fd01 100644 --- a/src/main/java/florizz/command/RemoveFlowerCommand.java +++ b/src/main/java/florizz/command/RemoveFlowerCommand.java @@ -37,7 +37,7 @@ public boolean execute(ArrayList bouquetList, Ui ui) throws FlorizzExce boolean doesBouquetExist = false; Bouquet bouquetToRemoveFlower = new Bouquet(); for (int i = 0; !doesBouquetExist && i < bouquetList.size(); i++) { - if (bouquetList.get(i).getBouquetName().equals(this.bouquetName)) { + if (bouquetList.get(i).getBouquetName().equalsIgnoreCase(this.bouquetName)) { bouquetToRemoveFlower = bouquetList.get(i); doesBouquetExist = true; } diff --git a/src/main/java/florizz/objects/Bouquet.java b/src/main/java/florizz/objects/Bouquet.java index 05487018b7..961d1364a5 100644 --- a/src/main/java/florizz/objects/Bouquet.java +++ b/src/main/java/florizz/objects/Bouquet.java @@ -137,7 +137,7 @@ public Integer getFlowerQuantity(Flower flowerName) { } /** - * get bouquet name + * Gets bouquet name * @return */ public String getBouquetName() { diff --git a/src/test/java/florizz/command/CompareCommandTest.java b/src/test/java/florizz/command/CompareCommandTest.java index 79129595fb..1f7d7cab6f 100644 --- a/src/test/java/florizz/command/CompareCommandTest.java +++ b/src/test/java/florizz/command/CompareCommandTest.java @@ -39,4 +39,12 @@ void testCompareException2() { // Comparing a flower that does not exist CompareCommand testCompareCommand3 = new CompareCommand("Rose", "Tulip"); assertThrows(FlorizzException.class, () -> testCompareCommand3.execute(testList, ui)); } + + @Test + void testCompareException3() { // Comparing empty flower names + ArrayList testList = new ArrayList<>(); + Ui ui = new Ui(); + CompareCommand testCompareCommand4 = new CompareCommand("", ""); + assertThrows(FlorizzException.class, () -> testCompareCommand4.execute(testList, ui)); + } }