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 calculations of budget and savings #172

Merged

Conversation

zhaojj2209
Copy link

@zhaojj2209 zhaojj2209 commented Oct 24, 2020

Resolves #170.
Resolves #171.

Changes:

  • ObservableAmount is no longer abstract to avoid duplication of similar classes
  • Added calculations of monthly expenses, monthly incomes and monthly savings for the past 3 months in MonthlyBudget; these values are not stored in the finance tracker but are calculated whenever the amounts in the finance tracker's transactions changes.
  • Added a boolean to CommandResult to track when the budget information in MonthlyBudget needs to be recalculated.
  • Added an overloaded constructor to assertCommandSuccess to pass tests; likely a temporary fix, will try to think of something better down the line.
  • All calculations of the current month's budget/savings will be displayed in the SavingsGoalPanel for easy reference for now.

@zhaojj2209 zhaojj2209 added type.enhancement 👍 New feature or request priority.medium 🥈 Todo for current iteration labels Oct 24, 2020
@zhaojj2209 zhaojj2209 added this to the v1.3 milestone Oct 24, 2020
@codecov-io
Copy link

codecov-io commented Oct 24, 2020

Codecov Report

Merging #172 into master will decrease coverage by 0.52%.
The diff coverage is 72.02%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #172      +/-   ##
============================================
- Coverage     76.03%   75.51%   -0.53%     
- Complexity      771      787      +16     
============================================
  Files           131      129       -2     
  Lines          2270     2381     +111     
  Branches        243      252       +9     
============================================
+ Hits           1726     1798      +72     
- Misses          447      488      +41     
+ Partials         97       95       -2     
Impacted Files Coverage Δ Complexity Δ
...021s1_cs2103_w16_3/finesse/logic/LogicManager.java 81.48% <0.00%> (-6.52%) 9.00 <0.00> (ø)
...ava/ay2021s1_cs2103_w16_3/finesse/model/Model.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
...a/ay2021s1_cs2103_w16_3/finesse/ui/MainWindow.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...21s1_cs2103_w16_3/finesse/ui/SavingsGoalPanel.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...cs2103_w16_3/finesse/ui/tabs/AnalyticsTabPane.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...2103_w16_3/finesse/logic/commands/EditCommand.java 94.11% <75.00%> (-1.27%) 14.00 <1.00> (+1.00) ⬇️
...3_w16_3/finesse/model/budget/ObservableAmount.java 53.84% <75.00%> (-46.16%) 4.00 <1.00> (-1.00)
...2103_w16_3/finesse/model/budget/MonthlyBudget.java 85.71% <86.48%> (+2.38%) 19.00 <14.00> (+13.00)
...16_3/finesse/logic/commands/AddExpenseCommand.java 100.00% <100.00%> (ø) 7.00 <0.00> (ø)
...w16_3/finesse/logic/commands/AddIncomeCommand.java 100.00% <100.00%> (ø) 7.00 <0.00> (ø)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4f65da...3456f19. Read the comment docs.

@zhaojj2209 zhaojj2209 marked this pull request as ready for review October 24, 2020 16:05
@zhaojj2209 zhaojj2209 requested a review from a team October 24, 2020 16:05
Copy link

@yongping827 yongping827 left a comment

Choose a reason for hiding this comment

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

Addition of expenses does not affect the remaining budget.

@ianyong ianyong mentioned this pull request Oct 24, 2020
Copy link

@yongping827 yongping827 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ianyong ianyong left a comment

Choose a reason for hiding this comment

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

LGTM!

@ianyong ianyong merged commit d7fbd22 into AY2021S1-CS2103T-W16-3:master Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.medium 🥈 Todo for current iteration type.enhancement 👍 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

View savings View remaining budget
4 participants