Skip to content

add goal entity, endpoint, and admin dashboard integration#112

Merged
thaninbew merged 3 commits intomainfrom
GrowingGoal-AdminDashboard
Apr 13, 2026
Merged

add goal entity, endpoint, and admin dashboard integration#112
thaninbew merged 3 commits intomainfrom
GrowingGoal-AdminDashboard

Conversation

@pujitakalinadhabhotla
Copy link
Copy Markdown
Contributor

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

  • Manual testing was not completed due to Docker environment issues preventing the backend from running locally.

Future Improvements/Notes

  • need to still test

@thaninbew thaninbew self-requested a review April 13, 2026 21:14
@thaninbew thaninbew linked an issue Apr 13, 2026 that may be closed by this pull request
@thaninbew
Copy link
Copy Markdown
Collaborator

thaninbew commented Apr 13, 2026

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

  • Created Goal entity to store target amount and dates.
  • Registered Goal in data source and donations module.
  • Added /api/donations/goal/active public GET endpoint.
  • Implemented logic to sum succeeded donations within the active goal's date range.
  • Mocked the active goal response for testing.

Frontend

  • Created useActiveGoal custom hook to centralize data fetching via ApiClient.
  • Refactored GrowingGoal component:
    • Added admin variant for different styling.
    • Set background to #FCFCFC.
    • Added box shadows to container and progress bar.
    • Fixed font to Source Sans Pro.
    • Added percentage complete calculation and pill UI.
    • Added safety checks for division by zero.
  • Integrated AdminGrowingGoal into the Admin Dashboard.
  • Updated Donation Page (Root) to use dynamic goal data.
  • Added AdminGrowingGoalTester page for visual verification.

@thaninbew thaninbew merged commit fcb6ce0 into main Apr 13, 2026
4 checks passed
@thaninbew thaninbew deleted the GrowingGoal-AdminDashboard branch April 13, 2026 22:54
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.

GrowingGoal refactor + implementation in Admin Dashboard

2 participants