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

Merged
merged 63 commits into from
Jan 12, 2025
Merged

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

@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

@nikhilpittala16 nikhilpittala16 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 works as expected.
Screenshot (179)

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

@Lexie5212 Lexie5212 self-requested a review September 20, 2024 00:54
strallia and others added 4 commits December 3, 2024 19:08
…eer-status-pie-chart

Strallia/Faye: Data for Volunteer Status Pie Chart on Total Org Summary Page
…omparision

Nishita_team_stats_comparision_for_total_org_summary_page
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.