-
Notifications
You must be signed in to change notification settings - Fork 140
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
[CS2113-W14-3] FinanceBuddy #25
base: master
Are you sure you want to change the base?
[CS2113-W14-3] FinanceBuddy #25
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some areas can be simplified to make the logic and flow more obvious and simpler to read. Keep up the good work!
System.out.println("--------------------------------------------"); | ||
System.out.println("Got it! I've added this income:"); | ||
System.out.println(income); | ||
System.out.println("--------------------------------------------"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be good to refactor this such that it is not magic strings
FinancialEntry entry = list.getEntry(index - 1); | ||
list.deleteEntry(index - 1); // Index correction as list is 0-based |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can refactor index - 1
as a variable since it is used multiple times, and also to make it clearer that it is because list is 0-based
if (index > 0 && index <= list.getEntryCount()) { | ||
assert index > 0 && index <= list.getEntryCount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is used multiple times, you could refactor the condition statement as a boolean variable
} else { | ||
System.out.println("OOPS!!! The entry does not exist."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make the happy path more prominent by making this a guard clause instead
private LocalDate start; | ||
private LocalDate end; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name might be a bit ambiguous, maybe it could be better refined as startDate
?
} else { | ||
System.out.println("OOPS!!! The entry does not exist."); | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this can be converted into an error?
* and the amount ("/a") and the date/time ("/dt") | ||
*/ | ||
public void addExpense(HashMap<String, String> commandArguments) { | ||
String description = commandArguments.get("argument"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to refactor these magic strings
String start = commandArguments.get("/from"); | ||
String end = commandArguments.get("/to"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can better name these variables to startDateString
, as it might be confusing alongside startDate
and endDate
.
addExpenseCommand.execute(financialList); | ||
|
||
String output = outputStream.toString(); | ||
String expectedOutput = "--------------------------------------------" + System.lineSeparator() + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe can keep the consistency between \n
and System.lineSeperator()
* @param input The raw input string from the user. | ||
* @return A HashMap containing the parsed command and its arguments. | ||
*/ | ||
public static HashMap<String, String> parseCommands(String input) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can look to splitting this method to multiple simpler methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good job!
docs/UML/CommandInheritance.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found quite a few rounded rectangles, consider using normal rectangle boxes.
docs/UML/SeeAllEntriesExecution.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objects are missing semi-colons, for example :Logic (in quite a few sequence diagrams).
docs/UML/SeeAllEntriesOverview.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameters are missing the corresponding types.
docs/UML/SeeAllEntriesOverview.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certain conditions in 'alt' can be indicated as "else".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diagram is mostly correct. I added some comments for your reference.
docs/DeveloperGuide.md
Outdated
The diagram below shows the inheritance of the `Command` class. The diagram is only meant to show | ||
the hierarchy of classes and have been greatly simplified. | ||
|
||
![Command_Inheritance_Diagram](UML/CommandInheritance.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a normal rectangle instead of a rounded rectangle
docs/DeveloperGuide.md
Outdated
The diagram below shows the inheritance of the `Command` class. The diagram is only meant to show | ||
the hierarchy of classes and have been greatly simplified. | ||
|
||
![Command_Inheritance_Diagram](UML/CommandInheritance.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider switching the direction of the arrow
docs/DeveloperGuide.md
Outdated
The diagram below shows the inheritance of the `Command` class. The diagram is only meant to show | ||
the hierarchy of classes and have been greatly simplified. | ||
|
||
![Command_Inheritance_Diagram](UML/CommandInheritance.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using an empty arrow instead of a filled arrow
docs/DeveloperGuide.md
Outdated
The interaction between the command classes and the `FinancialList` is as follows, | ||
using `SeeAllEntriesCommand` as an example: | ||
|
||
![execution](UML/SeeAllEntriesExecution.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding [else] for the alt frame
docs/DeveloperGuide.md
Outdated
The interaction between the command classes and the `FinancialList` is as follows, | ||
using `SeeAllEntriesCommand` as an example: | ||
|
||
![execution](UML/SeeAllEntriesExecution.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a ":" before an entities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, its a really good DP, as each command have a lot of details and the DP is structured neatly! Just take note of the minor details and should be alright.
docs/UML/SeeAllEntriesOverview.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally a well drawn diagram, but would be better if there are activation bars!
docs/UML/SeeAllEntriesExecution.puml
Outdated
participant "SeeAllEntriesCommand" as cmd | ||
participant "FinancialList" as list | ||
participant "FinancialEntry" as entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to start the entity's name with a colon?
docs/UML/overallFlow.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall DG is ok but there is something needs to be added
docs/UML/SeeAllEntriesExecution.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sequence diagram seems miss the activation bar.
docs/UML/overallFlow.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This structural diagram is clear.
.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is good to put data into the gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no example of input and output screenshots for the explanation with the DG.
Update UG post ped
Add-storage-feedback
Bugfix edit out of position
…-Time-Feature Update DateParser
Update PPP
Developer Guide
Update DG final
Ug duplicate
Update UserGuide.md
Developer guide
User guide
Finance Buddy is a software that allows university students to log their daily expenditures to help manage their budgets. Users can add, delete and edit expenditure logs into the app as well as list out all their logged transactions.