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

feat(api): Moving contribution calculation out of models #1726

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elliotcourant
Copy link
Member

Right now monetr calculates contributions to expenses and goals using
some specific code co-located in the models package. This isn't great as
that package should not contain business logic as much as possible. This
is the groundwork of moving that logic out of that package and to make
use of the existing forecasting code to facilitate the same
calculations. This should also make things more consistent as both the
contribution and spending calculations will be the same code.

Right now monetr calculates contributions to expenses and goals using
some specific code co-located in the models package. This isn't great as
that package should not contain business logic as much as possible. This
is the groundwork of moving that logic out of that package and to make
use of the existing forecasting code to facilitate the same
calculations. This should also make things more consistent as both the
contribution and spending calculations will be the same code.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 27.72277% with 146 lines in your changes are missing coverage. Please review.

Project coverage is 52.29%. Comparing base (852db5f) to head (d6aa0fd).

Files Patch % Lines
server/forecast/contribution.go 0.00% 73 Missing ⚠️
server/forecast/spending.go 55.40% 31 Missing and 2 partials ⚠️
server/controller/forecast.go 0.00% 22 Missing ⚠️
server/forecast/forecast.go 45.45% 16 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1726      +/-   ##
==========================================
- Coverage   52.47%   52.29%   -0.19%     
==========================================
  Files         365      366       +1     
  Lines       20509    20630     +121     
  Branches      500      500              
==========================================
+ Hits        10763    10788      +25     
- Misses       9129     9222      +93     
- Partials      617      620       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

2 participants