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

Abi weekly summary reports page #1062

Open
wants to merge 38 commits into
base: development
Choose a base branch
from
Open

Conversation

Abi-Liu
Copy link
Contributor

@Abi-Liu Abi-Liu commented Aug 12, 2024

Description

This PR implements a new aggregation pipeline for volunteer trends data as well as fixes previous queries for the volunteer hours stats and work distribution stats

New URL format: api/reports/volunteerstats?startDate=2024-05-26&endDate=2024-06-02&comparisonStartDate=2024-05-18&comparisonEndDate=2024-05-25

Changes 9/13

  • Updated API to retrieve comparison data for the following queries:
    • totalActiveTeams
    • totalBadgesAwarded
    • totalHoursWorked
   "totalBadgesAwarded": {
        "current": 40,
        "comparison": 40,
        "percentage": 0
    },
    "totalActiveTeams": {
        "current": 339,
        "comparison": 330,
        "percentage": 0.03
    },
   "totalHoursWorked": {
        "current": 161.93333333333334,
        "comparison": 342.56666666666666,
        "percentage": -0.53
    },

Changes 8/23

  • Updated the api to require a comparisonStartDate and comparisonEndDate
    • This comparison time range is the period in time that will be compared to the current week
  • Created the comparison data for the Volunteer Numbers Stats
    • The new data will be formatted like so:
"volunteerNumberStats": {
        "activeVolunteers": {
            "count": 1373,
            "comparisonPercentage": 0.01
        },
        "newVolunteers": {
            "count": 13,
            "comparisonPercentage": -0.32
        },
        "deactivatedVolunteers": {
            "count": 2,
            "comparisonPercentage": 1
        }
    },

NOTE the for the comparisonPercentage number. -0.32 means a decrese of 32% from the comparison week. 1 is a 100% increase

Related PRS (if any):

This PR is built off of #994

Main changes explained:

  • Created a new query to aggregate the monthly volunteer trends data for the past year.
  • Fixed bugs for the volunteer hours stats and work distribution stats to now return correct data

How to test:

  1. check into current branch
  2. do npm install and npm run dev
  3. Log in with an owner credential to Postman via the endpoint POST http://localhost:4500/api/login and paste the JWT token into the headers tab as shown below
  4. Query the endpoint with Postman: api/reports/volunteerstats?startDate=2024-05-26&endDate=2024-06-02&comparisonStartDate=2024-05-18&comparisonEndDate=2024-05-25
  5. verify the data is correct
    Screenshot 2024-08-12 at 5 00 53 PM

Screenshots or videos of changes:

Screenshot 2024-08-12 at 4 55 30 PM
Screenshot 2024-08-12 at 4 55 48 PM

one-community and others added 25 commits May 5, 2024 22:20
Includes: Xiaoyu chore: check request time off reason missing #937
@Abi-Liu Abi-Liu added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Aug 13, 2024
Copy link

@SMitta11 SMitta11 left a comment

Choose a reason for hiding this comment

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

I tested as per given instructions, initially sent a POST request to get a token and then GET request to get this data of volunteer stats for given start and end date and data matches exactly as given here.
Below screenshots:
PR 1062 FirstScreenshot
PR 1062 SecondScreenshot
PR 1062 ThirdScreenshot

Copy link
Contributor

@AJAYINAVOLU AJAYINAVOLU left a comment

Choose a reason for hiding this comment

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

Changes are working as expected.

1062
1062-2

Thank You.

Copy link
Contributor

@oliviahyw oliviahyw left a comment

Choose a reason for hiding this comment

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

I have tested this PR and it's working as expected.
pr1062

Copy link
Contributor

@Parth-tech Parth-tech left a comment

Choose a reason for hiding this comment

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

Hi Abi,
The the response matches with the provided reference. The API endpoint is working well.

Reference Images:
Screenshot 2024-08-29 at 5 03 53 PM

Copy link
Contributor

@yashwanth170 yashwanth170 left a comment

Choose a reason for hiding this comment

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

I have tested this PR and it's working as expected.
Screenshot 2024-08-31 113408
token

Copy link

@vedantg24 vedantg24 left a comment

Choose a reason for hiding this comment

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

Tested the PR as per the instructions. Changes working as expected.

Screenshot 2024-09-03 at 5 58 01 PM
Screenshot 2024-09-03 at 5 57 38 PM

Copy link

@vishnupriyaatheti vishnupriyaatheti left a comment

Choose a reason for hiding this comment

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

@Abi-Liu I have reviewed your changes. As per dates given in the description the PR is working as expected. But when I change the dates I am the below error. Can you please check and reply

I am passing below dates:
http://localhost:4500/api/reports/volunteerstats?startDate=2024-09-01&endDate=2024-09-07&comparisonStartDate=2024-09-25&comparisonEndDate=2024-09-31

BE PE 1062
BE PR 1062 dates given diferntly

@Shreyav2000 Shreyav2000 self-requested a review September 6, 2024 06:49
Copy link

@Shreyav2000 Shreyav2000 left a comment

Choose a reason for hiding this comment

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

Tested the PR by sending the necessary GET request and verifying the returned data. The volunteer stats, trends, and comparison percentages are working as expected. The aggregation and calculation logic for the volunteerNumberStats and volunteerTrends looks accurate. Everything is functioning as intended. Ready for approval! Nice work! I have attached the screenshots below:
Screenshot 2024-09-06 at 1 39 47 AM
Screenshot 2024-09-06 at 1 47 55 AM

Copy link

@sri0606 sri0606 left a comment

Choose a reason for hiding this comment

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

Hello @Abi-Liu , I have tested the PR as mentioned, and it worked as expected.

Screenshot 2024-09-06 153718
Screenshot 2024-09-06 153734

@chu-ziyu chu-ziyu self-requested a review September 20, 2024 00:45
Copy link

@chu-ziyu chu-ziyu left a comment

Choose a reason for hiding this comment

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

Hi Abi,
I have tested this PR and everything worked as expected!
Screenshot 2024-09-19 at 5 44 59 PM

Copy link

@Lexie5212 Lexie5212 left a comment

Choose a reason for hiding this comment

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

I have tested the PR. And everything is good.
Screenshot 2024-09-19 at 18 03 29

Copy link

@ashayk9 ashayk9 left a comment

Choose a reason for hiding this comment

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

Changes are working as expected
Screenshot 2024-09-20 at 1 30 37 PM
Screenshot 2024-09-20 at 1 38 26 PM

Copy link

@nevatiarishabh nevatiarishabh left a comment

Choose a reason for hiding this comment

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

I have tested the PR. Everything is working as expected.

Screenshot 2024-09-26 at 4 21 57 PM Screenshot 2024-09-26 at 4 21 16 PM

Copy link

@mrinalini-raghavendran19 mrinalini-raghavendran19 left a comment

Choose a reason for hiding this comment

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

This PR does a great job enhancing the reporting capabilities for volunteer statistics, allowing users to analyze trends and compare data effectively over defined time periods.

The new API now retrieves comparison data for various volunteer statistics, including Total Badges Awarded, Total Active Teams and Total Hours Worked in a given time range, with the addition of a start and end date incorporated.

It also provides counts of active, new, and deactivated volunteers, along with their respective comparison percentages relative to a previous week.

I have verified the changes via Postman with owner account credentials. Find below screenshots for the testing:

  1. Passed owner account details in the Body of the POST request with the login url @PORT 4500
Screenshot 2024-09-30 at 3 02 44 PM
  1. Used the JWT token generated with login for auth by passing it in the header, using the updated API that generates volunteer stats
Screenshot 2024-09-30 at 3 06 25 PM

Great job!

@pallavithorat
Copy link

I have reviewed the PR, and everything is working as expected.
PR #1062
PR_ #1062

Copy link

@neeharikakoniki neeharikakoniki left a comment

Choose a reason for hiding this comment

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

This PR successfully adds a new aggregation pipeline for tracking volunteer trends and fixes existing issues with volunteer hours and work distribution stats. I tested the updated API endpoint in Postman, confirming that the comparison data and formatting were accurate and aligned with the specified requirements.

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.