Denish - get volunteers over assigned time #1176
Merged
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
This PR introduces a new functionality to retrieve volunteers who logged hours exceeding their committed weekly hours by 1 hour or more, while filtering out volunteers with committed hours less than 10. The changes include adding a new function
getVolunteersOverAssignedTime
inoverviewReportHelper.js
and integrating it into the API endpoint/api/reports/volunteerstats
.Summary of Changes
getVolunteersOverAssignedTime
function inoverviewReportHelper.js
. This function filters volunteers based on the specified criteria and integrates seamlessly with other reporting helpers.getVolunteerStatsData
function inreportsController.js
to call the new helper function and return its results in the API response.Related PRs (if any)
This PR is based on Backend PR : Abi weekly summary reports page #1062.
Main Changes Explained
overviewReportHelper.js
:getVolunteersOverAssignedTime
function to compute volunteers exceeding their committed hours by 1 or more.reportsController.js
:getVolunteerStatsData
endpoint, ensuring it returns the appropriate data in the API response.How to Test
2.Install Dependencies:
Login Using Postman:
-Endpoint: POST http://localhost:4500/api/login
-Use Owner Credentials to log in.
-Copy the JWT token from the response and paste it into the Postman headers tab under Authorization.
Query the Endpoint:
API Call:
Screenshot
Notes
startDate
andendDate
) provided in the API query reflects a valid period with active volunteers.