-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add data storage and retrieval functionality of transactions #18
Add data storage and retrieval functionality of transactions #18
Conversation
# Conflicts: # src/main/java/budgetbuddy/BudgetBuddy.java
Please resolve merge conflict! Thank you! |
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 went through the code, it looks good to me! We can merge it!
f.createNewFile(); | ||
} | ||
|
||
assert f.exists() : "File 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.
Good use of assertions!
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.
Nice job of extracting the code into multiple 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. Consider avoiding some magic numbers
String[] transactionInfo = s.split(" ,"); | ||
|
||
assert transactionInfo.length == 5 : "Invalid transaction information format"; | ||
assert transactionInfo[2].equals("Income") || transactionInfo[2].equals("Expense") : "Invalid transaction type"; |
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.
Nice work on adding assertions at appropriate places
case "Income": | ||
return new Income(transactionInfo[0], Double.parseDouble(transactionInfo[4]), | ||
transactionInfo[1], transactionInfo[3], account); | ||
case "Expense": |
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 constants for "Expense" and "Income"
No description provided.