add goal entity, endpoint, and admin dashboard integration#112
Merged
add goal entity, endpoint, and admin dashboard integration#112
Conversation
Collaborator
|
Good work, you weren't able to test the backend so there were a couple of issues which i resolved (in the interest of time). I also made a couple extra consistency edits to the components, details below: Backend
Frontend
|
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.
Description
Implements dynamic GrowingGoal functionality for the Admin Dashboard by introducing a Goal entity and backend endpoint to calculate and return progress based on donations. Reuses the existing GrowingGoal component and connects it to backend data instead of hardcoded values.
Changes Made
Backend changes
Created new Goal entity (goal.entity.ts) to store target amount and date range
Registered Goal entity in data-source.ts and donations.module.ts
Added getActiveGoalSummary() in DonationsService to determine active goal, calculate total donations in range, compute progress, and format date range
Added GET /donations/goal/active endpoint in DonationsController to return goal data and progress
Frontend changes
Created AdminGrowingGoal.tsx to fetch data from /donations/goal/active and handle loading, error, and empty states
Reused existing GrowingGoal component and replaced hardcoded values with dynamic props
Testing & Verification
Future Improvements/Notes