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

[CS2113-W14-3] FinanceBuddy #25

Open
wants to merge 947 commits into
base: master
Choose a base branch
from

Conversation

limkongkiat
Copy link

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.

Copy link

@thomasjlalba thomasjlalba left a 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!

Comment on lines 47 to 50
System.out.println("--------------------------------------------");
System.out.println("Got it! I've added this income:");
System.out.println(income);
System.out.println("--------------------------------------------");

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

Comment on lines 31 to 32
FinancialEntry entry = list.getEntry(index - 1);
list.deleteEntry(index - 1); // Index correction as list is 0-based

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

Comment on lines 29 to 30
if (index > 0 && index <= list.getEntryCount()) {
assert index > 0 && index <= list.getEntryCount();

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

Comment on lines 37 to 38
} else {
System.out.println("OOPS!!! The entry does not exist.");

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

Comment on lines 13 to 14
private LocalDate start;
private LocalDate end;

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?

Comment on lines 55 to 58
} else {
System.out.println("OOPS!!! The entry does not exist.");
return null;
}

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");

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

Comment on lines 140 to 141
String start = commandArguments.get("/from");
String end = commandArguments.get("/to");

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() +

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) {

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

Copy link

@ZiliaAJY ZiliaAJY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good job!

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.

Copy link

@ZiliaAJY ZiliaAJY Oct 30, 2024

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).

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.

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".

Copy link

@telferang telferang left a 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.

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)

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

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)

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

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)

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

The interaction between the command classes and the `FinancialList` is as follows,
using `SeeAllEntriesCommand` as an example:

![execution](UML/SeeAllEntriesExecution.png)

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

The interaction between the command classes and the `FinancialList` is as follows,
using `SeeAllEntriesCommand` as an example:

![execution](UML/SeeAllEntriesExecution.png)

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

Copy link

@hzxnancy hzxnancy left a 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.

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!

Comment on lines 6 to 8
participant "SeeAllEntriesCommand" as cmd
participant "FinancialList" as list
participant "FinancialEntry" as entry

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask if this is an activity diagram? If it is, it would be better to use coloured cirlces to denote the start and end of the program!
image

Copy link

@Toby-Yu Toby-Yu left a 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

Copy link

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.

Copy link

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
Copy link

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

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants