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

Add data storage and retrieval functionality of transactions #18

Merged
merged 16 commits into from
Mar 20, 2024

Conversation

ShyamKrishna33
Copy link

No description provided.

# Conflicts:
#	src/main/java/budgetbuddy/BudgetBuddy.java
@vibes-863
Copy link

Please resolve merge conflict! Thank you!

Copy link

@vibes-863 vibes-863 left a 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";

Choose a reason for hiding this comment

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

Good use of assertions!

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!

Copy link

@Vavinan Vavinan 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. 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";
Copy link

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

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"

@Vavinan Vavinan merged commit fa37ab4 into AY2324S2-CS2113-T15-2:master Mar 20, 2024
3 checks passed
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.

3 participants