Skip to content

Xiaolei Implement Bar Graph named Lessons Learned backend #1302

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

Merged
merged 3 commits into from
Jun 19, 2025

Conversation

niccccccccer
Copy link
Contributor

Description

image

Related PRS (if any):

None

Main changes explained:

  • Added a new endpoint for GET /lessons-learnt.

  • Implemented filtering by projectId and date range.

  • Aggregated lesson counts and calculated the month-over-month percentage change.

How to test:

  1. check into current branch

  2. do npm install and npm run dev to run this PR locally

  3. Get authentication token (normal user)

    Make a POST request to:
    http://localhost:4500/api/login

    Request body (replace with your own credentials):
    {
    "email": "your-email",
    "password": "your-password"
    }

  4. Get authentication token (BM Dashboard user)

    Make a POST request to:
    http://localhost:4500/api/bm/login

    Headers:
    Authorization: your-token

    Request body (replace with your own credentials):
    {
    "email": "your-email",
    "password": "your-password"
    }

  5. Test GET http://localhost:4500/api/bm/lessons-learnt

    Headers:
    Authorization: your-token (BM Dashboard user)

    Query parameters optional:
    projectId (optional) – Filter by a specific project.
    startDate & endDate (optional) – Retrieve lessons within a date range.

Screenshots or videos of changes:

image

Copy link

@akanksha7 akanksha7 left a comment

Choose a reason for hiding this comment

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

Tested out the endpoint, it is working as expected to return the projectID, project, lessonsCount and changePercentage.

  1. Without the query params:
PR 1302
  1. With the query params:
Screenshot 2025-04-04 at 4 10 48 PM Screenshot 2025-04-04 at 4 11 00 PM

@Dharmik1710
Copy link
Contributor

Dharmik1710 commented Apr 6, 2025

Tested the new /api/bm/lessons-learnt endpoint with and without query parameters. The API returns the expected structure with project, lessonsCount, and changePercentage, supporting filtering by project and date range.

Verified correct behavior across edge cases including empty result sets, invalid project IDs, and partial date filters. All responses return with proper status codes and consistent formatting.

The endpoint integrates cleanly with BM dashboard requirements and works as intended. Good addition for supporting the new visualization.

Screenshot 2025-04-06 at 1 29 43 AM Screenshot 2025-04-06 at 1 29 56 AM Screenshot 2025-04-06 at 2 28 04 AM

Copy link

@pavanputti pavanputti 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 the fix by checking out the current branch, running npm install and npm run dev to start the app locally. I obtained an authentication token for a normal user by sending a POST request to http://localhost:4500/api/login with my credentials. For a BM Dashboard user, I sent a POST request to http://localhost:4500/api/bm/login with the appropriate credentials and token in the Authorization header. I then tested the GET request to http://localhost:4500/api/bm/lessons-learnt using the BM Dashboard user’s token in the Authorization header, optionally including query parameters like projectId, startDate, and endDate, and verified the response was correct.

Screenshot 2025-04-19 at 11 32 54 PM Screenshot 2025-04-19 at 11 34 59 PM Screenshot 2025-04-19 at 11 37 02 PM

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Jun 2, 2025
@one-community
Copy link
Member

Thank you all, merging!

@one-community one-community merged commit 18545a5 into development Jun 19, 2025
1 check passed
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.

5 participants