Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denish - New Filed Added for gettotalsummariessubmitted #1207

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

Dk-21
Copy link
Contributor

@Dk-21 Dk-21 commented Jan 25, 2025

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 in overviewReportHelper.js and integrating it into the API endpoint /api/reports/volunteerstats.

Summary of Changes

  • Added Functionality:
    • Created getTotalSummariesSubmitted function in overviewReportHelper.js. This function filters volunteers based on the specified criteria and integrates seamlessly with other reporting helpers.
  • Updated API Controller:
    • Modified getVolunteerStatsData function in reportsController.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

  • File Updates:
    • overviewReportHelper.js:
      • Added getTotalSummariesSubmitted function to compute volunteers exceeding their committed hours by 1 or more.
    • reportsController.js:
      • Integrated the new helper function into the getVolunteerStatsData endpoint, ensuring it returns the appropriate data in the API response.

How to Test

  1. Check into the Current Branch:
    git checkout add-getVolunteersOverAssignedTime

2.Install Dependencies:

 npm install
  1. Run the Application:
npm run dev
  1. 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.

  2. Query the Endpoint:
    API Call:

GET http://localhost:4500/api/reports/volunteerstats?startDate=2024-05-26&endDate=2024-06-02](http://localhost:4500/api/reports/volunteerstats?startDate=2024-05-26&endDate=2024-06 02&comparisonStartDate=2024-05-18&comparisonEndDate=2024-05-25

Screenshot

getTotalSummariesSubmitted

Notes

  • Ensure that the date range (startDate and endDate) provided in the API query reflects a valid period with active volunteers.
  • Also TO Compare You need to provide the comaprison Dates as well.
  • Verify that the JWT token used in Postman is from an Owner account to access restricted data.
  • Feel free to include screenshots or logs to confirm the data integrity during testing.

Copy link
Contributor

@strallia strallia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verify that the totalSummariesSubmitted field is returned in the response and retrieving expected data.

For testing purposes, I added this data into a user profile document:

image

API works with and without comparison dates:

image image

@strallia strallia changed the base branch from abi-volunteer-trends to development January 27, 2025 19:22
@strallia strallia changed the title New Filed Added for gettotalsummariessubmitted Denish - New Filed Added for gettotalsummariessubmitted Jan 27, 2025
@one-community one-community merged commit 4aba719 into development Jan 27, 2025
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.

3 participants