feat: Add Goals (goalsV2) support to Budget service#12
Merged
eshaffer321 merged 1 commit intomainfrom Oct 8, 2025
Merged
Conversation
Implements Goals support following Option A approach from analysis: - Add Goal and BudgetWithGoals types - Add ListWithGoals() method to BudgetService interface - Create list_with_goals.graphql query combining budgets and goals - Implement ListWithGoals() in budgetService - Add comprehensive test coverage (4 test cases) Test coverage increased from 37% to 39.3% All 58 tests pass including 4 new Goals tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (41.80%) is below the target coverage (70.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12 +/- ##
==========================================
+ Coverage 40.67% 41.80% +1.12%
==========================================
Files 15 15
Lines 2188 2239 +51
==========================================
+ Hits 890 936 +46
- Misses 1233 1236 +3
- Partials 65 67 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GoalandBudgetWithGoalstypes to support financial goals trackingListWithGoals()method toBudgetServiceinterfaceImplementation Details
New Types (pkg/monarch/types.go)
Goalstruct with fields: id, name, type, amounts, target dates, account info, progress trackingBudgetWithGoalsstruct that embedsBudgetand includesGoalsarrayNew Interface Method (pkg/monarch/interfaces.go)
ListWithGoals(ctx, startDate, endDate)- retrieves budgets with associated goalsGraphQL Query (internal/graphql/queries/budgets/list_with_goals.graphql)
budgetDataandgoalsV2queries in a single requestImplementation (pkg/monarch/budgets.go)
Test Coverage (pkg/monarch/budgets_test.go)
TestBudgetService_ListWithGoals: Full test with budgets and goalsTestBudgetService_ListWithGoals_NoGoals: Budget data without goalsTestBudgetService_ListWithGoals_EmptyResponse: Empty response handlingTestBudgetService_ListWithGoals_MultipleGoals: Multiple goals testTest Results
✅ All 4 new ListWithGoals tests pass
✅ All existing budget tests still pass (6 total)
✅ All 58 tests in pkg/monarch package pass
✅
go vet ./...passes with no issues✅ Coverage increased from 37% to 39.3%
Test plan
go test ./pkg/monarch/... -v- all tests passgo vet ./...- no issues found🤖 Generated with Claude Code