Skip to content

Roshini Seelamsetty - (PRIORITY HIGH) Yagna: Hours Completed / Tasks Report – Data Accuracy Needs Review #2104

Open
roshini1212 wants to merge 1 commit intodevelopmentfrom
roshini_fix_hours_completed_accuracy
Open

Roshini Seelamsetty - (PRIORITY HIGH) Yagna: Hours Completed / Tasks Report – Data Accuracy Needs Review #2104
roshini1212 wants to merge 1 commit intodevelopmentfrom
roshini_fix_hours_completed_accuracy

Conversation

@roshini1212
Copy link
Copy Markdown

@roshini1212 roshini1212 commented Mar 15, 2026

Description

Screenshot 2026-03-21 at 22 06 07

Related PRS (if any):

This backend PR is related to the #5000 frontend PR (roshini_feat_hours_chart_percentage_label).
To test this backend PR you need to checkout the (OneCommunityGlobal/HighestGoodNetworkApp#5000) frontend PR.

Main changes explained:

  • Update src/helpers/overviewReportHelper.js to fix getTaskHours() to only count entries where taskId is a valid ObjectId, and fix getProjectHours() to exclude entries where taskId is already an ObjectId to prevent double-counting
  • Update src/helpers/overviewReportHelper.js to fix hoursSubmittedToTasksPercentage calculation from taskHours / projectHours to taskHours / (taskHours + projectHours) * 100
  • Update src/helpers/overviewReportHelper.js to add taskPercentage, projectPercentage, totalTangibleHours, and hoursDistributionLabel fields to the response for frontend consumption

How to test:

  1. Check out roshini_fix_hours_completed_accuracy branch
  2. Run npm install then npm start to run the backend locally
  3. Clear site data/cache
  4. Log in as Owner
  5. Go to Reports → Hours Completed (Tasks view)
  6. Set a historical date range with known data (e.g. Jan 2025 – Mar 2026)
  7. Verify the Hours Completed header shows a reasonable percentage (not thousands of %)
  8. Verify the API response includes hoursDistributionLabel in format "X% Tasks | Y% Projects (Total = 100%)"
  9. Verify taskHours and projectHours in the API response are not double-counting the same entries

Screenshots or videos of changes:

Before:

Backend Before

After:

Screenshot 2026-03-14 at 22 31 49

@sonarqubecloud
Copy link
Copy Markdown

@roshini1212 roshini1212 changed the title Roshini - Fix Hours Completed Report Data Accuracy and Prevent Double Counting in Task and Project Stats Roshini Seelamsetty - Fix Hours Completed Report Data Accuracy and Prevent Double Counting in Task and Project Stats Mar 17, 2026
@roshini1212 roshini1212 changed the title Roshini Seelamsetty - Fix Hours Completed Report Data Accuracy and Prevent Double Counting in Task and Project Stats Roshini Seelamsetty - (PRIORITY HIGH) Yagna: Hours Completed / Tasks Report – Data Accuracy Needs Review Mar 22, 2026
@Anusha-Gali Anusha-Gali added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Mar 24, 2026
Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Roshini,

I have reviewed your PR locally and the API works as per requirement.

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.

2 participants