Skip to content

Sripriya - Add financial overview endpoint for the Financials Overview cost cards - #2471

Open
Sripriya03-hub wants to merge 2 commits into
developmentfrom
Sripriya_financials_overview_cards
Open

Sripriya03-hub wants to merge 2 commits into
developmentfrom
Sripriya_financials_overview_cards

Conversation

@Sripriya03-hub

@Sripriya03-hub Sripriya03-hub commented Nov 5, 2026 •

Copy link
Copy Markdown

Description:
This is the Phase 2 task "Add the Financials: Overview row with 6 cost cards". This PR adds the backend for it: one endpoint that returns all 6 cards for the Total Construction Summary page, with a week over week change like the Project Status cards.

1 task from Google Doc

Related PRS:
Frontend PR: OneCommunityGlobal/HighestGoodNetworkApp#5783. Both are needed to test.

Main changes explained:

  • Added GET /api/bm/weekly-project-summary/financial-overview. It takes the same filters as project-status: startDate, endDate, an optional projectId, and optional comparison dates.
  • Total Material Cost and Total Equipment Cost come from approved material and tool purchases in the selected dates. Total Labor Cost comes from the labor cost records. Total Project Cost adds them up.
  • Total Projected Cost and Predicted Cost Overrun use the risk profile formula: cost so far divided by the share of the project's time that has passed, compared with the initial cost estimate. They use the latest numbers, so they don't have a week over week change.
  • If there is no data for a card, it says why instead of showing $0.
  • Project Status and the new endpoint now share the same code, so nothing is copied.
  • Added unit tests for the new endpoint, the controller and the route.

How to test:

  1. Check out this branch, run npm install, then build and start the backend.
  2. Check out the frontend PR and start it.
  3. Log in as an admin and go to BM Dashboard, Reports, Total Construction Summary, then open Financials: Overview.
  4. All 6 cards should show values or N/A with a reason. Pick "Week Over Week" at the top to see the change under each cost card.
  5. Run npx jest src/services/bmdashboard/weeklyProjectSummaryFinancialOverview.spec.js src/controllers/bmdashboard/tests/weeklyProjectSummaryController.test.js src/routes/bmdashboard/weeklyProjectSummaryRouter.test.js. All tests pass.

Screenshots:

2 overview cards week over week light 4 backend tests

Note:

  • The existing risk profile summary in projectRiskProfileController.js multiplies by the % of time passed, but the spec divides by it. This PR follows the spec and doesn't change that file.
  • The full backend test suite passes locally.

@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

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.

1 participant