Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DG with sequence diagram #239

Merged
merged 4 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions StonksXD_Entries.csv
Original file line number Diff line number Diff line change
@@ -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
26 changes: 24 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---
Expand Down Expand Up @@ -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)

<to be updated>

---

##### Converting user inputs to commands

Expand Down Expand Up @@ -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.

---

Expand Down Expand Up @@ -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.
<br>

Expand Down
Binary file added docs/FinancialTrackerCD.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/StonksXDSequenceDiagram.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions src/main/java/seedu/duke/StonksXD.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

/**
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/seedu/utility/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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();
}

Expand Down