diff --git a/StonksXD_Entries.csv b/StonksXD_Entries.csv index ce992a3e0c..d669b29456 100644 --- a/StonksXD_Entries.csv +++ b/StonksXD_Entries.csv @@ -1,5 +1,9 @@ entry_type,entry_description,amount,category,date E,qwe,12.5,FOOD,11/11/2121 E,qwe,0.5,FOOD,11/11/2121 +E,food,500.0,FOOD,06/11/2021 +E,a,5.0E8,FOOD,06/11/2021 +E,a,5.0E8,FOOD,06/11/2021 +E,a,5.0E8,FOOD,06/11/2021 I,qwe,12.5,SALARY,11/11/2121 I,qwe,12.5,ALLOWANCE,11/11/2121 diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 00b9763193..c6a3a6a120 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -87,7 +87,10 @@ It interacts with `FinancialTracker` and `BudgetManager` and receives commands f `DataManager` ← `StonksXD_data.csv` +The Sequence Diagram below shows how the components interact with each other in a typical feedback loop. +It is illustrated using the hypothetical scenario where the user issues the command `del_ex i/1`. +![](StonksXDSequenceDiagram.drawio.png) The sections below provide more information on the respective components. --- @@ -129,6 +132,21 @@ The `Parser` class is in charge of: `Parser` mainly uses regex to parse items. +--- + +### Financial Tracker Component + +The `FinancialTracker` class is in charge of storing, deleting, and retrieving income and +expense related calculations while the program is running. It performs these operations based +on the different commands it receives from the user. + +The class diagram below shows the structure of `FinancialTracker`. + +![](FinancialTrackerCD.drawio.png) + + + +--- ##### Converting user inputs to commands @@ -339,7 +357,11 @@ It is designed to fit the needs of students who travel frequently and prefer log ### Value proposition -{Describe the value proposition: what problem does it solve?} +StonksXD a global financial tracking journal, capable of both budgeting and +analysis to serve financial needs while traveling. It is highly operable and +intuitive command line program that is simple to use and is optimized for +anyone on the go. Using a minimalistic command format, we aim to empower +youth to manage their finances by making personal finance entries simple. --- @@ -486,7 +508,7 @@ Below is a list of the currently available tests: Intellij comes with an in-built Gradle Daemon that can be used to run the following test: - `.\gradlew test` to check if all test files have passed. -- `.\graldew checkStyleTest` to check if test files comply with certain coding standards and conventions. +- `.\gradlew checkStyleTest` to check if test files comply with certain coding standards and conventions. - `.\gradlew checkStyleMain` to check if main program complies with all JAVA coding standards.
diff --git a/docs/FinancialTrackerCD.drawio.png b/docs/FinancialTrackerCD.drawio.png new file mode 100644 index 0000000000..8e86c1f057 Binary files /dev/null and b/docs/FinancialTrackerCD.drawio.png differ diff --git a/docs/StonksXDSequenceDiagram.drawio.png b/docs/StonksXDSequenceDiagram.drawio.png new file mode 100644 index 0000000000..07dff914cd Binary files /dev/null and b/docs/StonksXDSequenceDiagram.drawio.png differ diff --git a/src/main/java/seedu/duke/StonksXD.java b/src/main/java/seedu/duke/StonksXD.java index 4fe54da302..b618d20323 100644 --- a/src/main/java/seedu/duke/StonksXD.java +++ b/src/main/java/seedu/duke/StonksXD.java @@ -21,6 +21,7 @@ public class StonksXD { private final DataManager dataManager; private final BudgetManager budgetManager; private final CurrencyManager currencyManager; + private boolean isNonTerminatingCommand = true; /** * Constructor for StonksXD. It instantiates all the components used and are crucial to the functioning of the @@ -43,17 +44,21 @@ public StonksXD() { */ public void run() { ui.printWelcome(); - boolean isNonTerminatingCommand = true; + while (isNonTerminatingCommand) { String fullCommand = ui.readCommand(); Command command = parser.parseCommand(fullCommand); command.execute(finances, ui, budgetManager, currencyManager); if (command.isExit()) { - isNonTerminatingCommand = false; + terminateStonksXD(); } dataManager.saveAll(); } - //ui.printBye(getRandomAdvice()); + //ui.printBye(); + } + + private void terminateStonksXD() { + isNonTerminatingCommand = false; } /** diff --git a/src/main/java/seedu/utility/Ui.java b/src/main/java/seedu/utility/Ui.java index 66aa0d6ac3..7a678d687d 100644 --- a/src/main/java/seedu/utility/Ui.java +++ b/src/main/java/seedu/utility/Ui.java @@ -11,6 +11,8 @@ import java.util.ArrayList; import java.util.Scanner; +import static seedu.utility.tools.FinancialAdvisor.getRandomAdvice; + /** * Represents a user interface where feedbacks are given in response to user input. */ @@ -300,13 +302,12 @@ public void printHelp() { /** * Prints the termination message of the STONKS XD program. * - * @param advice The advice given by our Stonks program, given from a list of random advices. */ - public void printBye(String advice) { + public void printBye() { printLine(); System.out.println(Messages.BYE_MESSAGE); System.out.println(NEW_LINE); - System.out.println(Messages.TIP_HEADER + advice); + System.out.println(Messages.TIP_HEADER + getRandomAdvice()); printLine(); }