Juhitha fix financials endpoints validation#1769
Merged
one-community merged 2 commits intoMar 1, 2026
Merged
Conversation
Anusha-Gali
approved these changes
Dec 24, 2025
Member
|
Thank you all, merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Description
Fix backend errors and finalize Financials endpoints for Phase 2 Summary Dashboard. Correct the materials cost calculation and add defensive validation so the UI KPIs can reliably consume:
Fixes: High bug where Financials endpoints could return 500 for valid requests (incorrect helper usage, missing ObjectId validation).
Implements: Backend support for Phase 2 Financials KPIs (WBS), aligned to frontend integration.
Related PRS (if any):
Main changes explained:
src/controllers/bmdashboard/bmFinancialController.jscalculateMaterialsCostto pass onlyprojectId(previously passed model + id).GET /api/financials/project/:projectId/total-costGET /api/financials/project/:projectId/coststotal-cost→{ totalCost }costs→{ materialsCost, laborCost, equipmentCost }mom-changesunchanged →{ materialCostChange, laborCostChange, equipmentCostChange }How to test:
Check into this backend branch.
Environment setup:
run the frontend application.
Navigate to /bmdashboard/totalconstructionsummary → expand “Financials” and verify:
Navigate to
/bmdashboard/totalconstructionsummary→ expand “Financials” and verify:ExpenseBarChartremains visible.Verify the new feature works in dark mode.
Screenshots or videos of changes:
Screen.Recording.2025-10-01.at.9.55.12.PM.mov