Skip to content

feat: enhance GIVpower scoring functionality - #54

Merged
alireza-sharifpour merged 13 commits into
mainfrom
staging
Sep 6, 2025
Merged

feat: enhance GIVpower scoring functionality#54
alireza-sharifpour merged 13 commits into
mainfrom
staging

Conversation

@alireza-sharifpour

Copy link
Copy Markdown
Member
  • Added project power ranking information to GraphQL queries.
  • Updated EvaluationService to use topPowerRank instead of totalProjectCount for GIVpower scoring.
  • Refactored ScoringService to calculate GIVpower rank score based on topPowerRank, including edge case handling for invalid ranks.
  • Adjusted ScoringInputDto to replace totalProjectCount with topPowerRank for improved clarity and functionality in scoring calculations.

alireza-sharifpour and others added 13 commits August 19, 2025 17:33
- Added project power ranking information to GraphQL queries.
- Updated EvaluationService to use topPowerRank instead of totalProjectCount for GIVpower scoring.
- Refactored ScoringService to calculate GIVpower rank score based on topPowerRank, including edge case handling for invalid ranks.
- Adjusted ScoringInputDto to replace totalProjectCount with topPowerRank for improved clarity and functionality in scoring calculations.
- Deleted the GET_TOP_POWER_RANK_QUERY as it is no longer needed for GIVpower scoring normalization.
- Deleted the getTopPowerRank method as it is no longer necessary for GIVpower scoring normalization, following recent updates to scoring calculations.
- Deleted the getTopPowerRank method and the GET_TOP_POWER_RANK_QUERY as they are no longer necessary for GIVpower scoring normalization, streamlining the ImpactGraphService.
- Revised comments in ScoringInputDto to enhance clarity regarding the highest power rank value for normalization, specifying behavior when null or undefined.
…d improved logging

- Added checks to prevent division by zero in scoring calculations, returning 0 and logging warnings for invalid decay days and minimum posts thresholds.
- Improved logging for GIVpower rank score calculations, including input values and results for better debugging.
- Updated the getDaysSince method to return 0 for future dates, ensuring accurate decay calculations.
- Modified evaluateProjects method to accept projects with power data and highestPowerRank, enhancing flexibility in project evaluations.
- Improved logging to include project power data and evaluation details for better debugging.
- Removed the need to fetch top power rank, streamlining the evaluation process and reducing unnecessary queries.
- Updated related methods to ensure consistent handling of power rank values across evaluations.
- Introduced ProjectWithPowerDto to encapsulate project ID and optional power metrics.
- Updated EvaluateProjectsRequestDto to accept an array of ProjectWithPowerDto, enhancing the structure for project evaluations.
…werRank

- Added highestPowerRank property to EvaluateMultipleCausesRequestDto, allowing for optional inclusion of a numeric power rank in evaluation requests.
- Enhanced validation with IsOptional and IsNumber decorators to ensure proper handling of the new property.
@alireza-sharifpour
alireza-sharifpour merged commit 40d26d2 into main Sep 6, 2025
6 checks passed
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.

1 participant