Skip to content

Rohit - Fix Lessons Learnt MoM Percentage Calculation and Date Filtering - #2469

Open
RohSrik wants to merge 1 commit into
developmentfrom
Rohit_fix_lessons_mom_percentage
Open

RohSrik wants to merge 1 commit into
developmentfrom
Rohit_fix_lessons_mom_percentage

Conversation

@RohSrik

@RohSrik RohSrik commented Nov 5, 2026 •

Copy link
Copy Markdown

Description

Fixed incorrect month-over-month (MoM) percentages and date filtering in the Lessons Learnt chart. Previously, the API showed +100% when the previous month had zero lessons and excluded some lessons recorded on the selected end date.
image
image

Related PRS (if any):

Frontend: #5781

Main changes explained:

  • Updated bmNewLessonController.js to return N/A instead of +100% when the previous month's count is zero.
  • Fixed end-date filtering to include the entire selected day.
  • Updated unit tests to verify both fixes.

How to test:

  1. Checkout the Rohit_fix_lessons_mom_percentage branch in HGNRest and HighestGoodNetworkApp.
  2. Run npm install if needed, then start the backend using npm run dev and the frontend locally.
  3. Navigate to BM Dashboard → Total Construction Summary → Lessons Learned → Lessons Learnt.
  4. Select 10/01/2026 – 10/31/2026 and verify that N/A appears when the previous month has zero lessons.
  5. Verify that lessons recorded on the selected end date are included.
  6. Run the backend controller tests and verify that all 40 tests pass.

Screenshots or videos of changes:

Before:
image

After:
image

image

Note:

  • This backend PR should be tested with the corresponding frontend branch, Rohit_fix_lessons_mom_percentage.
  • The Unknown Project label is being addressed in separate PRs (Backend #2462 and Frontend #5773).

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@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 Nov 6, 2026

This branch has not been deployed

No deployments
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.

2 participants